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); }
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); }
b.isAssociationInitiator(), null); LdapUtils.storeDiffObject(ldapObj, mods, "dicomAssociationAcceptor", a.isAssociationAcceptor(), b.isAssociationAcceptor(), null); LdapUtils.storeDiff(ldapObj, mods, "dicomNetworkConnectionReference", a.getConnections(),
b.isAssociationInitiator(), null); LdapUtils.storeDiffObject(ldapObj, mods, "dicomAssociationAcceptor", a.isAssociationAcceptor(), b.isAssociationAcceptor(), null); LdapUtils.storeDiff(ldapObj, mods, "dicomNetworkConnectionReference", a.getConnections(),
private Attributes storeTo(ConfigurationChanges.ModifiedObject ldapObj, ApplicationEntity ae, String deviceDN, Attributes attrs) { BasicAttribute objectclass = new BasicAttribute("objectclass", "dicomNetworkAE"); attrs.put(objectclass); LdapUtils.storeNotNullOrDef(ldapObj, attrs, "dicomAETitle", ae.getAETitle(), null); LdapUtils.storeNotNullOrDef(ldapObj, attrs, "dicomDescription", ae.getDescription(), null); storeNotEmpty(ldapObj, attrs, "dicomVendorData", ae.getVendorData()); LdapUtils.storeNotEmpty(ldapObj, attrs, "dicomApplicationCluster", ae.getApplicationClusters()); LdapUtils.storeNotEmpty(ldapObj, attrs, "dicomPreferredCallingAETitle", ae.getPreferredCallingAETitles()); LdapUtils.storeNotEmpty(ldapObj, attrs, "dicomPreferredCalledAETitle", ae.getPreferredCalledAETitles()); LdapUtils.storeBoolean(ldapObj, attrs, "dicomAssociationInitiator", ae.isAssociationInitiator()); LdapUtils.storeBoolean(ldapObj, attrs, "dicomAssociationAcceptor", ae.isAssociationAcceptor()); LdapUtils.storeConnRefs(ldapObj, attrs, ae.getConnections(), deviceDN); LdapUtils.storeNotEmpty(ldapObj, attrs, "dicomSupportedCharacterSet", ae.getSupportedCharacterSets()); LdapUtils.storeNotNullOrDef(ldapObj, attrs, "dicomInstalled", ae.getInstalled(), null); if (!extended) return attrs; objectclass.add("dcmNetworkAE"); LdapUtils.storeNotEmpty(ldapObj, attrs, "dcmPreferredTransferSyntax", LdapUtils.addOrdinalPrefix(ae.getPreferredTransferSyntaxes())); LdapUtils.storeNotNullOrDef(ldapObj, attrs, "hl7ApplicationName", ae.getHl7ApplicationName(), null); LdapUtils.storeNotEmpty(ldapObj, attrs, "dcmAcceptedCallingAETitle", ae.getAcceptedCallingAETitles()); LdapUtils.storeNotEmpty(ldapObj, attrs, "dcmOtherAETitle", ae.getOtherAETitles()); LdapUtils.storeNotEmpty(ldapObj, attrs, "dcmMasqueradeCallingAETitle", ae.getMasqueradeCallingAETitles()); for (LdapDicomConfigurationExtension ext : extensions) ext.storeTo(ldapObj, ae, attrs); return attrs; }
private void writeTo(ApplicationEntity ae, List<Connection> conns, JsonWriter writer, boolean extended) { writer.writeStartObject(); writer.writeNotNullOrDef("dicomAETitle", ae.getAETitle(), null); writer.writeNotNullOrDef("dicomDescription", ae.getDescription(), null); writer.writeNotEmpty("dicomApplicationCluster", ae.getApplicationClusters()); writer.writeNotEmpty("dicomPreferredCallingAETitle", ae.getPreferredCallingAETitles()); writer.writeNotEmpty("dicomPreferredCalledAETitle", ae.getPreferredCalledAETitles()); writer.write("dicomAssociationInitiator", ae.isAssociationInitiator()); writer.write("dicomAssociationAcceptor", ae.isAssociationAcceptor()); writer.writeConnRefs(conns, ae.getConnections()); writer.writeNotEmpty("dicomSupportedCharacterSet", ae.getSupportedCharacterSets()); writer.writeNotNull("dicomInstalled", ae.getInstalled()); writeTransferCapabilitiesTo(ae, writer, extended); if (extended) { writer.writeStartObject("dcmNetworkAE"); writer.writeNotEmpty("dcmPreferredTransferSyntax", ae.getPreferredTransferSyntaxes()); writer.writeNotEmpty("dcmAcceptedCallingAETitle", ae.getAcceptedCallingAETitles()); writer.writeNotEmpty("dcmOtherAETitle", ae.getOtherAETitles()); writer.writeNotEmpty("dcmMasqueradeCallingAETitle", ae.getMasqueradeCallingAETitles()); writer.writeNotNullOrDef("hl7ApplicationName", ae.getHl7ApplicationName(), null); for (JsonConfigurationExtension ext : extensions) ext.storeTo(ae, writer); writer.writeEnd(); } writer.writeEnd(); }
private Attributes storeTo(ConfigurationChanges.ModifiedObject ldapObj, ApplicationEntity ae, String deviceDN, Attributes attrs) { BasicAttribute objectclass = new BasicAttribute("objectclass", "dicomNetworkAE"); attrs.put(objectclass); LdapUtils.storeNotNullOrDef(ldapObj, attrs, "dicomAETitle", ae.getAETitle(), null); LdapUtils.storeNotNullOrDef(ldapObj, attrs, "dicomDescription", ae.getDescription(), null); storeNotEmpty(ldapObj, attrs, "dicomVendorData", ae.getVendorData()); LdapUtils.storeNotEmpty(ldapObj, attrs, "dicomApplicationCluster", ae.getApplicationClusters()); LdapUtils.storeNotEmpty(ldapObj, attrs, "dicomPreferredCallingAETitle", ae.getPreferredCallingAETitles()); LdapUtils.storeNotEmpty(ldapObj, attrs, "dicomPreferredCalledAETitle", ae.getPreferredCalledAETitles()); LdapUtils.storeBoolean(ldapObj, attrs, "dicomAssociationInitiator", ae.isAssociationInitiator()); LdapUtils.storeBoolean(ldapObj, attrs, "dicomAssociationAcceptor", ae.isAssociationAcceptor()); LdapUtils.storeConnRefs(ldapObj, attrs, ae.getConnections(), deviceDN); LdapUtils.storeNotEmpty(ldapObj, attrs, "dicomSupportedCharacterSet", ae.getSupportedCharacterSets()); LdapUtils.storeNotNullOrDef(ldapObj, attrs, "dicomInstalled", ae.getInstalled(), null); if (!extended) return attrs; objectclass.add("dcmNetworkAE"); LdapUtils.storeNotEmpty(ldapObj, attrs, "dcmPreferredTransferSyntax", LdapUtils.addOrdinalPrefix(ae.getPreferredTransferSyntaxes())); LdapUtils.storeNotNullOrDef(ldapObj, attrs, "hl7ApplicationName", ae.getHl7ApplicationName(), null); LdapUtils.storeNotEmpty(ldapObj, attrs, "dcmAcceptedCallingAETitle", ae.getAcceptedCallingAETitles()); LdapUtils.storeNotEmpty(ldapObj, attrs, "dcmOtherAETitle", ae.getOtherAETitles()); LdapUtils.storeNotEmpty(ldapObj, attrs, "dcmMasqueradeCallingAETitle", ae.getMasqueradeCallingAETitles()); for (LdapDicomConfigurationExtension ext : extensions) ext.storeTo(ldapObj, ae, attrs); return attrs; }
private void writeTo(ApplicationEntity ae, List<Connection> conns, JsonWriter writer, boolean extended) { writer.writeStartObject(); writer.writeNotNullOrDef("dicomAETitle", ae.getAETitle(), null); writer.writeNotNullOrDef("dicomDescription", ae.getDescription(), null); writer.writeNotEmpty("dicomApplicationCluster", ae.getApplicationClusters()); writer.writeNotEmpty("dicomPreferredCallingAETitle", ae.getPreferredCallingAETitles()); writer.writeNotEmpty("dicomPreferredCalledAETitle", ae.getPreferredCalledAETitles()); writer.write("dicomAssociationInitiator", ae.isAssociationInitiator()); writer.write("dicomAssociationAcceptor", ae.isAssociationAcceptor()); writer.writeConnRefs(conns, ae.getConnections()); writer.writeNotEmpty("dicomSupportedCharacterSet", ae.getSupportedCharacterSets()); writer.writeNotNull("dicomInstalled", ae.getInstalled()); writeTransferCapabilitiesTo(ae, writer, extended); if (extended) { writer.writeStartObject("dcmNetworkAE"); writer.writeNotEmpty("dcmPreferredTransferSyntax", ae.getPreferredTransferSyntaxes()); writer.writeNotEmpty("dcmAcceptedCallingAETitle", ae.getAcceptedCallingAETitles()); writer.writeNotEmpty("dcmOtherAETitle", ae.getOtherAETitles()); writer.writeNotEmpty("dcmMasqueradeCallingAETitle", ae.getMasqueradeCallingAETitles()); writer.writeNotNullOrDef("hl7ApplicationName", ae.getHl7ApplicationName(), null); for (JsonConfigurationExtension ext : extensions) ext.storeTo(ae, writer); writer.writeEnd(); } writer.writeEnd(); }