Interface Configuration
-
- All Known Subinterfaces:
StatefulConfiguration
- All Known Implementing Classes:
AbstractConfiguration
public interface ConfigurationEncapsulates the configuration of a connector.Implementations of the
Configurationinterface must have a default constructor. All bean properties are considered configuration for the connector. The initial value of the property getter method is considered the default value of the property. The types of the bean properties can be only those returned byFrameworkUtil.getAllSupportedConfigTypes()and multi-dimensional arrays thereof. The bean properties are not required by default, but a property can be marked as required through use of theConfigurationPropertyannotation.Each bean property corresponds to two keys in a properties file named
Messagesin the same package as the implementing class:${property}.displayand${property}.help. For example,hostname.helpandhostname.displaywould be the keys corresponding to ahostnameproperty. Thedisplaymessage is the display name of the property and can be used to display the property in a view. Thehelpmessage holds the description of the property. The names of the two keys can be overridden through theConfigurationPropertyannotation.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description ConnectorMessagesgetConnectorMessages()Should return themessage catalogthat is set bysetConnectorMessages(ConnectorMessages).voidsetConnectorMessages(ConnectorMessages messages)Sets themessage cataloginstance that allows the Connector to localize messages.voidvalidate()Determines if the configuration is valid.
-
-
-
Method Detail
-
validate
void validate()
Determines if the configuration is valid.A valid configuration is one that is ready to be used by the connector: it is complete (all the required properties have been given values) and the property values are well-formed (are in the expected range, have the expected format, etc.)
Implementations of this method should not connect to the resource in an attempt to validate the configuration. For example, implementations should not attempt to check that a host of the specified name exists by making a connection to it. Such checks can be performed in the implementation of the
TestOp.test()method.- Throws:
java.lang.RuntimeException- if the configuration is not valid. Implementations are encouraged to throw the most specific exception available. When no specific exception is available, implementations can throwConfigurationException.
-
getConnectorMessages
ConnectorMessages getConnectorMessages()
Should return themessage catalogthat is set bysetConnectorMessages(ConnectorMessages).- Returns:
- the
ConnectorMessagesinstance.
-
setConnectorMessages
void setConnectorMessages(ConnectorMessages messages)
Sets themessage cataloginstance that allows the Connector to localize messages. This method is called before any bean property setter, thevalidate()method or thegetConnectorMessages()method.- Parameters:
messages- the message catalog.
-
-