org.openadaptor.adaptor
Interface Configurable

All Known Subinterfaces:
CallbackManager, Component, Controller, Sink, Source, Transporter
All Known Implementing Classes:
AbstractReader, AbstractSimplePipe, AbstractSimpleSink, AbstractSimpleSource, AbstractSimpleSourceSink, AbstractTransporter, AbstractTransporterSink, AbstractTransporterSource, AbstractWriter, AdvancedFileSource, AliasingPipeSegment, AliasPipe, ArraySplitterPipe, AuditPipe, BenchmarkPipe, BenchmarkSource, BenchmarkThroughputPipe, BinaryFileSink, BinaryFileSource, BridgeSocketSink, BridgeSocketSource, CheckMandatory, CrossRefPipe, DBEnrichmentPipe, DebugSink, DelayPipe, DOAttributeAddPipe, DOAttributeChangePipe, DOAttributeFilter, DOAttributeRemovePipe, DOFactoryConverterPipe, DOFactoryPipe, DOMParserPipe, DoNothingSource, DOTypeFilter, DOUnwrapperPipe, DOWrapperPipe, EchoAttributePipe, ExceptionPipe, FileBufferSource, FilePollSource, FileSink, FileSource, FilterPipe, FilterPipe, FTPSink, FTPSource, HospitalPipe, HospitalSink, HospitalSource, HospitalSourcePipe, HTMLTidyPipe, IDEnvelopePipe, InformixSink, InformixSource, InspectorPipe, InspectorSink, JabberSink, JdbcSink, JdbcSource, JDOMFilterPipe, JMSAdaptorListener, JMSAdaptorPublisher, JMSDrainListener, JMSListener, JMSPeeker, JMSPublisher, JMSSink, JMSSource, JMSStringPublisher, JMSTransporter, JSchSCPSink, JSchSCPSource, LDAPSink, LDAPSource, LocalAsyncSource, LocalSink, LocalSource, MailSink, MailSource, MessageEnvelopeProperties, MqSink, MqSource, MSAccessSource, MSSqlBatchSource, MSSqlSource, MultiDoJdbcSink, MultiDoSybaseSource, MultiFileSink, NullSink, OracleSink, OracleSource, OracleSQLSource, PartPrintPipeSegment, PollingSQLSource, RequestReplyEmbeddedPipe, RMISink, RMISource, SCPWriter, SimpleCallbackManager, SimpleComponent, SimpleController, SimpleEnvelopePipe, SimpleEnvelopeUnwrapPipe, SocketMTSource, SocketMTSourceInstance, SocketSink, SocketSource, SQLSink, SQLSource, StringToDOPipe, SybaseBatchSource, SybaseBcpInSink, SybaseSource, TerminatePipe, ThrowHospitalExceptionPipe, TibRvSink, TibRvSource, TimeoutExceptionPipe, TimestampAddingPipe, TransactionTerminatePipe, TransformerPipe, TxnExceptionSink, UniqueIDVerifyPipe, ValueAliasPipe, ValueModifyPipe, ViewerSink, WebServiceSink, WebServiceSource, XPathFilterPipe, XSLTransformPipe

public interface Configurable

Methods to be supported by a Transporter or Component, wherever possible, for run-time query and update of configuration parameters.

Author:
Colin Prosser

Method Summary
 boolean canUpdateWhileRunning(java.lang.String propertyName)
          Returns true if the given parameter can be updated while the transporter is running.
 SuperProperties getAsProperties(java.lang.String prefix)
          Returns status of parameters as a property list.
 void setFromProperties(java.util.Properties properties, java.lang.String prefix)
          Sets parameters from a property list.
 void setFromProperties(java.util.Properties properties, java.lang.String[] prefixList)
          Sets parameters from a property list.
 

Method Detail

getAsProperties

SuperProperties getAsProperties(java.lang.String prefix)
                                throws IbafException
Returns status of parameters as a property list.

Equivalent to calling the get method for each of the supported parameters.

An implementation must return a non-null SuperProperties object, but it may have no properties set.

Parameters:
prefix - If non-null, returned property names are prefixed with prefix.

Returns:
The properties list as a SuperProperties object.

Throws:
IbafException - If problem getting any properties.

setFromProperties

void setFromProperties(java.util.Properties properties,
                       java.lang.String[] prefixList)
                       throws IbafException
Sets parameters from a property list.

Equivalent to calling the set method for each of the supported parameters.

Only properties matching supported parameters are set.

Parameters:
properties - The properties list. Can be a SuperProperties object.
prefixList - If non-null, property names are looked up with prefix from prefixList prepended. The prefixList is used in index order until a match is found.

Throws:
IbafException - If problem setting any properties.

setFromProperties

void setFromProperties(java.util.Properties properties,
                       java.lang.String prefix)
                       throws IbafException
Sets parameters from a property list.

Same as setFromProperties(Properties properties, String[] prefixList) but with a single prefix.

Parameters:
properties - The properties list. Can be a SuperProperties object.
prefix - If non-null, property names are looked up with prefix prepended.

Throws:
IbafException - If problem setting any properties.

canUpdateWhileRunning

boolean canUpdateWhileRunning(java.lang.String propertyName)
                              throws IbafException
Returns true if the given parameter can be updated while the transporter is running.

An implementation may choose to enforce that a transporter is not running (i.e. closed, or not initialized) before allowing certain parameters to be updated. This will most often be the case where there would be a mismatch between a new parameter value and a currently active connection, where a query about the state of the transporter could give inconsistent results. Other implementations may allow updates while the transporter is running.

The return value applies to the corresponding setXXXX() method as well as to the setFromProperties(Properties properties, String[] prefixList) methods.

Parameters:
propertyName - The name of the parameter for which update is being tested

Returns:
true if update while running is permitted, otherwise false

Throws:
IbafException - If the supplied parameter is not supported.