org.mule.transport.legstar.cixs.transformer
Class AbstractHostToExecRequestMuleTransformer

java.lang.Object
  extended by org.mule.transformer.AbstractTransformer
      extended by org.mule.transformer.AbstractMessageTransformer
          extended by org.mule.transport.legstar.transformer.AbstractHostMuleTransformer
              extended by org.mule.transport.legstar.cixs.transformer.AbstractHostToExecRequestMuleTransformer
All Implemented Interfaces:
org.mule.api.AnnotatedObject, org.mule.api.context.MuleContextAware, org.mule.api.lifecycle.Disposable, org.mule.api.lifecycle.Initialisable, org.mule.api.NameableObject, org.mule.api.NamedObject, org.mule.api.processor.MessageProcessor, org.mule.api.transformer.MessageTransformer, org.mule.api.transformer.Transformer, org.mule.endpoint.EndpointAware
Direct Known Subclasses:
HostToLegstarExecRequestMuleTransformer, HostToMqcihExecRequestMuleTransformer

public abstract class AbstractHostToExecRequestMuleTransformer
extends AbstractHostMuleTransformer

Code common to host to transformers that produce mainframe program execution requests.

Source data is already in mainframe format. These transformers wrap that mainframe payload into a messaging envelope understood by the target execution environment on the mainframe.


Nested Class Summary
 
Nested classes/interfaces inherited from class org.mule.transport.legstar.transformer.AbstractHostMuleTransformer
AbstractHostMuleTransformer.HolderGetter, AbstractHostMuleTransformer.HolderSetter
 
Field Summary
static String LEGSTAR_HOST_TRACE_ON_KEY
          Property name that holds true if mainframe should trace execution requests.
 
Fields inherited from class org.mule.transformer.AbstractTransformer
encoding, endpoint, logger, mimeType, MULE_MESSAGE_DATA_TYPE, muleContext, name, returnType, sourceTypes
 
Fields inherited from interface org.mule.api.lifecycle.Initialisable
PHASE_NAME
 
Fields inherited from interface org.mule.api.lifecycle.Disposable
PHASE_NAME
 
Fields inherited from interface org.mule.api.AnnotatedObject
PROPERTY_NAME
 
Constructor Summary
AbstractHostToExecRequestMuleTransformer()
          Constructor registers source and return classes.
 
Method Summary
 String getHostCompatibleCorrelationId(String id)
          Creates a correlation ID that is compatible with mainframe transports.
 HostProgram getHostProgram()
           
 String getReplyTo()
           
 Object hostTransform(org.mule.api.MuleMessage esbMessage, String outputEncoding)
          Specialized classes perform the actual transformation.
 boolean isHostTraceOn()
           
 void setHostProgram(HostProgram hostProgram)
           
 void setHostTraceOn(boolean traceOn)
           
abstract  void setMessageProperties(org.mule.api.MuleMessage esbMessage)
          Allows derived classes to set additional properties on the esb message.
 void setReplyTo(String to)
           
abstract  byte[] wrapHostData(byte[] hostData, org.mule.api.MuleMessage esbMessage)
          This method wraps a single part payload into a mainframe program execution request message.
abstract  byte[] wrapHostData(Map<String,byte[]> hostDataMap, org.mule.api.MuleMessage esbMessage)
          If the mainframe is expecting a formatted mainframe program execution request message, this method wraps a multi part payloads into a mainframe program execution request message.
 
Methods inherited from class org.mule.transport.legstar.transformer.AbstractHostMuleTransformer
getHostCharset, getHostCharset, getI18NMessages, setHostCharset, transformMessage
 
Methods inherited from class org.mule.transformer.AbstractMessageTransformer
checkReturnClass, doTransform, isSourceDataTypeSupported, transform, transform, transform
 
Methods inherited from class org.mule.transformer.AbstractTransformer
dispose, generateTransformerName, getAnnotation, getAnnotations, getEncoding, getEncoding, getEndpoint, getMimeType, getName, getReturnClass, getReturnDataType, getSourceDataTypes, getSourceTypes, initialise, isAcceptNull, isAllowNullReturn, isConsumed, isIgnoreBadInput, isSourceDataTypeSupported, isSourceTypeSupported, isSourceTypeSupported, process, registerSourceType, registerSourceType, setAllowNullReturn, setAnnotations, setEncoding, setEndpoint, setIgnoreBadInput, setMimeType, setMuleContext, setName, setReturnClass, setReturnDataType, toString, transform, unregisterSourceType, unregisterSourceType
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.mule.api.transformer.Transformer
getEncoding, getEndpoint, getMimeType, getReturnClass, getReturnDataType, getSourceDataTypes, getSourceTypes, isAcceptNull, isIgnoreBadInput, isSourceDataTypeSupported, isSourceTypeSupported, setReturnClass, setReturnDataType, transform
 
Methods inherited from interface org.mule.api.processor.MessageProcessor
process
 
Methods inherited from interface org.mule.api.lifecycle.Initialisable
initialise
 
Methods inherited from interface org.mule.api.lifecycle.Disposable
dispose
 
Methods inherited from interface org.mule.api.NameableObject
setName
 
Methods inherited from interface org.mule.api.NamedObject
getName
 
Methods inherited from interface org.mule.api.context.MuleContextAware
setMuleContext
 
Methods inherited from interface org.mule.endpoint.EndpointAware
setEndpoint
 

Field Detail

LEGSTAR_HOST_TRACE_ON_KEY

public static final String LEGSTAR_HOST_TRACE_ON_KEY
Property name that holds true if mainframe should trace execution requests.

See Also:
Constant Field Values
Constructor Detail

AbstractHostToExecRequestMuleTransformer

public AbstractHostToExecRequestMuleTransformer()
Constructor registers source and return classes.

Method Detail

hostTransform

public Object hostTransform(org.mule.api.MuleMessage esbMessage,
                            String outputEncoding)
                     throws org.mule.api.transformer.TransformerException
Specialized classes perform the actual transformation.

Specified by:
hostTransform in class AbstractHostMuleTransformer
Parameters:
esbMessage - the Mule message
outputEncoding - the payload encoding
Returns:
the transformed payload
Throws:
org.mule.api.transformer.TransformerException - if transform fails

wrapHostData

public abstract byte[] wrapHostData(byte[] hostData,
                                    org.mule.api.MuleMessage esbMessage)
                             throws org.mule.api.transformer.TransformerException
This method wraps a single part payload into a mainframe program execution request message.

Parameters:
hostData - the single part mainframe payload
esbMessage - the original mule message
Returns:
the payload eventually wrapped in a mainframe program execution request message
Throws:
org.mule.api.transformer.TransformerException - if wrapping fails

wrapHostData

public abstract byte[] wrapHostData(Map<String,byte[]> hostDataMap,
                                    org.mule.api.MuleMessage esbMessage)
                             throws org.mule.api.transformer.TransformerException
If the mainframe is expecting a formatted mainframe program execution request message, this method wraps a multi part payloads into a mainframe program execution request message.

Parameters:
hostDataMap - the multi part mainframe payload (one entry per container)
esbMessage - the original mule message
Returns:
the payload eventually wrapped in a mainframe program execution request message
Throws:
org.mule.api.transformer.TransformerException - if wrapping fails

setMessageProperties

public abstract void setMessageProperties(org.mule.api.MuleMessage esbMessage)
Allows derived classes to set additional properties on the esb message.

Parameters:
esbMessage - the original mule message

getHostCompatibleCorrelationId

public String getHostCompatibleCorrelationId(String id)
Creates a correlation ID that is compatible with mainframe transports. The rules applied are those of WMQ, the main consumer of correlation IDs.

Parameters:
id - the ID as Mule would have it
Returns:
the ID as the mainframe would propagate it

getHostProgram

public HostProgram getHostProgram()
Returns:
target mainframe program attributes

setHostProgram

public void setHostProgram(HostProgram hostProgram)
Parameters:
hostProgram - target mainframe program attributes

getReplyTo

public String getReplyTo()
Returns:
reply URL. This is useful when the request needs to instruct the mainframe on where to store the reply

setReplyTo

public void setReplyTo(String to)
Parameters:
to - reply URL. This is useful when the request needs to instruct the mainframe on where to store the reply

isHostTraceOn

public boolean isHostTraceOn()
Returns:
true if mainframe server is to produce detailed traces

setHostTraceOn

public void setHostTraceOn(boolean traceOn)
Parameters:
traceOn - true if mainframe server is to produce detailed traces


Copyright © 2013 LegSem. All Rights Reserved.