use of com.helger.peppol.sml.SMLInfo in project phoss-smp by phax.
the class SMLInfoManagerXML 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) {
final SMLInfo aSMLInfo = getOfID(sSMLInfoID);
if (aSMLInfo == null) {
AuditHelper.onAuditModifyFailure(SMLInfo.OT, "set-all", sSMLInfoID, "no-such-id");
return EChange.UNCHANGED;
}
m_aRWLock.writeLock().lock();
try {
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));
if (eChange.isUnchanged())
return EChange.UNCHANGED;
internalUpdateItem(aSMLInfo);
} finally {
m_aRWLock.writeLock().unlock();
}
AuditHelper.onAuditModifySuccess(SMLInfo.OT, "set-all", sSMLInfoID, sDisplayName, sDNSZone, sManagementServiceURL, Boolean.valueOf(bClientCertificateRequired));
return EChange.CHANGED;
}
use of com.helger.peppol.sml.SMLInfo in project phoss-smp by phax.
the class SMLInfoManagerXML method deleteSMLInfo.
@Nullable
public EChange deleteSMLInfo(@Nullable final String sSMLInfoID) {
if (StringHelper.hasNoText(sSMLInfoID))
return EChange.UNCHANGED;
m_aRWLock.writeLock().lock();
try {
final SMLInfo aSMLInfo = internalDeleteItem(sSMLInfoID);
if (aSMLInfo == null) {
AuditHelper.onAuditDeleteFailure(SMLInfo.OT, sSMLInfoID, "no-such-id");
return EChange.UNCHANGED;
}
} finally {
m_aRWLock.writeLock().unlock();
}
AuditHelper.onAuditDeleteSuccess(SMLInfo.OT, sSMLInfoID);
return EChange.CHANGED;
}
use of com.helger.peppol.sml.SMLInfo in project phoss-smp by phax.
the class SMLInfoManagerXML method createSMLInfo.
@Nonnull
public ISMLInfo createSMLInfo(@Nonnull @Nonempty final String sDisplayName, @Nonnull @Nonempty final String sDNSZone, @Nonnull @Nonempty final String sManagementServiceURL, final boolean bClientCertificateRequired) {
final SMLInfo aSMLInfo = new SMLInfo(sDisplayName, sDNSZone, sManagementServiceURL, bClientCertificateRequired);
m_aRWLock.writeLocked(() -> {
internalCreateItem(aSMLInfo);
});
AuditHelper.onAuditCreateSuccess(SMLInfo.OT, aSMLInfo.getID(), sDisplayName, sDNSZone, sManagementServiceURL, Boolean.valueOf(bClientCertificateRequired));
return aSMLInfo;
}
use of com.helger.peppol.sml.SMLInfo 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;
}
Aggregations