|
||||||||||
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.FileConnector
public class FileConnector
The file system Connector is a transport Connector that requires a Parser to operate. The file system Connector reads and writes files available on the system it runs on. Concurrent usage of a file can be controlled by means of a locking mechanism. This Connector can only be used in Iterator or AddOnly mode, or for the equivalent operations in Passive state.
Field Summary |
---|
Fields inherited from class com.ibm.di.connector.Connector |
---|
ALL_MODES, myLog, PROPERTY_MESSAGE, PROPERTY_READER, PROPERTY_WRITER |
Constructor Summary | |
---|---|
FileConnector()
Constructor. |
Method Summary | |
---|---|
void |
acquireLock(java.nio.channels.FileChannel fc,
long timeout,
boolean shared)
Attempts to acquire a lock on a File Channel |
Entry |
getNextEntry()
Return the next Entry from the connector. |
java.lang.String |
getVersion()
Version information. |
void |
initialize(java.lang.Object o)
Initialize the connector. |
void |
openReadFile()
Opens the file specified by the FilePath field in the Config Tab for reading. |
void |
openWriteFile()
Opens the file specified by the FilePath field in the Config Tab for writing. |
void |
putEntry(Entry entry)
Add a new entry to the data source |
void |
reconnect()
Reconnect to the underlying data source. |
void |
releaseLock()
Releases the acquired lock. |
void |
selectEntries()
Prepare the Connector for sequential read. |
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 |
---|
deleteEntry, findEntry, getConfiguration, getContext, getFindEntryCount, getFirstFindEntry, getMaxDuplicateEntries, getName, getNextClient, getNextFindEntry, getParam, getPushbackEntry, getRawConnectorConfiguration, isDeltaSupported, isExceptionFatal, isIOException, modEntry, modEntry, pushback, queryOperations, queryReply, querySchema, reconnect, registerScriptBeans, replyEntry, setConfiguration, setContext, setCurrent, setLog, setMaxDuplicateEntries, setName, setParam, setRSInterface, terminate, terminateServer |
Constructor Detail |
---|
public FileConnector()
Method Detail |
---|
public void initialize(java.lang.Object o) throws java.lang.Exception
initialize
in interface ConnectorInterface
initialize
in class Connector
o
- Expects Reader or Writer to initialize the Parser with, or a
ConnectorMode with the mode in which the Iterator is set to
open the specified file in the configuration for reading or
writing respectively for Iterator and AddOnly modes. If the
object is not an instance of those classes, the iterator
checks for a configuration parameter with name "fileMode" and
if exists, checks if equals to "input" (and opens the file
specified in the configuration for reading) or equals to
"output" (and opens the file specified in the configuration
for writing). An exception is thrown if none of these
situations occur.
java.lang.Exception
- if the initialization of this connector fails.public void selectEntries() throws java.lang.Exception
selectEntries
in interface ConnectorInterface
selectEntries
in class Connector
java.lang.Exception
- if an error occurs.public Entry getNextEntry() throws java.lang.Exception
getNextEntry
in interface ConnectorInterface
getNextEntry
in class Connector
java.lang.Exception
- if an error occurs.selectEntries()
public void putEntry(Entry entry) throws java.lang.Exception
putEntry
in interface ConnectorInterface
putEntry
in class Connector
entry
- The entry data to add
java.lang.Exception
- if an error occurs.public void openReadFile() throws java.lang.Exception
public void openWriteFile() throws java.lang.Exception
public void acquireLock(java.nio.channels.FileChannel fc, long timeout, boolean shared) throws java.lang.Exception
fc
- The File channel we are attempting to locktimeout
- The max time in seconds in which the lock has to be acquired.shared
- true to request a shared lock, in which case this channel must
be open for reading (and possibly writing); false to request
an exclusive lock, in which case this channel must be open for
writing (and possibly reading)
java.lang.Exception
- If unable to acquire the lock within timeout time, an
Exception is thrownpublic void releaseLock()
public java.lang.String getVersion()
getVersion
in interface VersionInfoInterface
public void reconnect() throws java.lang.Exception
reconnect
in class Connector
java.lang.Exception
- if an error occurs.Connector.initialize(Object)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |