Search in sources :

Example 6 with ParticipantIdentifierPageType

use of com.helger.peppol.smlclient.participant.ParticipantIdentifierPageType in project peppol-commons by phax.

the class SMLFuncTest method testManageBusinessIdentifierListWithZeroElements.

@Test
public void testManageBusinessIdentifierListWithZeroElements() throws Exception {
    final ManageParticipantIdentifierServiceCaller aPIClient = new ManageParticipantIdentifierServiceCaller(SML_INFO);
    aPIClient.setSSLSocketFactory(createConfiguredSSLSocketFactory(SML_INFO, false));
    final ICommonsList<IParticipantIdentifier> aRecipientBusinessIdentifiers = new CommonsArrayList<>();
    aPIClient.createList(aRecipientBusinessIdentifiers, SMP_ID);
    final ParticipantIdentifierPageType aResult = aPIClient.list("", m_aServiceMetadataPublisher.getServiceMetadataPublisherID());
    assertNotNull(aResult);
    final List<ParticipantIdentifierType> aBusinessIdentifiers = aResult.getParticipantIdentifier();
    assertEquals(0, aBusinessIdentifiers.size());
    m_aSMClient.delete(m_aServiceMetadataPublisher.getServiceMetadataPublisherID());
}
Also used : ParticipantIdentifierPageType(com.helger.peppol.smlclient.participant.ParticipantIdentifierPageType) ParticipantIdentifierType(com.helger.xsds.peppol.id1.ParticipantIdentifierType) ManageParticipantIdentifierServiceCaller(com.helger.peppol.smlclient.ManageParticipantIdentifierServiceCaller) CommonsArrayList(com.helger.commons.collection.impl.CommonsArrayList) IParticipantIdentifier(com.helger.peppolid.IParticipantIdentifier) Test(org.junit.Test)

Example 7 with ParticipantIdentifierPageType

use of com.helger.peppol.smlclient.participant.ParticipantIdentifierPageType in project peppol-commons by phax.

the class ManageParticipantIdentifierServiceCaller method createList.

/**
 * Creates a list of participant identifiers.
 *
 * @param aParticipantIdentifiers
 *        The collection of identifiers to create. May neither be
 *        <code>null</code> nor empty nor may it contain <code>null</code>
 *        values.
 * @param sSMPID
 *        The id of the service meta data. May neither be <code>null</code>
 *        nor empty.
 * @throws BadRequestFault
 *         Is thrown if the request sent to the service was not well-formed.
 * @throws InternalErrorFault
 *         Is thrown if an internal error happened on the service.
 * @throws NotFoundFault
 *         If the SMP does not exist
 * @throws UnauthorizedFault
 *         Is thrown if the user was not authorized.
 */
public void createList(@Nonnull @Nonempty final Iterable<? extends IParticipantIdentifier> aParticipantIdentifiers, @Nonnull @Nonempty final String sSMPID) throws BadRequestFault, InternalErrorFault, NotFoundFault, UnauthorizedFault {
    ValueEnforcer.notEmptyNoNullValue(aParticipantIdentifiers, "ParticipantIdentifiers");
    ValueEnforcer.notEmpty(sSMPID, "SMPID");
    if (LOGGER.isInfoEnabled())
        LOGGER.info("Trying to create multiple new participants " + _toString(aParticipantIdentifiers) + " in SMP '" + sSMPID + "'");
    final ParticipantIdentifierPageType aParticipantList = new ParticipantIdentifierPageType();
    for (final IParticipantIdentifier aPI : aParticipantIdentifiers) {
        // Constructor call needed for type conversion
        aParticipantList.addParticipantIdentifier(new SimpleParticipantIdentifier(aPI));
    }
    aParticipantList.setServiceMetadataPublisherID(sSMPID);
    createWSPort().createList(aParticipantList);
}
Also used : ParticipantIdentifierPageType(com.helger.peppol.smlclient.participant.ParticipantIdentifierPageType) SimpleParticipantIdentifier(com.helger.peppolid.simple.participant.SimpleParticipantIdentifier) IParticipantIdentifier(com.helger.peppolid.IParticipantIdentifier)

Aggregations

ParticipantIdentifierPageType (com.helger.peppol.smlclient.participant.ParticipantIdentifierPageType)7 IParticipantIdentifier (com.helger.peppolid.IParticipantIdentifier)6 ParticipantIdentifierType (com.helger.xsds.peppol.id1.ParticipantIdentifierType)6 ManageParticipantIdentifierServiceCaller (com.helger.peppol.smlclient.ManageParticipantIdentifierServiceCaller)5 Test (org.junit.Test)5 SimpleParticipantIdentifier (com.helger.peppolid.simple.participant.SimpleParticipantIdentifier)3 CommonsArrayList (com.helger.commons.collection.impl.CommonsArrayList)2 ServiceMetadataPublisherServiceForParticipantType (com.helger.peppol.smlclient.participant.ServiceMetadataPublisherServiceForParticipantType)2 CommonsHashMap (com.helger.commons.collection.impl.CommonsHashMap)1