public <T extends AEExtension> T getAEExtensionNotNull(Class<T> clazz) { T aeExt = getAEExtension(clazz); if (aeExt == null) throw new IllegalStateException("No " + clazz.getName() + " configured for AE: " + aet); return aeExt; } }
public <T extends AEExtension> T getAEExtensionNotNull(Class<T> clazz) { T aeExt = getAEExtension(clazz); if (aeExt == null) throw new IllegalStateException("No " + clazz.getName() + " configured for AE: " + aet); return aeExt; } }
public boolean isAssociationFromDestinationAET(Association asAccepted) { ProxyAEExtension pae = (ProxyAEExtension) asAccepted.getApplicationEntity().getAEExtension( ProxyAEExtension.class); for (ForwardRule rule : pae.getForwardRules()) for (String destinationAET : rule.getDestinationAETitles()) if (asAccepted.getRemoteAET().equals(destinationAET)) return true; return false; }
@Override public Map toConfigNode(ApplicationEntity object, ConfigProperty property, SavingContext ctx) throws ConfigurationException { Map aeNode = super.toConfigNode(object, property, ctx); // strip the TCs out in case the TCGroupConfigAEExtension is present if (object.getAEExtension(TCGroupConfigAEExtension.class) != null) { // we cannot do this since we don't want to change the state of the ae object // object.setTransferCapabilities(Collections.<TransferCapability>emptyList()); // so we modify the serialized node instead Nodes.removeNodes(aeNode, DicomPath.AETransferCapabilities.path()); } return aeNode; }
@Override public ApplicationEntity fromConfigNode(Map configNode, ConfigProperty property, LoadingContext ctx, Object parent) throws ConfigurationException { ApplicationEntity applicationEntity = super.fromConfigNode(configNode, property, ctx, parent); TCGroupConfigAEExtension tcGroupConfigAEExtension = applicationEntity.getAEExtension(TCGroupConfigAEExtension.class); if (tcGroupConfigAEExtension != null) { // override any entries that might have been added before applicationEntity.setTransferCapabilities(new ArrayList<TransferCapability>()); // add processed TCs from pre-configured groups to this ae for (Map.Entry<String, TCGroupConfigAEExtension.TCGroupDetails> tcGroupRefEntry : tcGroupConfigAEExtension.getScpTCs().entrySet()) addTC(applicationEntity, tcGroupsProvider.getTCGroups(), tcGroupRefEntry, TransferCapability.Role.SCP); for (Map.Entry<String, TCGroupConfigAEExtension.TCGroupDetails> tcGroupRefEntry : tcGroupConfigAEExtension.getScuTCs().entrySet()) addTC(applicationEntity, tcGroupsProvider.getTCGroups(), tcGroupRefEntry, TransferCapability.Role.SCU); } return applicationEntity; }
@Override protected void loadChilds(ApplicationEntity ae, String aeDN) throws NamingException { ProxyAEExtension proxyAEE = ae.getAEExtension(ProxyAEExtension.class); if (proxyAEE == null) return; loadRetries(proxyAEE, aeDN); loadForwardOptions(proxyAEE, aeDN); loadForwardRules(proxyAEE, aeDN); config.load(proxyAEE.getAttributeCoercions(), aeDN); }
@Override protected void loadChilds(ApplicationEntity ae, Preferences aeNode) throws BackingStoreException { ProxyAEExtension proxyAE = ae.getAEExtension(ProxyAEExtension.class); if (proxyAE == null) return; loadRetries(proxyAE, aeNode); loadForwardOptions(proxyAE, aeNode); loadForwardRules(proxyAE, aeNode); config.load(proxyAE.getAttributeCoercions(), aeNode); }
void initGroupBasedTCs(Device d) throws ConfigurationException { TCConfiguration tcConfig = getTCConfig(); for (ApplicationEntity applicationEntity : d.getApplicationEntities()) { TCGroupConfigAEExtension tcGroupConfigAEExtension = applicationEntity.getAEExtension(TCGroupConfigAEExtension.class); if (tcGroupConfigAEExtension != null) { // override any entries that might have been added before applicationEntity.setTransferCapabilities(new ArrayList<TransferCapability>()); // Always add CEcho SCP applicationEntity.addTransferCapability(new TransferCapability("CEcho SCP", UID.VerificationSOPClass, TransferCapability.Role.SCP, UID.ImplicitVRLittleEndian)); // add processed TCs from pre-configured groups to this ae for (Map.Entry<String, TCGroupConfigAEExtension.TCGroupDetails> tcGroupRefEntry : tcGroupConfigAEExtension.getScpTCs().entrySet()) addTC(applicationEntity, tcConfig, tcGroupRefEntry, TransferCapability.Role.SCP); for (Map.Entry<String, TCGroupConfigAEExtension.TCGroupDetails> tcGroupRefEntry : tcGroupConfigAEExtension.getScuTCs().entrySet()) addTC(applicationEntity, tcConfig, tcGroupRefEntry, TransferCapability.Role.SCU); } } }
@Override protected void mergeChilds(ApplicationEntity prev, ApplicationEntity ae, String aeDN) throws NamingException { ProxyAEExtension pprev = prev.getAEExtension(ProxyAEExtension.class); ProxyAEExtension pae = ae.getAEExtension(ProxyAEExtension.class); if (pprev == null || pae == null) return; config.merge(pprev.getAttributeCoercions(), pae.getAttributeCoercions(), aeDN); mergeRetries(pprev.getRetries(), pae.getRetries(), aeDN); mergeForwardOptions(pprev.getForwardOptions(), pae.getForwardOptions(), aeDN); mergeForwardRules(pprev.getForwardRules(), pae.getForwardRules(), aeDN); }
@Override protected void mergeChilds(ApplicationEntity prev, ApplicationEntity ae, Preferences aePrefs) throws BackingStoreException { ProxyAEExtension pprev = prev.getAEExtension(ProxyAEExtension.class); ProxyAEExtension pae = ae.getAEExtension(ProxyAEExtension.class); if (pprev == null || pae == null) return; config.merge(pprev.getAttributeCoercions(), pae.getAttributeCoercions(), aePrefs); mergeRetries(pprev.getRetries(), pae.getRetries(), aePrefs); mergeForwardOptions(pprev.getForwardOptions(), pae.getForwardOptions(), aePrefs); mergeForwardRules(pprev.getForwardRules(), pae.getForwardRules(), aePrefs); }
@Override protected void storeChilds(String aeDN, ApplicationEntity ae) throws NamingException { ProxyAEExtension proxyAEE = ae.getAEExtension(ProxyAEExtension.class); if (proxyAEE == null) return; storeRetries(proxyAEE.getRetries(), aeDN); storeForwardOptions(proxyAEE.getForwardOptions(), aeDN); storeForwardRules(proxyAEE.getForwardRules(), aeDN); config.store(proxyAEE.getAttributeCoercions(), aeDN); }
@Override protected void storeChilds(ApplicationEntity ae, Preferences aeNode) { ProxyAEExtension proxyAE = ae.getAEExtension(ProxyAEExtension.class); if (proxyAE == null) return; storeRetries(proxyAE.getRetries(), aeNode); storeForwardOptions(proxyAE.getForwardOptions(), aeNode); storeForwardRules(proxyAE.getForwardRules(), aeNode); config.store(proxyAE.getAttributeCoercions(), aeNode); }
@Override protected void storeTo(ApplicationEntity ae, Attributes attrs) { ProxyAEExtension proxyAEE = ae.getAEExtension(ProxyAEExtension.class); if (proxyAEE == null) return; attrs.get("objectClass").add("dcmProxyNetworkAE"); LdapUtils.storeNotNull(attrs, "dcmSpoolDirectory", proxyAEE.getSpoolDirectory()); LdapUtils.storeNotNull(attrs, "dcmAcceptDataOnFailedAssociation", proxyAEE.isAcceptDataOnFailedAssociation()); LdapUtils.storeNotNull(attrs, "dcmEnableAuditLog", proxyAEE.isEnableAuditLog()); LdapUtils.storeNotNull(attrs, "hl7ProxyPIXConsumerApplication", proxyAEE.getProxyPIXConsumerApplication()); LdapUtils.storeNotNull(attrs, "hl7RemotePIXManagerApplication", proxyAEE.getRemotePIXManagerApplication()); LdapUtils.storeNotNull(attrs, "dcmDeleteFailedDataWithoutRetryConfiguration", proxyAEE.isDeleteFailedDataWithoutRetryConfiguration()); LdapUtils.storeNotNull(attrs, "dcmDestinationAETitle", proxyAEE.getFallbackDestinationAET()); LdapUtils.storeBoolean(attrs, "dcmMergeStgCmtMessagesUsingANDLogic", proxyAEE.isMergeStgCmtMessagesUsingANDLogic()); }
@Override protected void storeTo(ApplicationEntity ae, Preferences prefs) { ProxyAEExtension proxyAEE = ae.getAEExtension(ProxyAEExtension.class); if (proxyAEE == null) return; prefs.putBoolean("dcmProxyNetworkAE", true); PreferencesUtils.storeNotNull(prefs, "dcmSpoolDirectory", proxyAEE.getSpoolDirectory()); PreferencesUtils.storeNotNull(prefs, "dcmAcceptDataOnFailedAssociation", proxyAEE.isAcceptDataOnFailedAssociation()); PreferencesUtils.storeNotNull(prefs, "dcmEnableAuditLog", proxyAEE.isEnableAuditLog()); PreferencesUtils .storeNotNull(prefs, "hl7ProxyPIXConsumerApplication", proxyAEE.getProxyPIXConsumerApplication()); PreferencesUtils .storeNotNull(prefs, "hl7RemotePIXManagerApplication", proxyAEE.getRemotePIXManagerApplication()); PreferencesUtils.storeNotNull(prefs, "dcmDeleteFailedDataWithoutRetryConfiguration", proxyAEE.isDeleteFailedDataWithoutRetryConfiguration()); PreferencesUtils.storeNotNull(prefs, "dcmDestinationAETitle", proxyAEE.getFallbackDestinationAET()); PreferencesUtils.storeNotNull(prefs, "dcmMergeStgCmtMessagesUsingANDLogic", proxyAEE.isMergeStgCmtMessagesUsingANDLogic()); }
@Override protected void storeDiffs(ApplicationEntity a, ApplicationEntity b, List<ModificationItem> mods) { ProxyAEExtension pa = a.getAEExtension(ProxyAEExtension.class); ProxyAEExtension pb = b.getAEExtension(ProxyAEExtension.class); if (pa == null || pb == null) return; LdapUtils.storeDiff(mods, "dcmSpoolDirectory", pa.getSpoolDirectory(), pb.getSpoolDirectory()); LdapUtils.storeDiff(mods, "dcmAcceptDataOnFailedAssociation", pa.isAcceptDataOnFailedAssociation(), pb.isAcceptDataOnFailedAssociation()); LdapUtils.storeDiff(mods, "dcmEnableAuditLog", pa.isEnableAuditLog(), pb.isEnableAuditLog()); LdapUtils.storeDiff(mods, "hl7ProxyPIXConsumerApplication", pa.getProxyPIXConsumerApplication(), pb.getProxyPIXConsumerApplication()); LdapUtils.storeDiff(mods, "hl7RemotePIXManagerApplication", pa.getRemotePIXManagerApplication(), pb.getRemotePIXManagerApplication()); LdapUtils.storeDiff(mods, "dcmDeleteFailedDataWithoutRetryConfiguration", pa.isDeleteFailedDataWithoutRetryConfiguration(), pb.isDeleteFailedDataWithoutRetryConfiguration()); LdapUtils.storeDiff(mods, "dcmDestinationAETitle", pa.getFallbackDestinationAET(), pb.getFallbackDestinationAET()); LdapUtils.storeDiff(mods, "dcmMergeStgCmtMessagesUsingANDLogic", pa.isMergeStgCmtMessagesUsingANDLogic(), pb.isMergeStgCmtMessagesUsingANDLogic()); }
@Override protected void storeDiffs(ApplicationEntity a, ApplicationEntity b, Preferences prefs) { ProxyAEExtension pa = a.getAEExtension(ProxyAEExtension.class); ProxyAEExtension pb = b.getAEExtension(ProxyAEExtension.class); if (pa == null || pb == null) return; PreferencesUtils.storeDiff(prefs, "dcmSpoolDirectory", pa.getSpoolDirectory(), pb.getSpoolDirectory()); PreferencesUtils.storeDiff(prefs, "dcmAcceptDataOnFailedAssociation", pa.isAcceptDataOnFailedAssociation(), pb.isAcceptDataOnFailedAssociation()); PreferencesUtils.storeDiff(prefs, "dcmEnableAuditLog", pa.isEnableAuditLog(), pb.isEnableAuditLog()); PreferencesUtils.storeDiff(prefs, "hl7ProxyPIXConsumerApplication", pa.getProxyPIXConsumerApplication(), pb.getProxyPIXConsumerApplication()); PreferencesUtils.storeDiff(prefs, "hl7RemotePIXManagerApplication", pa.getRemotePIXManagerApplication(), pb.getRemotePIXManagerApplication()); PreferencesUtils.storeDiff(prefs, "dcmDeleteFailedDataWithoutRetryConfiguration", pa.isDeleteFailedDataWithoutRetryConfiguration(), pb.isDeleteFailedDataWithoutRetryConfiguration()); PreferencesUtils.storeDiff(prefs, "dcmDestinationAETitle", pa.getFallbackDestinationAET(), pb.getFallbackDestinationAET()); PreferencesUtils.storeDiff(prefs, "dcmMergeStgCmtMessagesUsingANDLogic", pa.isMergeStgCmtMessagesUsingANDLogic(), pb.isMergeStgCmtMessagesUsingANDLogic()); }