|
||||||||||
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.JMSConnector
public class JMSConnector
The JMS Connector uses underlying implementations to access JMS based systems. Since the constructor is not defined in the JMS specification we actually need a java class for each JMS system.
Field Summary | |
---|---|
static java.lang.String |
JMS_BROKER
The URL to the external broker |
static java.lang.String |
JMS_MESSAGE_PROPERTY
The name under which the JMS Property is stored in the Entry |
static java.lang.String |
JMS_PASSWORD
The password to use for establishing connection with the queue/topic. |
static java.lang.String |
JMS_Q_MANAGER
The name of the queue manager parameter |
static java.lang.String |
JMS_SERVER_CHANNEL
Websphere MQ server channel |
static java.lang.String |
JMS_SSL_CIPHER
The name of the cipher the IBMMQ driver to use. |
static java.lang.String |
JMS_SSL_SERVER_CHANNEL
Websphere MQ encrypted server channel |
static java.lang.String |
JMS_SSL_USE_FLAG
Tells whether a SSL should be used |
static java.lang.String |
JMS_USERNAME
The username to use for establishing connection with the queue/topic. |
static java.lang.String |
MESSAGE_ATTRIBUTE
The attribute name used for plain text messages |
Fields inherited from class com.ibm.di.connector.Connector |
---|
ALL_MODES, myLog, PROPERTY_MESSAGE, PROPERTY_READER, PROPERTY_WRITER |
Constructor Summary | |
---|---|
JMSConnector()
Constructor for the JMSConnector object |
Method Summary | |
---|---|
java.lang.String |
acknowledge()
Acknowledge all messages received in this topicSession. |
javax.jms.Message |
entry2message(Entry entry)
Convert an entry to a JMS message. |
Entry |
findEntry(SearchCriteria search)
Query the queue for specific messages. |
java.lang.String |
getIBMCharset(javax.jms.BytesMessage bytesmessage)
Gets the name of the charset set as a property to a BytesMessage |
Entry |
getNextEntry()
Gets the nextEntry attribute of the JMSConnector object |
javax.jms.Queue |
getQueue()
Gets the sendQueue member of the JMSConnector object |
javax.jms.Queue |
getReadQueue()
Gets the readQueue member of the JMSConnector object |
javax.jms.Queue |
getSendQueue()
Gets the sendQueue member of the JMSConnector object |
javax.jms.Session |
getSession()
Gets the Session member of the JMSConnector object If topicSession non equals to null then return topicSession else return queueSession |
javax.jms.Topic |
getTopic()
Gets the topic member of the JMSConnector object |
java.lang.String |
getVersion()
Return version information |
void |
initialize(java.lang.Object o)
Initialize the Connector |
Entry |
message2entry(javax.jms.Message m)
Convert a JMS message to an entry. |
void |
onMessage(javax.jms.Message message)
Handles the arrived message |
void |
putEntry(Entry entry)
Send an entry to the JMS server. |
Entry |
queryReply(Entry entry)
This method uses temporary queues/topics to implement the queryReply method. |
void |
reconnect()
Reconnect to the underlying data source. |
void |
selectEntries()
We only start the queue/topic listener thread if we are iterating |
void |
setFactory(javax.jms.ConnectionFactory factory)
Sets topicFactory or queueFactory members of the JMSConnector object If the parameter is instance of TopicConnectionFactory set topicFactory If the parameter is instance of QueueConnectionFactory set queueFactory |
void |
setReadQueue(javax.jms.Queue queue)
Sets the readQueue member of the JMSConnector object |
void |
setSendQueue(javax.jms.Queue queue)
Sets the sendQueue member of the JMSConnector object |
void |
setTopic(javax.jms.Topic topic)
Sets the topic member of the JMSConnector object |
void |
terminate()
Close the connection |
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, getConfiguration, getContext, getFindEntryCount, getFirstFindEntry, getMaxDuplicateEntries, getName, getNextClient, getNextFindEntry, getParam, getPushbackEntry, getRawConnectorConfiguration, isDeltaSupported, isExceptionFatal, isIOException, modEntry, modEntry, pushback, queryOperations, querySchema, reconnect, registerScriptBeans, replyEntry, setConfiguration, setContext, setCurrent, setLog, setMaxDuplicateEntries, setName, setParam, setRSInterface, terminateServer |
Field Detail |
---|
public static final java.lang.String MESSAGE_ATTRIBUTE
public static final java.lang.String JMS_MESSAGE_PROPERTY
public static final java.lang.String JMS_BROKER
public static final java.lang.String JMS_SERVER_CHANNEL
public static final java.lang.String JMS_SSL_SERVER_CHANNEL
public static final java.lang.String JMS_Q_MANAGER
public static final java.lang.String JMS_SSL_USE_FLAG
public static final java.lang.String JMS_SSL_CIPHER
public static final java.lang.String JMS_USERNAME
public static final java.lang.String JMS_PASSWORD
Constructor Detail |
---|
public JMSConnector()
Method Detail |
---|
public javax.jms.Topic getTopic()
public void setTopic(javax.jms.Topic topic)
topic
- The topic valuepublic javax.jms.Queue getQueue()
public javax.jms.Queue getSendQueue()
public javax.jms.Queue getReadQueue()
public void setSendQueue(javax.jms.Queue queue)
queue
- The sendQueue valuepublic void setReadQueue(javax.jms.Queue queue)
queue
- The readQueue valuepublic javax.jms.Session getSession()
public void setFactory(javax.jms.ConnectionFactory factory)
factory
- The TopicConnectionFactory or QueueConnectionFactory objectpublic Entry getNextEntry() throws java.lang.Exception
getNextEntry
in interface ConnectorInterface
getNextEntry
in class Connector
java.lang.Exception
- if the operation does not succeedConnectorInterface.selectEntries()
public java.lang.String acknowledge()
public void terminate()
terminate
in interface ConnectorInterface
terminate
in class Connector
public void initialize(java.lang.Object o) throws java.lang.Exception
initialize
in interface ConnectorInterface
initialize
in class Connector
o
- The mode of the Connector
java.lang.Exception
- if the initialization failspublic void selectEntries() throws java.lang.Exception
selectEntries
in interface ConnectorInterface
selectEntries
in class Connector
java.lang.Exception
- if an exception occurs while listening for messagespublic Entry findEntry(SearchCriteria search) throws java.lang.Exception
findEntry
in interface ConnectorInterface
findEntry
in class Connector
search
- The search criteria for message selection
java.lang.Exception
- Any JMS errorpublic void putEntry(Entry entry) throws java.lang.Exception
putEntry
in interface ConnectorInterface
putEntry
in class Connector
entry
- The entry to send
java.lang.Exception
- If the sending of a message failspublic Entry queryReply(Entry entry) throws java.lang.Exception
queryReply
in interface ConnectorInterface
queryReply
in class Connector
entry
- the entry to send.
java.lang.Exception
- if a JMS exception occurspublic void onMessage(javax.jms.Message message)
onMessage
in interface javax.jms.MessageListener
message
- The received messagepublic javax.jms.Message entry2message(Entry entry) throws java.lang.Exception
entry
- The entry to convert
java.lang.Exception
public java.lang.String getIBMCharset(javax.jms.BytesMessage bytesmessage) throws javax.jms.JMSException
BytesMessage
bytesmessage
- the byte message.
javax.jms.JMSException
- if an error occurs while retrieving the specific property.public Entry message2entry(javax.jms.Message m) throws java.lang.Exception
m
- The JMS message to convert
java.lang.Exception
public java.lang.String getVersion()
getVersion
in interface VersionInfoInterface
public void reconnect() throws java.lang.Exception
The following code could be placed in the 'On Connection lost' hook to
change the connector's ldapUrl
to another server in case
the connection is lost.
Example:
thisConnector.setParam("ldapURL", "ldap://backupserver.acme.com:389"); // reconnect to backup server thisConnector.reconnect();
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 |