Search in sources :

Example 26 with SimpleParticipantIdentifier

use of com.helger.peppolid.simple.participant.SimpleParticipantIdentifier in project peppol-commons by phax.

the class BPCURLProviderSMP1Test method testGetDNSNameOfParticipant2.

@Test
public void testGetDNSNameOfParticipant2() throws SMPDNSResolutionException {
    final SimpleParticipantIdentifier aPI = new SimpleParticipantIdentifier("urn:oasis:names:tc:ebcore:partyid-type:unregistered:disney", "goofy");
    final String s = BPCURLProviderSMP1.INSTANCE.getDNSNameOfParticipant(aPI, "bpc02.b2bei.us.");
    assertEquals("F64Y2CXXVX4VJF4E45OQVE6RUZML7AWG4SN4NKTYXLJSZEVUQKCQ.bpc02.b2bei.us", s);
}
Also used : SimpleParticipantIdentifier(com.helger.peppolid.simple.participant.SimpleParticipantIdentifier) IgnoredNaptrTest(com.helger.smpclient.IgnoredNaptrTest) Test(org.junit.Test)

Example 27 with SimpleParticipantIdentifier

use of com.helger.peppolid.simple.participant.SimpleParticipantIdentifier in project peppol-commons by phax.

the class BPCURLProviderSMP1Test method testGetSMPURIOfParticipant.

@Test
@Ignore("Because it may take long to execute")
@IgnoredNaptrTest
public void testGetSMPURIOfParticipant() throws SMPDNSResolutionException {
    final SimpleParticipantIdentifier aPI = new SimpleParticipantIdentifier("urn:oasis:names:tc:ebcore:partyid-type:iso6523:0060", "123456789");
    final URI x = BPCURLProviderSMP1.INSTANCE.getSMPURIOfParticipant(aPI, "bpc02.b2bei.us.");
    assertEquals("https://bpc-smp.bdxhub.com/", x.toString());
}
Also used : URI(java.net.URI) SimpleParticipantIdentifier(com.helger.peppolid.simple.participant.SimpleParticipantIdentifier) Ignore(org.junit.Ignore) IgnoredNaptrTest(com.helger.smpclient.IgnoredNaptrTest) IgnoredNaptrTest(com.helger.smpclient.IgnoredNaptrTest) Test(org.junit.Test)

Example 28 with SimpleParticipantIdentifier

use of com.helger.peppolid.simple.participant.SimpleParticipantIdentifier in project peppol-commons by phax.

the class BPCURLProviderSMP1Test method testGetDNSNameOfParticipant.

@Test
public void testGetDNSNameOfParticipant() throws SMPDNSResolutionException {
    final SimpleParticipantIdentifier aPI = new SimpleParticipantIdentifier("urn:oasis:names:tc:ebcore:partyid-type:iso6523:0060", "123456789");
    final String s = BPCURLProviderSMP1.INSTANCE.getDNSNameOfParticipant(aPI, "bpc02.b2bei.us.");
    assertEquals("64YIBI3W4XKI6USPE6LXNMDAXTO3EEZHPD3UQWEB7SYBMYVFRNHA.bpc02.b2bei.us", s);
}
Also used : SimpleParticipantIdentifier(com.helger.peppolid.simple.participant.SimpleParticipantIdentifier) IgnoredNaptrTest(com.helger.smpclient.IgnoredNaptrTest) Test(org.junit.Test)

Example 29 with SimpleParticipantIdentifier

use of com.helger.peppolid.simple.participant.SimpleParticipantIdentifier in project peppol-commons by phax.

the class BDMSLClient method createParticipantIdentifier.

public void createParticipantIdentifier(@Nonnull @Nonempty final String sSMPID, @Nonnull final IParticipantIdentifier aParticipantID, @Nonnull @Nonempty final String sServiceName) throws BadRequestFault, InternalErrorFault, NotFoundFault, UnauthorizedFault {
    ValueEnforcer.notEmpty(sSMPID, "SMPID");
    ValueEnforcer.notNull(aParticipantID, "ParticipantID");
    ValueEnforcer.notEmpty(sServiceName, "ServiceName");
    if (LOGGER.isDebugEnabled())
        LOGGER.debug("createParticipantIdentifier (" + sSMPID + ", " + aParticipantID + ", " + sServiceName + ")");
    final SMPAdvancedServiceForParticipantType aBody = new SMPAdvancedServiceForParticipantType();
    final ServiceMetadataPublisherServiceForParticipantType aSMP = new ServiceMetadataPublisherServiceForParticipantType();
    aSMP.setServiceMetadataPublisherID(sSMPID);
    // Explicit constructor call is needed here!
    aSMP.setParticipantIdentifier(new SimpleParticipantIdentifier(aParticipantID));
    aBody.setCreateParticipantIdentifier(aSMP);
    aBody.setServiceName(sServiceName);
    createWSPort().createParticipantIdentifier(aBody);
}
Also used : SMPAdvancedServiceForParticipantType(com.helger.peppol.smlclient.bdmsl.SMPAdvancedServiceForParticipantType) ServiceMetadataPublisherServiceForParticipantType(com.helger.peppol.smlclient.bdmsl.ServiceMetadataPublisherServiceForParticipantType) SimpleParticipantIdentifier(com.helger.peppolid.simple.participant.SimpleParticipantIdentifier)

Example 30 with SimpleParticipantIdentifier

use of com.helger.peppolid.simple.participant.SimpleParticipantIdentifier in project peppol-commons by phax.

the class ManageParticipantIdentifierServiceCaller method prepareToMigrate.

/**
 * Prepares a migrate of the given participant identifier from one SMP to
 * another. This method must be called from the source SMP. This overload
 * takes a migration key that was created outside.
 *
 * @param aIdentifier
 *        The participant identifier.
 * @param sMigrationKey
 *        The migration key to be used. May neither be <code>null</code> nor
 *        empty.
 * @param sSMPID
 *        SMP ID
 * @return The migration key to transfer out-of-band to the other SMP.
 * @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 business identifier was not found.
 * @throws UnauthorizedFault
 *         Is thrown if the user was not authorized.
 * @since 8.1.2
 */
@Nonnull
public String prepareToMigrate(@Nonnull final IParticipantIdentifier aIdentifier, @Nonnull @Nonempty final String sMigrationKey, @Nonnull @Nonempty final String sSMPID) throws BadRequestFault, InternalErrorFault, NotFoundFault, UnauthorizedFault {
    ValueEnforcer.notNull(aIdentifier, "Identifier");
    ValueEnforcer.notEmpty(sSMPID, "SMPID");
    if (LOGGER.isInfoEnabled())
        LOGGER.info("Preparing to migrate participant " + aIdentifier.getURIEncoded() + " from SMP '" + sSMPID + "' using migration key '" + sMigrationKey + "'");
    final MigrationRecordType aMigrationRecord = new MigrationRecordType();
    // Constructor call needed for type conversion
    aMigrationRecord.setParticipantIdentifier(new SimpleParticipantIdentifier(aIdentifier));
    aMigrationRecord.setMigrationKey(sMigrationKey);
    aMigrationRecord.setServiceMetadataPublisherID(sSMPID);
    createWSPort().prepareToMigrate(aMigrationRecord);
    if (LOGGER.isInfoEnabled())
        LOGGER.info("Successfully called 'prepareToMigrate'");
    return sMigrationKey;
}
Also used : MigrationRecordType(com.helger.peppol.smlclient.participant.MigrationRecordType) SimpleParticipantIdentifier(com.helger.peppolid.simple.participant.SimpleParticipantIdentifier) Nonnull(javax.annotation.Nonnull)

Aggregations

SimpleParticipantIdentifier (com.helger.peppolid.simple.participant.SimpleParticipantIdentifier)48 Test (org.junit.Test)26 IParticipantIdentifier (com.helger.peppolid.IParticipantIdentifier)25 ServiceGroupType (com.helger.xsds.peppol.smp1.ServiceGroupType)12 ServiceMetadataReferenceCollectionType (com.helger.xsds.peppol.smp1.ServiceMetadataReferenceCollectionType)12 ISMPServiceGroupManager (com.helger.phoss.smp.domain.servicegroup.ISMPServiceGroupManager)11 Nonnull (javax.annotation.Nonnull)11 ISMPServiceGroup (com.helger.phoss.smp.domain.servicegroup.ISMPServiceGroup)10 IDocumentTypeIdentifier (com.helger.peppolid.IDocumentTypeIdentifier)9 Response (javax.ws.rs.core.Response)9 SimpleDocumentTypeIdentifier (com.helger.peppolid.simple.doctype.SimpleDocumentTypeIdentifier)8 EndpointType (com.helger.xsds.peppol.smp1.EndpointType)7 ProcessListType (com.helger.xsds.peppol.smp1.ProcessListType)7 ProcessType (com.helger.xsds.peppol.smp1.ProcessType)7 ServiceEndpointList (com.helger.xsds.peppol.smp1.ServiceEndpointList)7 ServiceInformationType (com.helger.xsds.peppol.smp1.ServiceInformationType)7 WebTarget (javax.ws.rs.client.WebTarget)7 SMPServiceGroup (com.helger.phoss.smp.domain.servicegroup.SMPServiceGroup)6 CommonsArrayList (com.helger.commons.collection.impl.CommonsArrayList)5 PeppolDocumentTypeIdentifier (com.helger.peppolid.peppol.doctype.PeppolDocumentTypeIdentifier)5