001: /*
002: * ChainBuilder ESB
003: * Visual Enterprise Integration
004: *
005: * Copyright (C) 2007 Bostech Corporation
006: *
007: * This program is free software; you can redistribute it and/or modify it
008: * under the terms of the GNU General Public License as published by the
009: * Free Software Foundation; either version 2 of the License, or (at your option)
010: * any later version.
011: *
012: * This program is distributed in the hope that it will be useful,
013: * but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
014: * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
015: * for more details.
016: *
017: * You should have received a copy of the GNU General Public License along with
018: * this program; if not, write to the Free Software Foundation, Inc.,
019: * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
020: *
021: *
022: * $Id: IHttpResponse.java 8973 2007-09-07 01:29:55Z mpreston $
023: */
024: package com.bostechcorp.cbesb.runtime.ccsl.lib;
025:
026: import java.util.List;
027:
028: import javax.xml.transform.Source;
029:
030: /**
031: * Returned by the HTTP component in provider non-soap mode
032: * after an IHttpRequest is sent to an external HTTP Server.
033: */
034: public interface IHttpResponse {
035:
036: /**
037: * Gets the HTTP Status code from the executed request.
038: * @return
039: */
040: public int getStatusCode();
041:
042: /**
043: * Sets the HTTP Status code.
044: * @param statusCode
045: */
046: public void setStatusCode(int statusCode);
047:
048: /**
049: * Gets the status description of the executed request.
050: * @return
051: */
052: public String getStatusDescription();
053:
054: /**
055: * Sets the status description.
056: *
057: */
058: public void setStatusDescription(String statusDescription);
059:
060: /**
061: * Gets the response body as a Source.
062: * @return
063: */
064: public Source getBody();
065:
066: /**
067: * Sets the response body.
068: * @param body
069: */
070: public void setBody(Source body);
071:
072: /**
073: * Gets the List of HTTP Headers contained in the response.
074: * @return
075: */
076: public List<IHttpHeader> getHeaders();
077:
078: /**
079: * Sets the List of HTTP Headers contained in the response.
080: * @param httpHeaders
081: */
082: public void setHeaders(List<IHttpHeader> httpHeaders);
083:
084: /**
085: * Removes all HTTP Headers from the response.
086: *
087: */
088: public void clearHeaders();
089:
090: /**
091: * Adds a single Http Header to the response.
092: * @param httpHeader
093: */
094: public void addHeader(IHttpHeader httpHeader);
095:
096: /**
097: * Creates a new IHttpHeader instance and adds it to the request
098: * @param name
099: * @param value
100: * @return
101: */
102: public IHttpHeader createHeader(String name, String value);
103: }
|