Search in sources :

Example 1 with BDXR2ParticipantIdentifier

use of com.helger.peppolid.bdxr.smp2.participant.BDXR2ParticipantIdentifier in project peppol-commons by phax.

the class BDXR2IdentifierFactory method createParticipantIdentifier.

@Nullable
public BDXR2ParticipantIdentifier createParticipantIdentifier(@Nullable final String sScheme, @Nullable final String sValue) {
    final String sRealScheme = nullNotEmpty(sScheme);
    final String sRealValue = nullNotEmpty(isParticipantIdentifierCaseInsensitive(sRealScheme) ? getUnifiedValue(sValue) : sValue);
    if (isParticipantIdentifierSchemeValid(sRealScheme) && isParticipantIdentifierValueValid(sRealValue))
        return new BDXR2ParticipantIdentifier(sRealScheme, sRealValue);
    return null;
}
Also used : BDXR2ParticipantIdentifier(com.helger.peppolid.bdxr.smp2.participant.BDXR2ParticipantIdentifier) Nullable(javax.annotation.Nullable)

Example 2 with BDXR2ParticipantIdentifier

use of com.helger.peppolid.bdxr.smp2.participant.BDXR2ParticipantIdentifier in project peppol-commons by phax.

the class BDXR2Client method saveServiceGroup.

/**
 * Saves a service group. The meta data references should not be set and are
 * not used.
 *
 * @param aParticipantID
 *        The participant identifier for which the service group is to save.
 * @param aCredentials
 *        The user name and password to use as credentials.
 * @return The created {@link ServiceGroupType} object.
 * @throws SMPClientException
 *         in case something goes wrong
 * @throws SMPClientUnauthorizedException
 *         The user name or password was not correct.
 * @throws SMPClientNotFoundException
 *         A HTTP Not Found was received. This can happen if the service was
 *         not found.
 * @throws SMPClientBadRequestException
 *         The request was not well formed.
 */
@Nonnull
public ServiceGroupType saveServiceGroup(@Nonnull final IParticipantIdentifier aParticipantID, @Nonnull final BasicAuthClientCredentials aCredentials) throws SMPClientException {
    ValueEnforcer.notNull(aParticipantID, "ParticipantID");
    ValueEnforcer.notNull(aCredentials, "Credentials");
    final ServiceGroupType aServiceGroup = new ServiceGroupType();
    aServiceGroup.setParticipantID(new BDXR2ParticipantIdentifier(aParticipantID.getScheme(), aParticipantID.getValue()));
    saveServiceGroup(aServiceGroup, aCredentials);
    return aServiceGroup;
}
Also used : BDXR2ParticipantIdentifier(com.helger.peppolid.bdxr.smp2.participant.BDXR2ParticipantIdentifier) ServiceGroupType(com.helger.xsds.bdxr.smp2.ServiceGroupType) Nonnull(javax.annotation.Nonnull)

Example 3 with BDXR2ParticipantIdentifier

use of com.helger.peppolid.bdxr.smp2.participant.BDXR2ParticipantIdentifier in project phoss-smp by phax.

the class SMPServiceGroup method getAsJAXBObjectBDXR2.

@Nonnull
public com.helger.xsds.bdxr.smp2.ServiceGroupType getAsJAXBObjectBDXR2() {
    final com.helger.xsds.bdxr.smp2.ServiceGroupType ret = new com.helger.xsds.bdxr.smp2.ServiceGroupType();
    ret.setSMPExtensions(getAsBDXR2Extension());
    ret.setSMPVersionID("2.0");
    // Explicit constructor call is needed here!
    ret.setParticipantID(new BDXR2ParticipantIdentifier(m_aParticipantIdentifier));
    if (false) {
        // This is set by the REST server
        ret.setServiceReference(null);
    }
    return ret;
}
Also used : BDXR2ParticipantIdentifier(com.helger.peppolid.bdxr.smp2.participant.BDXR2ParticipantIdentifier) Nonnull(javax.annotation.Nonnull)

Aggregations

BDXR2ParticipantIdentifier (com.helger.peppolid.bdxr.smp2.participant.BDXR2ParticipantIdentifier)3 Nonnull (javax.annotation.Nonnull)2 ServiceGroupType (com.helger.xsds.bdxr.smp2.ServiceGroupType)1 Nullable (javax.annotation.Nullable)1