use of com.helger.peppolid.bdxr.smp1.participant.BDXR1ParticipantIdentifier in project peppol-commons by phax.
the class BDXRClient 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();
// Explicit constructor call is needed here!
aServiceGroup.setParticipantIdentifier(new BDXR1ParticipantIdentifier(aParticipantID));
// Mandatory element, but can be empty
aServiceGroup.setServiceMetadataReferenceCollection(new ServiceMetadataReferenceCollectionType());
saveServiceGroup(aServiceGroup, aCredentials);
return aServiceGroup;
}
use of com.helger.peppolid.bdxr.smp1.participant.BDXR1ParticipantIdentifier in project phoss-smp by phax.
the class SMPServiceInformation method getAsJAXBObjectBDXR1.
@Nullable
public com.helger.xsds.bdxr.smp1.ServiceMetadataType getAsJAXBObjectBDXR1() {
if (m_aProcesses.isEmpty()) {
// "ProcessList" is mandatory and MUST contain at least 1 value
return null;
}
final com.helger.xsds.bdxr.smp1.ServiceInformationType aSI = new com.helger.xsds.bdxr.smp1.ServiceInformationType();
// Explicit constructor call is needed here!
aSI.setParticipantIdentifier(new BDXR1ParticipantIdentifier(m_aServiceGroup.getParticipantIdentifier()));
aSI.setDocumentIdentifier(new BDXR1DocumentTypeIdentifier(m_aDocumentTypeIdentifier));
final com.helger.xsds.bdxr.smp1.ProcessListType aProcesses = new com.helger.xsds.bdxr.smp1.ProcessListType();
for (final ISMPProcess aProcess : m_aProcesses.values()) {
final com.helger.xsds.bdxr.smp1.ProcessType aJAXBProcess = aProcess.getAsJAXBObjectBDXR1();
if (aJAXBProcess != null)
aProcesses.addProcess(aJAXBProcess);
}
if (aProcesses.hasNoProcessEntries()) {
// "ProcessList" is mandatory and MUST contain at least 1 value
return null;
}
aSI.setProcessList(aProcesses);
aSI.setExtension(getAsBDXRExtension());
final com.helger.xsds.bdxr.smp1.ServiceMetadataType ret = new com.helger.xsds.bdxr.smp1.ServiceMetadataType();
ret.setServiceInformation(aSI);
return ret;
}
use of com.helger.peppolid.bdxr.smp1.participant.BDXR1ParticipantIdentifier in project phoss-smp by phax.
the class SMPServiceGroup method getAsJAXBObjectBDXR1.
@Nonnull
public com.helger.xsds.bdxr.smp1.ServiceGroupType getAsJAXBObjectBDXR1() {
final com.helger.xsds.bdxr.smp1.ServiceGroupType ret = new com.helger.xsds.bdxr.smp1.ServiceGroupType();
// Explicit constructor call is needed here!
ret.setParticipantIdentifier(new BDXR1ParticipantIdentifier(m_aParticipantIdentifier));
if (false) {
// This is set by the REST server
ret.setServiceMetadataReferenceCollection(null);
}
ret.setExtension(getAsBDXRExtension());
return ret;
}
use of com.helger.peppolid.bdxr.smp1.participant.BDXR1ParticipantIdentifier in project peppol-commons by phax.
the class BDXR1IdentifierFactory method createParticipantIdentifier.
@Nullable
public BDXR1ParticipantIdentifier 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 BDXR1ParticipantIdentifier(sRealScheme, sRealValue);
return null;
}
Aggregations