|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.ibm.di.connector.Connector
com.ibm.di.connector.HTTPServerConnector
public class HTTPServerConnector
This connector provides HTTP server like functionality and ability to receive/handle client requests sent over the HTTP protocol.
Field Summary | |
---|---|
static String |
ATTR_NAME_HTTP_AUTH_ENTRY
An Entry attribute name: "auth.entry" |
static String |
ATTR_NAME_HTTP_BODY
An Entry attribute name: "http.body" |
static String |
ATTR_NAME_HTTP_CHARACTER_SET
An Entry attribute name: "characterSet" |
static String |
ATTR_NAME_HTTP_CONNECTION
An Entry attribute name: "http.connection" |
static String |
ATTR_NAME_HTTP_CONTENT_TYPE
An Entry attribute name: "http.Content-Type" |
static String |
ATTR_NAME_HTTP_REMOTE_PASSWORD
An Entry attribute name: "http.remote_pass" |
static String |
ATTR_NAME_HTTP_REMOTE_USER
An Entry attribute name: "http.remote_user" |
static String |
HTTP_BAD_REQUEST
Error String: "400 Bad Request" |
static String |
PARAM_SYSTEM_TCP_BACKLOG
Parameter Name: "com.ibm.di.tcp.backlog" |
static String |
PARAM_TCP_BACKLOG
Parameter Name: "backlog" |
static String |
PARAMETER_AUTH_CONN
Parameter Name: "authConnector" |
static String |
PARAMETER_AUTH_REALM
Parameter Name: "authRealm" |
static String |
PARAMETER_CONTENT_TYPE
Parameter Name: "contentType" |
static String |
PARAMETER_HEADERS_AS_PROPS
Parameter Name: "headersAsProperties" |
static String |
PARAMETER_HTTP_BASIC_AUTH
Parameter Name: "httpAuth" |
static String |
PARAMETER_IDLE_CONNECTION_TIMEOUT
Parameter Name: . |
static String |
PARAMETER_REQUIRE_CLIENT_AUTH
Parameter Name: "needClientAuth" |
static String |
PARAMETER_TCP_DATA_AS_PROPS
Parameter Name: "tcpDataAsProperties" |
static String |
PARAMETER_TCP_PORT
Parameter Name: "tcpPort" |
static String |
PARAMETER_USE_CHUNKS
Parameter Name: "msgChunked" |
static String |
PARAMETER_USE_SSL
Parameter Name: "useSSL" |
Fields inherited from class com.ibm.di.connector.Connector |
---|
ALL_MODES, myLog, PROPERTY_MESSAGE, PROPERTY_READER, PROPERTY_WRITER |
Constructor Summary | |
---|---|
HTTPServerConnector()
Constructs this object, sets the supported modes and initializes the internally used HTTPParser . |
Method Summary | |
---|---|
ConnectorInterface |
getNextClient()
This method blocks until a client is connected. |
Entry |
getNextEntry()
This method is called when this connector is used in Iterator mode. |
String |
getPassword()
Retrieves password. |
HTTPServerConnector |
getServerConnector()
Retrieves server connector. |
String |
getUserName()
Retrieves username. |
String |
getVersion()
Version information. |
void |
initialize(Object aObject)
Parsers all the configuration parameters of this connector and prepares for starting the HTTP Server. |
boolean |
isAccepting()
Checks whether the connector is waiting for a client connection. |
boolean |
isAutoChunking()
Returns whether automatic chunking is enabled or not. |
boolean |
isChunked()
Returns true if response is chunked. |
boolean |
isTerminating()
Checks whether a termination request is sent. |
void |
putEntry(Entry aEntry)
This method provides chunking capabilities to the HTTP server. |
void |
rejectClientAuthentication()
Prints the Forbidden page and closes the connection. |
void |
replyEntry(Entry aEntry)
This method sends the provided entry to the client as an HTTP response. |
void |
setAutoChunking(boolean enabled)
This method lets the user dynamically configure chunked output mode. |
void |
setProperty(Entry aEntry,
String aProperty,
Object aValue,
boolean aTcpDataAsProps)
This method adds a property to the provided entry if the aTcpDataAsProps is set to true, if it is set to false then
the provided property is added as an attribute. |
void |
setServerConnector(HTTPServerConnector aServerConnector)
Sets the server connector for this connector. |
void |
terminate()
Terminate the connector. |
void |
terminateServer()
This method tries to terminate the server by setting the termination flag for the connector returned by getServerConnector and immediately connecting to its port (which should fail). |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface com.ibm.di.connector.ConnectorInterface |
---|
deleteEntry, findEntry, getConfiguration, getContext, getFindEntryCount, getFirstFindEntry, getMaxDuplicateEntries, getName, getNextFindEntry, getParam, getPushbackEntry, getRawConnectorConfiguration, isDeltaSupported, isExceptionFatal, isIOException, modEntry, modEntry, pushback, queryOperations, queryReply, querySchema, reconnect, registerScriptBeans, selectEntries, setConfiguration, setContext, setCurrent, setLog, setMaxDuplicateEntries, setName, setParam, setRSInterface |
Field Detail |
---|
public static final String PARAMETER_TCP_PORT
public static final String PARAM_TCP_BACKLOG
public static final String PARAM_SYSTEM_TCP_BACKLOG
public static final String PARAMETER_HEADERS_AS_PROPS
public static final String PARAMETER_TCP_DATA_AS_PROPS
public static final String PARAMETER_AUTH_CONN
public static final String PARAMETER_HTTP_BASIC_AUTH
public static final String PARAMETER_AUTH_REALM
public static final String PARAMETER_USE_SSL
public static final String PARAMETER_REQUIRE_CLIENT_AUTH
public static final String PARAMETER_CONTENT_TYPE
public static final String PARAMETER_USE_CHUNKS
public static final String PARAMETER_IDLE_CONNECTION_TIMEOUT
public static final String ATTR_NAME_HTTP_REMOTE_USER
Entry
attribute name: "http.remote_user"
public static final String ATTR_NAME_HTTP_REMOTE_PASSWORD
Entry
attribute name: "http.remote_pass"
public static final String ATTR_NAME_HTTP_BODY
Entry
attribute name: "http.body"
public static final String ATTR_NAME_HTTP_CONTENT_TYPE
Entry
attribute name: "http.Content-Type"
public static final String ATTR_NAME_HTTP_CHARACTER_SET
Entry
attribute name: "characterSet"
public static final String ATTR_NAME_HTTP_CONNECTION
Entry
attribute name: "http.connection"
public static final String ATTR_NAME_HTTP_AUTH_ENTRY
Entry
attribute name: "auth.entry"
public static final String HTTP_BAD_REQUEST
Constructor Detail |
---|
public HTTPServerConnector()
HTTPParser
.
Method Detail |
---|
public void initialize(Object aObject) throws Exception
Socket
is provided as a
parameter then that socket will be used for communication with the client
on the other end of the socket.
initialize
in interface ConnectorInterface
initialize
in class Connector
aObject
- recognizes only an object of type Socket
Exception
- if an error occurs.public ConnectorInterface getNextClient() throws Exception
getNextClient
in interface ConnectorInterface
getNextClient
in class Connector
HTTPServerConnector
responsible for
handling the communication with the new client.
Exception
- if this connector was not initialized properly or other type
of error occurs.public HTTPServerConnector getServerConnector()
null
if a connection has not been
established yet.public void setServerConnector(HTTPServerConnector aServerConnector)
aServerConnector
- the server connector that created this instance.public boolean isAccepting()
public boolean isTerminating()
public void terminateServer() throws Exception
terminateServer
in interface ConnectorInterface
terminateServer
in class Connector
Exception
- if an error occurs.public void terminate() throws Exception
terminate
in interface ConnectorInterface
terminate
in class Connector
Exception
- if an error occurs.public Entry getNextEntry() throws Exception
null
. If
authentication is successful the HTTP request is parsed to an
Entry
object and returned.
getNextEntry
in interface ConnectorInterface
getNextEntry
in class Connector
Entry
object.
Exception
- if an error occurs.ConnectorInterface.selectEntries()
public void putEntry(Entry aEntry) throws Exception
putEntry
in interface ConnectorInterface
putEntry
in class Connector
aEntry
- the entry to send as a chunk.
Exception
- if a communication error is raised.public void replyEntry(Entry aEntry) throws Exception
replyEntry
in interface ConnectorInterface
replyEntry
in class Connector
aEntry
- the entry to send to the client.
Exception
- if an error occurs.public String getUserName()
public String getPassword()
public void rejectClientAuthentication() throws Exception
Exception
- if an error occurs.public void setProperty(Entry aEntry, String aProperty, Object aValue, boolean aTcpDataAsProps)
aTcpDataAsProps
is set to true, if it is set to false then
the provided property is added as an attribute.
aEntry
- the entry which the property will be set on.aProperty
- the property name.aValue
- the property value.aTcpDataAsProps
- tells whether the property will be set as an Entry property or
as Entry Attribute.public String getVersion()
getVersion
in interface VersionInfoInterface
public void setAutoChunking(boolean enabled)
enabled
- The new value for automatic chunking.public boolean isAutoChunking()
public boolean isChunked()
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |