public interface AmiMethodInterface
When the monitoring agent sends a method invocation, this invocation is
the request. The AMI Java API convert this invocation request into a
call to the application onInvoke method. When onInvoke
returns, its result is converted into a reply message and sent back to the
original agent that made the request.
Modifier and Type | Method and Description |
---|---|
AmiParameterList |
getArguments()
Gets the parameter list that describes the input parameters of this
AMI method.
|
java.lang.String |
getHelp()
Gets the help text that describes the functionality of this AMI method.
|
java.lang.String[] |
getIndexName()
Gets the index parameter name of this method.
|
java.lang.String |
getName()
Gets the name of this AMI method.
|
AmiParameterList |
getReturns()
Gets the parameter list that describes the output parameters of this
AMI method.
|
AmiSession |
getSession()
Gets the AMI session that owns this AMI method.
|
int |
getTimeout()
Gets the timeout period for this AMI method.
|
AmiMethodType |
getType()
Gets the type of this AMI method.
|
AmiParameterList |
onInvoke(AmiParameterList args)
The onInvoke implements the method actions when this AMI method
is invoked by TIB/Hawk Agent.
|
void |
setIndexName(java.lang.String indexName)
Sets the AMI method's index parameter name.
|
void |
setIndexName(java.lang.String[] indexName)
Sets the AMI method's index parameter names - for composite index.
|
void |
setSession(AmiSession ami)
Sets the AMI session object this method is to be associated with.
|
void setSession(AmiSession ami) throws AmiException
ami
- The AMI session object this method is to be associated with.
An AMI method can only be associated with one AMI session. An exception should be thrown if the user attempts to associate an AMI method to an AMI session the second time.
AmiException
AmiSession getSession()
void setIndexName(java.lang.String indexName)
indexName
- Name of the parameter that serves as the index.
void setIndexName(java.lang.String[] indexName)
indexName
- Names of the parameters that serve as the index.
java.lang.String getName()
java.lang.String getHelp()
AmiMethodType getType()
Possible return values can only be one of the following static objects:
AmiConstants.METHOD_TYPE_INFO
AmiConstants.METHOD_TYPE_ACTION
AmiConstants.METHOD_TYPE_ACTION_INFO
int getTimeout()
If this method has the possibility to take a long time to return, then one would want to set and return a timeout value that is the worse case scenario.
java.lang.String[] getIndexName()
When a method returns mutiple rows of data, it is important to indicate
an index parameter name. This method should return null
if
this AMI method does not return multiple rows of data.
AmiParameterList getArguments()
null
should be returned, if this method does not accept
any parameters.
AmiParameterList getReturns()
null
should be returned, if this method does not return
any output parameters. This is usually the case if this AMI method
is a ACTION
method.
AMI method of type AmiConstants.METHOD_TYPE_INFO
and
AmiConstants.METHOD_TYPE_ACTION_INFO
are required to
return a non-null and non-empty list of output parameter list.
AmiParameterList onInvoke(AmiParameterList args) throws java.lang.Exception
args
- List of arguments of same type as defined in
getArguments()
, except that each parameter in
the list contains the corresponding input values.java.lang.Exception
- The application is allowed to throw any Exception
object from this method where the text message of the Exception will be
used by the AMI API as the method invocation reply.
Note that AmiException thrown from this method is capture by the AMI Java API and is turned into an error reply. This error reply is sent back to the invoking Agent as the result of the method invocation.
Copyright © 2000-2019 TIBCO Inc. All Rights Reserved.