|
||||||||||
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 | |
---|---|
static String |
INCLUDE_PREFIX
Include prefix - "!include <other-file/url>" |
protected boolean |
isJavaProperties
|
protected Iterator |
jpIterator
|
protected ArrayList |
lines
|
protected Map |
map
In-memory data |
protected Iterator |
mapIterator
Helper objects |
static String |
MERGE_PREFIX
Merge prefix - "!merge <other-file/url>". |
protected boolean |
modified
|
static String |
PARAM_AUTOREWRITE
|
static String |
PARAM_CIPHER
|
static String |
PARAM_COLLECTION
Connector parameters |
static String |
PARAM_COLLECTION_TYPE
|
static String |
PARAM_CREATE_FILE
|
static String |
PARAM_ENCRYPTION
|
static String |
PARAM_PASSWORD
|
static String |
PROTECT_PREFIX
Prefix used by encrypted property values |
static String |
PROTECT_VAL_PREFIX
Prefix used in property value to indicate encrypted data |
static String[] |
SUPPORTED_MODES
Supported connector modes |
protected PropertyStore |
systemStore
|
protected UserFunctions |
uf
|
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 an existing entry. |
Entry |
findEntry(SearchCriteria search)
Finds an existing entry. |
Entry |
getNextEntry()
Returns the next Entry from the connector. |
String |
getVersion()
Return version information |
int |
indexOfProperty(String key)
|
void |
initialize(Object o)
Initialize the connector. |
protected void |
loadProperties(String path,
Map map,
boolean overwrite)
Loads the data from path into a buffer where decryption is applied before parsing the properites into the map object. |
void |
modEntry(Entry entry,
SearchCriteria search)
Modifies an existing entry. |
void |
putEntry(Entry entry)
Adds a new entry to the data source |
Object |
querySchema(Object source)
Returns a vector of schema entries for this connector. |
protected void |
readStream(BufferedReader inp,
Map map,
boolean overwrite)
Read data from input reader |
void |
saveProperties(String path)
|
void |
savePropertiesFile(String path)
|
void |
selectEntries()
Prepare the Connector for sequential read. |
void |
setModified()
Set the modified flag, to make sure that the values are saved even if no change has been made |
void |
setProperty(String key,
Object value,
boolean encr)
|
String[] |
splitString(String str)
|
void |
terminate()
Terminate the connector. |
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 String PARAM_COLLECTION
public static final String PARAM_COLLECTION_TYPE
public static final String PARAM_ENCRYPTION
public static final String PARAM_CIPHER
public static final String PARAM_PASSWORD
public static final String PARAM_AUTOREWRITE
public static final String PARAM_CREATE_FILE
public static final String PROTECT_PREFIX
public static final String PROTECT_VAL_PREFIX
public static final String INCLUDE_PREFIX
public static final String MERGE_PREFIX
public static final String[] SUPPORTED_MODES
protected Map map
protected ArrayList lines
protected boolean modified
protected boolean isJavaProperties
protected PropertyStore systemStore
protected Iterator mapIterator
protected Iterator jpIterator
protected UserFunctions uf
Constructor Detail |
---|
public PropertiesConnector()
Method Detail |
---|
public void initialize(Object o) throws Exception
initialize
in interface ConnectorInterface
initialize
in class Connector
o
- This parameter is ignored by this connector.
Exception
- Any exception thrown by java.io/java.net classes when
loading a file/url.public void terminate() throws Exception
Connector
terminate
in interface ConnectorInterface
terminate
in class Connector
Exception
protected void loadProperties(String path, Map map, boolean overwrite) throws Exception
path
- The filename or URL from which to read propsmap
- The map object to receive propsoverwrite
- If true, all values from prop file are added to map.
Exception
- if an error occurs while loading propertiesprotected void readStream(BufferedReader inp, Map map, boolean overwrite) throws Exception
inp
- The reader from which data is readmap
- The target Map object to insert key/valuesoverwrite
- True if existing values in the map can be overwritten by
contents of reader
Exception
- if an error occurs while reading the streampublic int indexOfProperty(String key)
public void setProperty(String key, Object value, boolean encr) throws Exception
Exception
public void saveProperties(String path) throws Exception
Exception
public void savePropertiesFile(String path) throws Exception
Exception
public void selectEntries() throws Exception
Connector
selectEntries
in interface ConnectorInterface
selectEntries
in class Connector
Exception
public Entry getNextEntry() throws Exception
Connector
getNextEntry
in interface ConnectorInterface
getNextEntry
in class Connector
Exception
Connector.selectEntries()
public Entry findEntry(SearchCriteria search) throws Exception
Connector
findEntry
in interface ConnectorInterface
findEntry
in class Connector
search
- The search criteria used to locate the entry to be modified
Exception
- Any exceptions thrown by the connector's underlying classespublic Object querySchema(Object source) throws Exception
querySchema
in interface ConnectorInterface
querySchema
in class Connector
source
- The object on which to discover schema. This may be an Entry or a string value
Any
- Runtime exception
Exception
Entry
,
Vector
public void putEntry(Entry entry) throws Exception
Connector
putEntry
in interface ConnectorInterface
putEntry
in class Connector
entry
- The entry data to add
Exception
- Any exceptions thrown by the connector's underlying classespublic void modEntry(Entry entry, SearchCriteria search) throws Exception
modEntry
in interface ConnectorInterface
modEntry
in class Connector
entry
- The entry datasearch
- The search criteria used to locate the entry to be modified
Exception
- Any exceptions thrown by the connector's underlying
classespublic void deleteEntry(Entry entry, SearchCriteria search) throws Exception
Connector
deleteEntry
in interface ConnectorInterface
deleteEntry
in class Connector
entry
- The entry datasearch
- The search criteria used to locate the entry to be deleted
Exception
- Any exceptions thrown by the connector's underlying classespublic String[] splitString(String str)
public void setModified()
public String getVersion()
getVersion
in interface VersionInfoInterface
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |