public abstract class BaseConnector extends Object implements IConnector
Modifier and Type | Field and Description |
---|---|
static String |
_rcsid |
protected IThreadContext |
currentContext |
protected ConfigParams |
params |
Constructor and Description |
---|
BaseConnector() |
Modifier and Type | Method and Description |
---|---|
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,
String tabName)
Output the configuration body section.
|
void |
outputConfigurationBody(IThreadContext threadContext,
IHTTPOutput out,
Locale locale,
ConfigParams parameters,
String tabName)
Output the configuration body section.
|
void |
outputConfigurationHeader(IThreadContext threadContext,
IHTTPOutput out,
ConfigParams parameters,
ArrayList<Object> tabsArray) |
void |
outputConfigurationHeader(IThreadContext threadContext,
IHTTPOutput out,
ConfigParams parameters,
List<String> tabsArray)
Output the configuration header section.
|
void |
outputConfigurationHeader(IThreadContext threadContext,
IHTTPOutput out,
Locale locale,
ConfigParams parameters,
List<String> tabsArray)
Output the configuration header section.
|
protected static void |
pack(StringBuilder output,
String value,
char delimiter)
Stuffer for packing a single string with an end delimiter
|
protected static void |
packFixedList(StringBuilder output,
String[] values,
char delimiter)
Stuffer for packing lists of fixed length
|
protected static void |
packList(StringBuilder output,
List<String> values,
char delimiter)
Stuffer for packing lists of variable length
|
protected static void |
packList(StringBuilder output,
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.
|
String |
processConfigurationPost(IThreadContext threadContext,
IPostParameters variableContext,
ConfigParams parameters)
Process a configuration post.
|
String |
processConfigurationPost(IThreadContext threadContext,
IPostParameters variableContext,
Locale locale,
ConfigParams parameters)
Process a configuration post.
|
void |
setThreadContext(IThreadContext threadContext)
Attach to a new thread.
|
protected static int |
unpack(StringBuilder sb,
String value,
int startPosition,
char delimiter)
Unstuffer for the above.
|
protected static int |
unpackFixedList(String[] output,
String value,
int startPosition,
char delimiter)
Unstuffer for unpacking lists of fixed length
|
protected static int |
unpackList(List<String> output,
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,
Locale locale,
ConfigParams parameters)
View configuration.
|
public static final String _rcsid
protected ConfigParams params
protected IThreadContext currentContext
public void install(IThreadContext threadContext) throws ManifoldCFException
install
in interface IConnector
threadContext
- is the current thread context.ManifoldCFException
public void deinstall(IThreadContext threadContext) throws ManifoldCFException
deinstall
in interface IConnector
threadContext
- is the current thread context.ManifoldCFException
public void connect(ConfigParams configParams)
connect
in interface IConnector
configParams
- are the configuration parameters for this connection.public String check() throws ManifoldCFException
check
in interface IConnector
ManifoldCFException
public void poll() throws ManifoldCFException
poll
in interface IConnector
ManifoldCFException
public boolean isConnected()
isConnected
in interface IConnector
public void disconnect() throws ManifoldCFException
disconnect
in interface IConnector
ManifoldCFException
public void clearThreadContext()
clearThreadContext
in interface IConnector
public void setThreadContext(IThreadContext threadContext) throws ManifoldCFException
setThreadContext
in interface IConnector
threadContext
- is the new thread context.ManifoldCFException
public ConfigParams getConfiguration()
getConfiguration
in interface IConnector
public void outputConfigurationHeader(IThreadContext threadContext, IHTTPOutput out, Locale locale, ConfigParams parameters, List<String> tabsArray) throws ManifoldCFException, IOException
outputConfigurationHeader
in interface IConnector
threadContext
- 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.ManifoldCFException
IOException
public void outputConfigurationHeader(IThreadContext threadContext, IHTTPOutput out, ConfigParams parameters, List<String> tabsArray) throws ManifoldCFException, 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.ManifoldCFException
IOException
public void outputConfigurationHeader(IThreadContext threadContext, IHTTPOutput out, ConfigParams parameters, ArrayList<Object> tabsArray) throws ManifoldCFException, IOException
ManifoldCFException
IOException
public void outputConfigurationBody(IThreadContext threadContext, IHTTPOutput out, Locale locale, ConfigParams parameters, String tabName) throws ManifoldCFException, IOException
outputConfigurationBody
in interface IConnector
threadContext
- 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.ManifoldCFException
IOException
public void outputConfigurationBody(IThreadContext threadContext, IHTTPOutput out, ConfigParams parameters, String tabName) throws ManifoldCFException, 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.ManifoldCFException
IOException
public String processConfigurationPost(IThreadContext threadContext, IPostParameters variableContext, Locale locale, ConfigParams parameters) throws ManifoldCFException
processConfigurationPost
in interface IConnector
threadContext
- 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.ManifoldCFException
public 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.ManifoldCFException
public void viewConfiguration(IThreadContext threadContext, IHTTPOutput out, Locale locale, ConfigParams parameters) throws ManifoldCFException, IOException
viewConfiguration
in interface IConnector
threadContext
- 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.ManifoldCFException
IOException
public void viewConfiguration(IThreadContext threadContext, IHTTPOutput out, ConfigParams parameters) throws ManifoldCFException, 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.ManifoldCFException
IOException
protected static void pack(StringBuilder output, String value, char delimiter)
protected static int unpack(StringBuilder sb, String value, int startPosition, char delimiter)
protected static void packFixedList(StringBuilder output, String[] values, char delimiter)
protected static int unpackFixedList(String[] output, String value, int startPosition, char delimiter)
protected static void packList(StringBuilder output, List<String> values, char delimiter)
protected static void packList(StringBuilder output, String[] values, char delimiter)
protected static int unpackList(List<String> output, 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.