Esempio n. 1
0
 private void checkTransferCapability(String cuid, String tsuid) throws DicomServiceException {
   TransferCapability tc = ae.getTransferCapabilityFor(cuid, TransferCapability.Role.SCP);
   if (tc == null) {
     throw new DicomServiceException(org.dcm4che3.net.Status.SOPclassNotSupported);
   }
   if (!tc.containsTransferSyntax(tsuid)) {
     throw new DicomServiceException(TRANSFER_SYNTAX_NOT_SUPPORTED);
   }
 }
 private static void addTC(
     ApplicationEntity ae,
     EnumSet<QueryOption> queryOpts,
     TransferCapability.Role role,
     String cuid,
     String... tss) {
   String name = UID.nameOf(cuid).replace('/', ' ');
   TransferCapability tc = new TransferCapability(name + ' ' + role, cuid, role, tss);
   tc.setQueryOptions(queryOpts);
   ae.addTransferCapability(tc);
 }
 private String getDefaultConfiguredTransferSyntax(InstanceLocator ref) {
   if (context.getRemoteAE() != null) {
     ArrayList<TransferCapability> aeTCs =
         new ArrayList<TransferCapability>(
             context.getRemoteAE().getTransferCapabilitiesWithRole(Role.SCU));
     for (TransferCapability supportedTC : aeTCs) {
       if (ref.cuid.compareTo(supportedTC.getSopClass()) == 0) {
         return supportedTC.containsTransferSyntax(UID.ExplicitVRLittleEndian)
             ? UID.ExplicitVRLittleEndian
             : UID.ImplicitVRLittleEndian;
       }
     }
   }
   return UID.ImplicitVRLittleEndian;
 }
 private boolean isConfiguredAndAccepted(InstanceLocator ref, Set<String> negotiated) {
   if (context.getRemoteAE() != null) {
     ArrayList<TransferCapability> aeTCs =
         new ArrayList<TransferCapability>(
             context.getRemoteAE().getTransferCapabilitiesWithRole(Role.SCU));
     for (TransferCapability supportedTC : aeTCs) {
       if (ref.cuid.compareTo(supportedTC.getSopClass()) == 0
           && supportedTC.containsTransferSyntax(ref.tsuid)
           && negotiated.contains(ref.tsuid)) {
         return true;
       }
     }
   }
   return false;
 }
 public void validate(Form<?> form) {
   String commonName = this.commonNameTextField.getInput();
   if (commonName != null) {
     commonName = commonName.toLowerCase();
     if (commonNameTextField.getModelObject() != null
         && commonName.equals(commonNameTextField.getModelObject().toLowerCase())) return;
     for (TransferCapability transferCapability :
         this.applicationEntity.getTransferCapabilities()) {
       if (transferCapability.getCommonName() != null
           && commonName.equals(transferCapability.getCommonName().toLowerCase()))
         commonNameTextField.error(
             new StringResourceModel("TransferCapabilityValidator.commonName.invalid", form, null)
                 .getObject());
     }
   }
   String sopClass = this.sopClassTextField.getInput();
   String role = this.roleDropDown.getInput().equals("0") ? "SCP" : "SCU";
   if (sopClass.equals(sopClassTextField.getModelObject())
       && role.equals(roleDropDown.getModelObject().name())) return;
   for (TransferCapability transferCapability : this.applicationEntity.getTransferCapabilities()) {
     if (sopClass.equals(transferCapability.getSopClass())
         && role.equals(transferCapability.getRole().name()))
       sopClassTextField.error(
           new StringResourceModel("TransferCapabilityValidator.sopClass-role.invalid", form, null)
               .getObject());
   }
 }