Search in sources :

Example 1 with PublisherEndpointType

use of com.helger.peppol.smlclient.smp.PublisherEndpointType in project peppol-commons by phax.

the class WildcardFuncTest method initialize.

@Before
public void initialize() throws Exception {
    m_aSMClient = new ManageServiceMetadataServiceCaller(SML_INFO);
    m_aSMClient.setSSLSocketFactory(createConfiguredSSLSocketFactory(SML_INFO, false));
    try {
        m_aSMClient.delete(SMP_ID);
    } catch (final NotFoundFault e) {
    // This is fine, since we are just cleaning
    }
    // Create SMP
    final ServiceMetadataPublisherServiceType aServiceMetadataCreate = new ServiceMetadataPublisherServiceType();
    aServiceMetadataCreate.setServiceMetadataPublisherID(SMP_ID);
    final PublisherEndpointType aEndpoint = new PublisherEndpointType();
    aEndpoint.setLogicalAddress(ADDRESS_LOGICAL);
    aEndpoint.setPhysicalAddress(ADDRESS_PHYSICAL);
    aServiceMetadataCreate.setPublisherEndpoint(aEndpoint);
    m_aSMClient.create(aServiceMetadataCreate);
}
Also used : ManageServiceMetadataServiceCaller(com.helger.peppol.smlclient.ManageServiceMetadataServiceCaller) PublisherEndpointType(com.helger.peppol.smlclient.smp.PublisherEndpointType) ServiceMetadataPublisherServiceType(com.helger.peppol.smlclient.smp.ServiceMetadataPublisherServiceType) NotFoundFault(com.helger.peppol.smlclient.smp.NotFoundFault) Before(org.junit.Before)

Example 2 with PublisherEndpointType

use of com.helger.peppol.smlclient.smp.PublisherEndpointType in project peppol-commons by phax.

the class SMKFuncTest method _createSMPData.

@Nonnull
private static ServiceMetadataPublisherServiceType _createSMPData(@Nonnull final ManageServiceMetadataServiceCaller aSMPClient, @Nonnull @Nonempty final String sSMPID) throws Exception {
    final ServiceMetadataPublisherServiceType aServiceMetadataCreate = new ServiceMetadataPublisherServiceType();
    aServiceMetadataCreate.setServiceMetadataPublisherID(sSMPID);
    final PublisherEndpointType aEndpoint = new PublisherEndpointType();
    aEndpoint.setLogicalAddress(L_ENDPOINTADDRESS);
    aEndpoint.setPhysicalAddress(P_ENDPOINTADDRESS);
    aServiceMetadataCreate.setPublisherEndpoint(aEndpoint);
    aSMPClient.create(aServiceMetadataCreate);
    return aServiceMetadataCreate;
}
Also used : PublisherEndpointType(com.helger.peppol.smlclient.smp.PublisherEndpointType) ServiceMetadataPublisherServiceType(com.helger.peppol.smlclient.smp.ServiceMetadataPublisherServiceType) Nonnull(javax.annotation.Nonnull)

Example 3 with PublisherEndpointType

use of com.helger.peppol.smlclient.smp.PublisherEndpointType in project peppol-commons by phax.

the class SMLFuncTest method _createSMPData.

@Nonnull
private static ServiceMetadataPublisherServiceType _createSMPData(@Nonnull final ManageServiceMetadataServiceCaller aSMLSMPClient, @Nonnull @Nonempty final String sSMPID) throws Exception {
    final ServiceMetadataPublisherServiceType aServiceMetadataCreate = new ServiceMetadataPublisherServiceType();
    aServiceMetadataCreate.setServiceMetadataPublisherID(sSMPID);
    final PublisherEndpointType aEndpoint = new PublisherEndpointType();
    aEndpoint.setLogicalAddress(L_ENDPOINTADDRESS);
    aEndpoint.setPhysicalAddress(P_ENDPOINTADDRESS);
    aServiceMetadataCreate.setPublisherEndpoint(aEndpoint);
    aSMLSMPClient.create(aServiceMetadataCreate);
    return aServiceMetadataCreate;
}
Also used : PublisherEndpointType(com.helger.peppol.smlclient.smp.PublisherEndpointType) ServiceMetadataPublisherServiceType(com.helger.peppol.smlclient.smp.ServiceMetadataPublisherServiceType) Nonnull(javax.annotation.Nonnull)

Example 4 with PublisherEndpointType

use of com.helger.peppol.smlclient.smp.PublisherEndpointType in project peppol-commons by phax.

the class ManageServiceMetadataServiceCaller method update.

/**
 * Updates the specified service metadata given by the publisher id.
 *
 * @param sSMPID
 *        The publisher id. May neither be <code>null</code> nor empty.
 * @param sSMPAddressPhysical
 *        The physical address of the SMP (Example: 198.0.0.1). May neither be
 *        <code>null</code> nor empty.
 * @param sSMPAddressLogical
 *        The logical address of the SMP (Example: http://smp.example.org/).
 *        May neither be <code>null</code> nor empty.
 * @throws InternalErrorFault
 *         An internal error happened on the server.
 * @throws NotFoundFault
 *         The service metadata with the given publisher id was not found.
 * @throws UnauthorizedFault
 *         The username or password was not correct.
 * @throws BadRequestFault
 *         The request was not well formed.
 */
public void update(@Nonnull @Nonempty final String sSMPID, @Nonnull @Nonempty final String sSMPAddressPhysical, @Nonnull @Nonempty final String sSMPAddressLogical) throws InternalErrorFault, NotFoundFault, UnauthorizedFault, BadRequestFault {
    ValueEnforcer.notEmpty(sSMPID, "SMPID");
    ValueEnforcer.notEmpty(sSMPAddressPhysical, "SMPAddressPhysical");
    ValueEnforcer.notEmpty(sSMPAddressLogical, "SMPAddressLogical");
    // Custom validations
    validatePhysicalAddress(sSMPAddressPhysical);
    validateLogicalAddress(sSMPAddressLogical);
    final ServiceMetadataPublisherServiceType aServiceMetadata = new ServiceMetadataPublisherServiceType();
    aServiceMetadata.setServiceMetadataPublisherID(sSMPID);
    final PublisherEndpointType aEndpoint = new PublisherEndpointType();
    aEndpoint.setLogicalAddress(sSMPAddressLogical);
    aEndpoint.setPhysicalAddress(sSMPAddressPhysical);
    aServiceMetadata.setPublisherEndpoint(aEndpoint);
    update(aServiceMetadata);
}
Also used : PublisherEndpointType(com.helger.peppol.smlclient.smp.PublisherEndpointType) ServiceMetadataPublisherServiceType(com.helger.peppol.smlclient.smp.ServiceMetadataPublisherServiceType)

Example 5 with PublisherEndpointType

use of com.helger.peppol.smlclient.smp.PublisherEndpointType in project peppol-commons by phax.

the class ManageServiceMetadataServiceCaller method create.

/**
 * Creates the service metadata for the specified user.
 *
 * @param sSMPID
 *        The certificate UID of the SMP. May neither be <code>null</code> nor
 *        empty.
 * @param sSMPAddressPhysical
 *        The physical address of the SMP (Example: 198.0.0.1). May neither be
 *        <code>null</code> nor empty.
 * @param sSMPAddressLogical
 *        The logical address of the SMP (Example: http://smp.example.org/).
 *        May neither be <code>null</code> nor empty.
 * @throws BadRequestFault
 *         The request was not well formed.
 * @throws InternalErrorFault
 *         An internal error happened on the server.
 * @throws UnauthorizedFault
 *         The user name or password was not correct.
 */
public void create(@Nonnull @Nonempty final String sSMPID, @Nonnull @Nonempty final String sSMPAddressPhysical, @Nonnull @Nonempty final String sSMPAddressLogical) throws BadRequestFault, InternalErrorFault, UnauthorizedFault {
    ValueEnforcer.notEmpty(sSMPID, "SMPID");
    ValueEnforcer.notEmpty(sSMPAddressPhysical, "SMPAddressPhysical");
    ValueEnforcer.notEmpty(sSMPAddressLogical, "SMPAddressLogical");
    // Custom validations
    validatePhysicalAddress(sSMPAddressPhysical);
    validateLogicalAddress(sSMPAddressLogical);
    final ServiceMetadataPublisherServiceType aServiceMetadata = new ServiceMetadataPublisherServiceType();
    aServiceMetadata.setServiceMetadataPublisherID(sSMPID);
    final PublisherEndpointType aEndpoint = new PublisherEndpointType();
    aEndpoint.setLogicalAddress(sSMPAddressLogical);
    aEndpoint.setPhysicalAddress(sSMPAddressPhysical);
    aServiceMetadata.setPublisherEndpoint(aEndpoint);
    create(aServiceMetadata);
}
Also used : PublisherEndpointType(com.helger.peppol.smlclient.smp.PublisherEndpointType) ServiceMetadataPublisherServiceType(com.helger.peppol.smlclient.smp.ServiceMetadataPublisherServiceType)

Aggregations

PublisherEndpointType (com.helger.peppol.smlclient.smp.PublisherEndpointType)5 ServiceMetadataPublisherServiceType (com.helger.peppol.smlclient.smp.ServiceMetadataPublisherServiceType)5 Nonnull (javax.annotation.Nonnull)2 ManageServiceMetadataServiceCaller (com.helger.peppol.smlclient.ManageServiceMetadataServiceCaller)1 NotFoundFault (com.helger.peppol.smlclient.smp.NotFoundFault)1 Before (org.junit.Before)1