private void reconfigureApplicationEntities(Device from) { aes.keySet().retainAll(from.aes.keySet()); for (ApplicationEntity src : from.aes.values()) { ApplicationEntity ae = aes.get(src.getAETitle()); if (ae == null) addApplicationEntity(ae = new ApplicationEntity(src.getAETitle())); ae.reconfigure(src); } }
public void open() throws IOException, InterruptedException, IncompatibleConnectionException, GeneralSecurityException { as = ae.connect(conn, remote, rq); }
public void setRole(Role role) { if (role == null) throw new NullPointerException(); if (this.role == role) return; ApplicationEntity ae = this.ae; if (ae != null) ae.removeTransferCapabilityFor(sopClass, this.role); this.role = role; if (ae != null) ae.addTransferCapability(this); }
public Association connect(Connection remote, AAssociateRQ rq) throws IOException, InterruptedException, IncompatibleConnectionException, GeneralSecurityException { return connect(findCompatibleConnection(remote), remote, rq); }
// Usual calamity creating Connection, ApplicationEntity and Device ... ApplicationEntity ae = new ApplicationEntity("MYAETITLE"); String[] acceptedAETs = { "STORESCP", "GEPACS" }; // etc... ae.setAcceptedCallingAETitles(acceptedAETs);
private List<ModificationItem> storeDiffs(ConfigurationChanges.ModifiedObject ldapObj, ApplicationEntity a, ApplicationEntity b, String deviceDN, List<ModificationItem> mods, boolean preserveVendorData) { LdapUtils.storeDiffObject(ldapObj, mods, "dicomDescription", a.getDescription(), b.getDescription(), null); if (!preserveVendorData) storeDiff(ldapObj, mods, "dicomVendorData", a.getVendorData(), b.getVendorData()); LdapUtils.storeDiff(ldapObj, mods, "dicomApplicationCluster", a.getApplicationClusters(), b.getApplicationClusters()); LdapUtils.storeDiff(ldapObj, mods, "dicomPreferredCallingAETitle", a.getPreferredCallingAETitles(), b.getPreferredCallingAETitles()); LdapUtils.storeDiff(ldapObj, mods, "dicomPreferredCalledAETitle", a.getPreferredCalledAETitles(), b.getPreferredCalledAETitles()); LdapUtils.storeDiffObject(ldapObj, mods, "dicomAssociationInitiator", a.isAssociationInitiator(), b.isAssociationInitiator(), null); LdapUtils.storeDiffObject(ldapObj, mods, "dicomAssociationAcceptor", a.isAssociationAcceptor(), b.isAssociationAcceptor(), null); LdapUtils.storeDiff(ldapObj, mods, "dicomNetworkConnectionReference", a.getConnections(), b.getConnections(), deviceDN); LdapUtils.storeDiff(ldapObj, mods, "dicomSupportedCharacterSet", a.getSupportedCharacterSets(),
public GetSCU() throws IOException { ae = new ApplicationEntity("GETSCU"); device.addConnection(conn); device.addApplicationEntity(ae); ae.addConnection(conn); device.setDimseRQHandler(createServiceRegistry()); }
switch (reader.getString()) { case "dicomAETitle": ae.setAETitle(reader.stringValue()); break; case "dicomDescription": ae.setDescription(reader.stringValue()); break; case "dicomApplicationCluster": ae.setApplicationClusters(reader.stringArray()); break; case "dicomPreferredCallingAETitle": ae.setPreferredCallingAETitles(reader.stringArray()); break; case "dicomPreferredCalledAETitle": ae.setPreferredCalledAETitles(reader.stringArray()); break; case "dicomAssociationInitiator": ae.setAssociationInitiator(reader.booleanValue()); break; case "dicomAssociationAcceptor": ae.setAssociationAcceptor(reader.booleanValue()); break; case "dicomSupportedCharacterSet": ae.setSupportedCharacterSets(reader.stringArray()); break; case "dicomInstalled": ae.setInstalled(reader.booleanValue()); break; case "dicomNetworkConnectionReference":
public void addNetworkAE() throws ConfigurationException { Device device = conf.findDevice(deviceName); device.addConnection(conn); ApplicationEntity ae = new ApplicationEntity(aeTitle); device.addApplicationEntity(ae); ae.setDescription(aeDesc); ae.addConnection(conn); conf.merge(device, EnumSet.of(DicomConfiguration.Option.REGISTER)); }
ApplicationEntity ae = new ApplicationEntity(weasisAet); Connection conn = new Connection(); ApplicationEntity remoteAE = new ApplicationEntity(dcmNode.getAeTitle()); Connection remoteConn = new Connection(); ae.addConnection(conn); ae.setAssociationInitiator(true); ae.setAETitle(weasisAet); remoteConn.setSocketCloseDelay(90); remoteAE.setAssociationAcceptor(true); remoteAE.addConnection(remoteConn); ae.addConnection(conn); device.setExecutor(Executors.newSingleThreadExecutor()); device.setScheduledExecutor(Executors.newSingleThreadScheduledExecutor()); rq.setCallingAET(ae.getAETitle()); rq.setCalledAET(remoteAE.getAETitle()); Association as = ae.connect(remoteConn, rq); try {
private void loadFrom(ApplicationEntity ae, Attributes attrs) throws NamingException { ae.setDescription(LdapUtils.stringValue(attrs.get("dicomDescription"), null)); ae.setVendorData(byteArrays(attrs.get("dicomVendorData"))); ae.setApplicationClusters(LdapUtils.stringArray(attrs.get("dicomApplicationCluster"))); ae.setPreferredCallingAETitles(LdapUtils.stringArray(attrs.get("dicomPreferredCallingAETitle"))); ae.setPreferredCalledAETitles(LdapUtils.stringArray(attrs.get("dicomPreferredCalledAETitle"))); ae.setAssociationInitiator(LdapUtils.booleanValue(attrs.get("dicomAssociationInitiator"), false)); ae.setAssociationAcceptor(LdapUtils.booleanValue(attrs.get("dicomAssociationAcceptor"), false)); ae.setSupportedCharacterSets(LdapUtils.stringArray(attrs.get("dicomSupportedCharacterSet"))); ae.setInstalled(LdapUtils.booleanValue(attrs.get("dicomInstalled"), null)); if (!LdapUtils.hasObjectClass(attrs, "dcmNetworkAE")) return; ae.setAcceptedCallingAETitles(LdapUtils.stringArray(attrs.get("dcmAcceptedCallingAETitle"))); ae.setPreferredTransferSyntaxes(LdapUtils.removeOrdinalPrefix( LdapUtils.stringArray(attrs.get("dcmPreferredTransferSyntax")))); ae.setOtherAETitles(LdapUtils.stringArray(attrs.get("dcmOtherAETitle"))); ae.setMasqueradeCallingAETitles(LdapUtils.stringArray(attrs.get("dcmMasqueradeCallingAETitle"))); ae.setHl7ApplicationName(LdapUtils.stringValue(attrs.get("hl7ApplicationName"), null)); for (LdapDicomConfigurationExtension ext : extensions) ext.loadFrom(ae, attrs); }
public DcmQRSCP() throws IOException { device.addConnection(conn); device.addApplicationEntity(ae); ae.setAssociationAcceptor(true); ae.addConnection(conn); device.setDimseRQHandler(createServiceRegistry()); }
public MppsSCP() throws IOException { device.addConnection(conn); device.addApplicationEntity(ae); ae.setAssociationAcceptor(true); ae.addConnection(conn); DicomServiceRegistry serviceRegistry = new DicomServiceRegistry(); serviceRegistry.addDicomService(new BasicCEchoSCP()); serviceRegistry.addDicomService(mppsSCP); ae.setDimseRQHandler(serviceRegistry); }
public FindSCU() throws IOException { device.addConnection(conn); device.addApplicationEntity(ae); ae.addConnection(conn); }
private void loadTransferCapabilities(ApplicationEntity ae, String aeDN) throws NamingException { NamingEnumeration<SearchResult> ne = search(aeDN, "(objectclass=dicomTransferCapability)"); try { while (ne.hasMore()) ae.addTransferCapability(loadTransferCapability(ne.next())); } finally { LdapUtils.safeClose(ne); } }
public Association connect(ApplicationEntity remote, AAssociateRQ rq) throws IOException, InterruptedException, IncompatibleConnectionException, GeneralSecurityException { CompatibleConnection cc = findCompatibleConnection(remote); if (rq.getCalledAET() == null) rq.setCalledAET(remote.getAETitle()); return connect(cc.getLocalConnection(), cc.getRemoteConnection(), rq); }
public String getRetrieveAET() { return retrieveAET != null ? retrieveAET : ae.getAETitle(); }
protected AAssociateAC negotiate(Association as, AAssociateRQ rq) throws IOException { if ((rq.getProtocolVersion() & 1) == 0) throw new AAssociateRJ(AAssociateRJ.RESULT_REJECTED_PERMANENT, AAssociateRJ.SOURCE_SERVICE_PROVIDER_ACSE, AAssociateRJ.REASON_PROTOCOL_VERSION_NOT_SUPPORTED); if (!rq.getApplicationContext().equals( UID.DICOMApplicationContextName)) throw new AAssociateRJ(AAssociateRJ.RESULT_REJECTED_PERMANENT, AAssociateRJ.SOURCE_SERVICE_USER, AAssociateRJ.REASON_APP_CTX_NAME_NOT_SUPPORTED); ApplicationEntity ae = as.getApplicationEntity(); if (ae == null || !ae.getConnections().contains(as.getConnection()) || !ae.isInstalled() || !ae.isAssociationAcceptor()) throw new AAssociateRJ(AAssociateRJ.RESULT_REJECTED_PERMANENT, AAssociateRJ.SOURCE_SERVICE_USER, AAssociateRJ.REASON_CALLED_AET_NOT_RECOGNIZED); if (!ae.isAcceptedCallingAETitle(rq.getCallingAET())) throw new AAssociateRJ(AAssociateRJ.RESULT_REJECTED_PERMANENT, AAssociateRJ.SOURCE_SERVICE_USER, AAssociateRJ.REASON_CALLING_AET_NOT_RECOGNIZED); UserIdentityAC userIdentity = getUserIdNegotiator() != null ? getUserIdNegotiator().negotiate(as, rq.getUserIdentityRQ()) : null; if (ae.getDevice().isLimitOfAssociationsExceeded(rq)) throw new AAssociateRJ(AAssociateRJ.RESULT_REJECTED_TRANSIENT, AAssociateRJ.SOURCE_SERVICE_PROVIDER_PRES, AAssociateRJ.REASON_LOCAL_LIMIT_EXCEEDED); return makeAAssociateAC(as, rq, userIdentity); }
private void loadApplicationEntities(Device device, JsonReader reader, ConfigurationDelegate config) throws ConfigurationException { reader.next(); reader.expect(JsonParser.Event.START_ARRAY); while (reader.next() == JsonParser.Event.START_OBJECT) { ApplicationEntity ae = new ApplicationEntity(); loadFrom(ae, reader, device, config); device.addApplicationEntity(ae); } reader.expect(JsonParser.Event.END_ARRAY); }
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); } } }