com.infoengine.connector
Class HTTPConnection

java.lang.Object
  extended bycom.infoengine.connector.PhysicalConnection
      extended bycom.infoengine.connector.HTTPConnection

class HTTPConnection
extends PhysicalConnection

represents an HTTP physical connection to an Info*Engine SOAP service


Field Summary
(package private)  javax.xml.soap.SOAPConnection connection
           
static String CONNECTION_URL
           
protected  IeConnectionRequestInfo cxRequestInfo
           
(package private)  URL endPoint
           
private  URL httpURL
           
protected  Log log
           
protected  IeManagedConnection managedCx
           
protected  Subject subject
           
private static char[] toHex
           
 
Constructor Summary
(package private) HTTPConnection()
          create a new HTTPConnection
 
Method Summary
(package private)  void destroy()
          fulfills interface requirement.
private static String escape(String s)
          assumes that no characters have already been escaped (i.e.
protected  String[] extractCredentials()
           
(package private)  IeConnectionRequestInfo getRequestInfo()
           
(package private)  void init()
          initialize the HTTPConnection userName and password information found in cxReqInfo takes precendence over credentials contained in s.
(package private)  javax.xml.soap.SOAPMessage invoke(javax.xml.soap.SOAPMessage msg)
          jaxm implementation send the SOAPMessage to our configured endPoint and return the response.
private static boolean isAlpha(char c)
           
private static boolean isAlphanum(char c)
           
private static boolean isDigit(char c)
           
private static boolean isMark(char c)
           
private static boolean isSafe(char c)
           
private static boolean isUnreserved(char c)
           
(package private)  boolean match(Subject s, javax.resource.spi.ConnectionRequestInfo cri)
          does this connection match these criteria
(package private)  void setLog(Log l)
           
(package private)  void setManagedConnection(IeManagedConnection managed)
           
(package private)  void setRequestInfo(IeConnectionRequestInfo info)
           
(package private)  void setSubject(Subject s)
           
protected  Throwable unwrapSOAPException(javax.xml.soap.SOAPException soapE)
          extract root exception
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

CONNECTION_URL

public static final String CONNECTION_URL
See Also:
Constant Field Values

httpURL

private URL httpURL

connection

javax.xml.soap.SOAPConnection connection

endPoint

URL endPoint

toHex

private static final char[] toHex

managedCx

protected IeManagedConnection managedCx

subject

protected Subject subject

cxRequestInfo

protected IeConnectionRequestInfo cxRequestInfo

log

protected Log log
Constructor Detail

HTTPConnection

HTTPConnection()
create a new HTTPConnection

Method Detail

init

void init()
    throws javax.resource.ResourceException
initialize the HTTPConnection userName and password information found in cxReqInfo takes precendence over credentials contained in s. this allows an application to over-ride the default credentials supplied when the resource adapter is deployed in an application server.

Specified by:
init in class PhysicalConnection
Throws:
javax.resource.ResourceException

invoke

javax.xml.soap.SOAPMessage invoke(javax.xml.soap.SOAPMessage msg)
                            throws Exception
jaxm implementation send the SOAPMessage to our configured endPoint and return the response.

Specified by:
invoke in class PhysicalConnection
Parameters:
msg - the SOAPMessage to send
Returns:
SOAPMessage the response
Throws:
Exception

destroy

void destroy()
       throws Exception
fulfills interface requirement. no-op.

Specified by:
destroy in class PhysicalConnection
Throws:
Exception

escape

private static String escape(String s)
assumes that no characters have already been escaped (i.e. if '%' exists it needs to be escaped) according to rfc 2396 userinfo = *( unreserved | escaped | ";" | ":" | "&" | "=" | "+" | "$" | "," ) unreserved = alphanum | mark alphanum = alpha | digit (no need to exlain, i hope) mark = "-" | "_" | "." | "!" | "~" | "*" | "'" | "(" | ")" escaped = "%" hex hex hex = digit | "A" | "B" | "C" | "D" | "E" | "F" | "a" | "b" | "c" | "d" | "e" | "f" code consideres ":" as unsafe and encodes since the colon is used as a separator for Basic Authentication and would cause problems if left unencoded.


isSafe

private static boolean isSafe(char c)

isUnreserved

private static boolean isUnreserved(char c)

isAlphanum

private static boolean isAlphanum(char c)

isAlpha

private static boolean isAlpha(char c)

isDigit

private static boolean isDigit(char c)

isMark

private static boolean isMark(char c)

setManagedConnection

void setManagedConnection(IeManagedConnection managed)
Parameters:
managed - IeManagedConnection instance

setSubject

void setSubject(Subject s)
Parameters:
s - security credentials

setLog

void setLog(Log l)
Parameters:
l - Log

setRequestInfo

void setRequestInfo(IeConnectionRequestInfo info)
Parameters:
info - connection request info

getRequestInfo

IeConnectionRequestInfo getRequestInfo()
Returns:
IeConnectionRequestInfo the request info object

match

boolean match(Subject s,
              javax.resource.spi.ConnectionRequestInfo cri)
        throws PrivilegedActionException
does this connection match these criteria

Parameters:
s - security credentials
cri - connection request info
Returns:
boolean
Throws:
PrivilegedActionException

unwrapSOAPException

protected Throwable unwrapSOAPException(javax.xml.soap.SOAPException soapE)
extract root exception

Parameters:
soapE - SOAPException to unwrap
Returns:
Throwable

extractCredentials

protected String[] extractCredentials()
                               throws PrivilegedActionException
Throws:
PrivilegedActionException