org.netxms.client
Class NXCSession

java.lang.Object
  extended by org.netxms.client.NXCSession
All Implemented Interfaces:
ImageLibraryManager, ScriptLibraryManager, ServerManager, Session, UserManager

public class NXCSession
extends java.lang.Object
implements Session, ScriptLibraryManager, UserManager, ServerManager, ImageLibraryManager

Communication session with NetXMS server.


Field Summary
static int AUTH_TYPE_CERTIFICATE
           
static int AUTH_TYPE_PASSWORD
           
static int CFG_IMPORT_REPLACE_EVENT_BY_CODE
           
static int CFG_IMPORT_REPLACE_EVENT_BY_NAME
           
static int CHANNEL_ALARMS
           
static int CHANNEL_AUDIT_LOG
           
static int CHANNEL_EVENTS
           
static int CHANNEL_OBJECTS
           
static int CHANNEL_SITUATIONS
           
static int CHANNEL_SNMP_TRAPS
           
static int CHANNEL_SYSLOG
           
static int CLIENT_PROTOCOL_VERSION
           
static int DEFAULT_CONN_PORT
           
 
Fields inherited from interface org.netxms.api.client.users.UserManager
USER_MODIFY_ACCESS_RIGHTS, USER_MODIFY_AUTH_METHOD, USER_MODIFY_CERT_MAPPING, USER_MODIFY_DESCRIPTION, USER_MODIFY_FLAGS, USER_MODIFY_FULL_NAME, USER_MODIFY_LOGIN_NAME, USER_MODIFY_MEMBERS
 
Constructor Summary
NXCSession(java.lang.String connAddress, int connPort, java.lang.String connLoginName, java.lang.String connPassword)
           
NXCSession(java.lang.String connAddress, int connPort, java.lang.String connLoginName, java.lang.String connPassword, boolean connUseEncryption)
           
NXCSession(java.lang.String connAddress, java.lang.String connLoginName, java.lang.String connPassword)
           
 
Method Summary
 void acknowledgeAlarm(long alarmId)
          Acknowledge alarm.
 void addClusterNode(long clusterId, long nodeId)
          Add node to cluster.
 void addListener(SessionListener lst)
           
 void bindObject(long parentId, long childId)
          Bind object.
 void cancelServerJob(long jobId)
          Cancel server job
 void changeNodeIpAddress(long nodeId, java.net.InetAddress addr)
          Change primary IP address of a node.
 void checkConnection()
          
 void closeAlarm(long alarmId)
          Set alarm's helpdesk state to "Closed".
 void closeEventProcessingPolicy()
          Close event processing policy.
 void connect()
           
 long createAction(java.lang.String name)
          Create new server action.
 LibraryImage createImage(LibraryImage image)
           
 long createObject(NXCObjectCreationData data)
          Create object
 long createSituation(java.lang.String name, java.lang.String comments)
          Create new situation object.
 long createSnmpTrapConfiguration()
          Create new trap configuration record.
 long createUser(java.lang.String name)
           
 long createUserGroup(java.lang.String name)
           
 void deleteAction(long actionId)
          Delete server action
 void deleteAlarm(long alarmId)
          Delete alarm.
 void deleteEventTemplate(long eventCode)
          Delete event template.
 void deleteImage(LibraryImage image)
           
 void deleteObject(long objectId)
          Delete object
 void deleteObjectTool(long toolId)
          Delete object tool.
 void deleteScript(long scriptId)
           
 void deleteServerVariable(java.lang.String name)
           
 void deleteSituation(long id)
          Delete situation object
 void deleteSituationInstance(long id, java.lang.String instance)
          Delete situation instance
 void deleteSnmpTrapConfiguration(long trapId)
          Delete SNMP trap configuration record from server.
 void deleteUserDBObject(long id)
           
 void deployAgentPolicy(long policyId, long nodeId)
          Deploy policy on agent
 void disconnect()
           
 java.io.File downloadMibFile()
          Download MIB file from server.
 void executeAction(long nodeId, java.lang.String action)
          Execute action on remote agent
 void executeServerCommand(long objectId, java.lang.String command)
          Execute server command related to given object (usually defined as object tool)
protected  void executeSimpleCommand(int command)
          Execute simple commands (without arguments and only returning RCC)
 Table executeTableTool(long toolId, long nodeId)
          Execute object tool of "table" type against given node.
 java.lang.String exportConfiguration(java.lang.String description, long[] events, long[] traps, long[] templates)
          Export server configuration.
protected  void finalize()
           
 ConnectionPoint findConnectionPoint(long objectId)
          Find connection point (either directly connected or most close known interface on a switch) for given node or interface object.
 ConnectionPoint findConnectionPoint(MacAddress macAddr)
          Find connection point (either directly connected or most close known interface on a switch) for given MAC address.
 EventTemplate findEventTemplateByCode(long code)
          Find event template by code in event template database internally maintained by session object.
 java.util.List<EventTemplate> findMultipleEventTemplates(java.lang.Long[] codes)
          Find multiple event templates by event codes in event template database internally maintained by session object.
 java.util.List<GenericObject> findMultipleObjects(long[] idList)
          Find multiple NetXMS objects by identifiers
 java.util.List<GenericObject> findMultipleObjects(java.lang.Long[] idList)
          Find multiple NetXMS objects by identifiers
 GenericObject findObjectById(long id)
          Find NetXMS object by it's identifier.
 AbstractUserObject findUserDBObjectById(long id)
           
 long generateEventCode()
          Generate code for new event template.
 long generateObjectToolId()
          Generate unique ID for new object tool.
 java.util.List<ServerAction> getActions()
          Get list of configured actions from server
 java.lang.String getAgentConfig(long nodeId)
          Get agent's master configuration file.
 java.util.HashMap<java.lang.Long,Alarm> getAlarms(boolean getTerminated)
          Get alarm list.
 GenericObject[] getAllObjects()
          Get list of all objects
 java.lang.String getAttributeForCurrentUser(java.lang.String name)
           
 EventTemplate[] getCachedEventTemplates()
          Get cached list event templates
 DciData getCollectedData(long nodeId, long dciId, java.util.Date from, java.util.Date to, int maxRows)
          Get collected DCI data from server.
 java.lang.String getConnClientInfo()
           
 java.util.List<EventTemplate> getEventTemplates()
          Get event templates from server
 LibraryImage getImage(java.lang.String guid)
           
 java.util.List<LibraryImage> getImageLibrary()
           
 java.util.List<LibraryImage> getImageLibrary(java.lang.String category)
           
 DciValue[] getLastValues(long nodeId)
          Get last DCI values for given node
 java.util.Date getMibFileTimestamp()
          Get timestamp of server's MIB file.
 ObjectToolDetails getObjectToolDetails(long toolId)
          Get object tool details
 java.util.List<ObjectTool> getObjectTools()
          Get list of configured object tools
 PerfTabDci[] getPerfTabItems(long nodeId)
          Get list of DCIs configured to be shown on performance tab in console for given node.
 java.util.List<GraphSettings> getPredefinedGraphs()
          Get list of predefined graphs.
 int getRecvBufferSize()
           
 Script getScript(long scriptId)
           
 java.util.List<Script> getScriptLibrary()
           
 java.lang.String getServerAddress()
           
 byte[] getServerChallenge()
           
 byte[] getServerId()
           
 NXCServerJob[] getServerJobList()
          Get list of server jobs
 java.util.Map<java.lang.String,java.lang.Object> getServerStats()
          Get server stats.
 java.lang.String getServerTimeZone()
           
 java.util.Map<java.lang.String,ServerVariable> getServerVariables()
           
 java.lang.String getServerVersion()
           
 java.util.List<Situation> getSituations()
          Get list of all configured situations
 java.util.List<java.lang.String> getSnmpCommunities()
          Get list of well-known SNMP communities configured on server.
 java.util.List<SnmpTrap> getSnmpTrapsConfiguration()
          Get list of configured SNMP traps
 java.util.List<SnmpUsmCredential> getSnmpUsmCredentials()
          Get list of well-known SNMP USM (user security model) credentials configured on server.
 java.util.List<AgentParameter> getSupportedParameters(long nodeId)
          Get list of parameters supported by agent running on given node.
 Threshold[] getThresholds(long nodeId, long dciId)
          Get list of thresholds configured for given DCI
 GenericObject[] getTopLevelObjects()
          Get list of top-level objects.
 AbstractUserObject[] getUserDatabaseObjects()
           
 int getUserId()
           
 java.lang.String getUserName()
           
 int getUserSystemRights()
           
 void importConfiguration(java.lang.String config, int flags)
          Import server configuration (events, traps, thresholds) from XML
 boolean isConnected()
          
 boolean isPasswordExpired()
           
 void lockUserDatabase()
           
 void modifyAction(ServerAction action)
          Modify server action
 void modifyEventTemplate(EventTemplate evt)
          Modify event template.
 void modifyImage(LibraryImage image)
           
 void modifyObject(NXCObjectModificationData data)
          Modify object (generic interface, in most cases wrapper functions should be used instead)
 void modifyObjectTool(ObjectToolDetails tool)
          Modify object tool.
 long modifyScript(long scriptId, java.lang.String name, java.lang.String source)
           
 void modifySituation(long id, java.lang.String name, java.lang.String comments)
          Modify situation object.
 void modifySnmpTrapConfiguration(SnmpTrap trap)
          Modify SNMP trap configuration record.
 void modifyUserDBObject(AbstractUserObject object)
           
 void modifyUserDBObject(AbstractUserObject object, int fields)
           
 NXCPMessage newMessage(int code)
           
 void openAlarm(long alarmId, java.lang.String reference)
          Set alarm's helpdesk state to "Open".
 DataCollectionConfiguration openDataCollectionConfiguration(long nodeId)
          Open data collection configuration for given node.
 EventProcessingPolicy openEventProcessingPolicy()
          Open event processing policy for editing.
 Log openServerLog(java.lang.String logName)
          Open server log by name.
 void pollNode(long nodeId, int pollType, NodePollListener listener)
          Perform a forced node poll.
 NetworkMapPage queryLayer2Topology(long nodeId)
          Query layer 2 topology for node
 Table receiveTable(long requestId, int msgCode)
          Receive table from server.
 void removeClusterNode(long clusterId, long nodeId)
          Remove node from cluster.
 void removeListener(SessionListener lst)
           
 void removeTemplate(long templateId, long nodeId, boolean removeDci)
          Remove data collection template from node.
 void renameScript(long scriptId, java.lang.String name)
           
 void saveEventProcessingPolicy(EventProcessingPolicy epp)
          Save event processing policy.
 void sendMessage(NXCPMessage msg)
          Send message to server
protected  void sendNotification(NXCNotification n)
          Call notification handlers on all registered listeners
 void setAttributeForCurrentUser(java.lang.String name, java.lang.String value)
           
 void setCommandTimeout(int commandTimeout)
           
 void setConnClientInfo(java.lang.String connClientInfo)
           
 void setObjectACL(long objectId, AccessListElement[] acl, boolean inheritAccessRights)
          Change object's ACL (wrapper for modifyObject())
 void setObjectCustomAttributes(long objectId, java.util.Map<java.lang.String,java.lang.String> attrList)
          Change object's custom attributes (wrapper for modifyObject())
 void setObjectManaged(long objectId, boolean isManaged)
          Set object's managed status.
 void setObjectName(long objectId, java.lang.String name)
          Change object's name (wrapper for modifyObject())
 void setRecvBufferSize(int recvBufferSize)
           
 void setServerVariable(java.lang.String name, java.lang.String value)
           
 void setUserPassword(long id, java.lang.String newPassword, java.lang.String oldPassword)
           
 void subscribe(int channels)
          Subscribe to notification channel(s)
 void syncEventTemplates()
          Synchronize event templates configuration.
 void syncObjects()
          Synchronizes NetXMS objects between server and client.
 void syncUserDatabase()
           
 void terminateAlarm(long alarmId)
          Terminate alarm.
 void unbindObject(long parentId, long childId)
          Unbind object.
 void uninstallAgentPolicy(long policyId, long nodeId)
          Uninstall policy from agent
 void unlockUserDatabase()
           
 void unsubscribe(int channels)
          Unsubscribe from notification channel(s)
 void updateAgentConfig(long nodeId, java.lang.String config, boolean apply)
          Update agent's master configuration file.
 void updateObjectComments(long objectId, java.lang.String comments)
          Change object's comments.
 void updateSnmpCommunities(java.util.List<java.lang.String> list)
          Update list of well-known SNMP community strings on server.
 void updateSnmpUsmCredentials(java.util.List<SnmpUsmCredential> list)
          Update list of well-known SNMP USM credentials on server.
 java.io.File waitForFile(long id, int timeout)
          Wait for specific file to arrive
 NXCPMessage waitForMessage(int code, long id)
           
 NXCPMessage waitForMessage(int code, long id, int timeout)
           
 NXCPMessage waitForRCC(long id)
           
 void wakeupNode(long objectId)
          Wakeup node by sending wake-on-LAN magic packet.
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEFAULT_CONN_PORT

public static final int DEFAULT_CONN_PORT
See Also:
Constant Field Values

CLIENT_PROTOCOL_VERSION

public static final int CLIENT_PROTOCOL_VERSION
See Also:
Constant Field Values

AUTH_TYPE_PASSWORD

public static final int AUTH_TYPE_PASSWORD
See Also:
Constant Field Values

AUTH_TYPE_CERTIFICATE

public static final int AUTH_TYPE_CERTIFICATE
See Also:
Constant Field Values

CHANNEL_EVENTS

public static final int CHANNEL_EVENTS
See Also:
Constant Field Values

CHANNEL_SYSLOG

public static final int CHANNEL_SYSLOG
See Also:
Constant Field Values

CHANNEL_ALARMS

public static final int CHANNEL_ALARMS
See Also:
Constant Field Values

CHANNEL_OBJECTS

public static final int CHANNEL_OBJECTS
See Also:
Constant Field Values

CHANNEL_SNMP_TRAPS

public static final int CHANNEL_SNMP_TRAPS
See Also:
Constant Field Values

CHANNEL_AUDIT_LOG

public static final int CHANNEL_AUDIT_LOG
See Also:
Constant Field Values

CHANNEL_SITUATIONS

public static final int CHANNEL_SITUATIONS
See Also:
Constant Field Values

CFG_IMPORT_REPLACE_EVENT_BY_CODE

public static final int CFG_IMPORT_REPLACE_EVENT_BY_CODE
See Also:
Constant Field Values

CFG_IMPORT_REPLACE_EVENT_BY_NAME

public static final int CFG_IMPORT_REPLACE_EVENT_BY_NAME
See Also:
Constant Field Values
Constructor Detail

NXCSession

public NXCSession(java.lang.String connAddress,
                  java.lang.String connLoginName,
                  java.lang.String connPassword)
Parameters:
connAddress -
connLoginName -
connPassword -

NXCSession

public NXCSession(java.lang.String connAddress,
                  int connPort,
                  java.lang.String connLoginName,
                  java.lang.String connPassword)
Parameters:
connAddress -
connPort -
connLoginName -
connPassword -

NXCSession

public NXCSession(java.lang.String connAddress,
                  int connPort,
                  java.lang.String connLoginName,
                  java.lang.String connPassword,
                  boolean connUseEncryption)
Parameters:
connAddress -
connPort -
connLoginName -
connPassword -
connUseEncryption -
Method Detail

finalize

protected void finalize()
Overrides:
finalize in class java.lang.Object

addListener

public void addListener(SessionListener lst)
Specified by:
addListener in interface Session

removeListener

public void removeListener(SessionListener lst)
Specified by:
removeListener in interface Session

sendNotification

protected void sendNotification(NXCNotification n)
Call notification handlers on all registered listeners

Parameters:
n - Notification object

sendMessage

public void sendMessage(NXCPMessage msg)
                 throws java.io.IOException
Send message to server

Parameters:
msg - Message to sent
Throws:
java.io.IOException - if case of socket communication failure

waitForMessage

public NXCPMessage waitForMessage(int code,
                                  long id,
                                  int timeout)
                           throws NXCException
Specified by:
waitForMessage in interface Session
Throws:
NXCException

waitForMessage

public NXCPMessage waitForMessage(int code,
                                  long id)
                           throws NXCException
Specified by:
waitForMessage in interface Session
Throws:
NXCException

waitForRCC

public NXCPMessage waitForRCC(long id)
                       throws NXCException
Specified by:
waitForRCC in interface Session
Throws:
NXCException

newMessage

public final NXCPMessage newMessage(int code)
Specified by:
newMessage in interface Session

waitForFile

public java.io.File waitForFile(long id,
                                int timeout)
Wait for specific file to arrive

Parameters:
id - Message ID
timeout - Wait timeout in milliseconds
Returns:
Received file or null in case of failure

executeSimpleCommand

protected void executeSimpleCommand(int command)
                             throws java.io.IOException,
                                    NXCException
Execute simple commands (without arguments and only returning RCC)

Parameters:
command - Command code
Throws:
java.io.IOException
NXCException

receiveTable

public Table receiveTable(long requestId,
                          int msgCode)
                   throws NXCException
Receive table from server.

Parameters:
requestId - request ID
msgCode - Message code
Returns:
Received table
Throws:
NXCException - if operation was timed out

connect

public void connect()
             throws java.io.IOException,
                    java.net.UnknownHostException,
                    NetXMSClientException
Specified by:
connect in interface Session
Throws:
java.io.IOException
java.net.UnknownHostException
NetXMSClientException

disconnect

public void disconnect()
Specified by:
disconnect in interface Session

getRecvBufferSize

public int getRecvBufferSize()
Specified by:
getRecvBufferSize in interface Session

setRecvBufferSize

public void setRecvBufferSize(int recvBufferSize)
Specified by:
setRecvBufferSize in interface Session

getServerAddress

public java.lang.String getServerAddress()
Specified by:
getServerAddress in interface Session

getUserName

public java.lang.String getUserName()
Specified by:
getUserName in interface Session

getServerVersion

public java.lang.String getServerVersion()
Specified by:
getServerVersion in interface Session

getServerId

public byte[] getServerId()
Specified by:
getServerId in interface Session

getServerTimeZone

public java.lang.String getServerTimeZone()
Specified by:
getServerTimeZone in interface Session

getServerChallenge

public byte[] getServerChallenge()
Returns:
the serverChallenge

getConnClientInfo

public java.lang.String getConnClientInfo()
Specified by:
getConnClientInfo in interface Session

setConnClientInfo

public void setConnClientInfo(java.lang.String connClientInfo)
Specified by:
setConnClientInfo in interface Session

setCommandTimeout

public void setCommandTimeout(int commandTimeout)
Specified by:
setCommandTimeout in interface Session

getUserId

public int getUserId()
Specified by:
getUserId in interface Session

getUserSystemRights

public int getUserSystemRights()
Specified by:
getUserSystemRights in interface Session

isPasswordExpired

public boolean isPasswordExpired()
Specified by:
isPasswordExpired in interface Session

syncObjects

public void syncObjects()
                 throws java.io.IOException,
                        NXCException
Synchronizes NetXMS objects between server and client. After successful sync, subscribe client to object change notifications.

Throws:
java.io.IOException - if socket I/O error occurs
NXCException - if NetXMS server returns an error or operation was timed out

findObjectById

public GenericObject findObjectById(long id)
Find NetXMS object by it's identifier.

Parameters:
id - Object identifier
Returns:
Object with given ID or null if object cannot be found

findMultipleObjects

public java.util.List<GenericObject> findMultipleObjects(long[] idList)
Find multiple NetXMS objects by identifiers

Parameters:
idList - array of object identifiers
Returns:
list of found objects

findMultipleObjects

public java.util.List<GenericObject> findMultipleObjects(java.lang.Long[] idList)
Find multiple NetXMS objects by identifiers

Parameters:
idList - array of object identifiers
Returns:
array of found objects

getTopLevelObjects

public GenericObject[] getTopLevelObjects()
Get list of top-level objects.

Returns:
List of all top level objects (either without parents or with inaccessible parents)

getAllObjects

public GenericObject[] getAllObjects()
Get list of all objects

Returns:
List of all objects

getAlarms

public java.util.HashMap<java.lang.Long,Alarm> getAlarms(boolean getTerminated)
                                                  throws java.io.IOException,
                                                         NXCException
Get alarm list.

Parameters:
getTerminated - if set to true, all alarms will be retrieved from database, otherwise only active alarms
Returns:
Hash map containing alarms
Throws:
java.io.IOException - if socket I/O error occurs
NXCException - if NetXMS server returns an error or operation was timed out

acknowledgeAlarm

public void acknowledgeAlarm(long alarmId)
                      throws java.io.IOException,
                             NXCException
Acknowledge alarm.

Parameters:
alarmId - Identifier of alarm to be acknowledged.
Throws:
java.io.IOException - if socket I/O error occurs
NXCException - if NetXMS server returns an error or operation was timed out

terminateAlarm

public void terminateAlarm(long alarmId)
                    throws java.io.IOException,
                           NXCException
Terminate alarm.

Parameters:
alarmId - Identifier of alarm to be terminated.
Throws:
java.io.IOException - if socket I/O error occurs
NXCException - if NetXMS server returns an error or operation was timed out

deleteAlarm

public void deleteAlarm(long alarmId)
                 throws java.io.IOException,
                        NXCException
Delete alarm.

Parameters:
alarmId - Identifier of alarm to be deleted.
Throws:
java.io.IOException - if socket I/O error occurs
NXCException - if NetXMS server returns an error or operation was timed out

openAlarm

public void openAlarm(long alarmId,
                      java.lang.String reference)
               throws java.io.IOException,
                      NXCException
Set alarm's helpdesk state to "Open".

Parameters:
alarmId - Identifier of alarm to be changed.
reference - Helpdesk reference string.
Throws:
java.io.IOException - if socket I/O error occurs
NXCException - if NetXMS server returns an error or operation was timed out

closeAlarm

public void closeAlarm(long alarmId)
                throws java.io.IOException,
                       NXCException
Set alarm's helpdesk state to "Closed".

Parameters:
alarmId - Identifier of alarm to be changed.
Throws:
java.io.IOException - if socket I/O error occurs
NXCException - if NetXMS server returns an error or operation was timed out

getServerVariables

public java.util.Map<java.lang.String,ServerVariable> getServerVariables()
                                                                  throws java.io.IOException,
                                                                         NXCException
Specified by:
getServerVariables in interface ServerManager
Throws:
java.io.IOException
NXCException

setServerVariable

public void setServerVariable(java.lang.String name,
                              java.lang.String value)
                       throws java.io.IOException,
                              NXCException
Specified by:
setServerVariable in interface ServerManager
Throws:
java.io.IOException
NXCException

deleteServerVariable

public void deleteServerVariable(java.lang.String name)
                          throws java.io.IOException,
                                 NXCException
Specified by:
deleteServerVariable in interface ServerManager
Throws:
java.io.IOException
NXCException

subscribe

public void subscribe(int channels)
               throws java.io.IOException,
                      NXCException
Subscribe to notification channel(s)

Parameters:
channels - Notification channels to subscribe to. Multiple channels can be specified by combining them with OR operation.
Throws:
java.io.IOException - if socket I/O error occurs
NXCException - if NetXMS server returns an error or operation was timed out

unsubscribe

public void unsubscribe(int channels)
                 throws java.io.IOException,
                        NXCException
Unsubscribe from notification channel(s)

Parameters:
channels - Notification channels to unsubscribe from. Multiple channels can be specified by combining them with OR operation.
Throws:
java.io.IOException - if socket I/O error occurs
NXCException - if NetXMS server returns an error or operation was timed out

syncUserDatabase

public void syncUserDatabase()
                      throws java.io.IOException,
                             NXCException
Specified by:
syncUserDatabase in interface UserManager
Throws:
java.io.IOException
NXCException

findUserDBObjectById

public AbstractUserObject findUserDBObjectById(long id)
Specified by:
findUserDBObjectById in interface UserManager

getUserDatabaseObjects

public AbstractUserObject[] getUserDatabaseObjects()
Specified by:
getUserDatabaseObjects in interface UserManager

createUser

public long createUser(java.lang.String name)
                throws java.io.IOException,
                       NXCException
Specified by:
createUser in interface UserManager
Throws:
java.io.IOException
NXCException

createUserGroup

public long createUserGroup(java.lang.String name)
                     throws java.io.IOException,
                            NXCException
Specified by:
createUserGroup in interface UserManager
Throws:
java.io.IOException
NXCException

deleteUserDBObject

public void deleteUserDBObject(long id)
                        throws java.io.IOException,
                               NXCException
Specified by:
deleteUserDBObject in interface UserManager
Throws:
java.io.IOException
NXCException

setUserPassword

public void setUserPassword(long id,
                            java.lang.String newPassword,
                            java.lang.String oldPassword)
                     throws java.io.IOException,
                            NXCException
Specified by:
setUserPassword in interface UserManager
Throws:
java.io.IOException
NXCException

modifyUserDBObject

public void modifyUserDBObject(AbstractUserObject object,
                               int fields)
                        throws java.io.IOException,
                               NXCException
Specified by:
modifyUserDBObject in interface UserManager
Throws:
java.io.IOException
NXCException

modifyUserDBObject

public void modifyUserDBObject(AbstractUserObject object)
                        throws java.io.IOException,
                               NXCException
Specified by:
modifyUserDBObject in interface UserManager
Throws:
java.io.IOException
NXCException

lockUserDatabase

public void lockUserDatabase()
                      throws java.io.IOException,
                             NXCException
Specified by:
lockUserDatabase in interface UserManager
Throws:
java.io.IOException
NXCException

unlockUserDatabase

public void unlockUserDatabase()
                        throws java.io.IOException,
                               NXCException
Specified by:
unlockUserDatabase in interface UserManager
Throws:
java.io.IOException
NXCException

setAttributeForCurrentUser

public void setAttributeForCurrentUser(java.lang.String name,
                                       java.lang.String value)
                                throws java.io.IOException,
                                       NXCException
Specified by:
setAttributeForCurrentUser in interface Session
Throws:
java.io.IOException
NXCException

getAttributeForCurrentUser

public java.lang.String getAttributeForCurrentUser(java.lang.String name)
                                            throws java.io.IOException,
                                                   NXCException
Specified by:
getAttributeForCurrentUser in interface Session
Throws:
java.io.IOException
NXCException

getLastValues

public DciValue[] getLastValues(long nodeId)
                         throws java.io.IOException,
                                NXCException
Get last DCI values for given node

Parameters:
nodeId - ID of the node to get DCI values for
Returns:
List of DCI values
Throws:
java.io.IOException - if socket I/O error occurs
NXCException - if NetXMS server returns an error or operation was timed out

getPerfTabItems

public PerfTabDci[] getPerfTabItems(long nodeId)
                             throws java.io.IOException,
                                    NXCException
Get list of DCIs configured to be shown on performance tab in console for given node.

Parameters:
nodeId - Node object ID
Returns:
List of performance tab DCIs
Throws:
java.io.IOException - if socket I/O error occurs
NXCException - if NetXMS server returns an error or operation was timed out

getCollectedData

public DciData getCollectedData(long nodeId,
                                long dciId,
                                java.util.Date from,
                                java.util.Date to,
                                int maxRows)
                         throws java.io.IOException,
                                NXCException
Get collected DCI data from server. Please note that you should specify either row count limit or time from/to limit.

Parameters:
nodeId - Node ID
dciId - DCI ID
from - Start of time range or null for no limit
to - End of time range or null for no limit
maxRows - Maximum number of rows to retrieve or 0 for no limit
Returns:
DCI data set
Throws:
java.io.IOException - if socket I/O error occurs
NXCException - if NetXMS server returns an error or operation was timed out

getThresholds

public Threshold[] getThresholds(long nodeId,
                                 long dciId)
                          throws java.io.IOException,
                                 NXCException
Get list of thresholds configured for given DCI

Parameters:
nodeId - Node object ID
dciId - DCI ID
Returns:
List of configured thresholds
Throws:
java.io.IOException - if socket I/O error occurs
NXCException - if NetXMS server returns an error or operation was timed out

createObject

public long createObject(NXCObjectCreationData data)
                  throws java.io.IOException,
                         NXCException
Create object

Parameters:
data - Object creation data
Returns:
ID of new object
Throws:
java.io.IOException - if socket I/O error occurs
NXCException - if NetXMS server returns an error or operation was timed out

deleteObject

public void deleteObject(long objectId)
                  throws java.io.IOException,
                         NXCException
Delete object

Parameters:
objectId - ID of an object which should be deleted
Throws:
java.io.IOException - if socket I/O error occurs
NXCException - if NetXMS server returns an error or operation was timed out

modifyObject

public void modifyObject(NXCObjectModificationData data)
                  throws java.io.IOException,
                         NXCException
Modify object (generic interface, in most cases wrapper functions should be used instead)

Parameters:
data - Object modification data
Throws:
java.io.IOException - if socket I/O error occurs
NXCException - if NetXMS server returns an error or operation was timed out

setObjectName

public void setObjectName(long objectId,
                          java.lang.String name)
                   throws java.io.IOException,
                          NXCException
Change object's name (wrapper for modifyObject())

Parameters:
objectId - ID of object to be changed
name - New object's name
Throws:
java.io.IOException - if socket I/O error occurs
NXCException - if NetXMS server returns an error or operation was timed out

setObjectCustomAttributes

public void setObjectCustomAttributes(long objectId,
                                      java.util.Map<java.lang.String,java.lang.String> attrList)
                               throws java.io.IOException,
                                      NXCException
Change object's custom attributes (wrapper for modifyObject())

Throws:
java.io.IOException - if socket I/O error occurs
NXCException - if NetXMS server returns an error or operation was timed out

setObjectACL

public void setObjectACL(long objectId,
                         AccessListElement[] acl,
                         boolean inheritAccessRights)
                  throws java.io.IOException,
                         NXCException
Change object's ACL (wrapper for modifyObject())

Throws:
java.io.IOException - if socket I/O error occurs
NXCException - if NetXMS server returns an error or operation was timed out

changeNodeIpAddress

public void changeNodeIpAddress(long nodeId,
                                java.net.InetAddress addr)
                         throws java.io.IOException,
                                NXCException
Change primary IP address of a node. This operation separated from modifyObject() API because it forces immediate configuration poll for given node on server side.

Parameters:
nodeId - ID of node object
addr - New IP address
Throws:
java.io.IOException - if socket I/O error occurs
NXCException - if NetXMS server returns an error or operation was timed out

updateObjectComments

public void updateObjectComments(long objectId,
                                 java.lang.String comments)
                          throws java.io.IOException,
                                 NXCException
Change object's comments.

Parameters:
objectId - Object's ID
comments - New comments
Throws:
java.io.IOException - if socket I/O error occurs
NXCException - if NetXMS server returns an error or operation was timed out

setObjectManaged

public void setObjectManaged(long objectId,
                             boolean isManaged)
                      throws java.io.IOException,
                             NXCException
Set object's managed status.

Parameters:
objectId - object's identifier
isManaged - object's managed status
Throws:
java.io.IOException - if socket I/O error occurs
NXCException - if NetXMS server returns an error or operation was timed out

bindObject

public void bindObject(long parentId,
                       long childId)
                throws java.io.IOException,
                       NXCException
Bind object.

Parameters:
parentId - parent object's identifier
childId - Child object's identifier
Throws:
java.io.IOException - if socket I/O error occurs
NXCException - if NetXMS server returns an error or operation was timed out

unbindObject

public void unbindObject(long parentId,
                         long childId)
                  throws java.io.IOException,
                         NXCException
Unbind object.

Parameters:
parentId - parent object's identifier
childId - Child object's identifier
Throws:
java.io.IOException - if socket I/O error occurs
NXCException - if NetXMS server returns an error or operation was timed out

removeTemplate

public void removeTemplate(long templateId,
                           long nodeId,
                           boolean removeDci)
                    throws java.io.IOException,
                           NXCException
Remove data collection template from node.

Parameters:
templateId - template object identifier
nodeId - node object identifier
removeDci - true if DCIs created from this template should be removed
Throws:
java.io.IOException - if socket I/O error occurs
NXCException - if NetXMS server returns an error or operation was timed out

addClusterNode

public void addClusterNode(long clusterId,
                           long nodeId)
                    throws java.io.IOException,
                           NXCException
Add node to cluster.

Parameters:
clusterId - cluster object ID
nodeId - node object ID
Throws:
java.io.IOException - if socket I/O error occurs
NXCException - if NetXMS server returns an error or operation was timed out

removeClusterNode

public void removeClusterNode(long clusterId,
                              long nodeId)
                       throws java.io.IOException,
                              NXCException
Remove node from cluster.

Parameters:
clusterId - cluster object ID
nodeId - node object ID
Throws:
java.io.IOException - if socket I/O error occurs
NXCException - if NetXMS server returns an error or operation was timed out

queryLayer2Topology

public NetworkMapPage queryLayer2Topology(long nodeId)
                                   throws java.io.IOException,
                                          NXCException
Query layer 2 topology for node

Throws:
java.io.IOException - if socket I/O error occurs
NXCException - if NetXMS server returns an error or operation was timed out

executeAction

public void executeAction(long nodeId,
                          java.lang.String action)
                   throws java.io.IOException,
                          NXCException
Execute action on remote agent

Parameters:
nodeId - Node object ID
action - Action name
Throws:
java.io.IOException - if socket I/O error occurs
NXCException - if NetXMS server returns an error or operation was timed out

wakeupNode

public void wakeupNode(long objectId)
                throws java.io.IOException,
                       NXCException
Wakeup node by sending wake-on-LAN magic packet. Either node ID or interface ID may be given. If node ID is given, system will send wakeup packets to all active interfaces with IP address.

Parameters:
objectId - node or interface ID
Throws:
java.io.IOException - if socket I/O error occurs
NXCException - if NetXMS server returns an error or operation was timed out

getServerJobList

public NXCServerJob[] getServerJobList()
                                throws java.io.IOException,
                                       NXCException
Get list of server jobs

Returns:
list of server jobs
Throws:
java.io.IOException - if socket I/O error occurs
NXCException - if NetXMS server returns an error or operation was timed out

cancelServerJob

public void cancelServerJob(long jobId)
                     throws java.io.IOException,
                            NXCException
Cancel server job

Parameters:
jobId - Job ID
Throws:
java.io.IOException - if socket I/O error occurs
NXCException - if NetXMS server returns an error or operation was timed out

deployAgentPolicy

public void deployAgentPolicy(long policyId,
                              long nodeId)
                       throws java.io.IOException,
                              NXCException
Deploy policy on agent

Parameters:
policyId - Policy object ID
nodeId - Node object ID
Throws:
java.io.IOException - if socket I/O error occurs
NXCException - if NetXMS server returns an error or operation was timed out

uninstallAgentPolicy

public void uninstallAgentPolicy(long policyId,
                                 long nodeId)
                          throws java.io.IOException,
                                 NXCException
Uninstall policy from agent

Parameters:
policyId - Policy object ID
nodeId - Node object ID
Throws:
java.io.IOException - if socket I/O error occurs
NXCException - if NetXMS server returns an error or operation was timed out

openEventProcessingPolicy

public EventProcessingPolicy openEventProcessingPolicy()
                                                throws java.io.IOException,
                                                       NXCException
Open event processing policy for editing. This call will lock event processing policy on server until closeEventProcessingPolicy called or session terminated.

Returns:
Event processing policy
Throws:
java.io.IOException - if socket I/O error occurs
NXCException - if NetXMS server returns an error or operation was timed out

saveEventProcessingPolicy

public void saveEventProcessingPolicy(EventProcessingPolicy epp)
                               throws java.io.IOException,
                                      NXCException
Save event processing policy. If policy was not previously open by current session exception will be thrown.

Parameters:
epp - Modified event processing policy
Throws:
java.io.IOException - if socket I/O error occurs
NXCException - if NetXMS server returns an error or operation was timed out

closeEventProcessingPolicy

public void closeEventProcessingPolicy()
                                throws java.io.IOException,
                                       NXCException
Close event processing policy. This call will unlock event processing policy on server. If policy was not previously open by current session exception will be thrown.

Throws:
java.io.IOException - if socket I/O error occurs
NXCException - if NetXMS server returns an error or operation was timed out

openDataCollectionConfiguration

public DataCollectionConfiguration openDataCollectionConfiguration(long nodeId)
                                                            throws java.io.IOException,
                                                                   NXCException
Open data collection configuration for given node. You must call DataCollectionConfiguration.close() to close data collection configuration when it is no longer needed.

Parameters:
nodeId - Node object identifier
Returns:
Data collection configuration object
Throws:
java.io.IOException - if socket I/O error occurs
NXCException - if NetXMS server returns an error or operation was timed out

openServerLog

public Log openServerLog(java.lang.String logName)
                  throws java.io.IOException,
                         NXCException
Open server log by name.

Parameters:
logName - Log name
Returns:
Log object
Throws:
java.io.IOException - if socket I/O error occurs
NXCException - if NetXMS server returns an error or operation was timed out

syncEventTemplates

public void syncEventTemplates()
                        throws java.io.IOException,
                               NXCException
Synchronize event templates configuration. After call to this method session object will maintain internal list of configured event templates.

Throws:
java.io.IOException - if socket I/O error occurs
NXCException - if NetXMS server returns an error or operation was timed out

getCachedEventTemplates

public EventTemplate[] getCachedEventTemplates()
Get cached list event templates

Returns:
List of event templates cached by client library

findEventTemplateByCode

public EventTemplate findEventTemplateByCode(long code)
Find event template by code in event template database internally maintained by session object. You must call NXCSession.syncEventTemplates() first to make local copy of event template database.

Parameters:
code - Event code
Returns:
Event template object or null if not found

findMultipleEventTemplates

public java.util.List<EventTemplate> findMultipleEventTemplates(java.lang.Long[] codes)
Find multiple event templates by event codes in event template database internally maintained by session object. You must call NXCSession.syncEventTemplates() first to make local copy of event template database.

Parameters:
codes - List of event codes
Returns:
List of found event templates

getEventTemplates

public java.util.List<EventTemplate> getEventTemplates()
                                                throws java.io.IOException,
                                                       NXCException
Get event templates from server

Returns:
List of configured event templates
Throws:
java.io.IOException - if socket I/O error occurs
NXCException - if NetXMS server returns an error or operation was timed out

generateEventCode

public long generateEventCode()
                       throws java.io.IOException,
                              NXCException
Generate code for new event template.

Returns:
Code for new event template
Throws:
java.io.IOException - if socket I/O error occurs
NXCException - if NetXMS server returns an error or operation was timed out

deleteEventTemplate

public void deleteEventTemplate(long eventCode)
                         throws java.io.IOException,
                                NXCException
Delete event template.

Parameters:
eventCode - Event code
Throws:
java.io.IOException - if socket I/O error occurs
NXCException - if NetXMS server returns an error or operation was timed out

modifyEventTemplate

public void modifyEventTemplate(EventTemplate evt)
                         throws java.io.IOException,
                                NXCException
Modify event template.

Parameters:
evt - Event template
Throws:
java.io.IOException - if socket I/O error occurs
NXCException - if NetXMS server returns an error or operation was timed out

getSnmpCommunities

public java.util.List<java.lang.String> getSnmpCommunities()
                                                    throws java.io.IOException,
                                                           NXCException
Get list of well-known SNMP communities configured on server.

Returns:
List of SNMP community strings
Throws:
java.io.IOException - if socket I/O error occurs
NXCException - if NetXMS server returns an error or operation was timed out

updateSnmpCommunities

public void updateSnmpCommunities(java.util.List<java.lang.String> list)
                           throws java.io.IOException,
                                  NXCException
Update list of well-known SNMP community strings on server. Existing list will be replaced by given one.

Parameters:
list - New list of SNMP community strings
Throws:
java.io.IOException - if socket I/O error occurs
NXCException - if NetXMS server returns an error or operation was timed out

getSnmpUsmCredentials

public java.util.List<SnmpUsmCredential> getSnmpUsmCredentials()
                                                        throws java.io.IOException,
                                                               NXCException
Get list of well-known SNMP USM (user security model) credentials configured on server.

Returns:
List of SNMP USM credentials
Throws:
java.io.IOException - if socket I/O error occurs
NXCException - if NetXMS server returns an error or operation was timed out

updateSnmpUsmCredentials

public void updateSnmpUsmCredentials(java.util.List<SnmpUsmCredential> list)
                              throws java.io.IOException,
                                     NXCException
Update list of well-known SNMP USM credentials on server. Existing list will be replaced by given one.

Parameters:
list - New list of SNMP USM credentials
Throws:
java.io.IOException - if socket I/O error occurs
NXCException - if NetXMS server returns an error or operation was timed out

getAgentConfig

public java.lang.String getAgentConfig(long nodeId)
                                throws java.io.IOException,
                                       NXCException
Get agent's master configuration file.

Parameters:
nodeId - Node ID
Returns:
Master configuration file of agent running on given node
Throws:
java.io.IOException - if socket I/O error occurs
NXCException - if NetXMS server returns an error or operation was timed out

updateAgentConfig

public void updateAgentConfig(long nodeId,
                              java.lang.String config,
                              boolean apply)
                       throws java.io.IOException,
                              NXCException
Update agent's master configuration file.

Parameters:
nodeId - Node ID
config - New configuration file content
apply - Apply flag - if set to true, agent will restart automatically to apply changes
Throws:
java.io.IOException - if socket I/O error occurs
NXCException - if NetXMS server returns an error or operation was timed out

getSupportedParameters

public java.util.List<AgentParameter> getSupportedParameters(long nodeId)
                                                      throws java.io.IOException,
                                                             NXCException
Get list of parameters supported by agent running on given node.

Parameters:
nodeId - Node ID
Returns:
List of parameters supported by agent
Throws:
java.io.IOException - if socket I/O error occurs
NXCException - if NetXMS server returns an error or operation was timed out

exportConfiguration

public java.lang.String exportConfiguration(java.lang.String description,
                                            long[] events,
                                            long[] traps,
                                            long[] templates)
                                     throws java.io.IOException,
                                            NXCException
Export server configuration. Returns requested configuration elements exported into XML.

Parameters:
description - Description of exported configuration
events - List of event codes
traps - List of trap identifiers
templates - List of template object identifiers
Returns:
resulting XML document
Throws:
java.io.IOException - if socket I/O error occurs
NXCException - if NetXMS server returns an error or operation was timed out

importConfiguration

public void importConfiguration(java.lang.String config,
                                int flags)
                         throws java.io.IOException,
                                NXCException
Import server configuration (events, traps, thresholds) from XML

Parameters:
config - Configuration in XML format
flags - Import flags
Throws:
java.io.IOException - if socket I/O error occurs
NXCException - if NetXMS server returns an error or operation was timed out

getServerStats

public java.util.Map<java.lang.String,java.lang.Object> getServerStats()
                                                                throws java.io.IOException,
                                                                       NXCException
Get server stats. Returns set of named properties. The following properties could be found in result set: String: VERSION Integer: UPTIME, SESSION_COUNT, DCI_COUNT, OBJECT_COUNT, NODE_COUNT, PHYSICAL_MEMORY_USED, VIRTUAL_MEMORY_USED, QSIZE_CONDITION_POLLER, QSIZE_CONF_POLLER, QSIZE_DCI_POLLER, QSIZE_DBWRITER, QSIZE_EVENT, QSIZE_DISCOVERY, QSIZE_NODE_POLLER, QSIZE_ROUTE_POLLER, QSIZE_STATUS_POLLER, ALARM_COUNT long[]: ALARMS_BY_SEVERITY

Returns:
Server stats as set of named properties.
Throws:
java.io.IOException - if socket I/O error occurs
NXCException - if NetXMS server returns an error or operation was timed out

getActions

public java.util.List<ServerAction> getActions()
                                        throws java.io.IOException,
                                               NXCException
Get list of configured actions from server

Returns:
List of configured actions
Throws:
java.io.IOException - if socket I/O error occurs
NXCException - if NetXMS server returns an error or operation was timed out

createAction

public long createAction(java.lang.String name)
                  throws java.io.IOException,
                         NXCException
Create new server action.

Parameters:
name - action name
Returns:
ID assigned to new action
Throws:
java.io.IOException - if socket I/O error occurs
NXCException - if NetXMS server returns an error or operation was timed out

modifyAction

public void modifyAction(ServerAction action)
                  throws java.io.IOException,
                         NXCException
Modify server action

Parameters:
action - Action object
Throws:
java.io.IOException - if socket I/O error occurs
NXCException - if NetXMS server returns an error or operation was timed out

deleteAction

public void deleteAction(long actionId)
                  throws java.io.IOException,
                         NXCException
Delete server action

Parameters:
actionId - Action ID
Throws:
java.io.IOException - if socket I/O error occurs
NXCException - if NetXMS server returns an error or operation was timed out

getObjectTools

public java.util.List<ObjectTool> getObjectTools()
                                          throws java.io.IOException,
                                                 NXCException
Get list of configured object tools

Returns:
List of object tools
Throws:
java.io.IOException - if socket I/O error occurs
NXCException - if NetXMS server returns an error or operation was timed out

getObjectToolDetails

public ObjectToolDetails getObjectToolDetails(long toolId)
                                       throws java.io.IOException,
                                              NXCException
Get object tool details

Parameters:
toolId - Tool ID
Returns:
Object tool details
Throws:
java.io.IOException - if socket I/O error occurs
NXCException - if NetXMS server returns an error or operation was timed out

generateObjectToolId

public long generateObjectToolId()
                          throws java.io.IOException,
                                 NXCException
Generate unique ID for new object tool.

Returns:
Unique ID for object tool
Throws:
java.io.IOException - if socket I/O error occurs
NXCException - if NetXMS server returns an error or operation was timed out

modifyObjectTool

public void modifyObjectTool(ObjectToolDetails tool)
                      throws java.io.IOException,
                             NXCException
Modify object tool.

Parameters:
tool - Object tool
Throws:
java.io.IOException - if socket I/O error occurs
NXCException - if NetXMS server returns an error or operation was timed out

deleteObjectTool

public void deleteObjectTool(long toolId)
                      throws java.io.IOException,
                             NXCException
Delete object tool.

Parameters:
toolId - Object tool ID
Throws:
java.io.IOException - if socket I/O error occurs
NXCException - if NetXMS server returns an error or operation was timed out

executeTableTool

public Table executeTableTool(long toolId,
                              long nodeId)
                       throws java.io.IOException,
                              NXCException
Execute object tool of "table" type against given node.

Parameters:
toolId - Tool ID
nodeId - Node object ID
Returns:
Table with tool execution results
Throws:
java.io.IOException - if socket I/O error occurs
NXCException - if NetXMS server returns an error or operation was timed out

executeServerCommand

public void executeServerCommand(long objectId,
                                 java.lang.String command)
                          throws java.io.IOException,
                                 NXCException
Execute server command related to given object (usually defined as object tool)

Parameters:
objectId - object ID
command - command
Throws:
java.io.IOException - if socket I/O error occurs
NXCException - if NetXMS server returns an error or operation was timed out

getSnmpTrapsConfiguration

public java.util.List<SnmpTrap> getSnmpTrapsConfiguration()
                                                   throws java.io.IOException,
                                                          NXCException
Get list of configured SNMP traps

Returns:
List of configured SNMP traps.
Throws:
java.io.IOException - if socket I/O error occurs
NXCException - if NetXMS server returns an error or operation was timed out

createSnmpTrapConfiguration

public long createSnmpTrapConfiguration()
                                 throws java.io.IOException,
                                        NXCException
Create new trap configuration record.

Returns:
ID of new record
Throws:
java.io.IOException - if socket I/O error occurs
NXCException - if NetXMS server returns an error or operation was timed out

deleteSnmpTrapConfiguration

public void deleteSnmpTrapConfiguration(long trapId)
                                 throws java.io.IOException,
                                        NXCException
Delete SNMP trap configuration record from server.

Parameters:
trapId - Trap configuration record ID
Throws:
java.io.IOException - if socket I/O error occurs
NXCException - if NetXMS server returns an error or operation was timed out

modifySnmpTrapConfiguration

public void modifySnmpTrapConfiguration(SnmpTrap trap)
                                 throws java.io.IOException,
                                        NXCException
Modify SNMP trap configuration record.

Parameters:
trap - Modified trap configuration record
Throws:
java.io.IOException - if socket I/O error occurs
NXCException - if NetXMS server returns an error or operation was timed out

getMibFileTimestamp

public java.util.Date getMibFileTimestamp()
                                   throws java.io.IOException,
                                          NXCException
Get timestamp of server's MIB file.

Returns:
Timestamp of server's MIB file
Throws:
java.io.IOException - if socket I/O error occurs
NXCException - if NetXMS server returns an error or operation was timed out

downloadMibFile

public java.io.File downloadMibFile()
                             throws java.io.IOException,
                                    NXCException
Download MIB file from server.

Returns:
file handle for temporary file on local file system
Throws:
java.io.IOException - if socket or file I/O error occurs
NXCException - if NetXMS server returns an error or operation was timed out

getPredefinedGraphs

public java.util.List<GraphSettings> getPredefinedGraphs()
                                                  throws java.io.IOException,
                                                         NXCException
Get list of predefined graphs.

Returns:
list of predefined graphs
Throws:
java.io.IOException - if socket or file I/O error occurs
NXCException - if NetXMS server returns an error or operation was timed out

getScriptLibrary

public java.util.List<Script> getScriptLibrary()
                                        throws java.io.IOException,
                                               NXCException
Specified by:
getScriptLibrary in interface ScriptLibraryManager
Throws:
java.io.IOException
NXCException

getScript

public Script getScript(long scriptId)
                 throws java.io.IOException,
                        NXCException
Specified by:
getScript in interface ScriptLibraryManager
Throws:
java.io.IOException
NXCException

modifyScript

public long modifyScript(long scriptId,
                         java.lang.String name,
                         java.lang.String source)
                  throws java.io.IOException,
                         NXCException
Specified by:
modifyScript in interface ScriptLibraryManager
Throws:
java.io.IOException
NXCException

renameScript

public void renameScript(long scriptId,
                         java.lang.String name)
                  throws java.io.IOException,
                         NXCException
Specified by:
renameScript in interface ScriptLibraryManager
Throws:
java.io.IOException
NXCException

deleteScript

public void deleteScript(long scriptId)
                  throws java.io.IOException,
                         NXCException
Specified by:
deleteScript in interface ScriptLibraryManager
Throws:
java.io.IOException
NXCException

isConnected

public boolean isConnected()

Specified by:
isConnected in interface Session

findConnectionPoint

public ConnectionPoint findConnectionPoint(long objectId)
                                    throws java.io.IOException,
                                           NXCException
Find connection point (either directly connected or most close known interface on a switch) for given node or interface object. Will return null if connection point information cannot be found.

Parameters:
objectId - Node or interface object ID
Returns:
connection point information or null
Throws:
java.io.IOException - if socket or file I/O error occurs
NXCException - if NetXMS server returns an error or operation was timed out

findConnectionPoint

public ConnectionPoint findConnectionPoint(MacAddress macAddr)
                                    throws java.io.IOException,
                                           NXCException
Find connection point (either directly connected or most close known interface on a switch) for given MAC address. Will return null if connection point information cannot be found.

Parameters:
macAddr - MAC address
Returns:
connection point information or null
Throws:
java.io.IOException - if socket or file I/O error occurs
NXCException - if NetXMS server returns an error or operation was timed out

checkConnection

public void checkConnection()
                     throws java.io.IOException,
                            NXCException

Specified by:
checkConnection in interface Session
Throws:
java.io.IOException
NXCException

getImageLibrary

public java.util.List<LibraryImage> getImageLibrary()
                                             throws java.io.IOException,
                                                    NXCException
Specified by:
getImageLibrary in interface ImageLibraryManager
Throws:
java.io.IOException
NXCException

getImageLibrary

public java.util.List<LibraryImage> getImageLibrary(java.lang.String category)
                                             throws java.io.IOException,
                                                    NXCException
Specified by:
getImageLibrary in interface ImageLibraryManager
Throws:
java.io.IOException
NXCException

getImage

public LibraryImage getImage(java.lang.String guid)
                      throws java.io.IOException,
                             NXCException
Specified by:
getImage in interface ImageLibraryManager
Throws:
java.io.IOException
NXCException

createImage

public LibraryImage createImage(LibraryImage image)
                         throws java.io.IOException,
                                NXCException
Specified by:
createImage in interface ImageLibraryManager
Throws:
java.io.IOException
NXCException

deleteImage

public void deleteImage(LibraryImage image)
                 throws java.io.IOException,
                        NXCException
Specified by:
deleteImage in interface ImageLibraryManager
Throws:
java.io.IOException
NXCException

modifyImage

public void modifyImage(LibraryImage image)
                 throws java.io.IOException,
                        NXCException
Specified by:
modifyImage in interface ImageLibraryManager
Throws:
java.io.IOException
NXCException

pollNode

public void pollNode(long nodeId,
                     int pollType,
                     NodePollListener listener)
              throws java.io.IOException,
                     NXCException
Perform a forced node poll. This method will not return until poll is complete, so it's advised to run it from separate thread. For each message received from poller listener's method onPollerMessage will be called.

Parameters:
nodeId - node object ID
pollType - poll type (defined in org.netxms.client.constants.NodePoller)
listener - listener
Throws:
java.io.IOException - if socket or file I/O error occurs
NXCException - if NetXMS server returns an error or operation was timed out

getSituations

public java.util.List<Situation> getSituations()
                                        throws java.io.IOException,
                                               NXCException
Get list of all configured situations

Returns:
list of situation objects
Throws:
java.io.IOException - if socket or file I/O error occurs
NXCException - if NetXMS server returns an error or operation was timed out

createSituation

public long createSituation(java.lang.String name,
                            java.lang.String comments)
                     throws java.io.IOException,
                            NXCException
Create new situation object.

Parameters:
name - name for new situation object
comments - comments for new situation object
Returns:
id assigned to created situation object
Throws:
java.io.IOException - if socket or file I/O error occurs
NXCException - if NetXMS server returns an error or operation was timed out

modifySituation

public void modifySituation(long id,
                            java.lang.String name,
                            java.lang.String comments)
                     throws java.io.IOException,
                            NXCException
Modify situation object.

Parameters:
id - situation id
name - new name or null to leave unchanged
comments - new comments or null to leave unchanged
Throws:
java.io.IOException - if socket or file I/O error occurs
NXCException - if NetXMS server returns an error or operation was timed out

deleteSituation

public void deleteSituation(long id)
                     throws java.io.IOException,
                            NXCException
Delete situation object

Parameters:
id - situation id
Throws:
java.io.IOException - if socket or file I/O error occurs
NXCException - if NetXMS server returns an error or operation was timed out

deleteSituationInstance

public void deleteSituationInstance(long id,
                                    java.lang.String instance)
                             throws java.io.IOException,
                                    NXCException
Delete situation instance

Parameters:
id - situation id
instance - situation instance
Throws:
java.io.IOException - if socket or file I/O error occurs
NXCException - if NetXMS server returns an error or operation was timed out


Copyright © 2011. All Rights Reserved.