Package org.netxms.client.objecttools
Class ObjectTool
- java.lang.Object
-
- org.netxms.client.objecttools.ObjectTool
-
- All Implemented Interfaces:
ObjectAction
- Direct Known Subclasses:
ObjectToolDetails
public class ObjectTool extends Object implements ObjectAction
NetXMS object tool representation
-
-
Field Summary
Fields Modifier and Type Field Description static intASK_CONFIRMATIONprotected StringcommandNameprotected StringcommandShortNameprotected StringconfirmationTextprotected Stringdataprotected Stringdescriptionstatic intDISABLEDprotected StringdisplayNameprotected ObjectMenuFilterfilterprotected intflagsstatic intGENERATES_OUTPUTprotected longidprotected byte[]imageDataprotected Map<String,InputField>inputFieldsprotected Stringnamestatic intSHOW_IN_COMMANDSstatic intSNMP_INDEXED_BY_VALUEprotected inttypestatic intTYPE_ACTIONstatic intTYPE_AGENT_LISTstatic intTYPE_AGENT_TABLEstatic intTYPE_FILE_DOWNLOADstatic intTYPE_INTERNALstatic intTYPE_LOCAL_COMMANDstatic intTYPE_SERVER_COMMANDstatic intTYPE_SERVER_SCRIPTstatic intTYPE_SNMP_TABLEstatic intTYPE_URL
-
Constructor Summary
Constructors Modifier Constructor Description protectedObjectTool()Default implicit constructor.ObjectTool(org.netxms.base.NXCPMessage msg, long baseId)Create object tool from NXCP message.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidcreateDisplayName()Create display nameStringgetCommandDisplayName()Get command display nameStringgetCommandName()Get command nameStringgetCommandShortDisplayName()Get command short display nameStringgetCommandShortName()Get command short nameStringgetConfirmationText()StringgetData()StringgetDescription()StringgetDisplayName()intgetFlags()longgetId()Get tool IDbyte[]getImageData()InputFieldgetInputField(String name)Get input field definition by nameInputField[]getInputFields()Get all input fieldsObjectMenuFiltergetMenuFilter()Get menu filter associated with the toolStringgetName()StringgetSnmpOid()StringgetToolNodeOS()StringgetToolTemplate()intgetToolType()Get tool typeStringgetToolWorkstationOS()booleanisApplicableForNode(AbstractNode node)Check if tool is applicable for given node.booleanisEnabled()Check if tool is enabledbooleanisVisibleInCommands()Check if this tool should be visible in commandsvoidsetMenuFilter(ObjectMenuFilter filter)Sets menu filter for the toolprotected voidvalidateInputFields()Check if all input fields referenced in tool have definitions
-
-
-
Field Detail
-
TYPE_INTERNAL
public static final int TYPE_INTERNAL
- See Also:
- Constant Field Values
-
TYPE_ACTION
public static final int TYPE_ACTION
- See Also:
- Constant Field Values
-
TYPE_SNMP_TABLE
public static final int TYPE_SNMP_TABLE
- See Also:
- Constant Field Values
-
TYPE_AGENT_LIST
public static final int TYPE_AGENT_LIST
- See Also:
- Constant Field Values
-
TYPE_URL
public static final int TYPE_URL
- See Also:
- Constant Field Values
-
TYPE_LOCAL_COMMAND
public static final int TYPE_LOCAL_COMMAND
- See Also:
- Constant Field Values
-
TYPE_SERVER_COMMAND
public static final int TYPE_SERVER_COMMAND
- See Also:
- Constant Field Values
-
TYPE_FILE_DOWNLOAD
public static final int TYPE_FILE_DOWNLOAD
- See Also:
- Constant Field Values
-
TYPE_SERVER_SCRIPT
public static final int TYPE_SERVER_SCRIPT
- See Also:
- Constant Field Values
-
TYPE_AGENT_TABLE
public static final int TYPE_AGENT_TABLE
- See Also:
- Constant Field Values
-
ASK_CONFIRMATION
public static final int ASK_CONFIRMATION
- See Also:
- Constant Field Values
-
GENERATES_OUTPUT
public static final int GENERATES_OUTPUT
- See Also:
- Constant Field Values
-
DISABLED
public static final int DISABLED
- See Also:
- Constant Field Values
-
SHOW_IN_COMMANDS
public static final int SHOW_IN_COMMANDS
- See Also:
- Constant Field Values
-
SNMP_INDEXED_BY_VALUE
public static final int SNMP_INDEXED_BY_VALUE
- See Also:
- Constant Field Values
-
id
protected long id
-
name
protected String name
-
displayName
protected String displayName
-
type
protected int type
-
flags
protected int flags
-
description
protected String description
-
data
protected String data
-
confirmationText
protected String confirmationText
-
commandName
protected String commandName
-
commandShortName
protected String commandShortName
-
filter
protected ObjectMenuFilter filter
-
imageData
protected byte[] imageData
-
inputFields
protected Map<String,InputField> inputFields
-
-
Constructor Detail
-
ObjectTool
protected ObjectTool()
Default implicit constructor.
-
ObjectTool
public ObjectTool(org.netxms.base.NXCPMessage msg, long baseId)Create object tool from NXCP message. Intended to be called only by NXCSession methods.- Parameters:
msg- NXCP messagebaseId- Base variable ID
-
-
Method Detail
-
validateInputFields
protected void validateInputFields()
Check if all input fields referenced in tool have definitions
-
createDisplayName
protected void createDisplayName()
Create display name
-
isApplicableForNode
public boolean isApplicableForNode(AbstractNode node)
Check if tool is applicable for given node.- Specified by:
isApplicableForNodein interfaceObjectAction- Parameters:
node- AbstractNode object- Returns:
- true if tool is applicable for given node
-
getInputField
public InputField getInputField(String name)
Get input field definition by name- Parameters:
name- input field name- Returns:
- input field or null if not found
-
getInputFields
public InputField[] getInputFields()
Get all input fields- Returns:
- list of all defined input fields
-
getId
public long getId()
Get tool ID- Returns:
- tool ID
-
getName
public String getName()
- Returns:
- the name
-
getToolType
public int getToolType()
Description copied from interface:ObjectActionGet tool type- Specified by:
getToolTypein interfaceObjectAction- Returns:
- the type
-
getFlags
public int getFlags()
- Returns:
- the flags
-
isVisibleInCommands
public boolean isVisibleInCommands()
Check if this tool should be visible in commands- Returns:
- true if this tool should be visible in commands
-
isEnabled
public boolean isEnabled()
Check if tool is enabled- Returns:
- true if enabled
-
getDescription
public String getDescription()
- Returns:
- the description
-
getSnmpOid
public String getSnmpOid()
- Returns:
- the snmpOid
-
getData
public String getData()
- Returns:
- the data
-
getConfirmationText
public String getConfirmationText()
- Returns:
- the confirmationText
-
getDisplayName
public String getDisplayName()
- Returns:
- the displayName
-
getCommandName
public String getCommandName()
Get command name- Returns:
- command name
-
getCommandDisplayName
public String getCommandDisplayName()
Get command display name- Returns:
- command display name
-
getCommandShortName
public String getCommandShortName()
Get command short name- Returns:
- command short name
-
getCommandShortDisplayName
public String getCommandShortDisplayName()
Get command short display name- Returns:
- command short display name
-
getImageData
public byte[] getImageData()
- Returns:
- the imageData
-
getToolNodeOS
public String getToolNodeOS()
- Returns:
- the toolRemOS
-
getToolWorkstationOS
public String getToolWorkstationOS()
- Returns:
- the toolLocOS
-
getToolTemplate
public String getToolTemplate()
- Returns:
- the toolTemplate
-
getMenuFilter
public ObjectMenuFilter getMenuFilter()
Description copied from interface:ObjectActionGet menu filter associated with the tool- Specified by:
getMenuFilterin interfaceObjectAction
-
setMenuFilter
public void setMenuFilter(ObjectMenuFilter filter)
Description copied from interface:ObjectActionSets menu filter for the tool- Specified by:
setMenuFilterin interfaceObjectAction
-
-