public abstract class MHawkMethod
extends java.lang.Object
The application is to register an object to be monitored. The monitored object should contain a method where:
String
, Boolean
,
Integer
, or Float
.
Alternatively, the object's method can take a single parameter of type
MTree
which contains the input
parameters indexed by name.
The return value of the object's method can be a primitive value of type
string
, boolean
, integer
, real
.
This value should match a single output
parameter defined by the Hawk method description.
The other valid returned value type is an MTree
. The tree can be structured
in 2 ways.
string "", boolean true, integer 0, real 0.0
. Modifier and Type | Class and Description |
---|---|
static interface |
MHawkMethod.MethodType
This interface encapsulates the method types.
|
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
OPT_METH_START_ASYNC |
static java.lang.String |
OPT_METH_START_REPEAT |
static java.lang.String |
OPT_METH_STOP_REPEAT |
static java.lang.String |
REQ_METH_DESCRIBE |
static java.lang.String |
REQ_METH_HEARTBEAT |
static java.lang.String |
SUBJ_IMPLANT_MSG |
static java.lang.String |
SUBJ_IMPLANT_START |
static java.lang.String |
SUBJ_IMPLANT_STOP |
static java.lang.String |
SUBJ_MGR_DISCOVERY |
Modifier and Type | Method and Description |
---|---|
MHawkParameter |
addInputBooleanParameter(java.lang.String pName,
java.lang.String helpStr,
java.util.Vector valChoices,
java.util.Vector legalChoices)
Create an input boolean parameter and add to this method's list of input.
|
MHawkParameter |
addInputIntegerParameter(java.lang.String pName,
java.lang.String helpStr,
java.util.Vector valChoices,
java.util.Vector legalChoices)
Create an input integer parameter and add to this method's list of input.
|
MHawkParameter |
addInputRealParameter(java.lang.String pName,
java.lang.String helpStr,
java.util.Vector valChoices,
java.util.Vector legalChoices)
Create an input real parameter and add to this method's list of input.
|
MHawkParameter |
addInputStringParameter(java.lang.String pName,
java.lang.String helpStr,
java.util.Vector valChoices,
java.util.Vector legalChoices)
Create an input string parameter and add to this method's list of input.
|
MHawkParameter |
addOutputBooleanParameter(java.lang.String pName,
java.lang.String helpStr,
java.lang.Boolean sample)
Create an output boolean parameter and add to this method's list of output.
|
MHawkParameter |
addOutputIntegerParameter(java.lang.String pName,
java.lang.String helpStr,
java.lang.Integer sample)
Create an output integer parameter and add to this method's list of output.
|
MHawkParameter |
addOutputRealParameter(java.lang.String pName,
java.lang.String helpStr,
java.lang.Double sample)
Create an output real parameter and add to this method's list of output.
|
MHawkParameter |
addOutputStringParameter(java.lang.String pName,
java.lang.String helpStr,
java.lang.String sample)
Create an output string parameter and add to this method's list of output.
|
java.lang.String |
getHelpString()
Return the help string for this method
|
java.lang.String |
getIndex()
Return the index used to sort the tabular result of this method
|
java.util.Vector |
getInputParameters()
Return the input parameters of this method
|
java.lang.String |
getMethodName()
Return the name of this method
|
int |
getMethodType()
Return the type of this method, as defined by
MHawkMethod.MethodType . |
java.lang.String |
getName() |
java.util.Vector |
getOutputParameters()
Return the output parameters of this method
|
void |
setMonitoredObject(java.lang.Object monitoredObject)
Registers the object to be monitored with the instance of this class.
|
void |
validateParameters()
Validate the attributes for this method
|
public static final java.lang.String SUBJ_IMPLANT_START
public static final java.lang.String SUBJ_IMPLANT_STOP
public static final java.lang.String SUBJ_IMPLANT_MSG
public static final java.lang.String SUBJ_MGR_DISCOVERY
public static final java.lang.String REQ_METH_DESCRIBE
public static final java.lang.String REQ_METH_HEARTBEAT
public static final java.lang.String OPT_METH_START_REPEAT
public static final java.lang.String OPT_METH_STOP_REPEAT
public static final java.lang.String OPT_METH_START_ASYNC
public MHawkParameter addInputBooleanParameter(java.lang.String pName, java.lang.String helpStr, java.util.Vector valChoices, java.util.Vector legalChoices) throws MHawkException
MHawkException
- On specified choices, if any, that are not Booleanpublic MHawkParameter addOutputBooleanParameter(java.lang.String pName, java.lang.String helpStr, java.lang.Boolean sample) throws MHawkException
MHawkException
- On any error adding a boolean parameterpublic MHawkParameter addInputIntegerParameter(java.lang.String pName, java.lang.String helpStr, java.util.Vector valChoices, java.util.Vector legalChoices) throws MHawkException
MHawkException
- On specified choices, if any, that are not Integerpublic MHawkParameter addOutputIntegerParameter(java.lang.String pName, java.lang.String helpStr, java.lang.Integer sample) throws MHawkException
MHawkException
- On any error adding an integer parameterpublic MHawkParameter addInputRealParameter(java.lang.String pName, java.lang.String helpStr, java.util.Vector valChoices, java.util.Vector legalChoices) throws MHawkException
MHawkException
- On specified choices, if any, that are not Doublepublic MHawkParameter addOutputRealParameter(java.lang.String pName, java.lang.String helpStr, java.lang.Double sample) throws MHawkException
MHawkException
- On any error adding a float parameterpublic MHawkParameter addInputStringParameter(java.lang.String pName, java.lang.String helpStr, java.util.Vector valChoices, java.util.Vector legalChoices) throws MHawkException
MHawkException
- On specified choices, if any, that are not Stringpublic MHawkParameter addOutputStringParameter(java.lang.String pName, java.lang.String helpStr, java.lang.String sample) throws MHawkException
MHawkException
- On any error adding a string parameterpublic int getMethodType()
MHawkMethod.MethodType
.public void setMonitoredObject(java.lang.Object monitoredObject)
public java.lang.String getMethodName()
public java.lang.String getHelpString()
public java.lang.String getIndex()
public java.lang.String getName()
public java.util.Vector getInputParameters()
public java.util.Vector getOutputParameters()
public void validateParameters() throws MHawkException
MHawkException
- On any invalid combination