public Device createDevice(
     String name,
     Issuer issuer,
     Code institutionCode,
     String aet,
     String host,
     int port,
     int tlsPort)
     throws Exception {
   Device device = init(new Device(name), issuer, institutionCode);
   ApplicationEntity ae = new ApplicationEntity(aet);
   ae.setAssociationAcceptor(true);
   device.addApplicationEntity(ae);
   Connection dicom = new Connection("dicom", host, port);
   device.addConnection(dicom);
   ae.addConnection(dicom);
   Connection dicomTLS = new Connection("dicom-tls", host, tlsPort);
   dicomTLS.setTlsCipherSuites(
       Connection.TLS_RSA_WITH_AES_128_CBC_SHA, Connection.TLS_RSA_WITH_3DES_EDE_CBC_SHA);
   device.addConnection(dicomTLS);
   ae.addConnection(dicomTLS);
   return device;
 }
  private static ApplicationEntity createAE(
      String aet,
      String description,
      Connection dicom,
      Connection dicomTLS,
      QueryRetrieveView qrView,
      boolean storeSCP,
      boolean storeSCU) {
    ApplicationEntity ae = new ApplicationEntity(aet);
    ae.setDescription(description);
    ae.addConnection(dicom);
    if (dicomTLS != null) ae.addConnection(dicomTLS);

    ArchiveAEExtension aeExt = new ArchiveAEExtension();
    ae.addAEExtension(aeExt);
    ae.setAssociationAcceptor(true);
    ae.setAssociationInitiator(true);
    addTC(ae, null, SCP, UID.VerificationSOPClass, UID.ImplicitVRLittleEndian);
    addTC(ae, null, SCU, UID.VerificationSOPClass, UID.ImplicitVRLittleEndian);
    addTCs(ae, EnumSet.allOf(QueryOption.class), SCP, QUERY_CUIDS, UID.ImplicitVRLittleEndian);
    if (storeSCU) {
      addTCs(
          ae, EnumSet.of(QueryOption.RELATIONAL), SCP, RETRIEVE_CUIDS, UID.ImplicitVRLittleEndian);
      for (int i = 0; i < CUIDS_TSUIDS.length; i++, i++)
        addTCs(ae, null, SCU, CUIDS_TSUIDS[i], CUIDS_TSUIDS[i + 1]);
    }
    if (storeSCP) {
      for (int i = 0; i < CUIDS_TSUIDS.length; i++, i++)
        addTCs(ae, null, SCP, CUIDS_TSUIDS[i], CUIDS_TSUIDS[i + 1]);
      addTC(ae, null, SCP, UID.StorageCommitmentPushModelSOPClass, UID.ImplicitVRLittleEndian);
      addTC(ae, null, SCP, UID.ModalityPerformedProcedureStepSOPClass, UID.ImplicitVRLittleEndian);
      addTC(ae, null, SCU, UID.ModalityPerformedProcedureStepSOPClass, UID.ImplicitVRLittleEndian);
    }
    aeExt.setQueryRetrieveViewID(qrView.getViewID());
    return ae;
  }
Exemple #3
0
 public MoveSCU() throws IOException {
   this.device = new Device("movescu");
   this.device.addConnection(conn);
   this.device.addApplicationEntity(ae);
   ae.addConnection(conn);
 }
 public void setConnections(List<Connection> connections) {
   this.connections.clear();
   for (Connection connection : connections) addConnection(connection);
 }