public MoveSCU(ApplicationEntity ae) { this.ae = ae; this.device = ae.getDevice(); }
private void startWritePendingRSP() { writePendingRSP = rqas.getApplicationEntity().getDevice() .scheduleAtFixedRate( new Runnable(){ @Override public void run() { BasicRetrieveTask.this.writePendingRSP(); } }, 0, pendingRSPInterval, TimeUnit.SECONDS); }
private void startWritePendingRSP() { writePendingRSP = rqas.getApplicationEntity().getDevice() .scheduleAtFixedRate( new Runnable(){ @Override public void run() { BasicRetrieveTask.this.writePendingRSP(); } }, 0, pendingRSPInterval, TimeUnit.SECONDS); }
public void removeNetworkAE() throws ConfigurationException { ApplicationEntity ae = conf.findApplicationEntity(aeTitle); Device device = ae.getDevice(); device.removeApplicationEntity(aeTitle); for (Connection conn : ae.getConnections()) { device.removeConnection(conn); } if (device.getApplicationAETitles().isEmpty()) conf.removeDevice(device.getDeviceName(), EnumSet.of(DicomConfiguration.Option.REGISTER)); else conf.merge(device, EnumSet.of(DicomConfiguration.Option.REGISTER)); }
public void removeNetworkAE() throws ConfigurationException { ApplicationEntity ae = conf.findApplicationEntity(aeTitle); Device device = ae.getDevice(); device.removeApplicationEntity(aeTitle); for (Connection conn : ae.getConnections()) { device.removeConnection(conn); } if (device.getApplicationAETitles().isEmpty()) conf.removeDevice(device.getDeviceName(), EnumSet.of(DicomConfiguration.Option.REGISTER)); else conf.merge(device, EnumSet.of(DicomConfiguration.Option.REGISTER)); }
@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); }
private void onClose() { stopTimeout(); synchronized (rspHandlerForMsgId) { IntHashMap.Visitor<DimseRSPHandler> visitor = new IntHashMap.Visitor<DimseRSPHandler>() { @Override public boolean visit(int key, DimseRSPHandler value) { value.onClose(Association.this); return true; } }; rspHandlerForMsgId.accept(visitor); rspHandlerForMsgId.clear(); rspHandlerForMsgId.notifyAll(); } if (ae != null) ae.getDevice().getAssociationHandler().onClose(this); for (AssociationListener listener : listeners) listener.onClose(this); }
private void onClose() { stopTimeout(); synchronized (rspHandlerForMsgId) { IntHashMap.Visitor<DimseRSPHandler> visitor = new IntHashMap.Visitor<DimseRSPHandler>() { @Override public boolean visit(int key, DimseRSPHandler value) { value.onClose(Association.this); return true; } }; rspHandlerForMsgId.accept(visitor); rspHandlerForMsgId.clear(); rspHandlerForMsgId.notifyAll(); } if (ae != null) ae.getDevice().getAssociationHandler().onClose(this); for (AssociationListener listener : listeners) listener.onClose(this); }
@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_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)); }
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); }