Package com.ibm.di.connector
Class MemQConnector
- java.lang.Object
-
- com.ibm.di.connector.Connector
-
- com.ibm.di.connector.MemQConnector
-
- All Implemented Interfaces:
ConnectorInterface
,VersionInfoInterface
public class MemQConnector extends Connector implements ConnectorInterface
This class is a connector that wraps over the Memory Buffer Queue infrastructure.
-
-
Field Summary
-
Fields inherited from class com.ibm.di.connector.Connector
ALL_MODES, myLog, PROPERTY_MESSAGE, PROPERTY_READER, PROPERTY_WRITER
-
-
Constructor Summary
Constructors Constructor Description MemQConnector()
Class constructor
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
acquireLock()
Acquire lock on memqint
getMode()
Returns the mode of the connectorEntry
getNextEntry()
Returns the next entry objjava.lang.String
getVersion()
Returns version informationboolean
hasMore()
Checks if the specified memq has more entriesvoid
initialize(java.lang.Object o)
Method reads initialization params ,creates new pipe and calls initDB if persistence is enabled.boolean
isReleaseOnALEnd()
Checks if lock is to be released on AL cycle endvoid
purgeQueue()
Purges the queue.void
putEntry(Entry entry)
Adds the given entry object to the MemQvoid
releaseLock()
Release the lock on memqvoid
selectEntries()
Default implementationvoid
setMode(int mode)
Sets the mode of the connector.void
setReleaseOnALCycleEnd(boolean isReleaseOnALCycleEnd)
Sets the isReleaseOnALCycleEnd variablevoid
setTimeout(int timeout)
Sets the time out parametervoid
terminate()
Method is called when the Connector terminates-
Methods inherited from class com.ibm.di.connector.Connector
addFindEntry, allModes, clearFindEntries, debug, debugMode, deleteEntry, extractExceptionInformation, findEntry, findEntry, getBoolean, getClassInstance, getConfiguration, getContext, getFindEntryCount, getFirstFindEntry, getLog, getMaxDuplicateEntries, getModes, getModes, getName, getNextClient, getNextFindEntry, getParam, getParser, getProperty, getPushbackEntry, getRawConnectorConfiguration, getRSInterface, getUI, hasConfigValue, hasParser, initParser, isDeltaSupported, isExceptionFatal, isIOException, logError, logmsg, modEntry, modEntry, pushback, queryOperations, queryReply, querySchema, queryTables, reconnect, reconnect, registerScriptBeans, replyEntry, setConfiguration, setContext, setCurrent, setDebugMode, setLog, setMaxDuplicateEntries, setModes, setModes, setName, setParam, setParser, setProperty, setRSInterface, terminateServer
-
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, terminateServer
-
-
-
-
Method Detail
-
initialize
public void initialize(java.lang.Object o) throws java.lang.Exception
Method reads initialization params ,creates new pipe and calls initDB if persistence is enabled. Checks if user has enabled property to use earlier behavior of MEMQConnector in iterator mode where no new queue will be created if queue does not exist.- Specified by:
initialize
in interfaceConnectorInterface
- Overrides:
initialize
in classConnector
- Parameters:
o
- The connector mode of the Connector. The object should be of type ConnectorMode.- Throws:
java.lang.Exception
-
selectEntries
public void selectEntries() throws java.lang.Exception
Default implementation- Specified by:
selectEntries
in interfaceConnectorInterface
- Overrides:
selectEntries
in classConnector
- Throws:
java.lang.Exception
- never
-
getNextEntry
public Entry getNextEntry() throws java.lang.Exception
Returns the next entry obj- Specified by:
getNextEntry
in interfaceConnectorInterface
- Overrides:
getNextEntry
in classConnector
- Returns:
- the next entry
- Throws:
java.lang.Exception
- if an error occurs- See Also:
ConnectorInterface.selectEntries()
-
putEntry
public void putEntry(Entry entry) throws java.lang.Exception
Adds the given entry object to the MemQ- Specified by:
putEntry
in interfaceConnectorInterface
- Overrides:
putEntry
in classConnector
- Parameters:
entry
- entry to be added- Throws:
java.lang.Exception
- if an error occurs
-
setTimeout
public void setTimeout(int timeout)
Sets the time out parameter- Parameters:
timeout
- value to be set
-
hasMore
public boolean hasMore()
Checks if the specified memq has more entries- Returns:
- true if not empty
-
getVersion
public java.lang.String getVersion()
Returns version information- Specified by:
getVersion
in interfaceVersionInfoInterface
- Returns:
- version info
-
purgeQueue
public void purgeQueue() throws java.lang.Exception
Purges the queue. Wrapper over the MemBufferQ.purgeQueue()- Throws:
java.lang.Exception
-
terminate
public void terminate() throws java.lang.Exception
Method is called when the Connector terminates- Specified by:
terminate
in interfaceConnectorInterface
- Overrides:
terminate
in classConnector
- Throws:
java.lang.Exception
- never
-
acquireLock
public void acquireLock() throws java.lang.InterruptedException
Acquire lock on memq- Throws:
java.lang.InterruptedException
-
releaseLock
public void releaseLock()
Release the lock on memq
-
isReleaseOnALEnd
public boolean isReleaseOnALEnd()
Checks if lock is to be released on AL cycle end- Returns:
- true if it should be, false otherwise
-
setReleaseOnALCycleEnd
public void setReleaseOnALCycleEnd(boolean isReleaseOnALCycleEnd)
Sets the isReleaseOnALCycleEnd variable- Parameters:
isReleaseOnALCycleEnd
-
-
getMode
public int getMode()
Returns the mode of the connector- Returns:
- the number of the mode
-
setMode
public void setMode(int mode)
Sets the mode of the connector. Can be Add Only and Iterator.- Parameters:
mode
- value to set
-
-