@RequiresEnterpriseLicense(allowEval=true) @Connector(name="as400", friendlyName="AS400", minMuleVersion="3.6") public class AS400Connector extends Object
Modifier and Type | Field and Description |
---|---|
protected org.mule.api.MuleContext |
muleContext |
Constructor and Description |
---|
AS400Connector() |
Modifier and Type | Method and Description |
---|---|
void |
commandCall(String cmd)
Execute OS400 (IBM i) command
|
AS400ConnectionStrategy |
getConnectionStrategy() |
IBMiClient |
getiClient() |
String |
getLicenseData()
This method reads CustomLicenseUtils.LICENSE_FILE_NAME and
returns license data.
|
String |
getPublicKeyData(String publicKeyName)
This method reads file
CustomLicenseUtils.LICENSE_FILE_NAME_WITH_PUBLIC_KEY and returns
public key.
|
String |
getSerialN()
This method returns server or LPAR serial number.
|
Map<String,Object> |
programCallProcessor(String programName,
String programLibrary,
String procedureName,
Boolean procedureReturnsValue,
Boolean threadSafe,
List<ProgramCallParameter> parameters)
Implementation of IBM i program call.
|
void |
readDataQueue(org.mule.api.callback.SourceCallback callback,
String dtaq,
String library,
String dtaqKey,
SearchType dtaqKeySearchType,
Boolean peek,
String formatFileName,
String formatFileLibrary)
Listens until the data queue message arrives or the end of
times, whichever comes first.
|
Object |
readDataQueueProcessor(org.mule.api.MuleEvent muleEvent,
String dtaq,
String library,
String dtaqKey,
SearchType dtaqKeySearchType,
int dtaqwaittime,
Boolean peek,
String formatFileName,
String formatFileLibrary)
Data queue message reader - waits for specified period of time until the
message arrives then times out.
|
void |
setConnectionStrategy(AS400ConnectionStrategy connectionStrategy) |
void |
setiClient(IBMiClient iClient) |
void |
setMuleContext(org.mule.api.MuleContext muleContext) |
void |
verifyLicense()
This method checks the license on connector initialization.
|
void |
writeDataQueue(String dtaq,
String library,
String dqEntry,
String dtaqKey,
String formatFileName,
String formatFileLibrary)
Data queue message writer.
|
public IBMiClient getiClient()
public void setiClient(IBMiClient iClient)
@Start public void verifyLicense() throws AS400LicenseException
AS400LicenseException
- when license invalid.@Source(friendlyName="Data Queue Listener", sourceStrategy=POLLING, pollingPeriod=1L) public void readDataQueue(org.mule.api.callback.SourceCallback callback, @Placement(order=1) @FriendlyName(value="Data Queue") String dtaq, @Placement(order=2) String library, @Placement(order=3) @FriendlyName(value="Key") @Summary(value="Only for keyed data queues. If not specified, the data queue is not keyed.") @Optional String dtaqKey, @Placement(order=4) @FriendlyName(value="Key Search Type") @Summary(value="GE (Greater or Equal), GT (Greater Than), LE (Lesser or equal), LT, EQ (Equal), NE (Not Equal) Required if key is specified") @Optional SearchType dtaqKeySearchType, @Placement(order=5) @FriendlyName(value="Keep messages in Queue") @Default(value="false") Boolean peek, @Placement(order=7) @FriendlyName(value="Format File Name") @Optional String formatFileName, @Placement(order=8) @FriendlyName(value="Format File Library") @Optional String formatFileLibrary) throws AS400DataQueueReadException, AS400TransportException
callback
- the callbackdtaq
- the name of data queuelibrary
- the name of librarydtaqKey
- only for keyed data queues. If not specified, the data queue
is not keyeddtaqKeySearchType
- the key search typepeek
- keep messages in queueformatFileName
- Format file (AS400 table) nameformatFileLibrary
- Format file (AS400 table) library nameAS400DataQueueReadException
- if method can't read data from data queueAS400TransportException
- if as400 service or network is unavailable@Processor(friendlyName="Program Call") public Map<String,Object> programCallProcessor(@Placement(order=1) @FriendlyName(value="Program or Service Program Name") String programName, @Placement(order=2) String programLibrary, @Placement(order=3) @FriendlyName(value="Service Program Procedure Name") @Optional String procedureName, @Placement(order=4) @FriendlyName(value="Procedure Returns Value?") @Default(value="false") Boolean procedureReturnsValue, @Placement(order=4) @Default(value="false") Boolean threadSafe, @Placement(order=5) @Optional List<ProgramCallParameter> parameters) throws AS400TransportException, AS400ProgramCallException
programName
- name of the programprogramLibrary
- name of the program libraryprocedureName
- name of service program procedureprocedureReturnsValue
- indicates if procedure returns Integer value (true) or no value (false)threadSafe
- indicator if the program is thread safeparameters
- list of ProgramCallParameter
definitions and value referencesAS400TransportException
- if as400 service or network is unavailableAS400ProgramCallException
- when program call completed in error@Processor(friendlyName="Read Data Queue") public Object readDataQueueProcessor(org.mule.api.MuleEvent muleEvent, @Placement(order=1) @FriendlyName(value="Data Queue") String dtaq, @Placement(order=2) String library, @Placement(order=3) @FriendlyName(value="Key") @Summary(value="Only for keyed data queues. If not specified, the data queue is not keyed.") @Optional String dtaqKey, @Placement(order=4) @FriendlyName(value="Key Search Type") @Summary(value="GE (Greater or Equal), GT (Greater Than), LE (Lesser or equal), LT, EQ (Equal), NE (Not Equal) Required if key is specified") @Optional SearchType dtaqKeySearchType, @Placement(order=5) @FriendlyName(value="Max Wait Time") @Summary(value="Defaults to 0 (don\'t wait if no entries).") @Default(value="0") int dtaqwaittime, @Placement(order=6) @FriendlyName(value="Keep messages in Queue") @Default(value="false") Boolean peek, @Placement(order=7) @FriendlyName(value="Format File Name") @Optional String formatFileName, @Placement(order=8) @FriendlyName(value="Format File Library") @Optional String formatFileLibrary) throws AS400DataQueueReadException, AS400TransportException
muleEvent
- the Mule Eventdtaq
- the name of data queuelibrary
- the name of librarydtaqKey
- the name of keydtaqKeySearchType
- the key search typedtaqwaittime
- the max wait timepeek
- the keep messages in queueformatFileName
- Format file (AS400 table) nameformatFileLibrary
- Format file (AS400 table) library nameAS400DataQueueReadException
- if method can't read data from data queueAS400TransportException
- if as400 service or network is unavailable@Processor public void writeDataQueue(@FriendlyName(value="Data Queue") @Placement(order=1) String dtaq, @Placement(order=2) String library, @Default(value="#[payload]") @FriendlyName(value="Data Entry") @Placement(order=3) String dqEntry, @FriendlyName(value="Key") @Placement(order=4) @Optional String dtaqKey, @Placement(order=5) @FriendlyName(value="Format File Name") @Optional String formatFileName, @Placement(order=6) @FriendlyName(value="Format File Library") @Optional String formatFileLibrary) throws AS400DataQueueWriteException, AS400TransportException
dtaq
- the data queuelibrary
- the name of librarydqEntry
- the data entrydtaqKey
- the keyformatFileName
- Format file (AS400 table) nameformatFileLibrary
- Format file (AS400 table) library nameAS400DataQueueWriteException
- if method can't write data to data queueAS400TransportException
- if as400 service or network is unavailable@Processor(friendlyName="Command Call") public void commandCall(@FriendlyName(value="Command") @Default(value="#[payload]") String cmd) throws AS400CommandCallException, AS400TransportException
cmd
- the AS400 commandAS400CommandCallException
- if method can't call commandAS400TransportException
- if as400 service or network is unavailablepublic AS400ConnectionStrategy getConnectionStrategy()
public String getPublicKeyData(String publicKeyName)
publicKeyName
- the file name witch contains publicKeypublic String getLicenseData()
public String getSerialN()
public void setConnectionStrategy(AS400ConnectionStrategy connectionStrategy)
connectionStrategy
- the connectionStrategy to setpublic void setMuleContext(org.mule.api.MuleContext muleContext)
muleContext
- the muleContext to setCopyright © 2010–2018. All rights reserved.