Framework Professional Edition Package


com.prosyst.mbs.services.http
Interface HttpHelper


public interface HttpHelper

Helper service, which provides two utilities for http bundle clients: getting http output without using sockets or already created sockets, and listing all AliasProperties objects from HttpService.

See Also:
AliasProperties

Method Summary
 AliasProperties[] getAliases()
          Gets an array of all AliasProperties, corresponding to alias registrations, from the org.osgi.service.http.HttpService.
 byte[] getHttpOutput(byte[] httpInput)
          Gets http response of a byte[] request.
 void process(java.io.InputStream is, java.io.OutputStream os, boolean isSecure)
          Gets http response of an InputStream request.
 void process(java.net.Socket socket, boolean isSecure)
          In cases of external processing of accept sockets use this method to process the request.
 

Method Detail

getHttpOutput

byte[] getHttpOutput(byte[] httpInput)
                     throws java.io.IOException
Gets http response of a byte[] request. Instead of using sockets, bundles running in the framework can use this method to get their http requests serviced.

Parameters:
httpInput - a valid HTTP 1.0 or HTTP 1.1 request
Returns:
HTTP 1.1 response of the request passed.
Throws:
java.io.IOException - if an IO error occurs while handling request

getAliases

AliasProperties[] getAliases()
Gets an array of all AliasProperties, corresponding to alias registrations, from the org.osgi.service.http.HttpService.

Returns:
all alias properties from the HttpService; if none - an empty array is returned.
See Also:
AliasProperties

process

void process(java.io.InputStream is,
             java.io.OutputStream os,
             boolean isSecure)
Gets http response of an InputStream request. Instead of using sockets, bundles running in the framework can use this method to get their http requests serviced.

Parameters:
is - from this input stream is read a valid HTTP 1.0 or HTTP 1.1 request. The HTTP 1.1 response of the request passed as an Output Stream.
os - the output stream

process

void process(java.net.Socket socket,
             boolean isSecure)
             throws java.io.IOException
In cases of external processing of accept sockets use this method to process the request.

Parameters:
socket - Socket connection that has to be processed
isSecure - boolean flag indicating if this the socket is over a secure connection
Throws:
java.io.IOException - if an IO error occurs while handling request

Framework Professional Edition Package


Copyright © 1999-2007 ProSyst Software GmbH. All Rights Reserved