com.ibm.di.connector.maximo.core
Class AbstractMxConnMode

java.lang.Object
  extended by com.ibm.di.connector.maximo.core.AbstractMxConnMode
Direct Known Subclasses:
MxConnAddOnly, MxConnDelete, MxConnIterator, MxConnSync, MxConnUpdate

public abstract class AbstractMxConnMode
extends java.lang.Object

This class provides a base implementation to minimize the effort required to implement a specific connector's mode.

Since:
7.1
See Also:
HttpClient, MxConnConfiguration

Field Summary
static java.lang.String ACTION_ATTR
           
static java.lang.String ACTION_ATTR_PREFIXED
           
static java.lang.String ADD_ACTION
           
static java.lang.String ADDCHANGE_ACTION
           
static java.lang.String CHANGE_ACTION
           
static java.lang.String CHANGED_ATTR
           
static java.lang.String DELETE_ACTION
           
protected  Log logger
          Logger used by the connector.
static java.lang.String REPLACE_ACTION
           
 
Constructor Summary
AbstractMxConnMode(MxConnConfiguration cfg, Log log)
          Constructs an AbstractMxConnMode.
 
Method Summary
protected  MxConnConfiguration getCfg()
          Returns the connector configuration object.
protected  java.lang.String post(TemplateLoader tlp, java.util.List<java.lang.String> enterpriseServiceUrlList)
          Posts the message extracted from the specified template to the given Maximo Enterprise Service.
protected  void setCreation(long creation)
          Defines the creation date/time to be set before posting a message.
protected  void setMessageId(java.lang.String messageId)
          Defines the message ID to be set before posting a message.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

CHANGED_ATTR

public static final java.lang.String CHANGED_ATTR
See Also:
Constant Field Values

ACTION_ATTR

public static final java.lang.String ACTION_ATTR
See Also:
Constant Field Values

ACTION_ATTR_PREFIXED

public static final java.lang.String ACTION_ATTR_PREFIXED
See Also:
Constant Field Values

ADD_ACTION

public static final java.lang.String ADD_ACTION
See Also:
Constant Field Values

CHANGE_ACTION

public static final java.lang.String CHANGE_ACTION
See Also:
Constant Field Values

DELETE_ACTION

public static final java.lang.String DELETE_ACTION
See Also:
Constant Field Values

ADDCHANGE_ACTION

public static final java.lang.String ADDCHANGE_ACTION
See Also:
Constant Field Values

REPLACE_ACTION

public static final java.lang.String REPLACE_ACTION
See Also:
Constant Field Values

logger

protected Log logger
Logger used by the connector.

Constructor Detail

AbstractMxConnMode

public AbstractMxConnMode(MxConnConfiguration cfg,
                          Log log)
Constructs an AbstractMxConnMode.

Parameters:
cfg - the connector configuration object
log - logger of the connector
Method Detail

getCfg

protected final MxConnConfiguration getCfg()
Returns the connector configuration object.

Returns:
connector configuration object

post

protected final java.lang.String post(TemplateLoader tlp,
                                      java.util.List<java.lang.String> enterpriseServiceUrlList)
                               throws MxConnectorException
Posts the message extracted from the specified template to the given Maximo Enterprise Service. Before posting the message, some common properties are defined in the template, such as creation.date.time, message.id, and maximo.version.

Parameters:
tlp - template from which the message will be extracted and posted
enterpriseServiceUrlList - list of Maximo enterprise service URLs that will handle the message
Returns:
the response sent back by the Maximo Enterprise Service
Throws:
MxConnectorException - if any sort of communication problem occurs
See Also:
setMessageId(String)

setCreation

protected final void setCreation(long creation)
Defines the creation date/time to be set before posting a message. If no date/time is defined, the current date/time is used.

Parameters:
creation - creation date/time to be set before posting a message, expressed as milliseconds
See Also:
post(TemplateLoader, List)

setMessageId

protected final void setMessageId(java.lang.String messageId)
Defines the message ID to be set before posting a message. If no message ID is defined, the current date/time expressed as milliseconds is used. Note: Not used

Parameters:
messageId - message ID to be set before posting the message
See Also:
post(TemplateLoader, List)