All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.xsocket.connection.http.IHttpMessage Maven / Gradle / Ivy

The newest version!
/*
 *  Copyright (c) xsocket.org, 2006 - 2008. All rights reserved.
 *
 *  This library is free software; you can redistribute it and/or
 *  modify it under the terms of the GNU Lesser General Public
 *  License as published by the Free Software Foundation; either
 *  version 2.1 of the License, or (at your option) any later version.
 *
 *  This library is distributed in the hope that it will be useful,
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 *  Lesser General Public License for more details.
 *
 *  You should have received a copy of the GNU Lesser General Public
 *  License along with this library; if not, write to the Free Software
 *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 *
 * Please refer to the LGPL license at: http://www.gnu.org/copyleft/lesser.txt
 * The latest copy of this software may be found on http://www.xsocket.org/
 */
package org.xsocket.connection.http;

import java.io.IOException;
import java.util.Enumeration;
import java.util.List;
import java.util.Set;





/**
 * 
 * @author [email protected]
 */
public interface IHttpMessage  {

	/**
	 * returns the non-blocking body 
	 * 
	 * @return the body or null if message is bodyless
	 */
	public NonBlockingBodyDataSource getNonBlockingBody() throws IOException;
	
	
	/**
	 * returns the blocking body 
	 * 
	 * @return the body or null if message is bodyless
	 */
	public BlockingBodyDataSource getBlockingBody() throws IOException;

	
	/**
	 * returns true if the message has a body
	 * 
	 * @return  true, if the message has a body
	 */
	public boolean hasBody();
	

	/**
	 * adds a raw header line 
	 * 
	 * @param line  the headerline
	 */
	public void addHeaderLine(String line);
	
	
	public void addHeader(String headername, String headervalue);

	
	public void setHeader(String headername, String headervalue);

	
	public void removeHeader(String headername);
	
	
	public void removeHopByHopHeaders();
	
	
	public void removeHopByHopHeaders(String... headernames);


	public boolean containsHeader(String headername);
	
	
	public boolean containsHeaderValue(String headername, String headervalue);

	
	@SuppressWarnings("unchecked")
	public Enumeration getHeaderNames();
	
	
	public Set getHeaderNameSet();
	
	
	public String getHeader(String headername);
	
	
	public List getHeaderList(String headername);
	
	
	@SuppressWarnings("unchecked")
	public Enumeration getHeaders(String headername);
	
	
	public void setContentType(String type);


	public String getContentType();
	
	
	public String getCharacterEncoding();
	
	
	public void setContentLength(int length);
	
	
	public int getContentLength();

	
	public void setTransferEncoding(String transferEncoding);
	
	
	public String getTransferEncoding();
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy