*
Metamerge logo
Search

Advanced Search
*
*
*
* HOME DOCUMENTS & RESOURCES DOWNLOADS EARLY TECH ACCESS SUPPORT FAQ KNOWN ISSUES OLD VERSIONS

 

*

 


com.architech
Class rscTaskComponent

java.lang.Object
  |
  +--com.architech.rscTaskComponent

public class rscTaskComponent
extends Object

This class is used by the assembly line (rscTask) to wrap an rscConnector object and provide additional functionality over the underlying rscConnector object. All attribute mapping, hook handling is performed by this class.

The underlying rscConnector object is exposed as a property called connector.

Author:
bjorn@metamerge.com

Field Summary
 boolean accumulateDupEntries
          This governs wether multiple lookups are combined into one entry or not.
 rscConnectorInterface connector
          This is the connector we are working with
 rscConnectorInterface input_connector
          This is the input_connector provided as a parameter (to the assembly line)
protected  String name
          This is the connector name as given by the assembly line
protected  com.architech.TaskInterface parent
          This is the parent task (assembly line)
 com.architech.rsStats stats
          This is the statistics object for the connector
 Object value
          This is the "ret.value" object returned by the attribute map
 
Constructor Summary
rscTaskComponent()
          Constructor for the rscTaskComponent object
rscTaskComponent(com.architech.TaskInterface parent, String name, TreeMap config, rscConnectorInterface conn)
          Constructor
 
Method Summary
 void add(Entry meta)
          This method implements the AddOnly mode operation.
 void close()
          This method closes the connector (connector.terminate()) and calls the before/after close hooks.
 void debug(String msg)
          Call logmsg if we have debug messages enabled
 void delete(Entry meta)
          This method implements the Delete mode operation.
 void deleteEntry(Entry meta)
          This method calls the delete method.
 void dumpEntry(Entry meta)
          Deprecated method.
 void expandParameters(com.architech.config.rsConfiguration cf)
          This method expands the connector's parameters.
 Object getConfig(String param)
          This method returns the configuration value for parameter param.
 Object getConnectorParam(String param)
          This method returns the configuration value for the connector's parameter.
 Entry getCurrent()
          Gets the current attribute of the rscTaskComponent object
 boolean getDebug()
          This method returns the the debug mode flag.
 int getDuplicateEntryCount()
          Gets the duplicateEntryCount attribute of the rscTaskComponent object
 Entry getLastReadEntry()
          This method returns the last entry read from the connector.
 String getName()
          This method returns the name assigned to the connector by the assembly line.
 Entry getnext()
          The method returns the next entry from the connector.
 Entry getNextDuplicateEntry()
          Gets the nextDuplicateEntry attribute of the rscTaskComponent object
 String getNullBehavior()
          Returns the null behavior setting for this connector.
 String getNullBehaviorValue()
          Returns the null behavior value for this connector.
 com.architech.rsStats getStats()
          Gets the stats attribute of the rscTaskComponent object
 int getType()
          This method returns the mode in which we are executing (e.g.
 int handleException(String oper, Exception e, Entry meta)
          This method is called by the rscTask.
 void initialize()
          This method initializes the underlying connnector and registers the script beans in the scriptEngine context.
 boolean isEnabled()
          Gets the enabled attribute of the rscTaskComponent object
 boolean isExceptionFatal(Exception e)
          Gets the exceptionFatal attribute of the rscTaskComponent object
 void logmsg(String msg)
          Write a message to the logfile prefixed by this connector's name
 Entry lookup(Entry meta)
          The method is called to lookup an entry using the configured Link Criteria.
 Entry lookup(String attribute, String value)
          The method is called to lookup an entry using exact matching for attribute and value.
 void modify(Entry old, Entry meta)
          This method implements the Modify operation (called by Update)
 void pushback(Entry entry)
          This method pushes an entry back to the connector.
 void setCurrent(Entry current)
          Sets the current attribute of the rscTaskComponent object
 void setDebug(boolean debug)
          This method sets the the debug mode flag.
 void setDuplicateEntryCount(int maxdup)
          Sets the duplicateEntryCount attribute of the rscTaskComponent object
 void setErrorObject(String oper, String reason)
          Sets the errorObject attribute of the rscTaskComponent object
 void showDebug(String str, String oper, Entry work, Entry conn)
          Description of the Method
 boolean trigger(String oper)
          Description of the Method
 boolean trigger(String oper, Entry work, Entry conn)
          Description of the Method
 void update(Entry meta)
          This method implements the Update mode operation.
 boolean willExecute(Entry work)
          Return true/false if this component should be executed.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

input_connector

public rscConnectorInterface input_connector
This is the input_connector provided as a parameter (to the assembly line)

connector

public rscConnectorInterface connector
This is the connector we are working with

stats

public com.architech.rsStats stats
This is the statistics object for the connector

value

public Object value
This is the "ret.value" object returned by the attribute map

accumulateDupEntries

public boolean accumulateDupEntries
This governs wether multiple lookups are combined into one entry or not.

name

protected String name
This is the connector name as given by the assembly line

parent

protected com.architech.TaskInterface parent
This is the parent task (assembly line)
Constructor Detail

rscTaskComponent

public rscTaskComponent(com.architech.TaskInterface parent,
                        String name,
                        TreeMap config,
                        rscConnectorInterface conn)
                 throws Exception
Constructor
Parameters:
parent - Description of Parameter
name - Description of Parameter
config - Description of Parameter
conn - Description of Parameter
Throws:
Exception - Description of Exception

rscTaskComponent

public rscTaskComponent()
Constructor for the rscTaskComponent object
Method Detail

setCurrent

public void setCurrent(Entry current)
Sets the current attribute of the rscTaskComponent object
Parameters:
current - The new current value

setDebug

public void setDebug(boolean debug)
This method sets the the debug mode flag.
Parameters:
debug - True to enable debug, false to disable

setErrorObject

public void setErrorObject(String oper,
                           String reason)
Sets the errorObject attribute of the rscTaskComponent object
Parameters:
oper - The new errorObject value
reason - The new errorObject value

setDuplicateEntryCount

public void setDuplicateEntryCount(int maxdup)
Sets the duplicateEntryCount attribute of the rscTaskComponent object
Parameters:
maxdup - The new duplicateEntryCount value

getName

public String getName()
This method returns the name assigned to the connector by the assembly line.
Returns:
The name of this connector (in scripting terms)

getCurrent

public Entry getCurrent()
Gets the current attribute of the rscTaskComponent object
Returns:
The current value

getConfig

public Object getConfig(String param)
This method returns the configuration value for parameter param.
Parameters:
param - The parameter name
Returns:
The object associated with parameter name

getConnectorParam

public Object getConnectorParam(String param)
This method returns the configuration value for the connector's parameter.
Parameters:
param - The parameter name
Returns:
The object associated with parameter name

getDebug

public boolean getDebug()
This method returns the the debug mode flag.
Returns:
True if debug is enabled, false otherwise

getType

public int getType()
This method returns the mode in which we are executing (e.g. Iterator, update etc..). public final static int TYPE_ITERATOR = 0; public final static int TYPE_UPDATE = 1; public final static int TYPE_LOOKUP = 2; public final static int TYPE_DELETE = 3; public final static int TYPE_ADDONLY = 4; public final static int TYPE_PASSIVE = 5;
Returns:
The integer value corresponding to the execution mode

getLastReadEntry

public Entry getLastReadEntry()
This method returns the last entry read from the connector.
Returns:
The last input entry

getnext

public Entry getnext()
              throws Exception
The method returns the next entry from the connector. It is called by the assembly line if we are working in Iterator mode.
Returns:
The next input entry or null if there are no more entries
Throws:
Exception - Description of Exception

getStats

public com.architech.rsStats getStats()
Gets the stats attribute of the rscTaskComponent object
Returns:
The stats value

isExceptionFatal

public boolean isExceptionFatal(Exception e)
Gets the exceptionFatal attribute of the rscTaskComponent object
Parameters:
e - Description of Parameter
Returns:
The exceptionFatal value

getDuplicateEntryCount

public int getDuplicateEntryCount()
Gets the duplicateEntryCount attribute of the rscTaskComponent object
Returns:
The duplicateEntryCount value

getNextDuplicateEntry

public Entry getNextDuplicateEntry()
                            throws Exception
Gets the nextDuplicateEntry attribute of the rscTaskComponent object
Returns:
The nextDuplicateEntry value
Throws:
Exception - Description of Exception

isEnabled

public boolean isEnabled()
Gets the enabled attribute of the rscTaskComponent object
Returns:
The enabled value

getNullBehavior

public String getNullBehavior()
Returns the null behavior setting for this connector.
Returns:
The nullBehavior value

getNullBehaviorValue

public String getNullBehaviorValue()
Returns the null behavior value for this connector.
Returns:
The nullBehaviorValue value

close

public void close()
This method closes the connector (connector.terminate()) and calls the before/after close hooks.

willExecute

public boolean willExecute(Entry work)
                    throws Exception
Return true/false if this component should be executed.
Parameters:
work - Description of Parameter
Returns:
Description of the Returned Value
Throws:
Exception - Description of Exception

initialize

public void initialize()
                throws Exception
This method initializes the underlying connnector and registers the script beans in the scriptEngine context.
Throws:
Exception - Description of Exception

pushback

public void pushback(Entry entry)
This method pushes an entry back to the connector. The entry is returned the next time connector.getNextEntry() is called.
Parameters:
entry - Description of Parameter

lookup

public Entry lookup(String attribute,
                    String value)
             throws Exception
The method is called to lookup an entry using exact matching for attribute and value.
Parameters:
attribute - The attribute name to search
value - The attribute value
Returns:
The entry found or null if no entries or more than one entry was found.
Throws:
Exception - Description of Exception

lookup

public Entry lookup(Entry meta)
             throws Exception
The method is called to lookup an entry using the configured Link Criteria. The link criteria is applied using meta as source for variable substitution. If you allow duplicate entries by configuration, the method will return null only when no entries have been found.
Parameters:
meta - The entry object providing values for variable substitution.
Returns:
The entry found or null if no entries or more than one entry was found.
Throws:
Exception - Description of Exception

deleteEntry

public void deleteEntry(Entry meta)
                 throws Exception
This method calls the delete method. It is included since JavaScript and possibly other scripting languages choke on the "delete" keyword.
Parameters:
meta - The work object to use for the link criteria
Throws:
Exception - Any Exception

delete

public void delete(Entry meta)
            throws Exception
This method implements the Delete mode operation.
Parameters:
meta - Description of Parameter
Throws:
Exception - Description of Exception

update

public void update(Entry meta)
            throws Exception
This method implements the Update mode operation.
Parameters:
meta - The work entry
Throws:
Exception - Any Exception

modify

public void modify(Entry old,
                   Entry meta)
            throws Exception
This method implements the Modify operation (called by Update)
Parameters:
old - The current entry in the destination system
meta - The new entry to use in the attribute map
Throws:
Exception - Any Exception

add

public void add(Entry meta)
         throws Exception
This method implements the AddOnly mode operation.
Parameters:
meta - The work entry to add
Throws:
Exception - Description of Exception

dumpEntry

public void dumpEntry(Entry meta)
               throws Exception
Deprecated method.
Parameters:
meta - Description of Parameter
Throws:
Exception - Description of Exception

logmsg

public void logmsg(String msg)
Write a message to the logfile prefixed by this connector's name
Parameters:
msg - Description of Parameter

debug

public void debug(String msg)
Call logmsg if we have debug messages enabled
Parameters:
msg - Description of Parameter

handleException

public int handleException(String oper,
                           Exception e,
                           Entry meta)
                    throws Exception
This method is called by the rscTask. The oper is either any of the standard modes or "default". If the exception parameter is null the "_ok" trigger is called, else the mode error hook is called. If the mode error hook is undefined then the "default" error hook is called.
Parameters:
oper - Hook prefix
e - Error or null for no error
meta - No longer used (used to be the work entry)
Returns:
A constant to signal termination, continue etc ...
Throws:
Exception - Any Exception

showDebug

public void showDebug(String str,
                      String oper,
                      Entry work,
                      Entry conn)
               throws Exception
Description of the Method
Parameters:
str - Description of Parameter
oper - Description of Parameter
work - Description of Parameter
conn - Description of Parameter
Throws:
Exception - Description of Exception

trigger

public boolean trigger(String oper,
                       Entry work,
                       Entry conn)
                throws Exception
Description of the Method
Parameters:
oper - Description of Parameter
work - Description of Parameter
conn - Description of Parameter
Returns:
Description of the Returned Value
Throws:
Exception - Description of Exception

trigger

public boolean trigger(String oper)
                throws Exception
Description of the Method
Parameters:
oper - Description of Parameter
Returns:
Description of the Returned Value
Throws:
Exception - Description of Exception

expandParameters

public void expandParameters(com.architech.config.rsConfiguration cf)
                      throws Exception
This method expands the connector's parameters. Parameters may contain executable script code rather than static values.
Parameters:
cf - The configuration object
Throws:
Exception - Description of Exception


Copyright © 1999-2001 Metamerge AS. All Rights Reserved.
*

 

  Metamerge Integrator version 4.6 ©Copyright Metamerge AS 2000-2002 Last edited 2002-05-07 contact us