Exemplo n.º 1
0
  private void populateConsentTierResponse(
      final CollectionProtocolRegistration incomingCPR, final CollectionProtocol fetchedCP)
      throws ApplicationException {
    final Collection<ConsentTier> consentTierCollection = fetchedCP.getConsentTierCollection();
    if (consentTierCollection == null || consentTierCollection.isEmpty()) {
      LOG.error("Collection Protocol's consent tier statements list is empty.");
      throw new ApplicationException(
          "Collection Protocol's consent tier statements list is empty.");
    }
    final Iterator<ConsentTier> it = consentTierCollection.iterator();

    while (it.hasNext()) {
      final ConsentTier consentTier = (ConsentTier) it.next();
      final ConsentTierResponse ctResp = ConsentTierResponseFactory.getInstance().createObject();
      ctResp.setConsentTier(consentTier);
      ctResp.setResponse(NOT_SPECIFIED);
      incomingCPR.getConsentTierResponseCollection().add(ctResp);
    }
  }