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());
}
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);
}
Aggregations