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 voidacquireLock()Acquire lock on memqintgetMode()Returns the mode of the connectorEntrygetNextEntry()Returns the next entry objjava.lang.StringgetVersion()Returns version informationbooleanhasMore()Checks if the specified memq has more entriesvoidinitialize(java.lang.Object o)Method reads initialization params ,creates new pipe and calls initDB if persistence is enabled.booleanisReleaseOnALEnd()Checks if lock is to be released on AL cycle endvoidpurgeQueue()Purges the queue.voidputEntry(Entry entry)Adds the given entry object to the MemQvoidreleaseLock()Release the lock on memqvoidselectEntries()Default implementationvoidsetMode(int mode)Sets the mode of the connector.voidsetReleaseOnALCycleEnd(boolean isReleaseOnALCycleEnd)Sets the isReleaseOnALCycleEnd variablevoidsetTimeout(int timeout)Sets the time out parametervoidterminate()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.ExceptionMethod 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:
initializein interfaceConnectorInterface- Overrides:
initializein 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.ExceptionDefault implementation- Specified by:
selectEntriesin interfaceConnectorInterface- Overrides:
selectEntriesin classConnector- Throws:
java.lang.Exception- never
-
getNextEntry
public Entry getNextEntry() throws java.lang.Exception
Returns the next entry obj- Specified by:
getNextEntryin interfaceConnectorInterface- Overrides:
getNextEntryin 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:
putEntryin interfaceConnectorInterface- Overrides:
putEntryin 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:
getVersionin interfaceVersionInfoInterface- Returns:
- version info
-
purgeQueue
public void purgeQueue() throws java.lang.ExceptionPurges the queue. Wrapper over the MemBufferQ.purgeQueue()- Throws:
java.lang.Exception
-
terminate
public void terminate() throws java.lang.ExceptionMethod is called when the Connector terminates- Specified by:
terminatein interfaceConnectorInterface- Overrides:
terminatein classConnector- Throws:
java.lang.Exception- never
-
acquireLock
public void acquireLock() throws java.lang.InterruptedExceptionAcquire 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
-
-