use of com.helger.peppol.domain.SMLConfiguration in project peppol-practical by phax.
the class SMLConfigurationManager method updateSMLInfo.
@Nonnull
public EChange updateSMLInfo(@Nullable final String sSMLInfoID, @Nonnull @Nonempty final String sDisplayName, @Nonnull @Nonempty final String sDNSZone, @Nonnull @Nonempty final String sManagementServiceURL, final boolean bClientCertificateRequired, @Nonnull final ESMPAPIType eSMPAPIType, @Nonnull final ESMPIdentifierType eSMPIdentifierType, final boolean bProduction) {
final SMLConfiguration aExtSMLInfo = getOfID(sSMLInfoID);
if (aExtSMLInfo == null) {
AuditHelper.onAuditModifyFailure(SMLInfo.OT, "all", sSMLInfoID, "no-such-id");
return EChange.UNCHANGED;
}
m_aRWLock.writeLock().lock();
try {
final SMLInfo aSMLInfo = aExtSMLInfo.getSMLInfo();
EChange eChange = EChange.UNCHANGED;
eChange = eChange.or(aSMLInfo.setDisplayName(sDisplayName));
eChange = eChange.or(aSMLInfo.setDNSZone(sDNSZone));
eChange = eChange.or(aSMLInfo.setManagementServiceURL(sManagementServiceURL));
eChange = eChange.or(aSMLInfo.setClientCertificateRequired(bClientCertificateRequired));
eChange = eChange.or(aExtSMLInfo.setSMPAPIType(eSMPAPIType));
eChange = eChange.or(aExtSMLInfo.setSMPIdentifierType(eSMPIdentifierType));
eChange = eChange.or(aExtSMLInfo.setProduction(bProduction));
if (eChange.isUnchanged())
return EChange.UNCHANGED;
internalUpdateItem(aExtSMLInfo);
} finally {
m_aRWLock.writeLock().unlock();
}
AuditHelper.onAuditModifySuccess(SMLInfo.OT, "all", sSMLInfoID, sDisplayName, sDNSZone, sManagementServiceURL, Boolean.valueOf(bClientCertificateRequired), eSMPAPIType, eSMPIdentifierType, Boolean.valueOf(bProduction));
return EChange.CHANGED;
}
use of com.helger.peppol.domain.SMLConfiguration in project peppol-practical by phax.
the class SMLConfigurationManager method createSMLInfo.
@Nonnull
public ISMLConfiguration createSMLInfo(@Nonnull @Nonempty final String sSMLInfoID, @Nonnull @Nonempty final String sDisplayName, @Nonnull @Nonempty final String sDNSZone, @Nonnull @Nonempty final String sManagementServiceURL, final boolean bClientCertificateRequired, @Nonnull final ESMPAPIType eSMPAPIType, @Nonnull final ESMPIdentifierType eSMPIdentifierType, final boolean bProduction) {
final SMLInfo aSMLInfo = new SMLInfo(sSMLInfoID, sDisplayName, sDNSZone, sManagementServiceURL, bClientCertificateRequired);
final SMLConfiguration aExtSMLInfo = new SMLConfiguration(aSMLInfo, eSMPAPIType, eSMPIdentifierType, bProduction);
m_aRWLock.writeLocked(() -> {
internalCreateItem(aExtSMLInfo);
});
AuditHelper.onAuditCreateSuccess(SMLInfo.OT, sSMLInfoID, sDisplayName, sDNSZone, sManagementServiceURL, Boolean.valueOf(bClientCertificateRequired), eSMPAPIType, eSMPIdentifierType, Boolean.valueOf(bProduction));
return aExtSMLInfo;
}
use of com.helger.peppol.domain.SMLConfiguration in project peppol-practical by phax.
the class SMLConfigurationManager method removeSMLInfo.
@Nullable
public EChange removeSMLInfo(@Nullable final String sSMLInfoID) {
if (StringHelper.hasNoText(sSMLInfoID))
return EChange.UNCHANGED;
m_aRWLock.writeLock().lock();
try {
final SMLConfiguration aExtSMLInfo = internalDeleteItem(sSMLInfoID);
if (aExtSMLInfo == null) {
AuditHelper.onAuditDeleteFailure(SMLInfo.OT, "no-such-id", sSMLInfoID);
return EChange.UNCHANGED;
}
} finally {
m_aRWLock.writeLock().unlock();
}
AuditHelper.onAuditDeleteSuccess(SMLInfo.OT, sSMLInfoID);
return EChange.CHANGED;
}
Aggregations