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