protected void onClose(Association as) { DimseRQHandler tmp = as.getApplicationEntity().getDimseRQHandler(); if (tmp != null) tmp.onClose(as); }
private void startWritePendingRSP() { writePendingRSP = rqas.getApplicationEntity().getDevice() .scheduleAtFixedRate( new Runnable(){ @Override public void run() { BasicRetrieveTask.this.writePendingRSP(); } }, 0, pendingRSPInterval, TimeUnit.SECONDS); }
protected void onClose(Association as) { DimseRQHandler tmp = as.getApplicationEntity().getDimseRQHandler(); if (tmp != null) tmp.onClose(as); }
private void startWritePendingRSP() { writePendingRSP = rqas.getApplicationEntity().getDevice() .scheduleAtFixedRate( new Runnable(){ @Override public void run() { BasicRetrieveTask.this.writePendingRSP(); } }, 0, pendingRSPInterval, TimeUnit.SECONDS); }
private Association openStoreAssociation(Association as, Connection remote, AAssociateRQ aarq) throws DicomServiceException { try { return as.getApplicationEntity().connect( as.getConnection(), remote, aarq); } catch (Exception e) { throw new DicomServiceException(Status.UnableToPerformSubOperations, e); } }
private Association openStoreAssociation(Association as, Connection remote, AAssociateRQ aarq) throws DicomServiceException { try { return as.getApplicationEntity().connect( as.getConnection(), remote, aarq); } catch (Exception e) { throw new DicomServiceException(Status.UnableToPerformSubOperations, e); } }
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 void onDimseRQ(Association as, PresentationContext pc, Dimse dimse, Attributes rq, Attributes keys) throws IOException { if (dimse != Dimse.C_FIND_RQ) throw new DicomServiceException(Status.UnrecognizedOperation); QueryTask queryTask = calculateMatches(as, pc, rq, keys); as.getApplicationEntity().getDevice().execute(queryTask); }
@Override public void onDimseRQ(Association as, PresentationContext pc, Dimse dimse, Attributes rq, Attributes keys) throws IOException { if (dimse != Dimse.C_FIND_RQ) throw new DicomServiceException(Status.UnrecognizedOperation); QueryTask queryTask = calculateMatches(as, pc, rq, keys); as.getApplicationEntity().getDevice().execute(queryTask); }
@Override public void run() { if (sameAssoc) { try { neventReport(as); return; } catch (Exception e) { DcmQRSCP.LOG.info( "Failed to return Storage Commitment Result in same Association:", e); } } try { Association diffAssoc = as.getApplicationEntity().connect( as.getConnection(), remoteConn, makeAAssociateRQ()); neventReport(diffAssoc); diffAssoc.release(); } catch (Exception e) { DcmQRSCP.LOG.error( "Failed to return Storage Commitment Result in new Association:", e); } }
@Override public void run() { if (sameAssoc) { try { neventReport(as); return; } catch (Exception e) { DcmQRSCP.LOG.info( "Failed to return Storage Commitment Result in same Association:", e); } } try { Association diffAssoc = as.getApplicationEntity().connect( as.getConnection(), remoteConn, makeAAssociateRQ()); neventReport(diffAssoc); diffAssoc.release(); } catch (Exception e) { DcmQRSCP.LOG.error( "Failed to return Storage Commitment Result in new Association:", e); } }
@Override public void onDimseRQ(Association as, PresentationContext pc, Dimse dimse, Attributes cmd, Attributes keys) throws IOException { if (dimse != Dimse.C_MOVE_RQ) throw new DicomServiceException(Status.UnrecognizedOperation); RetrieveTask retrieveTask = calculateMatches(as, pc, cmd, keys); if (retrieveTask != null) as.getApplicationEntity().getDevice().execute(retrieveTask); else as.tryWriteDimseRSP(pc, Commands.mkCMoveRSP(cmd, Status.Success)); }
@Override public void onDimseRQ(Association as, PresentationContext pc, Dimse dimse, Attributes cmd, Attributes keys) throws IOException { if (dimse != Dimse.C_GET_RQ) throw new DicomServiceException(Status.UnrecognizedOperation); RetrieveTask retrieveTask = calculateMatches(as, pc, cmd, keys); if (retrieveTask != null) as.getApplicationEntity().getDevice().execute(retrieveTask); else as.tryWriteDimseRSP(pc, Commands.mkCGetRSP(cmd, Status.Success)); }
@Override public void onDimseRQ(Association as, PresentationContext pc, Dimse dimse, Attributes cmd, Attributes keys) throws IOException { if (dimse != Dimse.C_MOVE_RQ) throw new DicomServiceException(Status.UnrecognizedOperation); RetrieveTask retrieveTask = calculateMatches(as, pc, cmd, keys); if (retrieveTask != null) as.getApplicationEntity().getDevice().execute(retrieveTask); else as.tryWriteDimseRSP(pc, Commands.mkCMoveRSP(cmd, Status.Success)); }
@Override public void onDimseRQ(Association as, PresentationContext pc, Dimse dimse, Attributes cmd, Attributes keys) throws IOException { if (dimse != Dimse.C_GET_RQ) throw new DicomServiceException(Status.UnrecognizedOperation); RetrieveTask retrieveTask = calculateMatches(as, pc, cmd, keys); if (retrieveTask != null) as.getApplicationEntity().getDevice().execute(retrieveTask); else as.tryWriteDimseRSP(pc, Commands.mkCGetRSP(cmd, Status.Success)); }
private AAssociateRQ makeAAssociateRQ() { AAssociateRQ aarq = new AAssociateRQ(); aarq.setCallingAET(as.getLocalAET()); aarq.setCalledAET(as.getRemoteAET()); ApplicationEntity ae = as.getApplicationEntity(); TransferCapability tc = ae.getTransferCapabilityFor( UID.StorageCommitmentPushModelSOPClass, TransferCapability.Role.SCP); aarq.addPresentationContext( new PresentationContext( 1, UID.StorageCommitmentPushModelSOPClass, tc.getTransferSyntaxes())); aarq.addRoleSelection( new RoleSelection(UID.StorageCommitmentPushModelSOPClass, false, true)); return aarq; }
private AAssociateRQ makeAAssociateRQ() { AAssociateRQ aarq = new AAssociateRQ(); aarq.setCallingAET(as.getLocalAET()); aarq.setCalledAET(as.getRemoteAET()); ApplicationEntity ae = as.getApplicationEntity(); TransferCapability tc = ae.getTransferCapabilityFor( UID.StorageCommitmentPushModelSOPClass, TransferCapability.Role.SCP); aarq.addPresentationContext( new PresentationContext( 1, UID.StorageCommitmentPushModelSOPClass, tc.getTransferSyntaxes())); aarq.addRoleSelection( new RoleSelection(UID.StorageCommitmentPushModelSOPClass, false, true)); return aarq; }
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 makeAAssociateAC(Association as, AAssociateRQ rq, UserIdentityAC userIdentity) throws IOException { AAssociateAC ac = new AAssociateAC(); ac.setCalledAET(rq.getCalledAET()); ac.setCallingAET(rq.getCallingAET()); Connection conn = as.getConnection(); ac.setMaxPDULength(conn.getReceivePDULength()); ac.setMaxOpsInvoked(Association.minZeroAsMax(rq.getMaxOpsInvoked(), conn.getMaxOpsPerformed())); ac.setMaxOpsPerformed(Association.minZeroAsMax(rq.getMaxOpsPerformed(), conn.getMaxOpsInvoked())); ac.setUserIdentityAC(userIdentity); ApplicationEntity ae = as.getApplicationEntity(); for (PresentationContext rqpc : rq.getPresentationContexts()) ac.addPresentationContext(ae.negotiate(rq, ac, rqpc)); return ac; }
protected AAssociateAC makeAAssociateAC(Association as, AAssociateRQ rq, UserIdentityAC userIdentity) throws IOException { AAssociateAC ac = new AAssociateAC(); ac.setCalledAET(rq.getCalledAET()); ac.setCallingAET(rq.getCallingAET()); Connection conn = as.getConnection(); ac.setMaxPDULength(conn.getReceivePDULength()); ac.setMaxOpsInvoked(Association.minZeroAsMax(rq.getMaxOpsInvoked(), conn.getMaxOpsPerformed())); ac.setMaxOpsPerformed(Association.minZeroAsMax(rq.getMaxOpsPerformed(), conn.getMaxOpsInvoked())); ac.setUserIdentityAC(userIdentity); ApplicationEntity ae = as.getApplicationEntity(); for (PresentationContext rqpc : rq.getPresentationContexts()) ac.addPresentationContext(ae.negotiate(rq, ac, rqpc)); return ac; }