Package org.w3c.www.http

Examples of org.w3c.www.http.HttpExtList


         org.w3c.tools.resources.ResourceException
    {
  Request     request  = (Request) ri;
  Reply       reply    = null;
  Reply       extReply = null;
  HttpExtList cman     = request.getHttpCManExtDecl();
  HttpExtList copt     = request.getHttpCOptExtDecl();
  HttpExtList man      = request.getHttpManExtDecl();

  if ((cman != null) || (copt != null)) {
      extReply = applyExtensions(request, cman, copt);
      if (extReply != null)
    return extReply;
View Full Code Here


      al.addAccept(HttpFactory.parseAccept(value));
  } else if (hvalue instanceof HttpEntityTagList) {
      HttpEntityTagList etl = (HttpEntityTagList) hvalue;
      etl.addTag(HttpFactory.parseETag(value));
  } else if (hvalue instanceof HttpExtList) {
      HttpExtList el = (HttpExtList) hvalue;
      el.addHttpExt(new HttpExt(value, false));
  } else if (hvalue instanceof HttpCookieList) {
      // shouldn't be used, but who knows?
      HttpCookieList cl  = (HttpCookieList) hvalue;
      HttpCookieList ncl = HttpFactory.parseCookieList(value);
      HttpCookie scookies[] = ncl.getCookies();
View Full Code Here

     * Set the Acknowledgement Headers if it's appropriate.
     * @param reply the reply
     * @return the aknowledged reply
     */
    protected Reply acknowledge(Reply reply) {
  HttpExtList man = request.getHttpManExtDecl();
  if ((man != null) &&
      (man.getLength() == 1) &&
      (man.getHttpExt(HTTP_EXT_ID) != null)) {
      reply.setEnd2EndExtensionAcknowledgmentHeader();
  }

  HttpExtList cman = request.getHttpCManExtDecl();
  if ((cman != null) &&
      (cman.getLength() == 1) &&
      (cman.getHttpExt(HTTP_EXT_ID) != null)) {
      reply.setHopByHopExtensionAcknowledgmentHeader();
  }

  return reply;
    }
View Full Code Here

      ccppwarning = new CCPPWarning();
      reply.setState(CCPPWarning.CCPPWARNING_STATE, ccppwarning);
  }
  ccppwarning.addWarning(warning, reference);
  // is the extension declared?
  HttpExtList list = reply.getExtList(HTTP_EXT_ID);
  if (list == null) {
      list = new  HttpExtList(httpextlist);
      reply.setHttpExtDecl(list);
  }
  HttpExt ext = list.getHttpExt(HTTP_EXT_ID);
  reply.setExtensionHeader(ext,
         PROFILE_WARNING_HEADER,
         ccppwarning.toString());
    }
View Full Code Here

     * got a fatal error.
     */
    public Reply get(Request request)
  throws ProtocolException, ResourceException
    {
  HttpExtList extl       = null;
  HttpExtList reply_extl = null;
  Reply reply            = super.get(request);

  //Mandatory End-to-End
  extl = request.getHttpManExtDecl();
  if (extl != null) {
      reply_extl = new HttpExtList(extl);
      reply.setHttpManExtDecl(reply_extl);
      HttpExt exts[]  = extl.getHttpExts();
      HttpExt rexts[] = reply_extl.getHttpExts();
      for (int i=0; i < exts.length; i++) {
    HttpExt     ext         = exts[i];
    Dictionary  headers     = request.getExtensionHeaders(ext);
    Enumeration e           = headers.keys();
    String      resp_header = "";
    while (e.hasMoreElements()) {
        String name = (String) e.nextElement();
        HeaderValue value = (HeaderValue)headers.get(name);
        resp_header+="["+name+": "+value.toExternalForm()+"] ";
    }
    reply.setExtensionHeader(rexts[i], "receipt", resp_header);
      }
      if (rexts.length > 0)
    reply.setEnd2EndExtensionAcknowledgmentHeader();
  }

  //Mandatory Hop-by-Hop
  extl = request.getHttpCManExtDecl();
  if (extl != null) {
      reply_extl = new HttpExtList(extl);
      reply.setHttpCManExtDecl(reply_extl);
      HttpExt exts[]  = extl.getHttpExts();
      HttpExt rexts[] = reply_extl.getHttpExts();
      for (int i=0; i < exts.length; i++) {
    HttpExt     ext         = exts[i];
    Dictionary  headers     = request.getExtensionHeaders(ext);
    Enumeration e           = headers.keys();
    String      resp_header = "";
    while (e.hasMoreElements()) {
        String name = (String) e.nextElement();
        HeaderValue value = (HeaderValue)headers.get(name);
        resp_header+="["+name+": "+value.toExternalForm()+"] ";
    }
    reply.setExtensionHeader(rexts[i], "receipt", resp_header);
      }
      if (rexts.length > 0)
    reply.setHopByHopExtensionAcknowledgmentHeader();
  }

  //Optionnal End-to-End
  extl = request.getHttpOptExtDecl();
  if (extl != null) {
      reply_extl = new HttpExtList(extl);
      reply.setHttpOptExtDecl(reply_extl);
      HttpExt exts[]  = extl.getHttpExts();
      HttpExt rexts[] = reply_extl.getHttpExts();
      for (int i=0; i < exts.length; i++) {
    HttpExt     ext         = exts[i];
    Dictionary  headers     = request.getExtensionHeaders(ext);
    Enumeration e           = headers.keys();
    String      resp_header = "";
    while (e.hasMoreElements()) {
        String name = (String) e.nextElement();
        HeaderValue value = (HeaderValue)headers.get(name);
        resp_header+="["+name+": "+value.toExternalForm()+"] ";
    }
    reply.setExtensionHeader(rexts[i], "receipt", resp_header);
      }
  }

  //Optionnal Hop-by-Hop
  extl = request.getHttpCOptExtDecl();
  if (extl != null) {
      reply_extl = new HttpExtList(extl);
      reply.setHttpCOptExtDecl(reply_extl);
      HttpExt exts[]  = extl.getHttpExts();
      HttpExt rexts[] = reply_extl.getHttpExts();
      for (int i=0; i < exts.length; i++) {
    HttpExt     ext         = exts[i];
    Dictionary  headers     = request.getExtensionHeaders(ext);
    Enumeration e           = headers.keys();
    String      resp_header = "";
View Full Code Here

TOP

Related Classes of org.w3c.www.http.HttpExtList

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.