/* (non-Javadoc)
@see com.ibm.wsspi.webcontainer.servlet.IServletContext#addMappingTarget(java.lang.String, com.ibm.ws.webcontainer.core.RequestProcessor)
545576
public void addMappingTarget(String mapping, RequestProcessor target) throws Exception
	{
		context.addMappingTarget(mapping, target);
	}
65477
public void addServletMapping(final WebAppServletMapping servletMapping) {
		NullArgumentException
				.validateNotNull(servletMapping, "Servlet mapping");
		NullArgumentException.validateNotNull(servletMapping.getServletName(),
				"Servlet name");
		NullArgumentException.validateNotNull(servletMapping.getUrlPattern(),
				"Url pattern");
		Set<WebAppServletMapping> webAppServletMappings = servletMappings
				.get(servletMapping.getServletName());
		if (webAppServletMappings == null) {
			webAppServletMappings = new HashSet<>();
			servletMappings.put(servletMapping.getServletName(),
					webAppServletMappings);
		}
		webAppServletMappings.add(servletMapping);
		final WebAppServlet servlet = servlets.get(servletMapping
				.getServletName());
		// can be that the servlet is not yet added
		if (servlet != null) {
			servlet.addUrlPattern(servletMapping.getUrlPattern());
		}
	}
877611
@Override
    public T addAsWebInfResource(final URL resource, final String target) throws IllegalArgumentException {
        Validate.notNull(resource, "Resource should be specified");
        Validate.notNullOrEmpty(target, "Target should be specified");

        return addAsWebInfResource(new UrlAsset(resource), target);
    }
1337331
public void setTarget(Map<String, Object> target) {
        removeEntriesStartingWith(TARGET);
        eventMap.putAll(target);
    }
700083
public void setTargetedRequestPlatforms(com.google.api.ads.admanager.axis.v201808.RequestPlatform[] targetedRequestPlatforms) {
        this.targetedRequestPlatforms = targetedRequestPlatforms;
    }
343792
@Override
    public List<String> setTargetHostsFromCmsQueryUrl(String cmsQueryUrl)
            throws TargetHostsLoadException {
        List<String> targetHosts = new ArrayList<String>();
        try {

            logger.info("will use default project label");
            targetHosts = setTargetHostsFromCmsQueryUrl(cmsQueryUrl, "label");
        } catch (Exception e) {
            throw new TargetHostsLoadException("error when reading  "
                    + cmsQueryUrl, e);
        }

        return targetHosts;

    }
714603
@GetMapping("/attributeMapping")
  public String viewAttributeMapping(
      @RequestParam() String mappingProjectId,
      @RequestParam() String target,
      @RequestParam() String source,
      @RequestParam() String targetAttribute,
      Model model) {
    MappingProject project = mappingService.getMappingProject(mappingProjectId);
    MappingTarget mappingTarget = project.getMappingTarget(target);
    EntityMapping entityMapping = mappingTarget.getMappingForSource(source);
    AttributeMapping attributeMapping = entityMapping.getAttributeMapping(targetAttribute);

    if (attributeMapping == null) {
      attributeMapping = entityMapping.addAttributeMapping(targetAttribute);
    }

    if (attributeMapping.getTargetAttribute().hasRefEntity()) {
      EntityType refEntityType = attributeMapping.getTargetAttribute().getRefEntity();
      Iterable<Entity> refEntities = () -> dataService.findAll(refEntityType.getId()).iterator();
      model.addAttribute("categories", refEntities);
    }

    Multimap<Relation, OntologyTerm> tagsForAttribute =
        ontologyTagService.getTagsForAttribute(
            entityMapping.getTargetEntityType(), attributeMapping.getTargetAttribute());

    model.addAttribute("tags", tagsForAttribute.values());
    model.addAttribute(
        "dataExplorerUri", menuReaderService.findMenuItemPath(DataExplorerController.ID));
    model.addAttribute("mappingProject", project);
    model.addAttribute("entityMapping", entityMapping);
    model.addAttribute(
        "sourceAttributesSize",
        Iterables.size(entityMapping.getSourceEntityType().getAtomicAttributes()));
    model.addAttribute("attributeMapping", attributeMapping);
    model.addAttribute(
        "attributes", newArrayList(dataService.getEntityType(source).getAtomicAttributes()));

    return VIEW_ATTRIBUTE_MAPPING;
  }
881922
@Override
    public void setTargetSignificance(String value) throws JMSException {
        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
            SibTr.entry(this, tc, "setTargetSignificance", value);

        if (ApiJmsConstants.TARGET_SIGNIFICANCE_PREFERRED.equals(value)
            || ApiJmsConstants.TARGET_SIGNIFICANCE_REQUIRED.equals(value)) {
            jcaManagedConnectionFactory.setTargetSignificance(value);
        }
        else {
            // This is not a legal value.
            throw (JMSException) JmsErrorUtils.newThrowable(
                                                            JMSException.class,
                                                            "INVALID_VALUE_CWSIA0261",
                                                            new Object[] { "targetSignificance", value },
                                                            tc);
        }

        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
            SibTr.exit(this, tc, "setTargetSignificance");
    }
1225454
@Override
    public void addSourceTargetSet(UnicodeSet inputFilter, UnicodeSet sourceSet, UnicodeSet targetSet) {
        SourceTargetUtility cache;
        synchronized (SOURCE_CACHE) {
            //String id = getID();
            cache = SOURCE_CACHE.get(norm2);
            if (cache == null) {
                cache = new SourceTargetUtility(new NormalizingTransform(norm2), norm2);
                SOURCE_CACHE.put(norm2, cache);
            }
        }
        cache.addSourceTargetSet(this, inputFilter, sourceSet, targetSet);
    }
1349435
@Override
  protected void initTarget() throws ServletException {
    targetUriTemplate = getConfigParam(P_TARGET_URI);
    if (targetUriTemplate == null)
      throw new ServletException(P_TARGET_URI+" is required.");

    //leave this.target* null to prevent accidental mis-use
  }
1303271
private static void addRequestMappingParamDoc(Set<ApiParamDoc> apiParamDocs, RequestMapping requestMapping) {
		if (requestMapping.params().length > 0) {
            for (String param : requestMapping.params()) {
                String[] splitParam = param.split("=");
                if (splitParam.length > 1) {
                    apiParamDocs.add(new ApiParamDoc(splitParam[0], "", JSONDocTypeBuilder.build(new JSONDocType(), String.class, null), "true", new String[] { splitParam[1] }, null, null));
                } else {
                    apiParamDocs.add(new ApiParamDoc(param, "", JSONDocTypeBuilder.build(new JSONDocType(), String.class, null), "true", new String[] {}, null, null));
                }
            }
        }
	}
867050
public static void addTargetLinks(final MgmtTarget response) {
        response.add(linkTo(methodOn(MgmtTargetRestApi.class).getAssignedDistributionSet(response.getControllerId()))
                .withRel(MgmtRestConstants.TARGET_V1_ASSIGNED_DISTRIBUTION_SET));
        response.add(linkTo(methodOn(MgmtTargetRestApi.class).getInstalledDistributionSet(response.getControllerId()))
                .withRel(MgmtRestConstants.TARGET_V1_INSTALLED_DISTRIBUTION_SET));
        response.add(linkTo(methodOn(MgmtTargetRestApi.class).getAttributes(response.getControllerId()))
                .withRel(MgmtRestConstants.TARGET_V1_ATTRIBUTES));
        response.add(linkTo(methodOn(MgmtTargetRestApi.class).getActionHistory(response.getControllerId(), 0,
                MgmtRestConstants.REQUEST_PARAMETER_PAGING_DEFAULT_LIMIT_VALUE,
                ActionFields.ID.getFieldName() + ":" + SortDirection.DESC, null))
                        .withRel(MgmtRestConstants.TARGET_V1_ACTIONS).expand());
        response.add(linkTo(methodOn(MgmtTargetRestApi.class).getMetadata(response.getControllerId(),
                MgmtRestConstants.REQUEST_PARAMETER_PAGING_DEFAULT_OFFSET_VALUE,
                MgmtRestConstants.REQUEST_PARAMETER_PAGING_DEFAULT_LIMIT_VALUE, null, null)).withRel("metadata"));
    }
653536
public <T> DynamicJdbcMapper<T> newMapper(final Type target) {
		final ClassMeta<T> classMeta = getClassMeta(target);
		return new DynamicJdbcSetRowMapper<T>(new SetRowMapperFactory<T>(classMeta),  new MapperKeyFactory(),  new MapperKeyFactory());
	}
423560
public WebTarget appendPathAndQueryParameters(final WebTarget webTarget) {
    ArgumentChecker.notNull(webTarget, "webTarget");
    WebTarget resultTarget = webTarget;
    resultTarget = resultTarget.path(DATASETS_RELATIVE_URL + EXTENSION);
    if (_databaseCode != null) {
      resultTarget = resultTarget.queryParam(DATABASE_CODE_PARAM, _databaseCode);
    }
    if (_query != null) {
      resultTarget = resultTarget.queryParam(QUERY_PARAM, _query);
    }
    if (_pageNumber != null) {
      resultTarget = resultTarget.queryParam(PAGE_PARAM, _pageNumber);
    }
    if (_maxDocsPerPage != null) {
      resultTarget = resultTarget.queryParam(PER_PAGE_PARAM, _maxDocsPerPage);
    }
    return resultTarget;
  }
976625
public Object getService(TargetMetaDef targetMetaDef, RequestWrapper request) {
		userTargetMetaDefFactory.createTargetMetaRequest(targetMetaDef, request.getContextHolder());
		return webServiceAccessor.getService(request);
	}
1369659
@Override
  public void addMapping(
      String sourceName, @Nullable String symbolName,
      FilePosition sourceStartPosition,
      FilePosition startPosition, FilePosition endPosition) {

    // Don't bother if there is not sufficient information to be useful.
    if (sourceName == null || sourceStartPosition.getLine() < 0) {
      return;
    }

    FilePosition adjustedStart = startPosition;
    FilePosition adjustedEnd = endPosition;

    if (offsetPosition.getLine() != 0
        || offsetPosition.getColumn() != 0) {
      // If the mapping is found on the first line, we need to offset
      // its character position by the number of characters found on
      // the *last* line of the source file to which the code is
      // being generated.
      int offsetLine = offsetPosition.getLine();
      int startOffsetPosition = offsetPosition.getColumn();
      int endOffsetPosition = offsetPosition.getColumn();

      if (startPosition.getLine() > 0) {
        startOffsetPosition = 0;
      }

      if (endPosition.getLine() > 0) {
        endOffsetPosition = 0;
      }

      adjustedStart = new FilePosition(
          startPosition.getLine() + offsetLine,
          startPosition.getColumn() + startOffsetPosition);

      adjustedEnd = new FilePosition(
          endPosition.getLine() + offsetLine,
          endPosition.getColumn() + endOffsetPosition);
    }

    // Create the new mapping.
    Mapping mapping = new Mapping();
    mapping.sourceFile = sourceName;
    mapping.originalPosition = sourceStartPosition;
    mapping.originalName = symbolName;
    mapping.startPosition = adjustedStart;
    mapping.endPosition = adjustedEnd;

    // Validate the mappings are in a proper order.
    if (lastMapping != null) {
      int lastLine = lastMapping.startPosition.getLine();
      int lastColumn = lastMapping.startPosition.getColumn();
      int nextLine = mapping.startPosition.getLine();
      int nextColumn = mapping.startPosition.getColumn();
      Preconditions.checkState(nextLine > lastLine
          || (nextLine == lastLine && nextColumn >= lastColumn),
          "Incorrect source mappings order, previous : (%s,%s)\n"
          + "new : (%s,%s)",
          lastLine, lastColumn, nextLine, nextColumn);
    }

    lastMapping = mapping;
    mappings.add(mapping);
  }
729045
public void addServletMapping( String servletName, String urlPattern )
    {
        if ( ! urlPattern.endsWith( PageFlowConstants.PAGEFLOW_EXTENSION ) )
        {
            super.addServletMapping( servletName, urlPattern );
        }
    }