예제 #1
0
  public boolean supportsTransferCapability(
      TransferCapability transferCapability, boolean onlyAbstractSyntax) {
    TransferCapability matchingTC =
        this.getTransferCapabilityFor(
            transferCapability.getSopClass(), transferCapability.getRole());
    if (matchingTC == null) return false;
    else
      for (String ts : transferCapability.getTransferSyntaxes())
        if (!matchingTC.containsTransferSyntax(ts) && !onlyAbstractSyntax) return false;

    return true;
  }
예제 #2
0
  protected PresentationContext negotiate(
      AAssociateRQ rq, AAssociateAC ac, PresentationContext rqpc) {
    String as = rqpc.getAbstractSyntax();
    TransferCapability tc = roleSelection(rq, ac, as);
    int pcid = rqpc.getPCID();
    if (tc == null)
      return new PresentationContext(
          pcid, PresentationContext.ABSTRACT_SYNTAX_NOT_SUPPORTED, rqpc.getTransferSyntax());

    for (String ts : rqpc.getTransferSyntaxes())
      if (tc.containsTransferSyntax(ts)) {
        byte[] info = negotiate(rq.getExtNegotiationFor(as), tc);
        if (info != null) ac.addExtendedNegotiation(new ExtendedNegotiation(as, info));
        return new PresentationContext(pcid, PresentationContext.ACCEPTANCE, ts);
      }

    return new PresentationContext(
        pcid, PresentationContext.TRANSFER_SYNTAX_NOT_SUPPORTED, rqpc.getTransferSyntax());
  }