com.ibm.di.connector
Class MemQConnector

java.lang.Object
  extended by com.ibm.di.connector.Connector
      extended by 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
MemQConnector()
          Class constructor
 
Method Summary
 void acquireLock()
          Acquire lock on memq
 int getMode()
          Returns the mode of the connector
 Entry getNextEntry()
          Returns the next entry obj
 java.lang.String getVersion()
          Returns version information
 boolean hasMore()
          Checks if the specified memq has more entries
 void 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 end
 void purgeQueue()
          Purges the queue.
 void putEntry(Entry entry)
          Adds the given entry object to the MemQ
 void releaseLock()
          Release the lock on memq
 void selectEntries()
          Default implementation
 void setMode(int mode)
          Sets the mode of the connector.
 void setReleaseOnALCycleEnd(boolean isReleaseOnALCycleEnd)
          Sets the isReleaseOnALCycleEnd variable
 void setTimeout(int timeout)
          Sets the time out parameter
 void 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
 

Constructor Detail

MemQConnector

public MemQConnector()
Class constructor

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 interface ConnectorInterface
Overrides:
initialize in class Connector
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 interface ConnectorInterface
Overrides:
selectEntries in class Connector
Throws:
java.lang.Exception - never

getNextEntry

public Entry getNextEntry()
                   throws java.lang.Exception
Returns the next entry obj

Specified by:
getNextEntry in interface ConnectorInterface
Overrides:
getNextEntry in class Connector
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 interface ConnectorInterface
Overrides:
putEntry in class Connector
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 interface VersionInfoInterface
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 interface ConnectorInterface
Overrides:
terminate in class Connector
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