use of org.dcm4che3.net.pdu.AAssociateRQ in project dcm4chee-arc-light by dcm4che.
the class UPSEventSCP method mkAAssociateRQ.
private static AAssociateRQ mkAAssociateRQ(ApplicationEntity localAE, String subscriberAET) {
AAssociateRQ aarq = new AAssociateRQ();
aarq.setCalledAET(subscriberAET);
TransferCapability tc = localAE.getTransferCapabilityFor(UID.UnifiedProcedureStepEvent, TransferCapability.Role.SCP);
aarq.addPresentationContext(new PresentationContext(1, UID.UnifiedProcedureStepEvent, tc != null ? tc.getTransferSyntaxes() : new String[] { UID.ImplicitVRLittleEndian }));
aarq.addRoleSelection(new RoleSelection(UID.UnifiedProcedureStepEvent, false, true));
return aarq;
}
use of org.dcm4che3.net.pdu.AAssociateRQ in project dcm4chee-arc-light by dcm4che.
the class CStoreSCUImpl method openMultipleAssocations.
private Association[] openMultipleAssocations(RetrieveContext ctx) throws DicomServiceException {
Association storeas = openAssociation(ctx);
ctx.setStoreAssociation(storeas);
Association[] storeass = new Association[Math.min(ctx.getArchiveAEExtension().maxStoreAssociationsTo(ctx.getDestinationAETitle()), Math.max(ctx.getNumberOfMatches(), 1))];
storeass[0] = storeas;
ApplicationEntity localAE = ctx.getLocalApplicationEntity();
ApplicationEntity destinationAE = ctx.getDestinationAE();
AAssociateRQ acrq = storeas.getAAssociateRQ();
int count = 0;
while (++count < storeass.length) {
try {
storeass[count] = localAE.connect(destinationAE, acrq);
} catch (Exception e) {
LOG.warn("failed to open additional association to {}:\n", ctx.getDestinationAETitle());
return Arrays.copyOf(storeass, count);
}
}
return storeass;
}
use of org.dcm4che3.net.pdu.AAssociateRQ in project dcm4chee-arc-light by dcm4che.
the class CStoreSCUImpl method createAARQ.
private AAssociateRQ createAARQ(ApplicationEntity localAE, String calledAET, String cuid) {
AAssociateRQ aarq = new AAssociateRQ();
if (!localAE.isMasqueradeCallingAETitle(calledAET))
aarq.setCallingAET(localAE.getAETitle());
aarq.addPresentationContextFor(cuid, UID.ExplicitVRLittleEndian);
aarq.addPresentationContextFor(cuid, UID.ImplicitVRLittleEndian);
return aarq;
}
use of org.dcm4che3.net.pdu.AAssociateRQ in project dcm4chee-arc-light by dcm4che.
the class CStoreSCUImpl method createAARQ.
private AAssociateRQ createAARQ(RetrieveContext ctx) {
AAssociateRQ aarq = new AAssociateRQ();
ApplicationEntity localAE = ctx.getLocalApplicationEntity();
ApplicationEntity destAE = ctx.getDestinationAE();
if (!localAE.isMasqueradeCallingAETitle(ctx.getDestinationAETitle()))
aarq.setCallingAET(ctx.getCallingAET());
boolean noDestinationRestriction = destAE.getTransferCapabilitiesWithRole(SCP).isEmpty();
for (Iterator<InstanceLocations> iter = ctx.getMatches().iterator(); iter.hasNext(); ) {
InstanceLocations inst = iter.next();
String cuid = inst.getSopClassUID();
TransferCapability localTC = localAE.getTransferCapabilityFor(cuid, SCU);
TransferCapability destTC = noDestinationRestriction ? null : destAE.getTransferCapabilityFor(cuid, SCP);
if (!aarq.containsPresentationContextFor(cuid) && !isVideo(inst)) {
if (noDestinationRestriction) {
addPresentationContext(aarq, cuid, UID.ImplicitVRLittleEndian, localTC);
addPresentationContext(aarq, cuid, UID.ExplicitVRLittleEndian, localTC);
} else {
addPresentationContext(aarq, cuid, UID.ImplicitVRLittleEndian, localTC, destTC);
addPresentationContext(aarq, cuid, UID.ExplicitVRLittleEndian, localTC, destTC);
}
}
for (Location location : inst.getLocations()) {
String tsuid = location.getTransferSyntaxUID();
if (!tsuid.equals(UID.ImplicitVRLittleEndian) && !tsuid.equals(UID.ExplicitVRLittleEndian))
if (noDestinationRestriction) {
addPresentationContext(aarq, cuid, tsuid, localTC);
} else {
addPresentationContext(aarq, cuid, tsuid, localTC, destTC);
}
}
}
return aarq;
}
use of org.dcm4che3.net.pdu.AAssociateRQ in project dcm4chee-arc-light by dcm4che.
the class MPPSSCUImpl method forwardMPPS.
@Override
public Outcome forwardMPPS(String localAET, String remoteAET, Dimse dimse, String sopInstanceUID, Attributes attrs, Attributes procAttrs) throws Exception {
ApplicationEntity localAE = device.getApplicationEntity(localAET, true);
ApplicationEntity remoteAE = aeCache.findApplicationEntity(remoteAET);
AAssociateRQ aarq = mkAAssociateRQ(localAE);
Association as = localAE.connect(remoteAE, aarq);
ProcedureContext pCtx = createProcedureCtx(sopInstanceUID, attrs.getString(Tag.PerformedProcedureStepStatus), as, dimse, procAttrs);
try {
DimseRSP rsp = dimse == Dimse.N_CREATE_RQ ? as.ncreate(UID.ModalityPerformedProcedureStep, sopInstanceUID, attrs, null) : as.nset(UID.ModalityPerformedProcedureStep, sopInstanceUID, attrs, null);
rsp.next();
return outcome(rsp.getCommand().getInt(Tag.Status, -1), dimse, sopInstanceUID, remoteAET, pCtx);
} finally {
try {
as.release();
} catch (IOException e) {
LOG.info("{}: Failed to release association to {}", as, remoteAET);
} finally {
procedureEvent.fire(pCtx);
}
}
}
Aggregations