com.ibm.commerce.messaging.composer
Class JSPInvokerConnection

com.ibm.commerce.messaging.composer.JSPInvokerConnection

public class JSPInvokerConnection

An implemtation of an IOSEConnection object used to call another servlet.


Constructor Summary
JSPInvokerConnection()
          Constructs the JSPInvokerConnection object.
 
Method Summary
 void flush()
          Clears the input and output stream.
 java.lang.Object getAttribute(java.lang.String name)
          Returns the attribute for the specified name.
 java.lang.String getAuthType()
          Returns the authentication type.
 int getContentLength()
          Returns the content length.
 java.lang.String getContentType()
          Returns the content type.
 java.lang.String getCookieValue(java.lang.String name)
          Returns the cookie value.
 byte[] getCredBuf()
          Returns the credential buffer.
 void getHeaders(java.lang.String[][] nameValues)
          Sets the given nameValue parameter to the header names and values.
 java.lang.String getMethod()
          Returns the request method.
 java.lang.String getMimeType(java.lang.String ext)
          Returns the mime type.
 java.lang.String getProtocol()
          Returns the protocol.
 java.lang.String getQueryString()
          Returns the query string.
 java.lang.String getRealPath(java.lang.String path)
          Returns the real path.
 java.lang.String getRemoteAddr()
          Returns the remote address.
 java.lang.String getRemoteHost()
          Returns the remote host.
 java.lang.String getRemoteUser()
          Returns the remote user.
 java.lang.String getRequestURI()
          Returns the request URI.
 java.lang.String getScheme()
          Returns the scheme.
 java.lang.String getServerName()
          Returns the server name.
 int getServerPort()
          Returns the server port.
 java.lang.String getServletCode()
          Returns the servlet code.
 java.lang.String getServletCodeBase()
          Returns the servlet code base.
 java.util.Properties getServletExtraParameters()
          Returns the servlet extra parameters.
 java.util.Properties getServletInitProperties()
          Returns the servlet initialization properties.
 java.lang.String getServletName()
          Returns the servlet name.
 byte[] getSessionId()
          Dummy method which will always return null
 void init(java.lang.String _method, java.lang.String _requestURI, java.lang.String _queryString, java.lang.String _remoteUser, java.lang.String _authType, java.lang.String[] _headerNames, java.lang.String[] _headerValues, int _contentLength, java.lang.String _contentType, java.lang.String _protocol, java.lang.String _serverName, int _serverPort, java.lang.String _remoteHost, java.lang.String _remoteAddr, java.lang.String _scheme, java.io.InputStream _inStream, java.io.OutputStream _outStream)
          Initializes the object.
 boolean isCredBufAvail()
          Determines whether the buffer is available.
 boolean isServletInvoke()
          Determines whether the servlet should be invoked.
 boolean isSSL()
          Returns whether the request object is SSL.
 boolean isThreadSafe()
          Returns whether the object is thread safe.
 void prepareForWrite(int statusCode, java.lang.String statusMessage, java.lang.String[] respHeaderNames, java.lang.String[] respHeaderValues, int numRespHeaders)
          Preparation to right the result.
 int read()
          Reads from the input stream.
 int read(byte[] buf, int offset, int length)
          Reads from the input stream.
 boolean sendError(int errorCode, java.lang.String reason, java.lang.String message)
          sendError method comment.
 void setAttribute(java.lang.String name, java.lang.Object value)
          Sets the attributes of the request.
 void write(byte[] buf, int offset, int length)
          Writes the buf to the output stream base on the offset and lenght.
 void write(int b)
          Writes the int to the output stream.
 

Constructor Detail

JSPInvokerConnection

public JSPInvokerConnection()
Constructs the JSPInvokerConnection object.
Method Detail

flush

public void flush()
           throws java.io.IOException
Clears the input and output stream.

getAttribute

public java.lang.Object getAttribute(java.lang.String name)
Returns the attribute for the specified name.
Parameters:
name - java.lang.String The name of the Attribute.
Returns:
java.lang.Object The attribute value.

getAuthType

public java.lang.String getAuthType()
Returns the authentication type.
Returns:
java.lang.String The authentication type.

getContentLength

public int getContentLength()
Returns the content length.
Returns:
java.lang.String The content length.

getContentType

public java.lang.String getContentType()
Returns the content type.
Returns:
java.lang.String The content type.

getCookieValue

public java.lang.String getCookieValue(java.lang.String name)
Returns the cookie value.
Returns:
java.lang.String The cookie value.

getCredBuf

public byte[] getCredBuf()
Returns the credential buffer.
Returns:
java.lang.String The credential buffer.

getHeaders

public void getHeaders(java.lang.String[][] nameValues)
Sets the given nameValue parameter to the header names and values.
Parameters:
nameValues - java.lang.String[][] The header name and values. Will be set by the method.

getMethod

public java.lang.String getMethod()
Returns the request method.
Returns:
java.lang.String The request method.

getMimeType

public java.lang.String getMimeType(java.lang.String ext)
Returns the mime type.
Returns:
java.lang.String The mime type.

getProtocol

public java.lang.String getProtocol()
Returns the protocol.
Returns:
java.lang.String The protocol.

getQueryString

public java.lang.String getQueryString()
Returns the query string.
Returns:
java.lang.String The query string.

getRealPath

public java.lang.String getRealPath(java.lang.String path)
Returns the real path.
Returns:
java.lang.String The real path.

getRemoteAddr

public java.lang.String getRemoteAddr()
Returns the remote address.
Returns:
java.lang.String The remote address.

getRemoteHost

public java.lang.String getRemoteHost()
Returns the remote host.
Returns:
java.lang.String The remote host.

getRemoteUser

public java.lang.String getRemoteUser()
Returns the remote user.
Returns:
java.lang.String The remote user.

getRequestURI

public java.lang.String getRequestURI()
Returns the request URI.
Returns:
java.lang.String The request URI.

getScheme

public java.lang.String getScheme()
Returns the scheme.
Returns:
java.lang.String The scheme.

getServerName

public java.lang.String getServerName()
Returns the server name.
Returns:
java.lang.String The server name.

getServerPort

public int getServerPort()
Returns the server port.
Returns:
int The server port.

getServletCode

public java.lang.String getServletCode()
Returns the servlet code.
Returns:
java.lang.String The servlet code.

getServletCodeBase

public java.lang.String getServletCodeBase()
Returns the servlet code base.
Returns:
java.lang.String The servlet code base.

getServletExtraParameters

public java.util.Properties getServletExtraParameters()
Returns the servlet extra parameters.
Returns:
java.lang.String The servlet extra parameters.

getServletInitProperties

public java.util.Properties getServletInitProperties()
Returns the servlet initialization properties.
Returns:
java.lang.String The servlet initialization properties.

getServletName

public java.lang.String getServletName()
Returns the servlet name.
Returns:
java.lang.String The servlet name.

getSessionId

public byte[] getSessionId()
Dummy method which will always return null

init

public void init(java.lang.String _method,
                 java.lang.String _requestURI,
                 java.lang.String _queryString,
                 java.lang.String _remoteUser,
                 java.lang.String _authType,
                 java.lang.String[] _headerNames,
                 java.lang.String[] _headerValues,
                 int _contentLength,
                 java.lang.String _contentType,
                 java.lang.String _protocol,
                 java.lang.String _serverName,
                 int _serverPort,
                 java.lang.String _remoteHost,
                 java.lang.String _remoteAddr,
                 java.lang.String _scheme,
                 java.io.InputStream _inStream,
                 java.io.OutputStream _outStream)
Initializes the object.
Returns:
java.lang.String The servlet name.

isCredBufAvail

public boolean isCredBufAvail()
Determines whether the buffer is available.
Returns:
boolean

isServletInvoke

public boolean isServletInvoke()
Determines whether the servlet should be invoked.
Returns:
boolean

isSSL

public boolean isSSL()
Returns whether the request object is SSL.
Returns:
boolean

isThreadSafe

public boolean isThreadSafe()
Returns whether the object is thread safe.
Returns:
boolean Always false.

prepareForWrite

public void prepareForWrite(int statusCode,
                            java.lang.String statusMessage,
                            java.lang.String[] respHeaderNames,
                            java.lang.String[] respHeaderValues,
                            int numRespHeaders)
Preparation to right the result.
Parameters:
statusCode - int The status code.
statusMessage - java.lang.String The status message.
respHeaderNames - java.lang.String[] The response header attribute names.
respHeaderValues - java.lang.String[] The response header attribute values.
numRespHeaders - int The number of attributes in the response header.

read

public int read()
         throws java.io.IOException
Reads from the input stream.
Returns:
int The number of bytes read.
Throws:
java.io.IOException -  

read

public int read(byte[] buf,
                int offset,
                int length)
         throws java.io.IOException
Reads from the input stream.
Parameters:
buf - byte[] The byte array to place the bytes read.
offset - int The position to start reading bytes.
length - int The number of bytes to read.
Returns:
int The number of bytes read.
Throws:
java.io.IOException -  

sendError

public boolean sendError(int errorCode,
                         java.lang.String reason,
                         java.lang.String message)
                  throws java.io.IOException
sendError method comment.

setAttribute

public void setAttribute(java.lang.String name,
                         java.lang.Object value)
Sets the attributes of the request.
Parameters:
name - java.lang.String The name of the attribute.
value - java.lang.Object The value of the attribute.

write

public void write(byte[] buf,
                  int offset,
                  int length)
           throws java.io.IOException
Writes the buf to the output stream base on the offset and lenght.
Parameters:
buf - byte[] The bytes to write.
offset - int The offset of the byte array to start writing.
lenght - int The number of bytes to write.
Throws:
java.io.IOException -  

write

public void write(int b)
           throws java.io.IOException
Writes the int to the output stream.
Parameters:
b - int The value to write.