|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.openadaptor.adaptor.SimpleComponent
org.openadaptor.adaptor.AbstractSimplePipe
org.openadaptor.adaptor.standard.AliasingPipeSegment
public class AliasingPipeSegment
Creates a new DataObject array from the supplied DataObject array with certain attributes 'aliased' - that is, renamed as directed by the configuration (properties) file.
Aliases are to be supplied in the config file as follows:
xxx.Alias1 = inName outName
xxx.Alias2 = inName outName
or (for explicit type aliasing)
xxx.Type1 = inType outType
xxx.Type1.Alias1 = inName outName [SDO Type name]
xxx.Type1.Alias2 = inName outName [SDO Type name]
or (for predicate based aliasing type/attribute values), this uses SimpleDOPredicate objects.
xxx.Type1 = outType
xxx.Type1.Type = inType
xxx.Type1.AttName1 = att name
xxx.Type1.AttValue1 = att value
or xxx.Type1.AttRegExprValue1 = att reg expression
xxx.Type1.Alias1 = inName outName [SDO Type name]
xxx.Type1.Alias2 = inName outName [SDO Type name]
the optional third parameter is a class name for the value object created. If the incoming value is not of the class specified the pipe will attempt to instantiate a new value of the specified class using
Also support dataObjectType caching (rather then creating simple data type everytime. use following property but be careful that no down stream components do not modify types directly by calling addAttributeValue().
xxx.CacheTypes = [false | true] default is false
| Nested Class Summary | |
|---|---|
class |
AliasingPipeSegment.AliasMapping
structure class to hold all the stuff needed for aliasing |
class |
AliasingPipeSegment.AliasParser
|
| Nested classes/interfaces inherited from class org.openadaptor.adaptor.SimpleComponent |
|---|
SimpleComponent.StateHolder |
| Field Summary | |
|---|---|
protected java.util.Hashtable |
_alias_mappings
The hashtable use to map incoming dataobjects an AliasMapping object. |
protected java.util.Hashtable |
_mapping_keys
hashtable for lookup on "Type1", "Type2" etc. |
protected boolean |
_old_style_alias
flag to denote really old style alias that do nor require you to define a type or predicate mapping |
protected DOPredicate[] |
_predicates
The array of DOPredicates to check |
protected java.util.Hashtable |
_type_cache
cache of Simple data object types, index on predicate or type name |
(package private) static org.apache.log4j.Logger |
log
|
| Fields inherited from class org.openadaptor.adaptor.AbstractSimplePipe |
|---|
_continue_on_exception, _deepCopy, _deepCopyOnlySDO, _disruptive |
| Fields inherited from class org.openadaptor.adaptor.SimpleComponent |
|---|
_controller, _formatter, _name, _propsPrefix, _readerDelegate, _textEncoding, MESSAGE_WRITER_PREFIX, MESSAGEID_ATTR, TEXT_ENCODING_ATTR |
| Constructor Summary | |
|---|---|
AliasingPipeSegment()
|
|
| Method Summary | |
|---|---|
protected void |
checkAlias(DataObject outDob)
Check the integrity of the aliased DataObject This is an empty implementation, it will never throw an exception. |
protected DataObject |
createAlias(DataObject inDob)
Deprecated. |
protected DataObject |
createAlias(DataObject inDob,
java.lang.Object key)
Return alias dataobject type for given type Override this if you want to create your own outgoing dataobjects |
protected java.util.Vector |
getAliasAttributes(DataObject dob)
Deprecated. |
protected java.util.Vector |
getAliasAttributes(DataObject inDob,
java.lang.Object key)
Returns a vector of alias attributes |
protected java.util.Hashtable |
getAttributeMappings(DataObject dob)
Deprecated. |
protected java.util.Hashtable |
getAttributeMappings(DataObject inDob,
java.lang.Object key)
Returns a hashtable of attribute mappings |
protected java.util.Hashtable |
getAttributeTypes(DataObject inDob,
java.lang.Object key)
Returns a hashtable of attribute mappings |
protected java.lang.Object |
getMapKey(DataObject dob)
return key for AliasMapping object |
void |
init(java.lang.String name,
java.util.Properties props,
java.lang.String prefix,
Controller controller)
Calls super.init(), then gets all the aliasing information from the supplied properties |
protected void |
setAliasAttributeValue(java.lang.String attName,
java.lang.String aliasAttName,
DataObject inDob,
DataObject aliasDob)
Deprecated. |
protected void |
setAliasAttributeValue(java.lang.String attName,
java.lang.String aliasAttName,
DataObject inDob,
DataObject aliasDob,
java.lang.Object map_key)
set attribute value of AliasDO Override this if you want to do translations |
protected DataObject[] |
transformDataObjects(DataObject[] inDobs)
Creates a new array of DataObjects, identical to the supplied array except that attribute names are aliased according to the configuration information. |
void |
txnCommitWithExceptions(Message m)
this enables component to commit a transaction where exceptions have been thrown but trapped and marked in the message, component is stateless so this is fine |
| Methods inherited from class org.openadaptor.adaptor.AbstractSimplePipe |
|---|
canUpdateWhileRunning, getAsProperties, postProcessMessage, processHospitalException, processMessage, setDeepCopy, setDeepCopyUnlessSet, setDisruptive, setFromProperties |
| Methods inherited from class org.openadaptor.adaptor.SimpleComponent |
|---|
addCallback, cleanUp, customControl, didReceiveMessage, getCallbackManager, getCurrentState, getCustomControlProperties, getLastUID, getName, getProperty, getProperty, getPropsPrefix, getRequestedState, getSecurityManager, getStatus, getTextEncoding, getXMLFormatter, notifyEvent, pause, removeCallback, resume, setCallbackManager, setCallbackManager, setCurrentState, setFromProperties, setFromResource, setName, setPropsPrefix, setRequestedState, terminate, txnBegin, txnCommit, txnRollback, txnRollback, waitForRequestedStateChange |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface org.openadaptor.adaptor.Component |
|---|
cleanUp, customControl, getName, getPropsPrefix, getRequestedState, getStatus, pause, resume, setName, setPropsPrefix, terminate |
| Methods inherited from interface org.openadaptor.adaptor.IbafTransactionalResource |
|---|
txnBegin, txnCommit, txnRollback, txnRollback |
| Methods inherited from interface org.openadaptor.adaptor.Configurable |
|---|
setFromProperties |
| Methods inherited from interface org.openadaptor.adaptor.CallbackProvider |
|---|
addCallback, getCallbackManager, notifyEvent, removeCallback, setCallbackManager, setCallbackManager |
| Field Detail |
|---|
static org.apache.log4j.Logger log
protected java.util.Hashtable _alias_mappings
protected java.util.Hashtable _mapping_keys
protected boolean _old_style_alias
protected DOPredicate[] _predicates
protected java.util.Hashtable _type_cache
| Constructor Detail |
|---|
public AliasingPipeSegment()
| Method Detail |
|---|
public void init(java.lang.String name,
java.util.Properties props,
java.lang.String prefix,
Controller controller)
throws IbafException
init in interface Componentinit in class AbstractSimplePipename - The name to be given to the componentprops - The properties object from which the component can glean its config informationprefix - The component's property prefixcontroller - The component's controller object
IbafException - if initialization failsAbstractSimpleSink.init(String,Properties,String,Controller),
CheckMandatory.init(String,Properties,String,Controller)protected java.lang.Object getMapKey(DataObject dob)
protected DataObject createAlias(DataObject inDob)
throws PipelineException
PipelineException
protected DataObject createAlias(DataObject inDob,
java.lang.Object key)
throws PipelineException
PipelineException
protected java.util.Vector getAliasAttributes(DataObject dob)
throws PipelineException
PipelineException
protected java.util.Vector getAliasAttributes(DataObject inDob,
java.lang.Object key)
throws PipelineException
PipelineException
protected java.util.Hashtable getAttributeMappings(DataObject dob)
throws PipelineException
PipelineException
protected java.util.Hashtable getAttributeMappings(DataObject inDob,
java.lang.Object key)
throws PipelineException
PipelineException
protected java.util.Hashtable getAttributeTypes(DataObject inDob,
java.lang.Object key)
throws PipelineException
PipelineException
protected void setAliasAttributeValue(java.lang.String attName,
java.lang.String aliasAttName,
DataObject inDob,
DataObject aliasDob)
throws PipelineException
PipelineException
protected void setAliasAttributeValue(java.lang.String attName,
java.lang.String aliasAttName,
DataObject inDob,
DataObject aliasDob,
java.lang.Object map_key)
throws PipelineException
PipelineException
protected void checkAlias(DataObject outDob)
throws PipelineException
PipelineException
protected DataObject[] transformDataObjects(DataObject[] inDobs)
throws PipelineException
transformDataObjects in class AbstractSimplePipePipelineException - if any part of the aliasing failsAbstractSimplePipe.processMessage(Message)
public void txnCommitWithExceptions(Message m)
throws IbafException
txnCommitWithExceptions in interface IbafTransactionalResourcetxnCommitWithExceptions in class SimpleComponentIbafException - If fails to commit the transactionController.txnCommit(Source)
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||