Search for available line creation meeting time slots, for copper only

REST: POST /connectivity/eligibility/search/meetings
@param productCode [required] Choosen offer product code
@param eligibilityReference [required] Eligibility test reference
356823
public OvhAsyncTask<OvhMeetings> eligibility_search_meetings_POST(String eligibilityReference, String productCode) throws IOException {
		String qPath = "/connectivity/eligibility/search/meetings";
		StringBuilder sb = path(qPath);
		HashMap<String, Object>o = new HashMap<String, Object>();
		addBody(o, "eligibilityReference", eligibilityReference);
		addBody(o, "productCode", productCode);
		String resp = execN(qPath, "POST", sb.toString(), o);
		return convertTo(resp, t6);
	}
1255387
private void connectIfReady() {
        JingleContent content = jingleSession.getContents().get(0);
        if (ourChoice == null || theirChoice == null) {
            // Not yet ready.
            LOGGER.log(Level.INFO, "Not ready.");
            return;
        }

        if (ourChoice == CANDIDATE_FAILURE && theirChoice == CANDIDATE_FAILURE) {
            LOGGER.log(Level.INFO, "Failure.");
            jingleSession.onTransportMethodFailed(getNamespace());
            return;
        }

        LOGGER.log(Level.INFO, "Ready.");

        // Determine nominated candidate.
        UsedCandidate nominated;
        if (ourChoice != CANDIDATE_FAILURE && theirChoice != CANDIDATE_FAILURE) {
            if (ourChoice.candidate.getPriority() > theirChoice.candidate.getPriority()) {
                nominated = ourChoice;
            } else if (ourChoice.candidate.getPriority() < theirChoice.candidate.getPriority()) {
                nominated = theirChoice;
            } else {
                nominated = jingleSession.isInitiator() ? ourChoice : theirChoice;
            }
        } else if (ourChoice != CANDIDATE_FAILURE) {
            nominated = ourChoice;
        } else {
            nominated = theirChoice;
        }

        if (nominated == theirChoice) {
            LOGGER.log(Level.INFO, "Their choice, so our proposed candidate is used.");
            boolean isProxy = nominated.candidate.getType() == JingleS5BTransportCandidate.Type.proxy;
            try {
                nominated = connectToOurCandidate(nominated.candidate);
            } catch (InterruptedException | IOException | XMPPException | SmackException | TimeoutException e) {
                LOGGER.log(Level.INFO, "Could not connect to our candidate.", e);
                // TODO: Proxy-Error
                return;
            }

            if (isProxy) {
                LOGGER.log(Level.INFO, "Is external proxy. Activate it.");
                Bytestream activate = new Bytestream(ourProposal.getStreamId());
                activate.setMode(null);
                activate.setType(IQ.Type.set);
                activate.setTo(nominated.candidate.getJid());
                activate.setToActivate(jingleSession.getRemote());
                activate.setFrom(jingleSession.getLocal());
                try {
                    jingleSession.getConnection().createStanzaCollectorAndSend(activate).nextResultOrThrow();
                } catch (InterruptedException | XMPPException.XMPPErrorException | SmackException.NotConnectedException | SmackException.NoResponseException e) {
                    LOGGER.log(Level.WARNING, "Could not activate proxy.", e);
                    return;
                }

                LOGGER.log(Level.INFO, "Send candidate-activate.");
                Jingle candidateActivate = transportManager().createCandidateActivated(
                        jingleSession.getRemote(), jingleSession.getInitiator(), jingleSession.getSessionId(),
                        content.getSenders(), content.getCreator(), content.getName(), nominated.transport.getStreamId(),
                        nominated.candidate.getCandidateId());
                try {
                    jingleSession.getConnection().createStanzaCollectorAndSend(candidateActivate)
                            .nextResultOrThrow();
                } catch (InterruptedException | XMPPException.XMPPErrorException | SmackException.NotConnectedException | SmackException.NoResponseException e) {
                    LOGGER.log(Level.WARNING, "Could not send candidate-activated", e);
                    return;
                }
            }

            LOGGER.log(Level.INFO, "Start transmission.");
            Socks5BytestreamSession bs = new Socks5BytestreamSession(nominated.socket, !isProxy);
            callback.onSessionInitiated(bs);

        }
        // Our choice
        else {
            LOGGER.log(Level.INFO, "Our choice, so their candidate was used.");
            boolean isProxy = nominated.candidate.getType() == JingleS5BTransportCandidate.Type.proxy;
            if (!isProxy) {
                LOGGER.log(Level.INFO, "Direct connection.");
                Socks5BytestreamSession bs = new Socks5BytestreamSession(nominated.socket, true);
                callback.onSessionInitiated(bs);
            } else {
                LOGGER.log(Level.INFO, "Our choice was their external proxy. wait for candidate-activate.");
            }
        }
    }
1254972
static AdGroupCriterion createCriterionForAdd(ProductPartitionNode node, long adGroupId,
      BiddingStrategyConfiguration biddingConfig) {
    Preconditions.checkNotNull(node, "Null node");
    Preconditions.checkNotNull(biddingConfig, "Null bidding configuration");

    AdGroupCriterion adGroupCriterion;
    if (node.isExcludedUnit()) {
      adGroupCriterion = new NegativeAdGroupCriterion();
    } else if (node.isBiddableUnit()){
      BiddableAdGroupCriterion biddableCriterion = new BiddableAdGroupCriterion();
      if (node.getBid() != null) {
        Money bidMoney = new Money();
        bidMoney.setMicroAmount(node.getBid());
        CpcBid cpcBid = new CpcBid();
        cpcBid.setBid(bidMoney);
        cpcBid.setCpcBidSource(BidSource.CRITERION);
        biddingConfig.setBids(new Bids[] {cpcBid});
        biddableCriterion.setBiddingStrategyConfiguration(
            biddingConfig);
      }
      if (node.getTrackingUrlTemplate() != null) {
        biddableCriterion.setTrackingUrlTemplate(
            node.getTrackingUrlTemplate());
      }
      biddableCriterion.setUrlCustomParameters(createCustomParameters(node));
      adGroupCriterion = biddableCriterion;
    } else {
      adGroupCriterion = new BiddableAdGroupCriterion();
    }
    adGroupCriterion.setAdGroupId(adGroupId);

    ProductPartition partition = new ProductPartition();
    partition.setId(node.getProductPartitionId());
    if (node.getParent() != null) {
      partition.setParentCriterionId(node.getParent().getProductPartitionId());
    }
    partition.setCaseValue(node.getDimension());
    partition.setPartitionType(
        node.isUnit() ? ProductPartitionType.UNIT : ProductPartitionType.SUBDIVISION);
    adGroupCriterion.setCriterion(partition);
    return adGroupCriterion;
  }
825470
public void setProductSubscriptions(java.util.Collection<String> productSubscriptions) {
        if (productSubscriptions == null) {
            this.productSubscriptions = null;
            return;
        }

        this.productSubscriptions = new java.util.ArrayList<String>(productSubscriptions);
    }
633639
public void setProductCodes(java.util.Collection<ProductCode> productCodes) {
        if (productCodes == null) {
            this.productCodes = null;
            return;
        }

        this.productCodes = new java.util.ArrayList<ProductCode>(productCodes);
    }
1124874
public void create(final DbProduct dbProduct) {
        if(repositoryHandler.getProduct(dbProduct.getName()) != null){
            throw new WebApplicationException(Response.status(Response.Status.CONFLICT).entity("Product already exist!").build());
        }

        repositoryHandler.store(dbProduct);
    }
808919
public void link(String featureTable, String tileTable) {

		if (!isLinked(featureTable, tileTable)) {
			getOrCreateExtension();

			try {
				if (!featureTileLinkDao.isTableExists()) {
					geoPackage.createFeatureTileLinkTable();
				}

				FeatureTileLink link = new FeatureTileLink();
				link.setFeatureTableName(featureTable);
				link.setTileTableName(tileTable);

				featureTileLinkDao.create(link);
			} catch (SQLException e) {
				throw new GeoPackageException(
						"Failed to create feature tile link for GeoPackage: "
								+ geoPackage.getName() + ", Feature Table: "
								+ featureTable + ", Tile Table: " + tileTable,
						e);
			}
		}
	}
309430
@Override
	protected boolean isValidProposal(String proposal, String prefix, ContentAssistContext context) {
		// A valid proposal cannot be an hidden feature
		return !Utils.isHiddenMember(proposal) && super.isValidProposal(proposal, prefix, context);
	}
79148
@Override
    public LoopbackAckMessage createLPA(int cic) {
        LoopbackAckMessage msg = createLPA();
        CircuitIdentificationCode code = this.parameterFactory.createCircuitIdentificationCode();
        code.setCIC(cic);
        msg.setCircuitIdentificationCode(code);
        return msg;
    }
78586
private ProductDescriptor getSwapProductDescriptor(Element trade) {

		InterestRateSwapLegProductDescriptor legReceiver = null;
		InterestRateSwapLegProductDescriptor legPayer = null;

		NodeList legs = trade.getElementsByTagName("swapStream");
		for(int legIndex = 0; legIndex < legs.getLength(); legIndex++) {
			Element leg = (Element) legs.item(legIndex);

			boolean isPayer = leg.getElementsByTagName("payerPartyReference").item(0).getAttributes().getNamedItem("href").getNodeValue().equals(homePartyId);

			if(isPayer) {
				legPayer = getSwapLegProductDescriptor(leg);
			} else {
				legReceiver = getSwapLegProductDescriptor(leg);
			}
		}

		return new InterestRateSwapProductDescriptor(legReceiver, legPayer);
	}
650794
private void setIsInventionsAndPatentsAndIsPreviouslyReported(
            PHS398CoverPageSupplement20 coverPageSupplement) {
        String answer = getAnswer(PROPOSAL_YNQ_QUESTION_118,answerHeaders);
        if (answer != null && !answer.equals(NOT_ANSWERED)) {
            if (YnqConstant.YES.code().equals(answer)) {
                String explanation = getAnswer(PROPOSAL_YNQ_QUESTION_119,answerHeaders);
                if(explanation != null && !explanation.equals(NOT_ANSWERED)) {
                    if (YnqConstant.YES.code().equals(explanation)) {
                        coverPageSupplement.setIsInventionsAndPatents(YesNoDataType.Y_YES);
                        String subQuestionExplanation = getAnswer(PROPOSAL_YNQ_QUESTION_120,answerHeaders);
                        if (subQuestionExplanation != null && !subQuestionExplanation.equals(NOT_ANSWERED)) {
                            if (YnqConstant.YES.code().equals(subQuestionExplanation)) {
                                coverPageSupplement.setIsPreviouslyReported(YesNoDataType.Y_YES);  
                            }else if(YnqConstant.NO.code().equals(subQuestionExplanation)) {
                                coverPageSupplement.setIsPreviouslyReported(YesNoDataType.N_NO);
                            }
                        } else {
                            coverPageSupplement.setIsPreviouslyReported(null);
                        }

                    } else if(YnqConstant.NO.code().equals(explanation)) {
                        coverPageSupplement.setIsInventionsAndPatents(YesNoDataType.N_NO);
                    }
                } else {
                    coverPageSupplement.setIsInventionsAndPatents(null);
                }
            }
        }
    }
622500
private ClassReference processType(Type type, TypeReferenceLocation typeReferenceLocation, int lineNumber, int columnNumber, int length,
                String line)
    {
        if (type == null)
            return null;

        ITypeBinding resolveBinding = type.resolveBinding();
        if (resolveBinding == null)
        {
            ResolveClassnameResult resolvedResult = resolveClassname(type.toString());
            ResolutionStatus status = resolvedResult.found ? ResolutionStatus.RECOVERED : ResolutionStatus.UNRESOLVED;
            PackageAndClassName packageAndClassName = PackageAndClassName.parseFromQualifiedName(resolvedResult.result);

            return processTypeAsString(resolvedResult.result, packageAndClassName.packageName, packageAndClassName.className, status,
                        typeReferenceLocation, lineNumber,
                        columnNumber, length, line);
        }
        else
        {
            return processTypeBinding(type.resolveBinding(), ResolutionStatus.RESOLVED, typeReferenceLocation, lineNumber,
                        columnNumber, length, line);
        }

    }
348423
@Override
    public TableIdx getJoinTableIdx(final SQLSelect _sqlSelect)
        throws EFapsException
    {
        final String linktoColName = this.attribute.getSqlColNames().get(0);
        final String tableName = ((SQLTable) getTable()).getSqlTable();
        final Attribute joinAttr = this.attribute.getLink().getAttribute("ID");
        final String joinTableName = joinAttr.getTable().getSqlTable();
        return _sqlSelect.getIndexer().getTableIdx(joinTableName, tableName, linktoColName);
    }
171484
public OvhAsyncTaskArray<OvhCity> eligibility_search_cities_POST(String zipCode) throws IOException {
		String qPath = "/connectivity/eligibility/search/cities";
		StringBuilder sb = path(qPath);
		HashMap<String, Object>o = new HashMap<String, Object>();
		addBody(o, "zipCode", zipCode);
		String resp = execN(qPath, "POST", sb.toString(), o);
		return convertTo(resp, t4);
	}
727898
public Project.Storepoints.Storepoint.ActivityCodes.Code createProjectStorepointsStorepointActivityCodesCode()
   {
      return new Project.Storepoints.Storepoint.ActivityCodes.Code();
   }
988177
@SuppressWarnings("unchecked")
    void fetchFromRepository(Collection<ProductDefinition> installDefinition) throws RepositoryException {
        Collection<ResourceType> interestingTypes = new HashSet<ResourceType>();
        interestingTypes.add(ResourceType.FEATURE);
        interestingTypes.add(ResourceType.OPENSOURCE);
        interestingTypes.add(ResourceType.PRODUCTSAMPLE);
        Map<ResourceType, Collection<? extends RepositoryResource>> resources = repoConnections.getResources(installDefinition, interestingTypes, null);

        Collection<EsaResource> features = (Collection<EsaResource>) resources.get(ResourceType.FEATURE);
        if (features != null) {
            repoFeatures = features;
        } else {
            repoFeatures = Collections.emptySet();
        }

        repoSamples = new ArrayList<>();
        Collection<SampleResource> samples = (Collection<SampleResource>) resources.get(ResourceType.PRODUCTSAMPLE);
        if (samples != null) {
            repoSamples.addAll(samples);
        }

        Collection<SampleResource> osiSamples = (Collection<SampleResource>) resources.get(ResourceType.OPENSOURCE);
        if (osiSamples != null) {
            repoSamples.addAll(osiSamples);
        }
    }
398551
@Override
    @Path("/{solutionId}/{memberType}")
    @ApiOperation(value="Create a solution or add a member to an existing solution",
        notes="Supported memberTypes: requests, tasks, processes, solutions.", response=StatusMessage.class)
    @ApiImplicitParams({
        @ApiImplicitParam(name="Solution", paramType="body", dataType="com.centurylink.mdw.model.workflow.Solution")})
    public JSONObject post(String path, JSONObject content, Map<String,String> headers)
    throws ServiceException, JSONException {
        String id = getSegment(path, 1);
        String rel = getSegment(path, 2);

        SolutionServices solutionServices = ServiceLocator.getSolutionServices();
        if (rel == null) {
            Solution existing = solutionServices.getSolution(id);
            if (existing != null)
                throw new ServiceException(HTTP_409_CONFLICT, "Solution ID already exists: " + id);
            Solution solution = new Solution(content);
            solution.setOwnerType(OwnerType.USER);
            String userId = headers.get(Listener.AUTHENTICATED_USER_HEADER);
            solution.setOwnerId(userId);
            solution.setCreatedBy(userId);
            solutionServices.createSolution(solution);
        }
        else if (rel.equals("requests")) {
            String requestId = getSegment(path, 3);
            solutionServices.addMemberToSolution(id, MemberType.MasterRequest, requestId);
        }
        else if (rel.equals("tasks")) {
            String taskInstanceId = getSegment(path, 3);
            solutionServices.addMemberToSolution(id, MemberType.TaskInstance, taskInstanceId);
        }
        else if (rel.equals("processes")) {
            String processInstanceId = getSegment(path, 3);
            solutionServices.addMemberToSolution(id, MemberType.ProcessInstance, processInstanceId);
        }
        else if (rel.equals("solutions")) {
            String memebrSolId = getSegment(path, 3);
            solutionServices.addMemberToSolution(id, MemberType.Solution, memebrSolId);
        }
        else {
            String msg = "Unsupported relationship for solution " + id + ": " + rel;
            throw new ServiceException(HTTP_400_BAD_REQUEST, msg);
        }
        return null;
    }