Package org.apache.abdera.protocol.server.context

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


  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

   */
  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

   * 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

TOP

Related Classes of org.apache.abdera.protocol.server.context.AbstractResponseContext

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.