|
||||||||||
| 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.PropertiesConnector
public class PropertiesConnector
Properties Connector operates on a file or URL.
| Field Summary | |
|---|---|
protected boolean |
isJavaProperties
A flag that marks a collection of Java Properties. |
protected java.util.Iterator<java.lang.Object> |
jpIterator
Iterator over the Java Properties' keys. |
protected java.util.Map<java.lang.String,java.lang.Object> |
map
In-memory data |
protected java.util.Iterator<java.lang.String> |
mapIterator
Iterator over the in-memory/sysStore/File properties' keys. |
protected boolean |
modified
A flag that marks a modified collection. |
static java.lang.String |
PARAM_AUTOREWRITE
Connector parameter name: "autorewrite" |
static java.lang.String |
PARAM_CIPHER
Connector parameter name: "cipher" |
static java.lang.String |
PARAM_COLLECTION
Connector parameter name: "collection" |
static java.lang.String |
PARAM_COLLECTION_TYPE
Connector parameter name: "collectionType" |
static java.lang.String |
PARAM_CREATE_FILE
Connector parameter name: "createCollection" |
static java.lang.String |
PARAM_ENCRYPTION
Connector parameter name: "encryption" |
static java.lang.String |
PARAM_PASSWORD
Connector parameter name: "secret" |
protected PropertiesFile |
propsFile
The PropertiesFile object. |
protected Crypto |
propsFileCrypto
The Crypto object used for encryption/decryption of properties. |
static java.lang.String |
PROTECT_PREFIX
Prefix used by encrypted property values |
static java.lang.String |
PROTECT_VAL_PREFIX
Prefix used in property value to indicate encrypted data |
static java.lang.String[] |
SUPPORTED_MODES
Supported connector modes |
protected PropertyStore |
systemStore
The PropertyStore object. |
protected UserFunctions |
uf
Helper object. |
| Fields inherited from class com.ibm.di.connector.Connector |
|---|
ALL_MODES, myLog, PROPERTY_MESSAGE, PROPERTY_READER, PROPERTY_WRITER |
| Constructor Summary | |
|---|---|
PropertiesConnector()
Constructor |
|
| Method Summary | |||||||||
|---|---|---|---|---|---|---|---|---|---|
void |
deleteEntry(Entry entry,
SearchCriteria search)
Deletes the specified key/value pair from the configured property store. |
||||||||
Entry |
findEntry(SearchCriteria search)
Looks for a key name in the configured store. |
||||||||
Entry |
getNextEntry()
Iterates over the set of keys and returns an entry for each property. |
||||||||
java.lang.String |
getVersion()
Return version information |
||||||||
void |
initialize(java.lang.Object o)
Initialize the connector. |
||||||||
protected void |
loadProperties(java.lang.String path)
Loads the data from path into a buffer where decryption is applied before parsing the properties into the map object. |
||||||||
void |
modEntry(Entry entry,
SearchCriteria search)
Modifies an existing entry. |
||||||||
void |
putEntry(Entry entry)
Adds a key/value pair in the specified property store. |
||||||||
java.lang.Object |
querySchema(java.lang.Object source)
This function translates to whatever means a connector has to discover schema for a connection. The connector may implement this, in which case a Vector of Entry objects is returned for each column/attribute it discovered. For a database connector this would typically be column names and their attributes. Each Entry in the Vector returned should contain the following attributes:
|
||||||||
void |
saveProperties(java.lang.String path)
Saves the properties in the appropriate store. |
||||||||
void |
selectEntries()
Initializes the helper iterators objects used for iterating over the keys of the configured property store. |
||||||||
void |
setModified()
Set the modified flag, to make sure that the values are saved even if no change has been made |
||||||||
void |
setProperty(java.lang.String key,
java.lang.Object value,
boolean encr)
Sets the provided property in the JavaPropertiesMap/SystemStore/PropertyFile. |
||||||||
void |
setProperty(java.lang.String key,
java.lang.Object value,
java.lang.Boolean encr)
Sets the provided property in the JavaPropertiesMap/SystemStore/PropertyFile. |
||||||||
void |
terminate()
Terminate the connector. This function closes all connection and releases all resources used by the connector. This function also calls the parser's closeParser() method if a parser is active. |
||||||||
| 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 |
|---|
getConfiguration, getContext, getFindEntryCount, getFirstFindEntry, getMaxDuplicateEntries, getName, getNextClient, getNextFindEntry, getParam, getPushbackEntry, getRawConnectorConfiguration, isDeltaSupported, isExceptionFatal, isIOException, modEntry, pushback, queryOperations, queryReply, reconnect, registerScriptBeans, replyEntry, setConfiguration, setContext, setCurrent, setLog, setMaxDuplicateEntries, setName, setParam, setRSInterface, terminateServer |
| Field Detail |
|---|
public static final java.lang.String PARAM_COLLECTION
public static final java.lang.String PARAM_COLLECTION_TYPE
public static final java.lang.String PARAM_ENCRYPTION
public static final java.lang.String PARAM_CIPHER
public static final java.lang.String PARAM_PASSWORD
public static final java.lang.String PARAM_AUTOREWRITE
public static final java.lang.String PARAM_CREATE_FILE
public static final java.lang.String PROTECT_PREFIX
public static final java.lang.String PROTECT_VAL_PREFIX
public static final java.lang.String[] SUPPORTED_MODES
protected java.util.Map<java.lang.String,java.lang.Object> map
protected boolean modified
protected boolean isJavaProperties
protected PropertyStore systemStore
PropertyStore object.
protected PropertiesFile propsFile
PropertiesFile object.
protected Crypto propsFileCrypto
Crypto object used for encryption/decryption of properties.
protected java.util.Iterator<java.lang.String> mapIterator
protected java.util.Iterator<java.lang.Object> jpIterator
protected UserFunctions uf
| Constructor Detail |
|---|
public PropertiesConnector()
| Method Detail |
|---|
public void initialize(java.lang.Object o)
throws java.lang.Exception
initialize in interface ConnectorInterfaceinitialize in class Connectoro - This parameter is ignored by this connector.
java.lang.Exception - Any exception thrown by java.io/java.net classes when
loading a file/url.
public void terminate()
throws java.lang.Exception
terminate in interface ConnectorInterfaceterminate in class Connectorjava.lang.Exception - if an error occurs.
protected void loadProperties(java.lang.String path)
throws java.lang.Exception
path - The filename or URL from which to read props
java.lang.Exception - if an error occurs while loading properties
public void setProperty(java.lang.String key,
java.lang.Object value,
boolean encr)
throws java.lang.Exception
key - the key name to use.value - the value to set.encr - specify whether the value should be encrypted.
java.lang.Exception - if an error occurs.
public void setProperty(java.lang.String key,
java.lang.Object value,
java.lang.Boolean encr)
throws java.lang.Exception
key - the key name to use.value - the value to set.encr - If not null, specify whether the value should be encrypted.
If null, keep old encryption status if possible.
java.lang.Exception - if an error occurs.
public void saveProperties(java.lang.String path)
throws java.lang.Exception
path - this is the path to the file in which the properties will be
saved. This parameter is ignored if the connector is
configured to store properties in other than a File.
java.lang.Exception - if an error occurs.
public void selectEntries()
throws java.lang.Exception
selectEntries in interface ConnectorInterfaceselectEntries in class Connectorjava.lang.Exception - if an error occurs.
public Entry getNextEntry()
throws java.lang.Exception
getNextEntry in interface ConnectorInterfacegetNextEntry in class Connectorjava.lang.Exception - if an error occurs.ConnectorInterface.selectEntries()
public Entry findEntry(SearchCriteria search)
throws java.lang.Exception
SearchCriteria object.
findEntry in interface ConnectorInterfacefindEntry in class Connectorsearch - the object used to find the specific property. Note: only the
first criteria is used, the rest (if any) are ignored.
java.lang.Exception - if an error occurs.
public java.lang.Object querySchema(java.lang.Object source)
throws java.lang.Exception
Each Entry in the Vector returned should contain the following attributes:
| Name | Value |
|---|---|
| name | The name of the column/attribute/field .... |
| syntax | The syntax or expected value type |
| size | If specified this will give the user a hint as to how long the field may be |
querySchema in interface ConnectorInterfacequerySchema in class Connectorsource - The object on which to discover schema. This may be an Entry
or a string value
java.lang.Exception - if an error while retrieving the schema occurs.Entry,
Vector
public void putEntry(Entry entry)
throws java.lang.Exception
putEntry in interface ConnectorInterfaceputEntry in class Connectorentry - the entry containing the attributes "key" and "value".
java.lang.Exception - if an error occurs.
public void modEntry(Entry entry,
SearchCriteria search)
throws java.lang.Exception
modEntry in interface ConnectorInterfacemodEntry in class Connectorentry - The entry datasearch - The search criteria used to locate the entry to be modified
java.lang.Exception - Any exceptions thrown by the connector's underlying
classes
public void deleteEntry(Entry entry,
SearchCriteria search)
throws java.lang.Exception
deleteEntry in interface ConnectorInterfacedeleteEntry in class Connectorentry - -
ignored.search - the SearchCriteria object which first criteria object
is used to find the property to delete.
java.lang.Exception - if an error occurs.public void setModified()
public java.lang.String getVersion()
getVersion in interface VersionInfoInterface
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||