Package org.w3c.www.protocol.http

Examples of org.w3c.www.protocol.http.Request


     * @param preq The pending request that has made some progress.
     * @param event The event to broadcast.
     */

    public void notifyProgress(RequestEvent event) {
  Request req = event.request;

  if ( event instanceof ContinueEvent ) {
      // We need to forward this straight to the client:
      // FIXME 1/ why not using req?
      // should be check100Continue() or something
      ContinueEvent cevent = (ContinueEvent) event;
      if ((req.getMajorVersion() == 1) && (req.getMinorVersion() == 1)) {
    try {
        if ((cevent.packet != null) && (frame != null)) {
      Reply r = null;
      try {
          r = frame.dupReply(request, cevent.packet);
View Full Code Here


     * Our description
     */
    protected ResourceDescription description = null;

    protected Request createRequest() {
  Request request = admin.http.createRequest();
  request.setURL(url);
  if (!debug) {
      request.setValue("TE", "gzip");
  }
  return request;
    }
View Full Code Here

    public void reindex(boolean rec)
  throws RemoteAccessException
    {
  if (isDirectoryResource()) {
      try {
    Request req = createRequest();
    // Prepare the request:
    if (rec) {
        req.setMethod("REINDEX-RESOURCE");
    } else {
        req.setMethod("REINDEX-LOCALLY");
    }
    // Run it:
    Reply rep = admin.runRequest(req);
      } catch (RemoteAccessException rae) {
    throw rae;
View Full Code Here

     */
    public void delete()
  throws RemoteAccessException
    {
  try {
      Request req = createRequest();
      // Prepare the request:
      req.setMethod("DELETE-RESOURCE");
      // Run it:
      Reply rep = admin.runRequest(req);
  } catch (RemoteAccessException rae) {
      throw rae;
  } catch (Exception ex) {
View Full Code Here

    out = new GZIPOutputStream(bout);
      }
      admin.writer.writeResourceDescription(descr, out);
      byte bits[] = bout.toByteArray();

      Request req = createRequest();
      req.setMethod("SET-VALUES");
      req.setContentType(admin.conftype);
      req.setContentLength(bits.length);
      if (!debug) {
    req.addTransferEncoding("gzip");
      }
      req.setOutputStream(new ByteArrayInputStream(bits));
 
      // Run that request:
      Reply rep = admin.runRequest(req);
  } catch (RemoteAccessException rae) {
      throw rae;
View Full Code Here

    public RemoteResource loadResource(String identifier)
  throws RemoteAccessException
    {
  try {
      // Prepare the request:
      Request req = createRequest();
      req.setMethod("LOAD-RESOURCE");
      req.setURL(new URL(url.toString()+
             URLEncoder.encode(identifier)));
      // Run it:
      Reply rep = admin.runRequest(req);
      // Decode the reply:
      InputStream in = getInputStream(rep);
View Full Code Here

    public RemoteResource registerResource(String id, String classname)
  throws RemoteAccessException
    {
  ResourceDescription   rd   = new EmptyDescription(classname, id);
  try {
      Request req = createRequest();
      // Prepare the request:
      req.setMethod("REGISTER-RESOURCE");
      req.setContentType(admin.conftype);
      req.setURL(url);
      ByteArrayOutputStream bout = new ByteArrayOutputStream();
      OutputStream out;
      if (debug) {
    out = bout;
      } else {
    out = new GZIPOutputStream(bout);
      }
      admin.writer.writeResourceDescription(rd, out);
      byte bits[] = bout.toByteArray();
      req.setContentLength(bits.length);
      if (!debug) {
    req.addTransferEncoding("gzip");
      }
      req.setOutputStream(new ByteArrayInputStream(bits));
      // Run it:
      Reply rep = admin.runRequest(req);

      // Decode the result:
      rd = admin.reader.readResourceDescription(getInputStream(rep));
View Full Code Here

      throw new RuntimeException("this resource has no frames");
  // Remove it:
  String id = null;
  try {
      id = ((PlainRemoteResource)frame).identifier;
      Request req = createRequest();
      // Prepare the request:
      req.setMethod("UNREGISTER-FRAME");
      req.setContentType(admin.conftype);
      req.setURL(url);

      ResourceDescription dframe = new EmptyDescription("", id);
      ByteArrayOutputStream bout = new ByteArrayOutputStream();
      OutputStream out;
      if (debug) {
    out = bout;
      } else {
    out = new GZIPOutputStream(bout);
      }
      admin.writer.writeResourceDescription(dframe, out);
      byte bits[] = bout.toByteArray();
      req.setContentLength(bits.length);
      if (!debug) {
    req.addTransferEncoding("gzip");
      }
      req.setOutputStream(new ByteArrayInputStream(bits));

      // Run it:
      Reply rep = admin.runRequest(req)
  } catch (RemoteAccessException rae) {
      throw rae;
View Full Code Here

    {
  // Can we add new resources ?
  if ( ! isframed )
      throw new RuntimeException("not a framed resource");
  try {
      Request req = createRequest();
      // Prepare the request:
      req.setMethod("REGISTER-FRAME");
      req.setContentType(admin.conftype);

      ResourceDescription dframe = new EmptyDescription(classname, id);
      ByteArrayOutputStream bout = new ByteArrayOutputStream();
      OutputStream out;
      if (debug) {
    out = bout;
      } else {
    out = new GZIPOutputStream(bout);
      }
      admin.writer.writeResourceDescription(dframe, out);
      byte bits[] = bout.toByteArray();
      req.setContentLength(bits.length);
      if (!debug) {
    req.addTransferEncoding("gzip");
      }
      req.setOutputStream(new ByteArrayInputStream(bits));

      // Run it:
      Reply rep = admin.runRequest(req);
      dframe =
    admin.reader.readResourceDescription(getInputStream(rep));
View Full Code Here

     */
    protected void update()
  throws RemoteAccessException
    {
  try {
      Request req = createRequest();
      // Prepare the request:
      req.setMethod("LOAD-RESOURCE");
      // Run it:
      Reply rep = admin.runRequest(req);
      InputStream in = getInputStream(rep);
      this.description =
    admin.reader.readResourceDescription(in);
View Full Code Here

TOP

Related Classes of org.w3c.www.protocol.http.Request

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.