Adds information about defined profile.

@param pomDescriptor
The descriptor for the current POM.
@param model
The Maven Model.
@param scannerContext
The scanner context.
973146
private void addProfiles(MavenPomDescriptor pomDescriptor, Model model, ScannerContext scannerContext) {
        List<Profile> profiles = model.getProfiles();
        Store store = scannerContext.getStore();
        for (Profile profile : profiles) {
            MavenProfileDescriptor mavenProfileDescriptor = store.create(MavenProfileDescriptor.class);
            pomDescriptor.getProfiles().add(mavenProfileDescriptor);
            mavenProfileDescriptor.setId(profile.getId());
            addProperties(mavenProfileDescriptor, profile.getProperties(), store);
            addModules(mavenProfileDescriptor, profile.getModules(), store);
            addPlugins(mavenProfileDescriptor, profile.getBuild(), scannerContext);
            addManagedPlugins(mavenProfileDescriptor, profile.getBuild(), scannerContext);
            addDependencies(mavenProfileDescriptor, ProfileDeclaresDependencyDescriptor.class, ProfileManagesDependencyDescriptor.class, profile, scannerContext);
            addActivation(mavenProfileDescriptor, profile.getActivation(), store);
            addRepository(of(mavenProfileDescriptor), profile.getRepositories(), store);
        }
    }
1054219
@Override
    public boolean add(ClientPresentationModel model) {
        boolean success = super.add(model);
        if (success) {
            List<ClientAttribute> attributes = model.getAttributes();
            for (ClientAttribute attribute : attributes) {
                attribute.addPropertyChangeListener(attributeChangeListener);
            }
            if (!model.isClientSideOnly()) {
                getClientConnector().send(CreatePresentationModelCommand.makeFrom(model));
            }
        }
        return success;
    }
65689
private <T> void add(EjbDescriptor<T> ejbDescriptor) {
        InternalEjbDescriptor<T> internalEjbDescriptor = InternalEjbDescriptor.of(ejbDescriptor);
        ejbByName.put(ejbDescriptor.getEjbName(), internalEjbDescriptor);
        ejbByClass.put(ejbDescriptor.getBeanClass(), internalEjbDescriptor.getEjbName());
    }
781743
public void setTableModel(final TableModel tableModel) {
		getOrCreateComponentModel().tableModel = tableModel;
		getOrCreateComponentModel().rowIndexMapping = null;
		setSelectedRows(null);
		setExpandedRows(null);
		clearPrevExpandedRows();
		clearPrevRenderedRows();

		if (tableModel instanceof BeanBoundTableModel) {
			((BeanBoundTableModel) tableModel).
					setBeanProvider(new BeanBoundTableModelBeanProvider(this));
			((BeanBoundTableModel) tableModel).setBeanProperty(".");
		}

		if (tableModel instanceof ScrollableTableModel) {
			if (!isPaginated()) {
				throw new IllegalStateException(
						"Set a ScrollableTableModel on a table that is not paginated.");
			}

			int startIndex = getCurrentPage() * getRowsPerPage();
			int endIndex = startIndex + getRowsPerPage() - 1;
			((ScrollableTableModel) tableModel).setCurrentRows(startIndex, endIndex);
		}

		// Flush the repeater's row contexts and scratch maps
		repeater.reset();
	}
103591
@Override
	public synchronized void addWelcomeFiles(final WelcomeFileModel model) {
		final ServletContextHandler context = server
				.getOrCreateContext(model);

		context.setWelcomeFiles(model.getWelcomeFiles());

		if (context.getServletHandler() == null || context.getServletHandler().getServletMappings() == null) {
			return;
		}
		for (ServletMapping mapping : context.getServletHandler().getServletMappings()) {
			ServletHolder servlet = context.getServletHandler().getServlet(mapping.getServletName());
			try {
				if (servlet.getServlet() instanceof ResourceServlet) {
					LOG.debug("Reinitializing {} with new welcome files {}", servlet, Arrays.asList(model.getWelcomeFiles()));
					servlet.getServlet().init(servlet.getServlet().getServletConfig());
				}
			} catch (ServletException e) {
				LOG.warn("Problem reinitializing welcome files of default servlet", e);
			}
		}
	}
441942
public void setModel(Database databaseModel, DescriptorRepository objModel)
    {
        _dbModel       = databaseModel;
        _preparedModel = new PreparedModel(objModel, databaseModel);
    }
140311
private void scanClassesDirectory(MavenProjectDirectoryDescriptor projectDescriptor, MavenArtifactDescriptor artifactDescriptor, final String directoryName,
            Scanner scanner) {
        File directory = new File(directoryName);
        if (directory.exists()) {
            scanArtifact(projectDescriptor, artifactDescriptor, directory, directoryName, scanner);
        }
    }
1330695
protected final void registerModelBuilder(RestApiContext context, ModelBuilder mbProto, int version) {
    Class<? extends water.api.Handler> handlerClass = water.api.ModelBuilderHandler.class;
    if (H2O.ARGS.features_level.compareTo(mbProto.builderVisibility()) > 0) {
      return; // Skip endpoint registration
    }
    String base = mbProto.getClass().getSimpleName();
    String lbase = base.toLowerCase();
    // This is common model builder handler

    context.registerEndpoint(
        "train_" + lbase,
        "POST /" + version + "/ModelBuilders/" + lbase,
        handlerClass,
        "train",
        "Train a " + base + " model."
    );

    context.registerEndpoint(
        "validate_" + lbase,
        "POST /" + version + "/ModelBuilders/" + lbase + "/parameters",
        handlerClass,
        "validate_parameters",
        "Validate a set of " + base + " model builder parameters."
    );

    // Grid search is experimental feature
    context.registerEndpoint(
        "grid_search_" + lbase,
        "POST /99/Grid/" + lbase,
        GridSearchHandler.class,
        "train",
        "Run grid search for " + base + " model."
    );
  }
55766
@SuppressWarnings("unchecked")
	private void addParameters(Model model, HttpServletRequest request) {
		for (Object objectEntry : request.getParameterMap().entrySet()) {
			Map.Entry<String, String[]> entry = (Map.Entry<String, String[]>) objectEntry;
			String key = entry.getKey();
			String[] values = entry.getValue();
			if (null != values && values.length > 0) {
				String value  = values[0];
				try {
					model.addAttribute(key, getParameter(key, value));
				} catch (ParseException pe) {
					log.error("Could not parse parameter value {} for {}, ignoring parameter.", key, value);
				} catch (NumberFormatException nfe) {
					log.error("Could not parse parameter value {} for {}, ignoring parameter.", key, value);
				}
			}
		}
	}
984354
@Override
	public void setModelInfo(int inputModelNumber,
			int chainCount) {
		modelNumber = inputModelNumber;
		structure.addModel(new ArrayList<Chain>(chainCount));
		chainMap.add(new HashMap<>());
	}
626727
public void addMetadata( final Model model )
    {
        final Resource datasetId = model.createResource( getDatasetURI() );
        final Resource fragmentId = model.createResource( fragmentURL );

        datasetId.addProperty( CommonResources.RDF_TYPE, CommonResources.VOID_DATASET );
        datasetId.addProperty( CommonResources.RDF_TYPE, CommonResources.HYDRA_COLLECTION );
        datasetId.addProperty( CommonResources.VOID_SUBSET, fragmentId );
        
        Literal itemsPerPage = model.createTypedLiteral(this.getMaxPageSize());
        datasetId.addProperty( CommonResources.HYDRA_ITEMSPERPAGE, itemsPerPage);

        fragmentId.addProperty( CommonResources.RDF_TYPE, CommonResources.HYDRA_COLLECTION );
        fragmentId.addProperty( CommonResources.RDF_TYPE, CommonResources.HYDRA_PAGEDCOLLECTION );
    }
220071
@Override
	public void addSecurityConstraintMappings(
			final SecurityConstraintMappingModel model) {
		final ServletContextHandler context = server.getOrCreateContext(model);
		final SecurityHandler securityHandler = context.getSecurityHandler();
		if (securityHandler == null) {
			throw new IllegalStateException(
					"Internal error: Cannot find the security handler. Please report.");
		}
		String mappingMethod = model.getMapping();
		String constraintName = model.getConstraintName();
		String url = model.getUrl();
		String dataConstraint = model.getDataConstraint();
		List<String> roles = model.getRoles();
		boolean authentication = model.isAuthentication();

		ConstraintMapping newConstraintMapping = new ConstraintMapping();
		newConstraintMapping.setMethod(mappingMethod);
		newConstraintMapping.setPathSpec(url);
		Constraint constraint = new Constraint();
		constraint.setAuthenticate(authentication);
		constraint.setName(constraintName);
		constraint.setRoles(roles.toArray(new String[roles.size()]));

		if (dataConstraint == null || "NONE".equals(dataConstraint)) {
			constraint.setDataConstraint(Constraint.DC_NONE);
		} else if ("INTEGRAL".equals(dataConstraint)) {
			constraint.setDataConstraint(Constraint.DC_INTEGRAL);
		} else if ("CONFIDENTIAL".equals(dataConstraint)) {
			constraint.setDataConstraint(Constraint.DC_CONFIDENTIAL);
		} else {
			LOG.warn("Unknown user-data-constraint:" + dataConstraint);
			constraint.setDataConstraint(Constraint.DC_CONFIDENTIAL);
		}

		newConstraintMapping.setConstraint(constraint);

		((ConstraintSecurityHandler) securityHandler)
				.addConstraintMapping(newConstraintMapping);
	}
65452
public void addCollectionDescriptor(CollectionDescriptor cod)
    {
        m_CollectionDescriptors.add(cod);
        cod.setClassDescriptor(this); // BRJ

        m_collectionDescriptorNameMap = null;
    }
175597
@RequestMapping(value = "/profiles", method = RequestMethod.GET)
    public String list(Model model) {
        Profile profiles = new Profile();
        model.addAttribute("addNewProfile", profiles);
        model.addAttribute("version", Constants.VERSION);
        logger.info("Loading initial page");

        return "profiles";
    }
1353971
public void addFilterModel(final FilterModel model) {
		if (model.getUrlPatterns() != null) {
			try {
				filterLock.writeLock().lock();
				associateBundle(model.getContextModel().getVirtualHosts(), model.getContextModel().getBundle());
				for (String virtualHost : resolveVirtualHosts(model)) {
					for (String urlPattern : model.getUrlPatterns()) {
							final UrlPattern newUrlPattern = new UrlPattern(getFullPath(model.getContextModel(), urlPattern),
											model);
							String fullPath = getFullPath(model.getContextModel(), urlPattern);
							if (filterUrlPatterns.get(virtualHost) == null) {
								filterUrlPatterns.put(virtualHost, new ConcurrentHashMap<>());
							}
							Set<UrlPattern> urlSet = filterUrlPatterns.get(virtualHost).get(fullPath);
							if (urlSet == null) {
									//initialize first
									urlSet = new HashSet<>();
							}
							urlSet.add(newUrlPattern);
							filterUrlPatterns.get(virtualHost).put(fullPath, urlSet);
    //					final UrlPattern existingPattern = filterUrlPatterns.putIfAbsent(
    //							getFullPath(model.getContextModel(), urlPattern), newUrlPattern);
    //					if (existingPattern != null) {
    //						// this should never happen but is a good assertion
    //						LOG.error("Internal error (please report): Cannot associate url mapping "
    //								+ getFullPath(model.getContextModel(), urlPattern) + " to " + newUrlPattern
    //								+ " because is already associated to " + existingPattern);
    //					}
                                    }
                                }
			} finally {
				filterLock.writeLock().unlock();
			}
		}
	}
33488
protected <T extends MavenProjectDescriptor> T resolveProject(MavenProject project, Class<T> expectedType, ScannerContext scannerContext) {
        Store store = scannerContext.getStore();
        String id = project.getGroupId() + ":" + project.getArtifactId() + ":" + project.getVersion();
        MavenProjectDescriptor projectDescriptor = store.find(MavenProjectDescriptor.class, id);
        if (projectDescriptor == null) {
            projectDescriptor = store.create(expectedType, id);
            projectDescriptor.setName(project.getName());
            projectDescriptor.setGroupId(project.getGroupId());
            projectDescriptor.setArtifactId(project.getArtifactId());
            projectDescriptor.setVersion(project.getVersion());
            projectDescriptor.setPackaging(project.getPackaging());
            projectDescriptor.setFullQualifiedName(id);
        } else if (!expectedType.isAssignableFrom(projectDescriptor.getClass())) {
            projectDescriptor = store.addDescriptorType(projectDescriptor, expectedType);
        }
        return expectedType.cast(projectDescriptor);
    }
964371
private void addHardcodedRecognitionDependencies(ProjectModel projectModel, Pom modulePom)
    {
        // TODO: Create a mapping from API occurence in the module into use of
        if (hasJpaEntities(projectModel))
            modulePom.getDependencies().add(new SimpleDependency(Dependency.Role.API, ApiDependenciesData.DEP_API_JPA_21));

        if (hasJsf(projectModel))
            modulePom.getDependencies().add(new SimpleDependency(Dependency.Role.API, ApiDependenciesData.DEP_API_JSF));

        if (hasJaxrs(projectModel))
            modulePom.getDependencies().add(new SimpleDependency(Dependency.Role.API, ApiDependenciesData.DEP_API_JAXRS_20));
    }