use of com.helger.peppol.sml.SMLInfo in project phoss-directory by phax.
the class SMLInfoManager method removeSMLInfo.
@Nullable
public EChange removeSMLInfo(@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, "no-such-id", sSMLInfoID);
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-directory by phax.
the class SMLInfoManager 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-commons by phax.
the class BDXRClientReadOnlyTest method testReadConnectivityTest.
@Test
@Ignore("Because it may take long to execute")
@IgnoredNaptrTest
public void testReadConnectivityTest() throws SMPDNSResolutionException, SMPClientException {
final IParticipantIdentifier aPI = SimpleIdentifierFactory.INSTANCE.createParticipantIdentifier("connectivity-partid-qns", "dynceftest1party59gw");
final IDocumentTypeIdentifier aDocTypeID = SimpleIdentifierFactory.INSTANCE.createDocumentTypeIdentifier("connectivity-docid-qns", "doc_id1");
// TOOP SML
final ISMLInfo aSMLInfo = new SMLInfo("cef-connectivity", "CEF ConnectivityTest", "connectivitytest.acc.edelivery.tech.ec.europa.eu.", "https://acc.edelivery.tech.ec.europa.eu/edelivery-sml", true);
// PEPPOL URL provider
final BDXRClientReadOnly aBDXRClient = new BDXRClientReadOnly(BDXLURLProvider.INSTANCE, aPI, aSMLInfo);
// We don't have the truststore at hand - ignore it
aBDXRClient.setVerifySignature(false);
assertEquals("https://gateway-edelivery.westeurope.cloudapp.azure.com:444/", aBDXRClient.getSMPHostURI());
final SignedServiceMetadataType aMetadata = aBDXRClient.getServiceMetadata(aPI, aDocTypeID);
assertNotNull(aMetadata);
}
use of com.helger.peppol.sml.SMLInfo in project phoss-directory by phax.
the class SMLInfoManager 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, 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, "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 SMLInfoManagerMongoDBTest method testConversion.
@Test
public void testConversion() {
final ISMLInfo aInfo = new SMLInfo("displayName", "DNSZone", "https://url/url", true);
final Document aSrc = SMLInfoManagerMongoDB.toBson(aInfo);
assertNotNull(aSrc);
final ISMLInfo aSrc2 = SMLInfoManagerMongoDB.toDomain(aSrc);
assertNotNull(aSrc2);
assertEquals(aInfo, aSrc2);
}
Aggregations