View Javadoc
1 /* Reattore HTTP Server 2 3 Copyright (C) 2002 Michael Hope <michaelh@juju.net.nz> 4 5 This program is free software; you can redistribute it and/or modify 6 it under the terms of the GNU General Public License as published by 7 the Free Software Foundation; either version 2 of the License, or 8 (at your option) any later version. 9 10 This program is distributed in the hope that it will be useful, 11 but WITHOUT ANY WARRANTY; without even the implied warranty of 12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 GNU General Public License for more details. 14 15 You should have received a copy of the GNU General Public License 16 along with this program; if not, write to the Free Software 17 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 18 19 $Id: HttpResponse.java,v 1.6 2003/02/14 05:24:25 michaelh Exp $ 20 */ 21 22 package juju.reattore.protocol.http; 23 24 import juju.reattore.core.rr.Response; 25 import juju.reattore.io.ByteSource; 26 27 /*** Encapsulates a HTTP response. 28 */ 29 public interface HttpResponse 30 extends HttpMessage { 31 32 /*** Status code indicating that request succeeded normally. */ 33 static final int SC_OK = 200; 34 /*** Status code indicating that the request resource is not available. */ 35 static final int SC_NOT_FOUND = 404; 36 /*** Status code indicating that an error occured inside the server. */ 37 static final int SC_INTERNAL_SERVER_ERROR = 500; 38 /*** Status code indicating that the server understood the request 39 but refused to fulfill it. */ 40 static final int SC_FORBIDDEN = 403; 41 /*** Moved Permanently */ 42 static final int SC_MOVED_PERMANENTLY = 301; 43 44 /*** Sets the response status. 45 46 @param to One of the SC_* constants. 47 */ 48 void setStatus(int to); 49 50 /*** Sets the source to read the body from. 51 52 @param to The source. 53 */ 54 void setBody(ByteSource to); 55 56 /*** Sets a header. 57 58 @param name One of HttpConstants.* 59 @param value The value to use. 60 */ 61 void setHeader(String name, String value); 62 63 /*** Gets the response status. 64 65 @return One of the SC_* constants. 66 */ 67 int getStatus(); 68 69 /*** Gets the source to read the body from. 70 71 @return The source. 72 */ 73 ByteSource getBody(); 74 }

This page was automatically generated by Maven