Beispiel #1
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());
  }