public abstract class BaseConnector extends java.lang.Object implements IConnector
| Modifier and Type | Field and Description |
|---|---|
static java.lang.String |
_rcsid |
protected IThreadContext |
currentContext |
protected ConfigParams |
params |
| Constructor and Description |
|---|
BaseConnector() |
| Modifier and Type | Method and Description |
|---|---|
java.lang.String |
check()
Test the connection.
|
void |
clearThreadContext()
Clear out any state information specific to a given thread.
|
void |
connect(ConfigParams configParams)
Connect.
|
void |
deinstall(IThreadContext threadContext)
Uninstall the connector.
|
void |
disconnect()
Close the connection.
|
ConfigParams |
getConfiguration()
Get configuration information.
|
void |
install(IThreadContext threadContext)
Install the connector.
|
boolean |
isConnected()
This method is called to assess whether to count this connector instance should
actually be counted as being connected.
|
void |
outputConfigurationBody(IThreadContext threadContext,
IHTTPOutput out,
ConfigParams parameters,
java.lang.String tabName)
Output the configuration body section.
|
void |
outputConfigurationBody(IThreadContext threadContext,
IHTTPOutput out,
java.util.Locale locale,
ConfigParams parameters,
java.lang.String tabName)
Output the configuration body section.
|
void |
outputConfigurationHeader(IThreadContext threadContext,
IHTTPOutput out,
ConfigParams parameters,
java.util.ArrayList<java.lang.Object> tabsArray) |
void |
outputConfigurationHeader(IThreadContext threadContext,
IHTTPOutput out,
ConfigParams parameters,
java.util.List<java.lang.String> tabsArray)
Output the configuration header section.
|
void |
outputConfigurationHeader(IThreadContext threadContext,
IHTTPOutput out,
java.util.Locale locale,
ConfigParams parameters,
java.util.List<java.lang.String> tabsArray)
Output the configuration header section.
|
protected static void |
pack(java.lang.StringBuilder output,
java.lang.String value,
char delimiter)
Stuffer for packing a single string with an end delimiter
|
protected static void |
packFixedList(java.lang.StringBuilder output,
java.lang.String[] values,
char delimiter)
Stuffer for packing lists of fixed length
|
protected static void |
packList(java.lang.StringBuilder output,
java.util.List<java.lang.String> values,
char delimiter)
Stuffer for packing lists of variable length
|
protected static void |
packList(java.lang.StringBuilder output,
java.lang.String[] values,
char delimiter)
Another stuffer for packing lists of variable length
|
void |
poll()
This method is periodically called for all connectors that are connected but not
in active use.
|
java.lang.String |
processConfigurationPost(IThreadContext threadContext,
IPostParameters variableContext,
ConfigParams parameters)
Process a configuration post.
|
java.lang.String |
processConfigurationPost(IThreadContext threadContext,
IPostParameters variableContext,
java.util.Locale locale,
ConfigParams parameters)
Process a configuration post.
|
void |
setThreadContext(IThreadContext threadContext)
Attach to a new thread.
|
protected static int |
unpack(java.lang.StringBuilder sb,
java.lang.String value,
int startPosition,
char delimiter)
Unstuffer for the above.
|
protected static int |
unpackFixedList(java.lang.String[] output,
java.lang.String value,
int startPosition,
char delimiter)
Unstuffer for unpacking lists of fixed length
|
protected static int |
unpackList(java.util.List<java.lang.String> output,
java.lang.String value,
int startPosition,
char delimiter)
Unstuffer for unpacking lists of variable length.
|
void |
viewConfiguration(IThreadContext threadContext,
IHTTPOutput out,
ConfigParams parameters)
View configuration.
|
void |
viewConfiguration(IThreadContext threadContext,
IHTTPOutput out,
java.util.Locale locale,
ConfigParams parameters)
View configuration.
|
public static final java.lang.String _rcsid
protected ConfigParams params
protected IThreadContext currentContext
public void install(IThreadContext threadContext) throws ManifoldCFException
install in interface IConnectorthreadContext - is the current thread context.ManifoldCFExceptionpublic void deinstall(IThreadContext threadContext) throws ManifoldCFException
deinstall in interface IConnectorthreadContext - is the current thread context.ManifoldCFExceptionpublic void connect(ConfigParams configParams)
connect in interface IConnectorconfigParams - are the configuration parameters for this connection.public java.lang.String check()
throws ManifoldCFException
check in interface IConnectorManifoldCFExceptionpublic void poll()
throws ManifoldCFException
poll in interface IConnectorManifoldCFExceptionpublic boolean isConnected()
isConnected in interface IConnectorpublic void disconnect()
throws ManifoldCFException
disconnect in interface IConnectorManifoldCFExceptionpublic void clearThreadContext()
clearThreadContext in interface IConnectorpublic void setThreadContext(IThreadContext threadContext) throws ManifoldCFException
setThreadContext in interface IConnectorthreadContext - is the new thread context.ManifoldCFExceptionpublic ConfigParams getConfiguration()
getConfiguration in interface IConnectorpublic void outputConfigurationHeader(IThreadContext threadContext, IHTTPOutput out, java.util.Locale locale, ConfigParams parameters, java.util.List<java.lang.String> tabsArray) throws ManifoldCFException, java.io.IOException
outputConfigurationHeader in interface IConnectorthreadContext - is the local thread context.out - is the output to which any HTML should be sent.locale - is the locale that the output should use.parameters - are the configuration parameters, as they currently exist, for this connection being configured.tabsArray - is an array of tab names. Add to this array any tab names that are specific to the connector.ManifoldCFExceptionjava.io.IOExceptionpublic void outputConfigurationHeader(IThreadContext threadContext, IHTTPOutput out, ConfigParams parameters, java.util.List<java.lang.String> tabsArray) throws ManifoldCFException, java.io.IOException
threadContext - is the local thread context.out - is the output to which any HTML should be sent.parameters - are the configuration parameters, as they currently exist, for this connection being configured.tabsArray - is an array of tab names. Add to this array any tab names that are specific to the connector.ManifoldCFExceptionjava.io.IOExceptionpublic void outputConfigurationHeader(IThreadContext threadContext, IHTTPOutput out, ConfigParams parameters, java.util.ArrayList<java.lang.Object> tabsArray) throws ManifoldCFException, java.io.IOException
ManifoldCFExceptionjava.io.IOExceptionpublic void outputConfigurationBody(IThreadContext threadContext, IHTTPOutput out, java.util.Locale locale, ConfigParams parameters, java.lang.String tabName) throws ManifoldCFException, java.io.IOException
outputConfigurationBody in interface IConnectorthreadContext - is the local thread context.out - is the output to which any HTML should be sent.locale - is the locale that the output should use.parameters - are the configuration parameters, as they currently exist, for this connection being configured.tabName - is the current tab name.ManifoldCFExceptionjava.io.IOExceptionpublic void outputConfigurationBody(IThreadContext threadContext, IHTTPOutput out, ConfigParams parameters, java.lang.String tabName) throws ManifoldCFException, java.io.IOException
threadContext - is the local thread context.out - is the output to which any HTML should be sent.parameters - are the configuration parameters, as they currently exist, for this connection being configured.tabName - is the current tab name.ManifoldCFExceptionjava.io.IOExceptionpublic java.lang.String processConfigurationPost(IThreadContext threadContext, IPostParameters variableContext, java.util.Locale locale, ConfigParams parameters) throws ManifoldCFException
processConfigurationPost in interface IConnectorthreadContext - is the local thread context.variableContext - is the set of variables available from the post, including binary file post information.locale - is the locale that the output should use.parameters - are the configuration parameters, as they currently exist, for this connection being configured.ManifoldCFExceptionpublic java.lang.String processConfigurationPost(IThreadContext threadContext, IPostParameters variableContext, ConfigParams parameters) throws ManifoldCFException
threadContext - is the local thread context.variableContext - is the set of variables available from the post, including binary file post information.parameters - are the configuration parameters, as they currently exist, for this connection being configured.ManifoldCFExceptionpublic void viewConfiguration(IThreadContext threadContext, IHTTPOutput out, java.util.Locale locale, ConfigParams parameters) throws ManifoldCFException, java.io.IOException
viewConfiguration in interface IConnectorthreadContext - is the local thread context.out - is the output to which any HTML should be sent.locale - is the locale that the output should use.parameters - are the configuration parameters, as they currently exist, for this connection being configured.ManifoldCFExceptionjava.io.IOExceptionpublic void viewConfiguration(IThreadContext threadContext, IHTTPOutput out, ConfigParams parameters) throws ManifoldCFException, java.io.IOException
threadContext - is the local thread context.out - is the output to which any HTML should be sent.parameters - are the configuration parameters, as they currently exist, for this connection being configured.ManifoldCFExceptionjava.io.IOExceptionprotected static void pack(java.lang.StringBuilder output,
java.lang.String value,
char delimiter)
protected static int unpack(java.lang.StringBuilder sb,
java.lang.String value,
int startPosition,
char delimiter)
protected static void packFixedList(java.lang.StringBuilder output,
java.lang.String[] values,
char delimiter)
protected static int unpackFixedList(java.lang.String[] output,
java.lang.String value,
int startPosition,
char delimiter)
protected static void packList(java.lang.StringBuilder output,
java.util.List<java.lang.String> values,
char delimiter)
protected static void packList(java.lang.StringBuilder output,
java.lang.String[] values,
char delimiter)
protected static int unpackList(java.util.List<java.lang.String> output,
java.lang.String value,
int startPosition,
char delimiter)
output - is the array to write the unpacked result into.value - is the value to unpack.startPosition - is the place to start the unpack.delimiter - is the character to use between values.