Examples of AbstractResponseContext


Examples of org.apache.abdera.protocol.server.context.AbstractResponseContext

  public static AbstractResponseContext createErrorResponse(
    Abdera abdera,
    final int code,
    final String message,
    final Throwable t) {
      AbstractResponseContext rc =
        new StreamWriterResponseContext(abdera) {
          protected void writeTo(StreamWriter sw)
            throws IOException {
            Error.create(sw, code, message, t);
          }
        };
      rc.setStatus(code);
      rc.setStatusText(message);
      return rc;
  }
View Full Code Here

Examples of org.apache.abdera.protocol.server.context.AbstractResponseContext

  public static ResponseContext notallowed(
    RequestContext request,
    String reason,
    String... methods) {
      log.debug(Localizer.get("NOT.ALLOWED"));
      AbstractResponseContext resp =
        createErrorResponse(request.getAbdera(),405,reason);
      resp.setAllow(methods);
      return resp;
  }
View Full Code Here

Examples of org.apache.abdera.protocol.server.context.AbstractResponseContext

   */
  protected ResponseContext buildGetEntryResponse(RequestContext request, Entry entry) throws ResponseContextException {
    Feed feed = createFeedBase(request);
    entry.setSource(feed.getAsSource());
    Document<Entry> entry_doc = entry.getDocument();
    AbstractResponseContext rc = new BaseResponseContext<Document<Entry>>(entry_doc);
    rc.setEntityTag(calculateEntityTag(entry));
    return rc;
  }
View Full Code Here

Examples of org.apache.abdera.protocol.server.context.AbstractResponseContext

   * Creates the ResponseContext for a GET feed request.  By default, a BaseResponseContext
   * is returned.  The Etag header will be set.
   */
  protected ResponseContext buildGetFeedResponse(Feed feed) {
    Document<Feed> document = feed.getDocument();
    AbstractResponseContext rc = new BaseResponseContext<Document<Feed>>(document);
    rc.setEntityTag(calculateEntityTag(document.getRoot()));
    return rc;
  }
View Full Code Here

Examples of org.apache.abdera.protocol.server.impl.AbstractResponseContext

 
  public ResponseContext getService(
    RequestContext request) {
      Abdera abdera = request.getAbdera();
      Document<Service> service = get_service_doc(abdera);
      AbstractResponseContext rc;
      rc = new BaseResponseContext<Document<Service>>(service);
      rc.setEntityTag(service_etag);
      return rc;
  }
View Full Code Here

Examples of org.apache.abdera.protocol.server.impl.AbstractResponseContext

 
  public ResponseContext getFeed(
    RequestContext request) {
      Abdera abdera = request.getAbdera();
      Document<Feed> feed = get_feed_doc(abdera);
      AbstractResponseContext rc;
      rc = new BaseResponseContext<Document<Feed>>(feed);
      rc.setEntityTag(calculateEntityTag(feed.getRoot()));
      return rc;
  }
View Full Code Here

Examples of org.apache.abdera.protocol.server.impl.AbstractResponseContext

      if (entry != null) {
        Feed feed = entry.getParentElement();
        entry = (Entry) entry.clone();
        entry.setSource(feed.getAsSource());
        Document<Entry> entry_doc = entry.getDocument();
        AbstractResponseContext rc = new BaseResponseContext<Document<Entry>>(entry_doc);
        rc.setEntityTag(calculateEntityTag(entry));
        return rc;
      } else {
        return new EmptyResponseContext(404);
      }
  }
View Full Code Here

Examples of org.apache.abdera.protocol.server.provider.AbstractResponseContext

            if (type == TargetType.TYPE_MEDIA) {
              return provider.deleteMedia(request);
            }
          }
          else if (method == "OPTIONS") {
            AbstractResponseContext rc = new EmptyResponseContext(200);
            rc.addHeader("Allow", combine(getAllowedMethods(type)));
            return rc;
          }
        } else {
          return handler.process(provider, request);
        }
View Full Code Here

Examples of org.apache.abdera.protocol.server.provider.AbstractResponseContext

  public ResponseContext getService(
    RequestContext request,
    boolean full) {
      Abdera abdera = request.getServiceContext().getAbdera();
      Document<Service> service = get_service_doc(abdera);
      AbstractResponseContext rc;
      rc = (full) ?
        new BaseResponseContext<Document<Service>>(service) :
        new EmptyResponseContext(200);
      rc.setEntityTag(service_etag);
      return rc;
  }
View Full Code Here

Examples of org.apache.abdera.protocol.server.provider.AbstractResponseContext

  public ResponseContext getFeed(
    RequestContext request,
    boolean full) {
      Abdera abdera = request.getServiceContext().getAbdera();
      Document<Feed> feed = get_feed_doc(abdera);
      AbstractResponseContext rc;
      rc = (full) ?
        new BaseResponseContext<Document<Feed>>(feed) :
        new EmptyResponseContext(200);
      rc.setEntityTag(calculateEntityTag(feed.getRoot()));
      return rc;
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.