Package org.netxms.client
Class NXCSession
- java.lang.Object
-
- org.netxms.client.NXCSession
-
public class NXCSession extends Object
Communication session with NetXMS server.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected classNXCSession.MessageSubscriptionMessage subscription class
-
Field Summary
-
Constructor Summary
Constructors Constructor Description NXCSession(String connAddress)NXCSession(String connAddress, int connPort)NXCSession(String connAddress, int connPort, boolean connUseEncryption)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidacknowledgeAlarm(long alarmId)Acknowledge alarm.voidacknowledgeAlarm(long alarmId, boolean sticky, int time)Acknowledge alarm.voidacknowledgeAlarm(String helpdeskReference)Acknowledge alarm by helpdesk reference.voidaddClusterNode(long clusterId, long nodeId)Add node to cluster.voidaddConsoleListener(ServerConsoleListener listener)Add server console listenervoidaddListener(SessionListener listener)Add notification listenervoidaddMessageSubscription(int messageCode, long messageId, MessageHandler handler)Subscribe to specific messagesvoidaddRepository(Repository r)Add repository.voidaddScheduledTask(ScheduledTask task)Add new scheduled taskvoidapplyTemplate(long templateId, long nodeId)Apply data collection template to node.booleanareChildrenSynchronized(long id)Returns true if children are already synchronized for given object.voidbindAgentTunnel(int tunnelId, long nodeId)Bind agent tunnel to nodevoidbindObject(long parentId, long childId)Bind object.Map<Long,Integer>bulkResolveAlarms(List<Long> alarmIds)Bulk terminate alarms.Map<Long,Integer>bulkTerminateAlarms(List<Long> alarmIds)Bulk terminate alarms.voidcancelFileMonitoring(long nodeId, String remoteFileName)Cancel file monitoringvoidcancelServerJob(long jobId)Cancel server jobvoidchangeObjecToolDisableStatuss(long toolId, boolean enable)Delete object tool.voidchangeObjectZone(long objectId, long zoneUIN)Move object to different zone.booleancheckConnection()Send KEEPALIVE message.voidclearAgentDataCollectionConfiguration(long nodeId)Clear data collection configuration on agent.voidclearCollectedData(long nodeId, long dciId)Clear collected data for given DCIvoidcloseConsole()Close server console.voidcloseEventProcessingPolicy()Close event processing policy.protected voidcloseTcpProxy(int channelId)Close TCP proxy channel.ScriptCompilationResultcompileScript(String source, boolean serialize)Compile NXSL script on server.voidconnect()Connect to NetMS server.voidconnect(int[] componentVersions)Connect to NetMS server.voidcopyAgentFile(long nodeId, String oldName, String newFileName, boolean overwrite)Copy file from agentlongcreateAction(String name)Create new server action.voidcreateAlarmComment(long alarmId, String text)Create alarm comment.voidcreateAlarmComment(String helpdeskReference, String text)Create alarm comment by helpdesk reference.protected voidcreateCustomObject(NXCObjectCreationData data, Object userData, org.netxms.base.NXCPMessage msg)Hook method to allow adding of custom object creation data to NXCP message.protected AbstractObjectcreateCustomObjectFromMessage(int objectClass, org.netxms.base.NXCPMessage msg)Create custom object from NXCP message.voidcreateFolderOnAgent(long nodeId, String folder)Create folder on remote system via agentGraphFoldercreateGraphTree(List<GraphSettings> graphs)Create graph tree from listLibraryImagecreateImage(LibraryImage image, ProgressListener listener)Create an imageintcreateMappingTable(String name, String description, int flags)Create new mapping table.voidcreateNewCertificate(byte[] data, String comments)Create new certificatevoidcreateNotificationChannel(NotificationChannel nc)Create notification channellongcreateObject(NXCObjectCreationData data)Create new NetXMS object.longcreateObject(NXCObjectCreationData data, Object userData)Create new NetXMS object.longcreateSnmpTrapConfiguration()Create new trap configuration record.ObjectToolFoldercreateToolTree(List<ObjectTool> tools)Create object tool treelongcreateUser(String name)Create user on servervoidcreateUserAgentNotification(String message, long[] objects, Date startTime, Date endTime, boolean startup)Create new user agent notificationsvoidcreateUserAgentNotification(String message, Collection<Long> objects, Date startTime, Date endTime, boolean onStartup)Create new user agent notificationslongcreateUserGroup(String name)Create user group on serverString[]dciIdsToNames(long[] nodeIds, long[] dciIds)Get names for given DCI listString[]dciIdsToNames(Collection<ConditionDciInfo> dciList)Get names for given DCI listlongdciNameToId(long nodeId, String dciName)Get DCI ID for given DCI namevoiddeleteAction(long actionId)Delete server actionvoiddeleteAgentConfig(long id)Delete config with given id.voiddeleteAgentFile(long nodeId, String fileName)Delete file from agentvoiddeleteAlarm(long alarmId)Delete alarm.voiddeleteAlarmCategory(long id)Delete alarm category in DBvoiddeleteAlarmComment(long alarmId, long commentId)Delete alarm comment.voiddeleteCertificate(long id)Delete certificatevoiddeleteDciEntry(long nodeId, long dciId, long timestamp)Delete collected data entry for given DCIvoiddeleteDciSummaryTable(int id)Delete DCI summary table.voiddeleteEventTemplate(long eventCode)Delete event template.voiddeleteImage(UUID guid)Delete an imagevoiddeleteImage(LibraryImage image)Delete an imagevoiddeleteMappingTable(int id)Delete mapping tablevoiddeleteNotificationChannel(String name)Delete notification channelvoiddeleteObject(long objectId)Delete objectvoiddeleteObjectTool(long toolId)Delete object tool.voiddeletePersistentStorageValue(String key)Delete persistent storage valuevoiddeletePhysicalLink(long linkId)Delete physical link.voiddeletePolicy(long templateId, UUID guid)Delete policyvoiddeletePredefinedGraph(long graphId)Delete predefined graph.voiddeleteReportResult(UUID reportId, UUID jobId)Delete report resultvoiddeleteReportSchedule(UUID reportId, UUID jobId)Delete report schedulevoiddeleteRepository(int id)Delete repository.voiddeleteScheduledTask(long taskId)Delete scheduled task.voiddeleteScript(long scriptId)Delete script from libraryvoiddeleteServerFile(String serverFileName)Delete file from server's file storevoiddeleteServerVariable(String name)Delete server configuration variablevoiddeleteSnmpTrapConfiguration(long trapId)Delete SNMP trap configuration record from server.voiddeleteUserDBObject(long id)Delete user or group on servervoiddeleteWebServiceDefinition(int id)Delete web service definition.voiddeployAgentPolicy(long policyId, long nodeId)Deploy policy on agentvoiddeployPackage(long packageId, Long[] nodeList, PackageDeploymentListener listener)Deploy agent packages onto given nodesvoiddetachUserFromLdap(long userId)Detach user from LDAPvoiddisconnect()Disconnect from server.AgentFileDatadownloadFileFromAgent(long nodeId, String remoteFileName, boolean expandMacros, long alarmId, Map<String,String> inputValues, long maxFileSize, boolean follow, ProgressListener listener, ServerJobIdUpdater updateServerJobId)Download file from remote host via agent.AgentFileDatadownloadFileFromAgent(long nodeId, String remoteFileName, long maxFileSize, boolean follow, ProgressListener listener, ServerJobIdUpdater updateServerJobId)Download file from remote host via agent.FiledownloadFileFromServer(String remoteFileName)Download file from server file storage.FiledownloadMibFile()Download MIB file from server.voidexecuteAction(long nodeId, String action, String[] args)Execute action on remote agentvoidexecuteAction(long nodeId, String action, String[] args, boolean receiveOutput, TextOutputListener listener, Writer writer)Execute action on remote agentStringexecuteActionWithExpansion(long nodeId, long alarmId, String action, boolean receiveOutput, Map<String,String> inputValues, TextOutputListener listener, Writer writer)Execute action on remote agentStringexecuteActionWithExpansion(long nodeId, long alarmId, String action, Map<String,String> inputValues)Execute action on remote agentvoidexecuteLibraryScript(long nodeId, long alarmId, String script, Map<String,String> inputFields, TextOutputListener listener)Execute library script on object.voidexecuteLibraryScript(long nodeId, String script, Map<String,String> inputFields, TextOutputListener listener)Execute library script on object.UUIDexecuteReport(UUID reportId, Map<String,String> parameters)Execute a reportvoidexecuteScript(long nodeId, String script, TextOutputListener listener)Execute script.voidexecuteServerCommand(long objectId, String command, Map<String,String> inputFields)Execute server command related to given object (usually defined as object tool)voidexecuteServerCommand(long objectId, String command, Map<String,String> inputFields, boolean receiveOutput, TextOutputListener listener, Writer writer)Execute server command related to given object (usually defined as object tool)protected voidexecuteSimpleCommand(int command)Execute simple commands (without arguments and only returning RCC)TableexecuteTableTool(long toolId, long nodeId)Execute object tool of "table" type against given node.StringexportConfiguration(String description, long[] events, long[] traps, long[] templates, UUID[] rules, long[] scripts, long[] objectTools, long[] dciSummaryTables, long[] actions)Export server configuration.List<AbstractObject>filterObjects(ObjectFilter filter)Find all objects matching given filter.protected voidfinalize()AlarmCategoryfindAlarmCategoryById(long id)Find alarm category by id in alarm category database internally maintained by session object.AlarmCategoryfindAlarmCategoryByName(String name)Find alarm category by name in alarm category database internally maintained by session object.ConnectionPointfindConnectionPoint(int zoneId, InetAddress ipAddr)Find connection point (either directly connected or most close known interface on a switch) for given IP address.ConnectionPointfindConnectionPoint(long objectId)Find connection point (either directly connected or most close known interface on a switch) for given node or interface object.ConnectionPointfindConnectionPoint(org.netxms.base.MacAddress macAddr)Find connection point (either directly connected or most close known interface on a switch) for given MAC address.EventTemplatefindEventTemplateByCode(long code)Find event template by code in event template database internally maintained by session object.EventTemplatefindEventTemplateByName(String name)Find event template by name in event template database internally maintained by session object.List<DciValue>findMatchingDCI(long objectId, String objectName, String dciName, int flags)Resolve list of last values by regexList<AlarmCategory>findMultipleAlarmCategories(List<Long> ids)Find multiple alarm categories by category id`s in alarm category database internally maintained by session object.List<EventTemplate>findMultipleEventTemplates(long[] codes)Find multiple event templates by event codes in event template database internally maintained by session object.List<EventTemplate>findMultipleEventTemplates(Long[] codes)Find multiple event templates by event codes in event template database internally maintained by session object.List<AbstractObject>findMultipleObjects(long[] idList, boolean returnUnknown)Find multiple NetXMS objects by identifiersList<AbstractObject>findMultipleObjects(long[] idList, Class<? extends AbstractObject> classFilter, boolean returnUnknown)Find multiple NetXMS objects by identifiersList<AbstractObject>findMultipleObjects(Long[] idList, boolean returnUnknown)Find multiple NetXMS objects by identifiersList<AbstractObject>findMultipleObjects(Long[] idList, Class<? extends AbstractObject> classFilter, boolean returnUnknown)Find multiple NetXMS objects by identifiersList<AbstractNode>findNodesByHostname(int zoneId, String hostname)Find all nodes that contain the primary hostnameAbstractObjectfindObject(ObjectFilter filter)Generic object find using filter.AbstractObjectfindObjectByGUID(UUID guid)Find NetXMS object by it's GUID.<T extends AbstractObject>
TfindObjectByGUID(UUID guid, Class<T> requiredClass)Find NetXMS object by it's GUID with additional class checking.AbstractObjectfindObjectById(long id)Find NetXMS object by it's identifier.<T> TfindObjectById(long id, Class<T> requiredClass)Find NetXMS object by it's identifier with additional class checking.AbstractObjectfindObjectByName(String name)Find object by name.AbstractObjectfindObjectByName(String name, ObjectFilter filter)Find object by name with object filter.AbstractObjectfindObjectByNamePattern(String pattern)Find object by name using regular expression.List<AbstractObject>findObjectByRegex(String regex)Find object by regexAbstractUserObjectfindUserDBObjectByGUID(UUID guid)Find user or group by GUIDAbstractUserObjectfindUserDBObjectById(long id, Runnable callback)Find user or group by IDList<AbstractUserObject>findUserDBObjectsByIds(List<Long> ids)Find multiple users by list of IDsZonefindZone(long zoneUIN)Find zone object by zone UIN (unique identification number).voidforceDCIPoll(long nodeId, long dciId)Force DCI poll for given DCIvoidforcePolicyInstallation(long templateId)Force policy installation on all nodes where template is appliedlonggenerateEventCode()Generate code for new event template.longgenerateObjectToolId()Generate unique ID for new object tool.List<ServerAction>getActions()Get list of configured actions from serverList<Threshold>getActiveThresholds(List<SingleDciConfig> dciConfig)Get active thresholdsList<InetAddressListElement>getAddressList(int listId)Get address list.StringgetAgentConfig(long nodeId)Get agent's master configuration file.AgentFileInfogetAgentFileInfo(AgentFile file)Return information about agent fileAgentPolicygetAgentPolicy(long templateId, UUID policyGUID)Get agent policy by template id and GUIDHashMap<UUID,AgentPolicy>getAgentPolicyList(long templateId)Returns agent policy listList<AgentTunnel>getAgentTunnels()Get list of agent tunnelsAlarmgetAlarm(long alarmId)Get information about single active alarm.List<AlarmCategory>getAlarmCategories()Get alarm categories from serverList<AlarmComment>getAlarmComments(long alarmId)Get list of comments for given alarm.List<EventInfo>getAlarmEvents(long alarmId)Get information about events related to single active alarm.intgetAlarmListDisplayLimit()Get maximum number of records allowed to be displayed in alarm listHashMap<Long,Alarm>getAlarms()Get list of active alarms.List<AbstractObject>getAllObjects()Get list of all objectsList<Zone>getAllZones()Get all accessible zone objectsStringgetAttributeForCurrentUser(String name)Get custom attribute for currently logged in user.AuthenticationTypegetAuthenticationMethod()Get the current authentication methodEventTemplate[]getCachedEventTemplates()Get cached list event templatesList<AuthCertificate>getCertificateList()Get list of certificatesStringgetClientConfigurationHint(String name)Get client configuration hint as stringStringgetClientConfigurationHint(String name, String defaultValue)Get client configuration hint as stringbooleangetClientConfigurationHintAsBoolean(String name, boolean defaultValue)Get client configuration hint as booleanintgetClientConfigurationHintAsInt(String name, int defaultValue)Get client configuration hint as integerStringgetClientInfo()Get client information stringStringgetClientLanguage()Get the client`s languageintgetClientType()DciDatagetCollectedData(long nodeId, long dciId, Date from, Date to, int maxRows, HistoricalDataType valueType)Get collected DCI data from server.DciDatagetCollectedTableData(long nodeId, long dciId, String instance, String dataColumn, Date from, Date to, int maxRows)Get collected table DCI data from server.ConfigContentgetConfigContent(long id)Saves existing configList<ConfigListElement>getConfigList()Gets the list of configuration files.(Config id, name and sequence number)long[]getDataCollectionEvents(long objectId)Get all events used in data collection by given node, cluster, or template object.List<Script>getDataCollectionScripts(long objectId)Get names of all scripts used in data collection by given node, cluster, or template object.StringgetDateFormat()Get default date format provided by serverDciSummaryTablegetDciSummaryTable(int id)Get DCI summary table configuration.intgetDefaultDciPollingInterval()Get the default DCI polling intervalintgetDefaultDciRetentionTime()Get the default DCI retention timeintgetDefaultRecvBufferSize()Get default receiver buffer size.List<DependentNode>getDependentNodes(long nodeId)Get list of dependent nodes for given node.List<String>getDriverNames()Get driver name listintgetEffectiveRights(long objectId)Get effective rights of currently logged in user to given object.StringgetEventName(long code)Get event name from event codeEventProcessingPolicygetEventProcessingPolicy()Get read-only copy of event processing policy.List<EventTemplate>getEventTemplates()Get event objects from serverintgetGraceLogins()Get number of remaining grace loginsStringgetHelpdeskIssueUrl(long alarmId)Get URL for helpdesk issue associated with given alarmLibraryImagegetImage(UUID guid)Get an image from the libraryList<LibraryImage>getImageLibrary()Get the whole image libraryList<LibraryImage>getImageLibrary(String category)Get the image library of specific categoryList<PackageInfo>getInstalledPackages()Get list of installed packagesDciValue[]getLastValues(long nodeId)Get last DCI values for given nodeDciValue[]getLastValues(long nodeId, boolean objectTooltipOnly, boolean overviewOnly, boolean includeNoValueObjects)Get last DCI values for given nodeDciValue[]getLastValues(List<SingleDciConfig> dciConfig)Get last DCI values for given Single Dci Config listDciValue[]getLastValues(Set<MapDCIInstance> mapDcis)Get last DCI values for given Map DCI Instance listList<org.netxms.base.GeoLocation>getLocationHistory(long objectId, Date from, Date to)Get location history for given object.MappingTablegetMappingTable(int id)Get list of specific mapping tableintgetMaxRecvBufferSize()Get max receiver buffer size.StringgetMessageOfTheDay()Get message of the day if server config is setDategetMibFileTimestamp()Get timestamp of server's MIB file.intgetMinViewRefreshInterval()Get the minimal view refresh intervalNetworkPathgetNetworkPath(long node1, long node2)Get IPv4 network path between two nodes.List<HardwareComponent>getNodeHardwareComponents(long nodeId)PhysicalComponentgetNodePhysicalComponents(long nodeId)Get node's physical components (obtained from ENTITY-MIB).List<SoftwarePackage>getNodeSoftwarePackages(long nodeId)Get list of software packages installed on node.List<WinPerfObject>getNodeWinPerfObjects(long nodeId)Get list of available Windows performance objects.List<NotificationChannel>getNotificationChannels()Get server notification channelsStringgetObjectName(long objectId)Get object name by ID.ObjectToolDetailsgetObjectToolDetails(long toolId)Get object tool detailsList<ObjectTool>getObjectTools()Get list of configured object toolsObjectToolFoldergetObjectToolsAsTree()PerfTabDci[]getPerfTabItems(long nodeId)Get list of DCIs configured to be shown on performance tab in console for given node.HashMap<String,String>getPersistentStorageList()Get list of all values in persistent storageList<PhysicalLink>getPhysicalLinks(long objectId, long patchPanelId)Get list of physical links filtered by provided optionsGraphSettingsgetPredefinedGraph(long graphId)Get predefined graph infromation by graph idList<GraphSettings>getPredefinedGraphs(boolean graphTemplates)Get list of predefined graphs or graph templatesGraphFoldergetPredefinedGraphsAsTree()DciDatagetPredictedData(long nodeId, long dciId, Date from, Date to)Get predicted DCI data from server.List<PredictionEngine>getPredictionEngines()Get list of registered prediction enginesStringgetPublicServerVariable(String name)Get server public configuration variablebooleangetPublicServerVariableAsBoolean(String name)Get server public configuration variable as boolen valueintgetPublicServerVariableAsInt(String name)Get server public configuration variable as a intString[]getRegisteredServerComponents()Get list of registered server componentsReportDefinitiongetReportDefinition(UUID reportId)Get the report definitionList<Repository>getRepositories()Get list of configured repositoriesList<Route>getRoutingTable(long nodeId)Get routing table from nodeList<ScheduledTask>getScheduledTasks()Get list of scheduled tasks.List<String>getScheudledTaskHandlers()Get list of available scheduled task handlers.ScriptgetScript(long scriptId)Get script from libraryList<Script>getScriptLibrary()Get list of all scripts in script library.StringgetServerAddress()Get server addressbyte[]getServerChallenge()StringgetServerColor()Get server identification colourStringgetServerConfigClob(String name)Get server config CLOBlonggetServerId()Get NetXMS server UID.ServerJob[]getServerJobList()Get list of server jobsStringgetServerName()Get server nameMap<String,Object>getServerStats()Get server stats.longgetServerTime()Get server timeStringgetServerTimeZone()Get server time zone.Map<String,ServerVariable>getServerVariables()Get server configuration variablesStringgetServerVersion()Get NetXMS server version.intgetSessionId()Get this session's ID on server.StringgetShortTimeFormat()Get time format for short form (usually without seconds).Map<Integer,List<String>>getSnmpCommunities()Get list of well-known SNMP communities configured on server.List<SnmpTrap>getSnmpTrapsConfiguration()Get list of configured SNMP trapsList<SnmpTrap>getSnmpTrapsConfigurationSummary()Get summary of SNMP trap mapping.Map<Integer,List<SnmpUsmCredential>>getSnmpUsmCredentials()Get list of well-known SNMP USM (user security model) credentials configured on server.long[]getSubnetAddressMap(long subnetId)Get address map for subnet.List<AgentParameter>getSupportedParameters(long nodeId)Get list of parameters supported by agent running on given node.List<AgentParameter>getSupportedParameters(long nodeId, int origin)Get list of parameters supported by entity defined by origin on given node.List<AgentTable>getSupportedTables(long nodeId)Get list of tables supported by agent running on given node.List<FdbEntry>getSwitchForwardingDatabase(long nodeId)Get switch forwarding database (MAC address table) from nodeTablegetTableLastValues(long nodeId, long dciId)Get last values for given table DCI on given nodeThreshold[]getThresholds(long nodeId, long dciId)Get list of thresholds configured for given DCIList<ThresholdViolationSummary>getThresholdSummary(long objectId)Get threshold violation summary for all nodes under given parent object.StringgetTileServerURL()Get server URLStringgetTimeFormat()Get default time format provided by serverAbstractObject[]getTopLevelObjects()Get list of top-level objects.AbstractObject[]getTopLevelObjects(Set<Integer> classFilter)Get list of top-level objects matching given class filter.List<UserAgentNotification>getUserAgentNotifications()Get user agent notifications listAbstractUserObject[]getUserDatabaseObjects()Get list of all user database objectsintgetUserId()Get identifier of logged in user.StringgetUserName()Get the current user namelonggetUserSystemRights()Get system-wide rights of currently logged in user.List<VlanInfo>getVlans(long nodeId)Get list of VLANs configured on given nodeList<WebServiceDefinition>getWebServiceDefinitions()Get configured web service definitions.List<WirelessStation>getWirelessStations(long nodeId)Get list of wireless stations registered at given wireless controller.List<ZmqSubscription>getZmqSubscriptions(ZmqSubscriptionType type)Get subscriptions for ZMQ data forwarderStringgetZoneName(long zoneUIN)Get zone name by UINvoidhandover(NXCSession target)Handover object cache to new session.voidholdServerJob(long jobId)Put server job on holdvoidimportConfiguration(String config, int flags)Import server configuration (events, traps, thresholds) from XMLlonginstallPackage(PackageInfo info, File pkgFile, ProgressListener listener)Install (upload) package on serverbooleanisAlarmCategoriesSynchronized()Check if alarm categories are synchronized.booleanisConnected()Get connection statebooleanisEncrypted()Get encryption state for current session.booleanisEventObjectsSynchronized()Check if event configuratrion objects are synchronized.booleanisHelpdeskLinkActive()Get status of helpdesk integration module on server.booleanisIgnoreProtocolVersion()Get the state of protocol version checkbooleanisObjectsSynchronized()booleanisPasswordExpired()Check if password is expired for currently logged in user.booleanisServerComponentRegistered(String componentId)Check if server component with given id is registeredbooleanisServerConsoleConnected()booleanisStrictAlarmStatusFlow()Get the state of alarm status flowbooleanisTimedAlarmAckEnabled()booleanisUserDatabaseSynchronized()Check if user database is synchronized with clientbooleanisZoningEnabled()Get the state of zoningList<AgentFile>listAgentFiles(AgentFile file, String fullPath, long objectId)List files on agent file store.List<DciSummaryTableDescriptor>listDciSummaryTables()Get list of all configured DCI summary tablesList<MappingTableDescriptor>listMappingTables()Get list of all configured mapping tables.List<ReportResult>listReportResults(UUID reportId)List report resultsList<UUID>listReports()List reportsList<ReportingJob>listScheduledJobs(UUID reportId)List scheduled jobsServerFile[]listServerFiles()List files in server's file store.ServerFile[]listServerFiles(String[] filter)List files in server's file store.voidlockUserDatabase()Lock user databasevoidlogin(String login, String password)Login to server using login name and password.voidlogin(String login, Certificate certificate, Signature signature)Login to server using certificate.voidlogin(AuthenticationType authType, String login, String password, Certificate certificate, Signature signature)Login to server.voidmodifyAction(ServerAction action)Modify server actionlongmodifyAlarmCategory(AlarmCategory object)Add or update alarm category in DBprotected voidmodifyCustomObject(NXCObjectModificationData data, Object userData, org.netxms.base.NXCPMessage msg)Hook method to populate NXCP message with custom object's data on object modification.intmodifyDciSummaryTable(DciSummaryTable table)Modify DCI summary table configuration.voidmodifyEventObject(EventTemplate tmpl)Modify event template.voidmodifyImage(LibraryImage image, ProgressListener listener)Modify an imagevoidmodifyObject(NXCObjectModificationData data)Modify object (generic interface, in most cases wrapper functions should be used instead).voidmodifyObject(NXCObjectModificationData data, Object userData)Modify object (generic interface, in most cases wrapper functions should be used instead).voidmodifyObjectTool(ObjectToolDetails tool)Modify object tool.voidmodifyRepository(Repository r)Modify repository.longmodifyScript(long scriptId, String name, String source)Modify script.voidmodifySnmpTrapConfiguration(SnmpTrap trap)Modify SNMP trap configuration record.voidmodifyUserDBObject(AbstractUserObject object)Modify user database objectvoidmodifyUserDBObject(AbstractUserObject object, int fields)Modify user database objectintmodifyWebServiceDefinition(WebServiceDefinition definition)Modify (or create new) web service definition.voidmoveAgentFile(long nodeId, String oldName, String newFileName, boolean overwrite)Move file from agentorg.netxms.base.NXCPMessagenewMessage(int code)Create new NXCP message with unique idvoidonPolicyEditorClose(long templateId)Command sent on policyEditor close to send updates to all applied nodesvoidopenConsole()Open server console.DataCollectionConfigurationopenDataCollectionConfiguration(long nodeId)Open data collection configuration for given node.DataCollectionConfigurationopenDataCollectionConfiguration(long nodeId, DataCollectionConfigurationChangeListener changeListener)Open data collection configuration for given node.EventProcessingPolicyopenEventProcessingPolicy()Open event processing policy for editing.StringopenHelpdeskIssue(long alarmId)Open issue in helpdesk system from given alarmLogopenServerLog(String logName)Open server log by name.intparseDataRows(byte[] input, DciData data)Parse data from raw message CMD_DCI_DATA.voidpollNode(long nodeId, NodePollType pollType, TextOutputListener listener)Perform a forced node poll.booleanprocessConsoleCommand(String command)Process console command on server.voidpushDciData(long nodeId, long dciId, String value)Push value for single DCI.voidpushDciData(String nodeName, String dciName, String value)Push value for single DCI.voidpushDciData(DciPushData[] data)Push data to server.TablequeryAdHocDciSummaryTable(long baseObjectId, List<DciSummaryTableColumn> columns, AggregationFunction function, Date periodStart, Date periodEnd, boolean multiInstance)Query ad-hoc DCI summary table.TablequeryAgentTable(long nodeId, String name)Query agent's table immediately.TablequeryDciSummaryTable(int tableId, long baseObjectId)Query DCI summary table.NetworkMapPagequeryInternalConnectionTopology(long nodeId)Query internal connection topology for nodeNetworkMapPagequeryLayer2Topology(long nodeId)Query layer 2 topology for nodeList<ObjectQueryResult>queryObjectDetails(String query, List<String> properties, List<String> orderBy, int limit)Query objects on server side and read certain object properties.List<AbstractObject>queryObjects(String query)Query objects on server sideStringqueryParameter(long nodeId, int origin, String name)Query parameter immediately.longrecalculateDCIValues(long objectId, long dciId)Start recalculation of DCI values using preserver raw values.voidrecallUserAgentNotification(long id)Recall user agent notificationTablereceiveTable(long requestId, int msgCode)Receive table from server.voidremoveClusterNode(long clusterId, long nodeId)Remove node from cluster.voidremoveConsoleListener(ServerConsoleListener listener)Remove server console listenervoidremoveListener(SessionListener listener)Remove notification listenervoidremoveMessageSubscription(int messageCode, long messageId)Remove message subscriptionvoidremovePackage(long packageId)Remove agent package from servervoidremoveTemplate(long templateId, long nodeId, boolean removeDci)Remove data collection template from node.voidrenameAgentFile(long nodeId, String oldName, String newFileName, boolean overwrite)Rename agent's filevoidrenameNotificaiotnChannel(String name, String newName)Rename notification channelvoidrenameScript(long scriptId, String name)Rename script in script library.FilerenderReport(UUID reportId, UUID jobId, ReportRenderFormat format)Render reportvoidresetServerComponent(int component)Reset server's internal component (defined by SERVER_COMPONENT_xxx)voidresolveAlarm(long alarmId)Resolve alarm.voidresolveAlarm(String helpdeskReference)Resolve alarm by helpdesk reference.voidresyncAgentDataCollectionConfiguration(long nodeId)Force re-synchronization of data collection configuration with agent.voidsaveAgentConfig(ConfigContent conf)Saves or creates new agent's configvoidsaveEventProcessingPolicy(EventProcessingPolicy epp)Save event processing policy.longsaveGraph(GraphSettings graph, boolean overwrite)Checks if graph with specified name can be created/overwritten and creates/overwrites it in DB.UUIDsavePolicy(long templateId, AgentPolicy currentlySelectedElement, boolean duplicate)Saves new or updated policyvoidscheduleReport(ReportingJob job, Map<String,String> parameters)Schedule a reportvoidsendEvent(long eventCode, String[] parameters)Convenience wrapper for sendEvent interface.voidsendEvent(long eventCode, String eventName, long objectId, String[] parameters, String userTag)Send event to server.voidsendEvent(String eventName, String[] parameters)Convenience wrapper for sendEvent interface.protected voidsendFile(long requestId, byte[] data, ProgressListener listener, boolean allowStreamCompression)Send block of data as binary messageprotected voidsendFile(long requestId, File file, ProgressListener listener, boolean allowStreamCompression)Send file over NXCPvoidsendMessage(org.netxms.base.NXCPMessage msg)Send message to servervoidsendNotification(String channelName, String phoneNumber, String subject, String message)Send Notification via server.protected voidsendNotification(SessionNotification n)Call notification handlers on all registered listenersvoidsetAddressList(int listId, List<InetAddressListElement> list)Set content of address list.voidsetAlarmFlowState(int state)Changes state of alarm status flow.voidsetAttributeForCurrentUser(String name, String value)Set custom attribute for currently logged in user.voidsetClientAddress(String clientAddress)Set the client addressvoidsetClientInfo(String connClientInfo)Set client information stringvoidsetClientLanguage(String clientLanguage)Set client`s languagevoidsetClientType(int clientType)Set client type.voidsetCommandTimeout(int commandTimeout)Set command execution timeout.voidsetConnectTimeout(int connectTimeout)Set connect call timeout (must be set before connect call)voidsetDefaultServerValues(List<ServerVariable> varList)Set server configuration variables to defaultvoidsetIgnoreProtocolVersion(boolean ignoreProtocolVersion)If set to true, protocol version is not checked at connect.voidsetObjectACL(long objectId, AccessListElement[] acl, boolean inheritAccessRights)Change object's ACL (wrapper for modifyObject())voidsetObjectCustomAttributes(long objectId, Map<String,CustomAttribute> attrList)Change object's custom attributes (wrapper for modifyObject())voidsetObjectMaintenanceMode(long objectId, boolean inMaintenance)Set maintenance mode for objectvoidsetObjectMaintenanceMode(long objectId, boolean inMaintenance, String comments)Set maintenance mode for objectvoidsetObjectManaged(long objectId, boolean isManaged)Set object's managed status.voidsetObjectName(long objectId, String name)Change object's name (wrapper for modifyObject())voidsetPersistentStorageValue(String key, String value)Set persistent storage value.voidsetRecvBufferSize(int defaultBufferSize, int maxBufferSize)Set receiver buffer size.voidsetServerConfigClob(String name, String value)Set server config CLOBvoidsetServerVariable(String name, String value)Set server configuration variableTcpProxysetupTcpProxy(long nodeId, InetAddress address, int port)Setup new TCP proxy channel.voidsetUserPassword(long id, String newPassword, String oldPassword)Set password for uservoidsnmpWalk(long nodeId, String rootOid, SnmpWalkListener listener)Do SNMP walk.voidstartManualActiveDiscovery(List<InetAddressListElement> list)Start active discovery for provided list manuallyvoidstopServerCommand(long commandId)Stop server commandvoidsubscribe(String channel)Subscribe to notification channel.voidsubscribeToUserDBUpdates()Subscribe to user change notificationsList<String>substitureMacross(ObjectContextBase[] context, String textToExpand, Map<String,String> inputValues)Substitute macross in many constexts for one stringList<String>substitureMacross(ObjectContextBase context, List<String> textsToExpand, Map<String,String> inputValues)Substitute macross in may strings and one contextvoidswapAgentConfigs(long id1, long id2)Swaps 2 configs sequence numbersvoidsyncAlarmCategories()Synchronize alarm category configuration.voidsyncChildren(AbstractObject object)Sync children of given object.voidsyncEventTemplates()Synchronize event templates configuration.voidsyncMissingObjects(long[] objects, boolean syncComments)Synchronize only those objects from given set which are not synchronized yet.voidsyncMissingObjects(long[] objects, boolean syncComments, int options)Synchronize only those objects from given set which are not synchronized yet.voidsyncMissingObjects(List<Long> relatedOpbjects, boolean syncComments, int options)Synchronize only those objects from given set which are not synchronized yet.booleansyncMissingUsers(Long[] userList)Synchronize only objects that were not yet synchronizedvoidsyncObjects()Synchronizes NetXMS objects between server and client.voidsyncObjects(boolean syncNodeComponents)Synchronizes NetXMS objects between server and client.voidsyncObjectSet(long[] objects, boolean syncComments)Synchronizes selected object set with the server.voidsyncObjectSet(long[] objects, boolean syncComments, int options)Synchronizes selected object set with the server.voidsyncUserDatabase()Synchronize user database and subscribe to user change notificationsvoidsyncUserSet(Long[] userList)Synchronize users by id if does not existbyte[]takeScreenshot(long nodeId, String sessionName)Take screenshot from given node.voidterminateAlarm(long alarmId)Terminate alarm.voidterminateAlarm(String helpdeskReference)Terminate alarm by helpdesk reference.TransformationTestResulttestTransformationScript(long nodeId, String script, String inputValue, DataCollectionObject dcObject)Test DCI transformation script.voidunbindAgentTunnel(long nodeId)Unbind agent tunnel to nodevoidunbindObject(long parentId, long childId)Unbind object.voidunholdServerJob(long jobId)Put server on hold job to pending statevoiduninstallAgentPolicy(long policyId, long nodeId)Uninstall policy from agentvoidunlinkHelpdeskIssue(long alarmId)Unlink helpdesk issue from alarm.voidunlinkHelpdeskIssue(String helpdeskReference)Unlink helpdesk issue from alarm.voidunlockUserDatabase()Unlock user databasevoidunsubscribe(String channel)Unsubscribe from notification channel.voidupdateAgentConfig(long nodeId, String config, boolean apply)Update agent's master configuration file.voidupdateAlarmComment(long alarmId, long commentId, String text)Update alarm comment.voidupdateCertificate(long id, String comment)Update certificateintupdateMappingTable(MappingTable table)Create or update mapping table.voidupdateNotificationChannel(NotificationChannel nc)Update notification channelvoidupdateObjectComments(long objectId, String comments)Change object's comments.voidupdatePhysicalLink(PhysicalLink link)Create new or update existing physical linkvoidupdateScheduledTask(ScheduledTask task)Update existing scheduled task.voidupdateSnmpCommunities(Map<Integer,List<String>> map)Update list of well-known SNMP community strings on server.voidupdateSnmpUsmCredentials(Map<Integer,List<SnmpUsmCredential>> map)Update list of well-known SNMP USM credentials on server.voidupdateZmqDataSubscription(long objectId, long dciId, boolean subscribe)Manage subscription for ZMQ data forwardervoidupdateZmqEventSubscription(long objectId, long dciId, boolean subscribe)Manage subscription for ZMQ event forwarderlonguploadFileToAgent(long nodeId, String serverFileName, String remoteFileName, boolean jobOnHold)Start file upload from server's file store to agent.voiduploadFileToServer(File localFile, String serverFileName, ProgressListener listener)Upload local file to server's file storevoiduploadLocalFileToAgent(long nodeId, File localFile, String remoteFileName, boolean overwrite, ProgressListener listener)Upload local file to remote node via agent.booleanvalidateProtocolVersions(int[] versions)Validate protocol versionsbooleanvalidateUserPassword(String password)Validate password for currently logged in userReceivedFilewaitForFile(long id, int timeout)Wait for specific file to arriveStringwaitForFileTail(String fileName, int timeout)Wait for specific file tail to arriveorg.netxms.base.NXCPMessagewaitForMessage(int code, long id)Wait for message with specific code and id.org.netxms.base.NXCPMessagewaitForMessage(int code, long id, int timeout)Wait for message with specific code and id.org.netxms.base.NXCPMessagewaitForRCC(long id)Wait for CMD_REQUEST_COMPLETED message with given id using default timeoutorg.netxms.base.NXCPMessagewaitForRCC(long id, int timeout)Wait for CMD_REQUEST_COMPLETED message with given idvoidwakeupNode(long objectId)Wakeup node by sending wake-on-LAN magic packet.
-
-
-
Field Detail
-
DCI_RES_SEARCH_NAME
public static final int DCI_RES_SEARCH_NAME
- See Also:
- Constant Field Values
-
DEFAULT_CONN_PORT
public static final int DEFAULT_CONN_PORT
- See Also:
- Constant Field Values
-
CHANNEL_ALARMS
public static final String CHANNEL_ALARMS
- See Also:
- Constant Field Values
-
CHANNEL_AUDIT_LOG
public static final String CHANNEL_AUDIT_LOG
- See Also:
- Constant Field Values
-
CHANNEL_DC_THRESHOLDS
public static final String CHANNEL_DC_THRESHOLDS
- See Also:
- Constant Field Values
-
CHANNEL_EVENTS
public static final String CHANNEL_EVENTS
- See Also:
- Constant Field Values
-
CHANNEL_OBJECTS
public static final String CHANNEL_OBJECTS
- See Also:
- Constant Field Values
-
CHANNEL_SNMP_TRAPS
public static final String CHANNEL_SNMP_TRAPS
- See Also:
- Constant Field Values
-
CHANNEL_SYSLOG
public static final String CHANNEL_SYSLOG
- See Also:
- Constant Field Values
-
CHANNEL_USERDB
public static final String CHANNEL_USERDB
- See Also:
- Constant Field Values
-
OBJECT_SYNC_NOTIFY
public static final int OBJECT_SYNC_NOTIFY
- See Also:
- Constant Field Values
-
OBJECT_SYNC_WAIT
public static final int OBJECT_SYNC_WAIT
- See Also:
- Constant Field Values
-
CFG_IMPORT_REPLACE_EVENTS
public static final int CFG_IMPORT_REPLACE_EVENTS
- See Also:
- Constant Field Values
-
CFG_IMPORT_REPLACE_ACTIONS
public static final int CFG_IMPORT_REPLACE_ACTIONS
- See Also:
- Constant Field Values
-
CFG_IMPORT_REPLACE_TEMPLATES
public static final int CFG_IMPORT_REPLACE_TEMPLATES
- See Also:
- Constant Field Values
-
CFG_IMPORT_REPLACE_TRAPS
public static final int CFG_IMPORT_REPLACE_TRAPS
- See Also:
- Constant Field Values
-
CFG_IMPORT_REPLACE_SCRIPTS
public static final int CFG_IMPORT_REPLACE_SCRIPTS
- See Also:
- Constant Field Values
-
CFG_IMPORT_REPLACE_SUMMARY_TABLES
public static final int CFG_IMPORT_REPLACE_SUMMARY_TABLES
- See Also:
- Constant Field Values
-
CFG_IMPORT_REPLACE_OBJECT_TOOLS
public static final int CFG_IMPORT_REPLACE_OBJECT_TOOLS
- See Also:
- Constant Field Values
-
CFG_IMPORT_REPLACE_EPP_RULES
public static final int CFG_IMPORT_REPLACE_EPP_RULES
- See Also:
- Constant Field Values
-
CFG_IMPORT_REPLACE_TEMPLATE_NAMES_LOCATIONS
public static final int CFG_IMPORT_REPLACE_TEMPLATE_NAMES_LOCATIONS
- See Also:
- Constant Field Values
-
CFG_IMPORT_DELETE_EMPTY_TEMPLATE_GROUPS
public static final int CFG_IMPORT_DELETE_EMPTY_TEMPLATE_GROUPS
- See Also:
- Constant Field Values
-
ADDRESS_LIST_DISCOVERY_TARGETS
public static final int ADDRESS_LIST_DISCOVERY_TARGETS
- See Also:
- Constant Field Values
-
ADDRESS_LIST_DISCOVERY_FILTER
public static final int ADDRESS_LIST_DISCOVERY_FILTER
- See Also:
- Constant Field Values
-
SERVER_COMPONENT_DISCOVERY_MANAGER
public static final int SERVER_COMPONENT_DISCOVERY_MANAGER
- See Also:
- Constant Field Values
-
DESKTOP_CLIENT
public static final int DESKTOP_CLIENT
- See Also:
- Constant Field Values
-
WEB_CLIENT
public static final int WEB_CLIENT
- See Also:
- Constant Field Values
-
MOBILE_CLIENT
public static final int MOBILE_CLIENT
- See Also:
- Constant Field Values
-
TABLET_CLIENT
public static final int TABLET_CLIENT
- See Also:
- Constant Field Values
-
APPLICATION_CLIENT
public static final int APPLICATION_CLIENT
- See Also:
- Constant Field Values
-
-
Method Detail
-
finalize
protected void finalize() throws Throwable
-
createCustomObjectFromMessage
protected AbstractObject createCustomObjectFromMessage(int objectClass, org.netxms.base.NXCPMessage msg)
Create custom object from NXCP message. May be overridden by derived classes to create custom NetXMS objects. This method called before standard object creation, so it can be used for overriding standard object classes. If this method returns null, standard object creation mechanism will be used. Default implementation will always return null.- Parameters:
objectClass- NetXMS object class IDmsg- Source NXCP message- Returns:
- NetXMS object or null if object cannot be created
-
addListener
public void addListener(SessionListener listener)
Add notification listener- Parameters:
listener- Listener to add
-
removeListener
public void removeListener(SessionListener listener)
Remove notification listener- Parameters:
listener- Listener to remove
-
addConsoleListener
public void addConsoleListener(ServerConsoleListener listener)
Add server console listener- Parameters:
listener- The ServerConsoleListener to add
-
removeConsoleListener
public void removeConsoleListener(ServerConsoleListener listener)
Remove server console listener- Parameters:
listener- The ServerConsoleListener to remove
-
addMessageSubscription
public void addMessageSubscription(int messageCode, long messageId, MessageHandler handler)Subscribe to specific messages- Parameters:
messageCode- The message codemessageId- The message IDhandler- The message handler
-
removeMessageSubscription
public void removeMessageSubscription(int messageCode, long messageId)Remove message subscription- Parameters:
messageCode- The message codemessageId- The message ID
-
sendNotification
protected void sendNotification(SessionNotification n)
Call notification handlers on all registered listeners- Parameters:
n- Notification object
-
sendMessage
public void sendMessage(org.netxms.base.NXCPMessage msg) throws IOException, NXCExceptionSend message to server- Parameters:
msg- Message to sent- Throws:
IOException- in case of socket communication failureNXCException- in case of encryption error
-
sendFile
protected void sendFile(long requestId, File file, ProgressListener listener, boolean allowStreamCompression) throws IOException, NXCExceptionSend file over NXCP- Parameters:
requestId- request IDfile- source file to be sentlistener- progress listenerallowStreamCompression- true if data stream compression is allowed- Throws:
IOException- if socket I/O error occursNXCException- if NetXMS server returns an error or operation was timed out
-
sendFile
protected void sendFile(long requestId, byte[] data, ProgressListener listener, boolean allowStreamCompression) throws IOException, NXCExceptionSend block of data as binary message- Parameters:
requestId- request IDdata- file datalistener- progress listenerallowStreamCompression- true if data stream compression is allowed- Throws:
IOException- if socket I/O error occursNXCException- if NetXMS server returns an error or operation was timed out
-
waitForMessage
public org.netxms.base.NXCPMessage waitForMessage(int code, long id, int timeout) throws NXCExceptionWait for message with specific code and id.- Parameters:
code- Message codeid- Message idtimeout- Wait timeout in milliseconds- Returns:
- Message object
- Throws:
NXCException- if message was not arrived within timeout interval
-
waitForMessage
public org.netxms.base.NXCPMessage waitForMessage(int code, long id) throws NXCExceptionWait for message with specific code and id.- Parameters:
code- Message codeid- Message id- Returns:
- Message object
- Throws:
NXCException- if message was not arrived within timeout interval
-
waitForRCC
public org.netxms.base.NXCPMessage waitForRCC(long id) throws NXCExceptionWait for CMD_REQUEST_COMPLETED message with given id using default timeout- Parameters:
id- Message id- Returns:
- received message
- Throws:
NXCException- if message was not arrived within timeout interval or contains RCC other than RCC.SUCCESS
-
waitForRCC
public org.netxms.base.NXCPMessage waitForRCC(long id, int timeout) throws NXCExceptionWait for CMD_REQUEST_COMPLETED message with given id- Parameters:
id- Message idtimeout- Timeout in milliseconds- Returns:
- received message
- Throws:
NXCException- if message was not arrived within timeout interval or contains RCC other than RCC.SUCCESS
-
newMessage
public final org.netxms.base.NXCPMessage newMessage(int code)
Create new NXCP message with unique id- Parameters:
code- Message code- Returns:
- New message object
-
waitForFile
public ReceivedFile waitForFile(long id, int timeout)
Wait for specific file to arrive- Parameters:
id- Message IDtimeout- Wait timeout in milliseconds- Returns:
- Received file or null in case of failure
-
waitForFileTail
public String waitForFileTail(String fileName, int timeout)
Wait for specific file tail to arrive- Parameters:
fileName- Waiting file nametimeout- Wait timeout in milliseconds- Returns:
- Received tail string or null in case of failure
-
executeSimpleCommand
protected void executeSimpleCommand(int command) throws IOException, NXCExceptionExecute simple commands (without arguments and only returning RCC)- Parameters:
command- Command code- Throws:
IOException- if socket I/O error occursNXCException- if NetXMS server returns an error or operation was timed out
-
receiveTable
public Table receiveTable(long requestId, int msgCode) throws NXCException
Receive table from server.- Parameters:
requestId- request IDmsgCode- Message code- Returns:
- Received table
- Throws:
NXCException- if operation was timed out
-
connect
public void connect() throws IOException, UnknownHostException, NXCException, IllegalStateExceptionConnect to NetMS server. Establish connection with the server and set up encryption if required. Only base protocol version check will be performed. Login must be performed before using session after successful connect.- Throws:
IOException- if socket I/O error occursUnknownHostException- if the host is unknownNXCException- if NetXMS server returns an error or operation was timed outIllegalStateException- if the state is illegal
-
connect
public void connect(int[] componentVersions) throws IOException, UnknownHostException, NXCException, IllegalStateExceptionConnect to NetMS server. Establish connection with the server and set up encryption if required. Versions of protocol components given in *componentVersions* will be validated. Login must be performed before using session after successful connect.- Parameters:
componentVersions- The versions of the components- Throws:
IOException- if socket I/O error occursUnknownHostException- if the host is unknownNXCException- if NetXMS server returns an error or operation was timed outIllegalStateException- if the state is illegal
-
login
public void login(String login, String password) throws NXCException, IOException, IllegalStateException
Login to server using login name and password.- Parameters:
login- login namepassword- password- Throws:
IOException- if socket I/O error occursNXCException- if NetXMS server returns an error or operation was timed outIllegalStateException- if the state is illegal
-
login
public void login(String login, Certificate certificate, Signature signature) throws NXCException, IOException, IllegalStateException
Login to server using certificate.- Parameters:
login- login namecertificate- user's certificatesignature- user's digital signature- Throws:
IOException- if socket I/O error occursNXCException- if NetXMS server returns an error or operation was timed outIllegalStateException- if the state is illegal
-
login
public void login(AuthenticationType authType, String login, String password, Certificate certificate, Signature signature) throws NXCException, IOException, IllegalStateException
Login to server.- Parameters:
authType- authentication typelogin- login namepassword- passwordcertificate- user's certificatesignature- user's digital signature- Throws:
IOException- if socket I/O error occursNXCException- if NetXMS server returns an error or operation was timed outIllegalStateException- if the state is illegal
-
disconnect
public void disconnect()
Disconnect from server.
-
isConnected
public boolean isConnected()
Get connection state- Returns:
- connection state
-
isEncrypted
public boolean isEncrypted()
Get encryption state for current session.- Returns:
- true if session is encrypted
-
isIgnoreProtocolVersion
public boolean isIgnoreProtocolVersion()
Get the state of protocol version check- Returns:
- true if protocol version should not be checked
-
setIgnoreProtocolVersion
public void setIgnoreProtocolVersion(boolean ignoreProtocolVersion)
If set to true, protocol version is not checked at connect.- Parameters:
ignoreProtocolVersion- true if protocol version should not be checked
-
validateProtocolVersions
public boolean validateProtocolVersions(int[] versions)
Validate protocol versions- Parameters:
versions- the protocol versions- Returns:
- true if protocol versions are valid
-
getDefaultRecvBufferSize
public int getDefaultRecvBufferSize()
Get default receiver buffer size.- Returns:
- Default receiver buffer size in bytes.
-
getMaxRecvBufferSize
public int getMaxRecvBufferSize()
Get max receiver buffer size.- Returns:
- Max receiver buffer size in bytes.
-
setRecvBufferSize
public void setRecvBufferSize(int defaultBufferSize, int maxBufferSize)Set receiver buffer size. This method should be called before connect(). It will not have any effect after connect().- Parameters:
defaultBufferSize- default size of receiver buffer in bytes.maxBufferSize- max size of receiver buffer in bytes.
-
getServerAddress
public String getServerAddress()
Get server address- Returns:
- Server address
-
getServerVersion
public String getServerVersion()
Get NetXMS server version.- Returns:
- Server version
-
getServerId
public long getServerId()
Get NetXMS server UID.- Returns:
- Server UID
-
getServerTimeZone
public String getServerTimeZone()
Get server time zone.- Returns:
- server's time zone string
-
getServerName
public String getServerName()
Get server name- Returns:
- the serverName
-
getServerColor
public String getServerColor()
Get server identification colour- Returns:
- the serverColor
-
getServerTime
public long getServerTime()
Get server time- Returns:
- the serverTime
-
getServerChallenge
public byte[] getServerChallenge()
- Returns:
- the serverChallenge
-
isServerComponentRegistered
public boolean isServerComponentRegistered(String componentId)
Check if server component with given id is registered- Parameters:
componentId- The component ID- Returns:
- true if server component is registered
-
getRegisteredServerComponents
public String[] getRegisteredServerComponents()
Get list of registered server components- Returns:
- Array of registered server components
-
getTileServerURL
public String getTileServerURL()
Get server URL- Returns:
- the tileServerURL
-
isZoningEnabled
public boolean isZoningEnabled()
Get the state of zoning- Returns:
- true if zoning is enabled
-
isHelpdeskLinkActive
public boolean isHelpdeskLinkActive()
Get status of helpdesk integration module on server.- Returns:
- true if helpdesk integration module loaded on server
-
getClientInfo
public String getClientInfo()
Get client information string- Returns:
- The client information
-
setClientInfo
public void setClientInfo(String connClientInfo)
Set client information string- Parameters:
connClientInfo- The client info to set
-
setCommandTimeout
public void setCommandTimeout(int commandTimeout)
Set command execution timeout.- Parameters:
commandTimeout- New command timeout
-
setConnectTimeout
public void setConnectTimeout(int connectTimeout)
Set connect call timeout (must be set before connect call)- Parameters:
connectTimeout- connect timeout in milliseconds
-
getUserId
public int getUserId()
Get identifier of logged in user.- Returns:
- Identifier of logged in user
-
getUserName
public String getUserName()
Get the current user name- Returns:
- the userName
-
getAuthenticationMethod
public AuthenticationType getAuthenticationMethod()
Get the current authentication method- Returns:
- the authenticationMethod
-
getUserSystemRights
public long getUserSystemRights()
Get system-wide rights of currently logged in user.- Returns:
- System-wide rights of currently logged in user
-
getMessageOfTheDay
public String getMessageOfTheDay()
Get message of the day if server config is set- Returns:
- Message of the day
-
isPasswordExpired
public boolean isPasswordExpired()
Check if password is expired for currently logged in user.- Returns:
- true if password is expired
-
getGraceLogins
public int getGraceLogins()
Get number of remaining grace logins- Returns:
- number of remaining grace logins
-
getAlarmListDisplayLimit
public int getAlarmListDisplayLimit()
Get maximum number of records allowed to be displayed in alarm list- Returns:
- The limit of alarms displayed
-
getClientConfigurationHint
public String getClientConfigurationHint(String name, String defaultValue)
Get client configuration hint as string- Parameters:
name- hint namedefaultValue- default value (returned if given hint was not provided by server)- Returns:
- hint value as provided by server or default value
-
getClientConfigurationHint
public String getClientConfigurationHint(String name)
Get client configuration hint as string- Parameters:
name- hint name- Returns:
- hint value as provided by server or null
-
getClientConfigurationHintAsInt
public int getClientConfigurationHintAsInt(String name, int defaultValue)
Get client configuration hint as integer- Parameters:
name- hint namedefaultValue- default value (returned if given hint was not provided by server or is not valid integer)- Returns:
- hint value as provided by server or default value
-
getClientConfigurationHintAsBoolean
public boolean getClientConfigurationHintAsBoolean(String name, boolean defaultValue)
Get client configuration hint as boolean- Parameters:
name- hint namedefaultValue- default value (returned if given hint was not provided by server or is not valid boolean)- Returns:
- hint value as provided by server or default value
-
syncObjects
public void syncObjects() throws IOException, NXCExceptionSynchronizes NetXMS objects between server and client. After successful sync, subscribe client to object change notifications.- Throws:
IOException- if socket I/O error occursNXCException- if NetXMS server returns an error or operation was timed out
-
syncObjects
public void syncObjects(boolean syncNodeComponents) throws IOException, NXCExceptionSynchronizes NetXMS objects between server and client. After successful sync, subscribe client to object change notifications.- Parameters:
syncNodeComponents- defines if node components should be synced- Throws:
IOException- if socket I/O error occursNXCException- if NetXMS server returns an error or operation was timed out
-
syncObjectSet
public void syncObjectSet(long[] objects, boolean syncComments) throws IOException, NXCExceptionSynchronizes selected object set with the server.- Parameters:
objects- identifiers of objects need to be synchronizedsyncComments- if true, comments for objects will be synchronized as well- Throws:
IOException- if socket I/O error occursNXCException- if NetXMS server returns an error or operation was timed out
-
syncObjectSet
public void syncObjectSet(long[] objects, boolean syncComments, int options) throws IOException, NXCExceptionSynchronizes selected object set with the server. The following options are accepted: OBJECT_SYNC_NOTIFY - send object update notification for each received object OBJECT_SYNC_WAIT - wait until all requested objects received- Parameters:
objects- identifiers of objects need to be synchronizedsyncComments- if true, comments for objects will be synchronized as welloptions- sync options (see above)- Throws:
IOException- if socket I/O error occursNXCException- if NetXMS server returns an error or operation was timed out
-
syncMissingObjects
public void syncMissingObjects(long[] objects, boolean syncComments) throws IOException, NXCExceptionSynchronize only those objects from given set which are not synchronized yet.- Parameters:
objects- identifiers of objects need to be synchronizedsyncComments- if true, comments for objects will be synchronized as well- Throws:
IOException- if socket I/O error occursNXCException- if NetXMS server returns an error or operation was timed out
-
syncMissingObjects
public void syncMissingObjects(long[] objects, boolean syncComments, int options) throws IOException, NXCExceptionSynchronize only those objects from given set which are not synchronized yet. Accepts all options which are valid for syncObjectSet.- Parameters:
objects- identifiers of objects need to be synchronizedsyncComments- if true, comments for objects will be synchronized as welloptions- sync options (see comments for syncObjectSet)- Throws:
IOException- if socket I/O error occursNXCException- if NetXMS server returns an error or operation was timed out
-
syncMissingObjects
public void syncMissingObjects(List<Long> relatedOpbjects, boolean syncComments, int options) throws IOException, NXCException
Synchronize only those objects from given set which are not synchronized yet. Accepts all options which are valid for syncObjectSet.- Parameters:
relatedOpbjects- identifiers of objects need to be synchronizedsyncComments- if true, comments for objects will be synchronized as welloptions- sync options (see comments for syncObjectSet)- Throws:
IOException- if socket I/O error occursNXCException- if NetXMS server returns an error or operation was timed out
-
syncChildren
public void syncChildren(AbstractObject object) throws NXCException, IOException
Sync children of given object.- Parameters:
object- parent object- Throws:
NXCExceptionIOException
-
areChildrenSynchronized
public boolean areChildrenSynchronized(long id)
Returns true if children are already synchronized for given object.- Parameters:
id- object id- Returns:
- true if children are synchronized
-
findObjectByRegex
public List<AbstractObject> findObjectByRegex(String regex)
Find object by regex- Parameters:
regex- for object name- Returns:
- list of matching objects
-
findObjectById
public AbstractObject 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
-
findObjectById
public <T> T findObjectById(long id, Class<T> requiredClass)Find NetXMS object by it's identifier with additional class checking.- Type Parameters:
T- Object- Parameters:
id- object identifierrequiredClass- required object class- Returns:
- Object with given ID or null if object cannot be found or is not an instance of required class
-
findMultipleObjects
public List<AbstractObject> findMultipleObjects(long[] idList, boolean returnUnknown)
Find multiple NetXMS objects by identifiers- Parameters:
idList- array of object identifiersreturnUnknown- if true, this method will return UnknownObject placeholders for unknown object identifiers- Returns:
- list of found objects
-
findMultipleObjects
public List<AbstractObject> findMultipleObjects(long[] idList, Class<? extends AbstractObject> classFilter, boolean returnUnknown)
Find multiple NetXMS objects by identifiers- Parameters:
idList- array of object identifiersclassFilter- class filter for objects, or null to disable filteringreturnUnknown- if true, this method will return UnknownObject placeholders for unknown object identifiers- Returns:
- list of found objects
-
findMultipleObjects
public List<AbstractObject> findMultipleObjects(Long[] idList, boolean returnUnknown)
Find multiple NetXMS objects by identifiers- Parameters:
idList- array of object identifiersreturnUnknown- if true, this method will return UnknownObject placeholders for unknown object identifiers- Returns:
- array of found objects
-
findMultipleObjects
public List<AbstractObject> findMultipleObjects(Long[] idList, Class<? extends AbstractObject> classFilter, boolean returnUnknown)
Find multiple NetXMS objects by identifiers- Parameters:
idList- array of object identifiersclassFilter- class filter for objects, or null to disable filteringreturnUnknown- if true, this method will return UnknownObject placeholders for unknown object identifiers- Returns:
- array of found objects
-
findObjectByGUID
public AbstractObject findObjectByGUID(UUID guid)
Find NetXMS object by it's GUID.- Parameters:
guid- Object GUID- Returns:
- Object with given ID or null if object cannot be found
-
findObjectByGUID
public <T extends AbstractObject> T findObjectByGUID(UUID guid, Class<T> requiredClass)
Find NetXMS object by it's GUID with additional class checking.- Type Parameters:
T- Object- Parameters:
guid- object GUIDrequiredClass- required object class- Returns:
- Object with given ID or null if object cannot be found or is not an instance of required class
-
findZone
public Zone findZone(long zoneUIN)
Find zone object by zone UIN (unique identification number).- Parameters:
zoneUIN- zone UIN to find- Returns:
- zone object or null
-
getAllZones
public List<Zone> getAllZones()
Get all accessible zone objects- Returns:
- list of all accessible zone objects
-
findObjectByName
public AbstractObject findObjectByName(String name)
Find object by name. If multiple objects with same name exist, it is not determined what object will be returned. Name comparison is case-insensitive.- Parameters:
name- object name to find- Returns:
- object with matching name or null
-
findObjectByName
public AbstractObject findObjectByName(String name, ObjectFilter filter)
Find object by name with object filter. Name comparison is case-insensitive.- Parameters:
name- object name to findfilter- TODO- Returns:
- object with matching name or null
-
findObjectByNamePattern
public AbstractObject findObjectByNamePattern(String pattern)
Find object by name using regular expression. If multiple objects with same name exist, it is not determined what object will be returned. Name comparison is case-insensitive.- Parameters:
pattern- regular expression for matching object name- Returns:
- object with matching name or null
-
findObject
public AbstractObject findObject(ObjectFilter filter)
Generic object find using filter. WIll return first object matching given filter.- Parameters:
filter- ObjectFilter to filter the result- Returns:
- first matching object or null
-
filterObjects
public List<AbstractObject> filterObjects(ObjectFilter filter)
Find all objects matching given filter.- Parameters:
filter- ObjectFilter to filter the result- Returns:
- list of matching objects (empty list if nothing found)
-
getTopLevelObjects
public AbstractObject[] getTopLevelObjects(Set<Integer> classFilter)
Get list of top-level objects matching given class filter. Class filter may be null to ignore object class.- Parameters:
classFilter- To filter the classes- Returns:
- List of all top matching level objects (either without parents or with inaccessible parents)
-
getTopLevelObjects
public AbstractObject[] getTopLevelObjects()
Get list of top-level objects.- Returns:
- List of all top level objects (either without parents or with inaccessible parents)
-
getAllObjects
public List<AbstractObject> getAllObjects()
Get list of all objects- Returns:
- List of all objects
-
getObjectName
public String getObjectName(long objectId)
Get object name by ID.- Parameters:
objectId- object ID- Returns:
- object name if object is known, or string in form [<object_id>] for unknown objects
-
getZoneName
public String getZoneName(long zoneUIN)
Get zone name by UIN- Parameters:
zoneUIN- zone UIN- Returns:
- zone name
-
queryObjects
public List<AbstractObject> queryObjects(String query) throws IOException, NXCException
Query objects on server side- Parameters:
query- query to execute- Returns:
- list of matching objects
- Throws:
IOException- if socket I/O error occursNXCException- if NetXMS server returns an error or operation was timed out
-
queryObjectDetails
public List<ObjectQueryResult> queryObjectDetails(String query, List<String> properties, List<String> orderBy, int limit) throws IOException, NXCException
Query objects on server side and read certain object properties. Available properties are the same as in corresponding NXSL objects or calculated properties set using "with" statement in query.- Parameters:
query- query to executeproperties- object properties to readorderBy- list of properties for ordering result set (can be null)limit- limit number of records (0 for unlimited)- Returns:
- list of matching objects
- Throws:
IOException- if socket I/O error occursNXCException- if NetXMS server returns an error or operation was timed out
-
getAlarms
public HashMap<Long,Alarm> getAlarms() throws IOException, NXCException
Get list of active alarms. For accessing terminated alarms log view API should be used.- Returns:
- Hash map containing alarms
- Throws:
IOException- if socket I/O error occursNXCException- if NetXMS server returns an error or operation was timed out
-
getAlarm
public Alarm getAlarm(long alarmId) throws IOException, NXCException
Get information about single active alarm. Terminated alarms cannot be accessed with this call.- Parameters:
alarmId- alarm ID- Returns:
- alarm object
- Throws:
IOException- if socket I/O error occursNXCException- if NetXMS server returns an error or operation was timed out
-
getAlarmEvents
public List<EventInfo> getAlarmEvents(long alarmId) throws IOException, NXCException
Get information about events related to single active alarm. Information for terminated alarms cannot be accessed with this call. User must have "view alarms" permission on alarm's source node and "view event log" system-wide access.- Parameters:
alarmId- alarm ID- Returns:
- list of related events
- Throws:
IOException- if socket I/O error occursNXCException- if NetXMS server returns an error or operation was timed out
-
acknowledgeAlarm
public void acknowledgeAlarm(long alarmId, boolean sticky, int time) throws IOException, NXCExceptionAcknowledge alarm.- Parameters:
alarmId- Identifier of alarm to be acknowledged.sticky- if set to true, acknowledged state will be made "sticky" (duplicate alarms with same key will not revert it back to outstanding)time- timeout for sticky acknowledge in seconds (0 for infinite)- Throws:
IOException- if socket I/O error occursNXCException- if NetXMS server returns an error or operation was timed out
-
acknowledgeAlarm
public void acknowledgeAlarm(long alarmId) throws IOException, NXCExceptionAcknowledge alarm.- Parameters:
alarmId- Identifier of alarm to be acknowledged.- Throws:
IOException- if socket I/O error occursNXCException- if NetXMS server returns an error or operation was timed out
-
acknowledgeAlarm
public void acknowledgeAlarm(String helpdeskReference) throws IOException, NXCException
Acknowledge alarm by helpdesk reference.- Parameters:
helpdeskReference- Helpdesk issue reference (e.g. JIRA issue key)- Throws:
IOException- if socket I/O error occursNXCException- if NetXMS server returns an error or operation was timed out
-
resolveAlarm
public void resolveAlarm(long alarmId) throws IOException, NXCExceptionResolve alarm.- Parameters:
alarmId- Identifier of alarm to be resolved.- Throws:
IOException- if socket I/O error occursNXCException- if NetXMS server returns an error or operation was timed out
-
resolveAlarm
public void resolveAlarm(String helpdeskReference) throws IOException, NXCException
Resolve alarm by helpdesk reference.- Parameters:
helpdeskReference- Identifier of alarm to be resolved.- Throws:
IOException- if socket I/O error occursNXCException- if NetXMS server returns an error or operation was timed out
-
terminateAlarm
public void terminateAlarm(long alarmId) throws IOException, NXCExceptionTerminate alarm.- Parameters:
alarmId- Identifier of alarm to be terminated.- Throws:
IOException- if socket I/O error occursNXCException- if NetXMS server returns an error or operation was timed out
-
terminateAlarm
public void terminateAlarm(String helpdeskReference) throws IOException, NXCException
Terminate alarm by helpdesk reference.- Parameters:
helpdeskReference- Identifier of alarm to be resolved.- Throws:
IOException- if socket I/O error occursNXCException- if NetXMS server returns an error or operation was timed out
-
bulkResolveAlarms
public Map<Long,Integer> bulkResolveAlarms(List<Long> alarmIds) throws IOException, NXCException
Bulk terminate alarms.- Parameters:
alarmIds- Identifiers of alarms to be terminated.- Returns:
- true if all alarms were terminated, false if some, or all, were not terminated
- Throws:
IOException- if socket I/O error occursNXCException- if NetXMS server returns an error or operation was timed out
-
bulkTerminateAlarms
public Map<Long,Integer> bulkTerminateAlarms(List<Long> alarmIds) throws IOException, NXCException
Bulk terminate alarms.- Parameters:
alarmIds- Identifiers of alarms to be terminated.- Returns:
- true if all alarms were terminated, false if some, or all, were not terminated
- Throws:
IOException- if socket I/O error occursNXCException- if NetXMS server returns an error or operation was timed out
-
deleteAlarm
public void deleteAlarm(long alarmId) throws IOException, NXCExceptionDelete alarm.- Parameters:
alarmId- Identifier of alarm to be deleted.- Throws:
IOException- if socket I/O error occursNXCException- if NetXMS server returns an error or operation was timed out
-
openHelpdeskIssue
public String openHelpdeskIssue(long alarmId) throws IOException, NXCException
Open issue in helpdesk system from given alarm- Parameters:
alarmId- alarm identifier- Returns:
- helpdesk issue identifier
- Throws:
IOException- if socket I/O error occursNXCException- if NetXMS server returns an error or operation was timed out
-
getHelpdeskIssueUrl
public String getHelpdeskIssueUrl(long alarmId) throws IOException, NXCException
Get URL for helpdesk issue associated with given alarm- Parameters:
alarmId- The ID of alarm- Returns:
- URL of helpdesk issue
- Throws:
IOException- if socket I/O error occursNXCException- if NetXMS server returns an error or operation was timed out
-
unlinkHelpdeskIssue
public void unlinkHelpdeskIssue(String helpdeskReference) throws IOException, NXCException
Unlink helpdesk issue from alarm. User must have OBJECT_ACCESS_UPDATE_ALARMS access right on alarm's source object and SYSTEM_ACCESS_UNLINK_ISSUES system wide access right.- Parameters:
helpdeskReference- The helpdesk reference- Throws:
IOException- if socket I/O error occursNXCException- if NetXMS server returns an error or operation was timed out
-
unlinkHelpdeskIssue
public void unlinkHelpdeskIssue(long alarmId) throws IOException, NXCExceptionUnlink helpdesk issue from alarm. User must have OBJECT_ACCESS_UPDATE_ALARMS access right on alarm's source object and SYSTEM_ACCESS_UNLINK_ISSUES system wide access right.- Parameters:
alarmId- alarm id- Throws:
IOException- if socket I/O error occursNXCException- if NetXMS server returns an error or operation was timed out
-
getAlarmComments
public List<AlarmComment> getAlarmComments(long alarmId) throws IOException, NXCException
Get list of comments for given alarm.- Parameters:
alarmId- alarm ID- Returns:
- list of alarm comments
- Throws:
IOException- if socket I/O error occursNXCException- if NetXMS server returns an error or operation was timed out
-
deleteAlarmComment
public void deleteAlarmComment(long alarmId, long commentId) throws IOException, NXCExceptionDelete alarm comment.- Parameters:
alarmId- alarm IDcommentId- comment ID- Throws:
IOException- if socket I/O error occursNXCException- if NetXMS server returns an error or operation was timed out
-
createAlarmComment
public void createAlarmComment(long alarmId, String text) throws IOException, NXCExceptionCreate alarm comment.- Parameters:
alarmId- The alarm IDtext- The comment text- Throws:
IOException- if socket I/O error occursNXCException- if NetXMS server returns an error or operation was timed out
-
createAlarmComment
public void createAlarmComment(String helpdeskReference, String text) throws IOException, NXCException
Create alarm comment by helpdesk reference.- Parameters:
helpdeskReference- The helpdesk referencetext- The reference text- Throws:
IOException- if socket I/O error occursNXCException- if NetXMS server returns an error or operation was timed out
-
updateAlarmComment
public void updateAlarmComment(long alarmId, long commentId, String text) throws IOException, NXCExceptionUpdate alarm comment. If alarmId == 0 — new comment will be created.- Parameters:
alarmId- alarm IDcommentId- comment ID or 0 for creating new commenttext- message text- Throws:
IOException- if socket I/O error occursNXCException- if NetXMS server returns an error or operation was timed out
-
setAlarmFlowState
public void setAlarmFlowState(int state) throws IOException, NXCExceptionChanges state of alarm status flow. Strict or not - terminate state can be set only after resolve state or after any state.- Parameters:
state- state of alarm status flow - strict or not (1 or 0)- Throws:
IOException- if socket I/O error occursNXCException- if NetXMS server returns an error or operation was timed out
-
getServerVariables
public Map<String,ServerVariable> getServerVariables() throws IOException, NXCException
Get server configuration variables- Returns:
- The server variables
- Throws:
IOException- if socket I/O error occursNXCException- if NetXMS server returns an error or operation was timed out
-
getPublicServerVariable
public String getPublicServerVariable(String name) throws IOException, NXCException
Get server public configuration variable- Parameters:
name- configuration variable name- Returns:
- value of requested configuration variable
- Throws:
IOException- if socket I/O error occursNXCException- if NetXMS server returns an error or operation was timed out
-
getPublicServerVariableAsInt
public int getPublicServerVariableAsInt(String name) throws IOException, NXCException
Get server public configuration variable as a int- Parameters:
name- configuration variable name- Returns:
- value of requested configuration variable
- Throws:
IOException- if socket I/O error occursNXCException- if NetXMS server returns an error or operation was timed out
-
getPublicServerVariableAsBoolean
public boolean getPublicServerVariableAsBoolean(String name) throws IOException, NXCException
Get server public configuration variable as boolen value- Parameters:
name- configuration variable name- Returns:
- value of requested configuration variable
- Throws:
IOException- if socket I/O error occursNXCException- if NetXMS server returns an error or operation was timed out
-
setServerVariable
public void setServerVariable(String name, String value) throws IOException, NXCException
Set server configuration variable- Parameters:
name- The name of the variablevalue- The value of the variable- Throws:
IOException- if socket I/O error occursNXCException- if NetXMS server returns an error or operation was timed out
-
deleteServerVariable
public void deleteServerVariable(String name) throws IOException, NXCException
Delete server configuration variable- Parameters:
name- The name of the variable- Throws:
IOException- if socket I/O error occursNXCException- if NetXMS server returns an error or operation was timed out
-
setDefaultServerValues
public void setDefaultServerValues(List<ServerVariable> varList) throws IOException, NXCException
Set server configuration variables to default- Parameters:
varList- The list of variables- Throws:
IOException- if socket I/O error occursNXCException- if NetXMS server returns an error or operation was timed out
-
getServerConfigClob
public String getServerConfigClob(String name) throws IOException, NXCException
Get server config CLOB- Parameters:
name- The name of the config- Returns:
- The config CLOB
- Throws:
IOException- if socket I/O error occursNXCException- if NetXMS server returns an error or operation was timed out
-
setServerConfigClob
public void setServerConfigClob(String name, String value) throws IOException, NXCException
Set server config CLOB- Parameters:
name- The name to setvalue- The value to set- Throws:
IOException- if socket I/O error occursNXCException- if NetXMS server returns an error or operation was timed out
-
subscribe
public void subscribe(String channel) throws IOException, NXCException
Subscribe to notification channel. Each subscribe call should be matched by unsubscribe call. Calling subscribe on already subscribed channel will increase internal counter, and subscription will be cancelled when this counter returns back to 0.- Parameters:
channel- Notification channel to subscribe to.- Throws:
IOException- if socket I/O error occursNXCException- if NetXMS server returns an error or operation was timed out
-
unsubscribe
public void unsubscribe(String channel) throws IOException, NXCException
Unsubscribe from notification channel.- Parameters:
channel- Notification channel to unsubscribe from.- Throws:
IOException- if socket I/O error occursNXCException- if NetXMS server returns an error or operation was timed out
-
syncUserDatabase
public void syncUserDatabase() throws IOException, NXCExceptionSynchronize user database and subscribe to user change notifications- Throws:
IOException- if socket I/O error occursNXCException- if NetXMS server returns an error or operation was timed out
-
subscribeToUserDBUpdates
public void subscribeToUserDBUpdates() throws IOException, NXCExceptionSubscribe to user change notifications- Throws:
IOException- if socket I/O error occursNXCException- if NetXMS server returns an error or operation was timed out
-
syncUserSet
public void syncUserSet(Long[] userList) throws IOException, NXCException
Synchronize users by id if does not exist- Parameters:
userList- list of user id's to synchronize- Throws:
IOException- if socket I/O error occursNXCException- if NetXMS server returns an error or operation was timed out
-
syncMissingUsers
public boolean syncMissingUsers(Long[] userList) throws IOException, NXCException
Synchronize only objects that were not yet synchronized- Parameters:
userList-- Throws:
IOExceptionNXCException
-
isUserDatabaseSynchronized
public boolean isUserDatabaseSynchronized()
Check if user database is synchronized with client- Returns:
- true if user database is synchronized with client
-
findUserDBObjectsByIds
public List<AbstractUserObject> findUserDBObjectsByIds(List<Long> ids)
Find multiple users by list of IDs- Parameters:
ids- of user DBObjects to find- Returns:
- list of found users
-
findUserDBObjectById
public AbstractUserObject findUserDBObjectById(long id, Runnable callback)
Find user or group by ID- Parameters:
id- The user DBObject Id- Returns:
- User object with given ID or null if such user does not exist
-
findUserDBObjectByGUID
public AbstractUserObject findUserDBObjectByGUID(UUID guid)
Find user or group by GUID- Parameters:
guid- The user DBObject GUID- Returns:
- User object with given GUID or null if such user does not exist
-
getUserDatabaseObjects
public AbstractUserObject[] getUserDatabaseObjects()
Get list of all user database objects- Returns:
- List of all user database objects
-
createUser
public long createUser(String name) throws IOException, NXCException
Create user on server- Parameters:
name- Login name for new user- Returns:
- ID assigned to newly created user
- Throws:
IOException- if socket I/O error occursNXCException- if NetXMS server returns an error or operation was timed out
-
createUserGroup
public long createUserGroup(String name) throws IOException, NXCException
Create user group on server- Parameters:
name- Name for new user group- Returns:
- ID assigned to newly created user group
- Throws:
IOException- if socket I/O error occursNXCException- if NetXMS server returns an error or operation was timed out
-
deleteUserDBObject
public void deleteUserDBObject(long id) throws IOException, NXCExceptionDelete user or group on server- Parameters:
id- User or group ID- Throws:
IOException- if socket I/O error occursNXCException- if NetXMS server returns an error or operation was timed out
-
setUserPassword
public void setUserPassword(long id, String newPassword, String oldPassword) throws IOException, NXCExceptionSet password for user- Parameters:
id- User IDnewPassword- New passwordoldPassword- Old password- Throws:
IOException- if socket I/O error occursNXCException- if NetXMS server returns an error or operation was timed out
-
validateUserPassword
public boolean validateUserPassword(String password) throws IOException, NXCException
Validate password for currently logged in user- Parameters:
password- password to validate- Returns:
- true if password is valid
- Throws:
IOException- if socket I/O error occursNXCException- if NetXMS server returns an error or operation was timed out
-
modifyUserDBObject
public void modifyUserDBObject(AbstractUserObject object, int fields) throws IOException, NXCException
Modify user database object- Parameters:
object- User datafields- bit mask indicating fields to modify- Throws:
IOException- if socket I/O error occursNXCException- if NetXMS server returns an error or operation was timed out
-
modifyUserDBObject
public void modifyUserDBObject(AbstractUserObject object) throws IOException, NXCException
Modify user database object- Parameters:
object- User data- Throws:
IOException- if socket I/O error occursNXCException- if NetXMS server returns an error or operation was timed out
-
detachUserFromLdap
public void detachUserFromLdap(long userId) throws IOException, NXCExceptionDetach user from LDAP- Parameters:
userId- user ID- Throws:
IOException- if socket I/O error occursNXCException- if NetXMS server returns an error or operation was timed out
-
lockUserDatabase
public void lockUserDatabase() throws IOException, NXCExceptionLock user database- Throws:
IOException- if socket I/O error occursNXCException- if NetXMS server returns an error or operation was timed out
-
unlockUserDatabase
public void unlockUserDatabase() throws IOException, NXCExceptionUnlock user database- Throws:
IOException- if socket I/O error occursNXCException- if NetXMS server returns an error or operation was timed out
-
setAttributeForCurrentUser
public void setAttributeForCurrentUser(String name, String value) throws IOException, NXCException
Set custom attribute for currently logged in user. Server will allow to change only attributes whose name starts with dot.- Parameters:
name- Attribute's namevalue- New attribute's value- Throws:
IOException- if socket I/O error occursNXCException- if NetXMS server returns an error or operation was timed out
-
getAttributeForCurrentUser
public String getAttributeForCurrentUser(String name) throws IOException, NXCException
Get custom attribute for currently logged in user. If attribute is not set, empty string will be returned.- Parameters:
name- Attribute's name- Returns:
- Attribute's value
- Throws:
IOException- if socket I/O error occursNXCException- if NetXMS server returns an error or operation was timed out
-
findMatchingDCI
public List<DciValue> findMatchingDCI(long objectId, String objectName, String dciName, int flags) throws IOException, NXCException
Resolve list of last values by regex- Parameters:
objectId- if specific object neededobjectName- as regexdciName- as regexflags-- Returns:
- list of all resolved last values
- Throws:
IOException- if socket I/O error occursNXCException- if NetXMS server returns an error or operation was timed out
-
getLastValues
public DciValue[] getLastValues(long nodeId, boolean objectTooltipOnly, boolean overviewOnly, boolean includeNoValueObjects) throws IOException, NXCException
Get last DCI values for given node- Parameters:
nodeId- ID of the node to get DCI values forobjectTooltipOnly- if set to true, only DCIs with DCF_SHOW_ON_OBJECT_TOOLTIP flag set are returnedoverviewOnly- if set to true, only DCIs with DCF_SHOW_IN_OBJECT_OVERVIEW flag set are returnedincludeNoValueObjects- if set to true, objects with no value (like instance discovery DCIs) will be returned as well- Returns:
- List of DCI values
- Throws:
IOException- if socket I/O error occursNXCException- if NetXMS server returns an error or operation was timed out
-
getLastValues
public DciValue[] getLastValues(long nodeId) throws 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:
IOException- if socket I/O error occursNXCException- if NetXMS server returns an error or operation was timed out
-
getLastValues
public DciValue[] getLastValues(Set<MapDCIInstance> mapDcis) throws IOException, NXCException
Get last DCI values for given Map DCI Instance list- Parameters:
mapDcis- List with Map DCI Instances- Returns:
- List of DCI values
- Throws:
IOException- if socket I/O error occursNXCException- if NetXMS server returns an error or operation was timed out
-
getLastValues
public DciValue[] getLastValues(List<SingleDciConfig> dciConfig) throws IOException, NXCException
Get last DCI values for given Single Dci Config list- Parameters:
dciConfig- List with Single Dci Configs- Returns:
- List of DCI values
- Throws:
IOException- if socket I/O error occursNXCException- if NetXMS server returns an error or operation was timed out
-
getActiveThresholds
public List<Threshold> getActiveThresholds(List<SingleDciConfig> dciConfig) throws IOException, NXCException
Get active thresholds- Parameters:
dciConfig- Dci config- Returns:
- list of active thresholds
- Throws:
IOException- TODONXCException- TODO
-
getTableLastValues
public Table getTableLastValues(long nodeId, long dciId) throws IOException, NXCException
Get last values for given table DCI on given node- Parameters:
nodeId- ID of the node to get DCI values fordciId- DCI ID- Returns:
- Table object with last values for table DCI
- Throws:
IOException- if socket I/O error occursNXCException- if NetXMS server returns an error or operation was timed out
-
getPerfTabItems
public PerfTabDci[] getPerfTabItems(long nodeId) throws 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:
IOException- if socket I/O error occursNXCException- if NetXMS server returns an error or operation was timed out
-
getThresholdSummary
public List<ThresholdViolationSummary> getThresholdSummary(long objectId) throws IOException, NXCException
Get threshold violation summary for all nodes under given parent object. Parent object could be container, subnet, zone, entire network, or infrastructure service root.- Parameters:
objectId- parent object ID- Returns:
- list of threshold violation summary objects for all nodes below given root
- Throws:
IOException- if socket I/O error occursNXCException- if NetXMS server returns an error or operation was timed out
-
parseDataRows
public int parseDataRows(byte[] input, DciData data)Parse data from raw message CMD_DCI_DATA. This method is intended for calling by client internal methods only. It made public to allow access from client extensions.- Parameters:
input- Raw datadata- Data object to add rows to- Returns:
- number of received data rows
-
getCollectedData
public DciData getCollectedData(long nodeId, long dciId, Date from, Date to, int maxRows, HistoricalDataType valueType) throws 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 IDdciId- DCI IDfrom- Start of time range or null for no limitto- End of time range or null for no limitmaxRows- Maximum number of rows to retrieve or 0 for no limitvalueType- TODO- Returns:
- DCI data set
- Throws:
IOException- if socket I/O error occursNXCException- if NetXMS server returns an error or operation was timed out
-
getCollectedTableData
public DciData getCollectedTableData(long nodeId, long dciId, String instance, String dataColumn, Date from, Date to, int maxRows) throws IOException, NXCException
Get collected table DCI data from server. Please note that you should specify either row count limit or time from/to limit.- Parameters:
nodeId- Node IDdciId- DCI IDinstance- instance valuedataColumn- name of column to retrieve data fromfrom- Start of time range or null for no limitto- End of time range or null for no limitmaxRows- Maximum number of rows to retrieve or 0 for no limit- Returns:
- DCI data set
- Throws:
IOException- if socket I/O error occursNXCException- if NetXMS server returns an error or operation was timed out
-
clearCollectedData
public void clearCollectedData(long nodeId, long dciId) throws IOException, NXCExceptionClear collected data for given DCI- Parameters:
nodeId- Node object IDdciId- DCI ID- Throws:
IOException- if socket I/O error occursNXCException- if NetXMS server returns an error or operation was timed out
-
deleteDciEntry
public void deleteDciEntry(long nodeId, long dciId, long timestamp) throws IOException, NXCExceptionDelete collected data entry for given DCI- Parameters:
nodeId- Node object IDdciId- DCI IDtimestamp- timestamp of entry- Throws:
IOException- if socket I/O error occursNXCException- if NetXMS server returns an error or operation was timed out
-
recalculateDCIValues
public long recalculateDCIValues(long objectId, long dciId) throws IOException, NXCExceptionStart recalculation of DCI values using preserver raw values.- Parameters:
objectId- object IDdciId- DCI ID- Returns:
- assigned job ID
- Throws:
IOException- if socket I/O error occursNXCException- if NetXMS server returns an error or operation was timed out
-
forceDCIPoll
public void forceDCIPoll(long nodeId, long dciId) throws IOException, NXCExceptionForce DCI poll for given DCI- Parameters:
nodeId- Node object IDdciId- DCI ID- Throws:
IOException- if socket I/O error occursNXCException- if NetXMS server returns an error or operation was timed out
-
getThresholds
public Threshold[] getThresholds(long nodeId, long dciId) throws IOException, NXCException
Get list of thresholds configured for given DCI- Parameters:
nodeId- Node object IDdciId- DCI ID- Returns:
- List of configured thresholds
- Throws:
IOException- if socket I/O error occursNXCException- if NetXMS server returns an error or operation was timed out
-
dciIdsToNames
public String[] dciIdsToNames(long[] nodeIds, long[] dciIds) throws IOException, NXCException
Get names for given DCI list- Parameters:
nodeIds- node identifiersdciIds- DCI identifiers (length must match length of node identifiers list)- Returns:
- array of resolved DCI names
- Throws:
IOException- if socket I/O error occursNXCException- if NetXMS server returns an error or operation was timed out
-
dciIdsToNames
public String[] dciIdsToNames(Collection<ConditionDciInfo> dciList) throws IOException, NXCException
Get names for given DCI list- Parameters:
dciList- DCI list- Returns:
- array of resolved DCI names
- Throws:
IOException- if socket I/O error occursNXCException- if NetXMS server returns an error or operation was timed out
-
dciNameToId
public long dciNameToId(long nodeId, String dciName) throws IOException, NXCExceptionGet DCI ID for given DCI name- Parameters:
nodeId- node object identifierdciName- DCI name- Returns:
- id of DCI with given name
- Throws:
IOException- if socket I/O error occursNXCException- if NetXMS server returns an error or operation was timed out
-
queryParameter
public String queryParameter(long nodeId, int origin, String name) throws IOException, NXCException
Query parameter immediately. This call will cause server to do actual call to managed node and will return current value for given parameter. Result is not cached.- Parameters:
nodeId- node object IDorigin- parameter's origin (NetXMS agent, SNMP, etc.)name- parameter's name- Returns:
- current parameter's value
- Throws:
IOException- if socket I/O error occursNXCException- if NetXMS server returns an error or operation was timed out
-
queryAgentTable
public Table queryAgentTable(long nodeId, String name) throws IOException, NXCException
Query agent's table immediately. This call will cause server to do actual call to managed node and will return current value for given table. Result is not cached.- Parameters:
nodeId- node object IDname- table's name- Returns:
- current table's value
- Throws:
IOException- if socket I/O error occursNXCException- if NetXMS server returns an error or operation was timed out
-
createCustomObject
protected void createCustomObject(NXCObjectCreationData data, Object userData, org.netxms.base.NXCPMessage msg)
Hook method to allow adding of custom object creation data to NXCP message. Default implementation does nothing.- Parameters:
data- object creation data passed to createObjectuserData- user-defined data for object creation passed to createObjectmsg- NXCP message that will be sent to server
-
createObject
public long createObject(NXCObjectCreationData data, Object userData) throws IOException, NXCException
Create new NetXMS object.- Parameters:
data- Object creation datauserData- User-defined data for custom object creation- Returns:
- ID of new object
- Throws:
IOException- if socket I/O error occursNXCException- if NetXMS server returns an error or operation was timed out
-
createObject
public long createObject(NXCObjectCreationData data) throws IOException, NXCException
Create new NetXMS object. Equivalent of calling createObject(data, null).- Parameters:
data- Object creation data- Returns:
- ID of new object
- Throws:
IOException- if socket I/O error occursNXCException- if NetXMS server returns an error or operation was timed out
-
deleteObject
public void deleteObject(long objectId) throws IOException, NXCExceptionDelete object- Parameters:
objectId- ID of an object which should be deleted- Throws:
IOException- if socket I/O error occursNXCException- if NetXMS server returns an error or operation was timed out
-
modifyCustomObject
protected void modifyCustomObject(NXCObjectModificationData data, Object userData, org.netxms.base.NXCPMessage msg)
Hook method to populate NXCP message with custom object's data on object modification. Default implementation does nothing.- Parameters:
data- object modification data passed to modifyObjectuserData- user-defined data passed to modifyObjectmsg- NXCP message to be sent to server
-
modifyObject
public void modifyObject(NXCObjectModificationData data, Object userData) throws IOException, NXCException
Modify object (generic interface, in most cases wrapper functions should be used instead).- Parameters:
data- Object modification datauserData- user-defined data for custom object modification- Throws:
IOException- if socket I/O error occursNXCException- if NetXMS server returns an error or operation was timed out
-
modifyObject
public void modifyObject(NXCObjectModificationData data) throws IOException, NXCException
Modify object (generic interface, in most cases wrapper functions should be used instead). Equivalent of calling modifyObject(data, null).- Parameters:
data- Object modification data- Throws:
IOException- if socket I/O error occursNXCException- if NetXMS server returns an error or operation was timed out
-
setObjectName
public void setObjectName(long objectId, String name) throws IOException, NXCExceptionChange object's name (wrapper for modifyObject())- Parameters:
objectId- ID of object to be changedname- New object's name- Throws:
IOException- if socket I/O error occursNXCException- if NetXMS server returns an error or operation was timed out
-
setObjectCustomAttributes
public void setObjectCustomAttributes(long objectId, Map<String,CustomAttribute> attrList) throws IOException, NXCExceptionChange object's custom attributes (wrapper for modifyObject())- Parameters:
objectId- The object IDattrList- The attribute list- Throws:
IOException- if socket I/O error occursNXCException- if NetXMS server returns an error or operation was timed out
-
setObjectACL
public void setObjectACL(long objectId, AccessListElement[] acl, boolean inheritAccessRights) throws IOException, NXCExceptionChange object's ACL (wrapper for modifyObject())- Parameters:
objectId- The object idacl- The AccessListElementsinheritAccessRights- true if access rights should be inherited- Throws:
IOException- if socket I/O error occursNXCException- if NetXMS server returns an error or operation was timed out
-
changeObjectZone
public void changeObjectZone(long objectId, long zoneUIN) throws IOException, NXCExceptionMove object to different zone. Only nodes and clusters can be moved between zones.- Parameters:
objectId- Node or cluster object IDzoneUIN- The zone UIN (unique identification number)- Throws:
IOException- if socket I/O error occursNXCException- if NetXMS server returns an error or operation was timed out
-
updateObjectComments
public void updateObjectComments(long objectId, String comments) throws IOException, NXCExceptionChange object's comments.- Parameters:
objectId- Object's IDcomments- New comments- Throws:
IOException- if socket I/O error occursNXCException- if NetXMS server returns an error or operation was timed out
-
setObjectManaged
public void setObjectManaged(long objectId, boolean isManaged) throws IOException, NXCExceptionSet object's managed status.- Parameters:
objectId- object's identifierisManaged- object's managed status- Throws:
IOException- if socket I/O error occursNXCException- if NetXMS server returns an error or operation was timed out
-
getEffectiveRights
public int getEffectiveRights(long objectId) throws IOException, NXCExceptionGet effective rights of currently logged in user to given object.- Parameters:
objectId- The object ID- Returns:
- The effective rights
- Throws:
IOException- if socket I/O error occursNXCException- if NetXMS server returns an error or operation was timed out
-
bindObject
public void bindObject(long parentId, long childId) throws IOException, NXCExceptionBind object.- Parameters:
parentId- parent object's identifierchildId- Child object's identifier- Throws:
IOException- if socket I/O error occursNXCException- if NetXMS server returns an error or operation was timed out
-
unbindObject
public void unbindObject(long parentId, long childId) throws IOException, NXCExceptionUnbind object.- Parameters:
parentId- parent object's identifierchildId- Child object's identifier- Throws:
IOException- if socket I/O error occursNXCException- if NetXMS server returns an error or operation was timed out
-
removeTemplate
public void removeTemplate(long templateId, long nodeId, boolean removeDci) throws IOException, NXCExceptionRemove data collection template from node.- Parameters:
templateId- template object identifiernodeId- node object identifierremoveDci- true if DCIs created from this template should be removed- Throws:
IOException- if socket I/O error occursNXCException- if NetXMS server returns an error or operation was timed out
-
applyTemplate
public void applyTemplate(long templateId, long nodeId) throws IOException, NXCExceptionApply data collection template to node.- Parameters:
templateId- template object IDnodeId- node object ID- Throws:
IOException- if socket I/O error occursNXCException- if NetXMS server returns an error or operation was timed out
-
addClusterNode
public void addClusterNode(long clusterId, long nodeId) throws IOException, NXCExceptionAdd node to cluster.- Parameters:
clusterId- cluster object IDnodeId- node object ID- Throws:
IOException- if socket I/O error occursNXCException- if NetXMS server returns an error or operation was timed out
-
removeClusterNode
public void removeClusterNode(long clusterId, long nodeId) throws IOException, NXCExceptionRemove node from cluster.- Parameters:
clusterId- cluster object IDnodeId- node object ID- Throws:
IOException- if socket I/O error occursNXCException- if NetXMS server returns an error or operation was timed out
-
queryLayer2Topology
public NetworkMapPage queryLayer2Topology(long nodeId) throws IOException, NXCException
Query layer 2 topology for node- Parameters:
nodeId- The node ID- Returns:
- The NetworkMapPage
- Throws:
IOException- if socket I/O error occursNXCException- if NetXMS server returns an error or operation was timed out
-
queryInternalConnectionTopology
public NetworkMapPage queryInternalConnectionTopology(long nodeId) throws IOException, NXCException
Query internal connection topology for node- Parameters:
nodeId- The node ID- Returns:
- The NetworkMapPage
- Throws:
IOException- if socket I/O error occursNXCException- if NetXMS server returns an error or operation was timed out
-
executeActionWithExpansion
public String executeActionWithExpansion(long nodeId, long alarmId, String action, Map<String,String> inputValues) throws IOException, NXCException
Execute action on remote agent- Parameters:
nodeId- Node object IDalarmId- Alarm ID (used for macro expansion)action- Action with all arguments, that will be expanded and splitted on server sideinputValues- Input values provided by user for expansion- Returns:
- Expanded action name
- Throws:
IOException- if socket I/O error occursNXCException- if NetXMS server returns an error or operation was timed out
-
executeActionWithExpansion
public String executeActionWithExpansion(long nodeId, long alarmId, String action, boolean receiveOutput, Map<String,String> inputValues, TextOutputListener listener, Writer writer) throws IOException, NXCException
Execute action on remote agent- Parameters:
nodeId- Node object IDalarmId- Alarm ID (used for macro expansion)action- Action with all arguments, that will be expanded and splitted on server sideinputValues- Input values provided by user for expansionreceiveOutput- true if action's output has to be readlistener- listener for action's output or nullwriter- writer for action's output or null- Returns:
- Expanded action name
- Throws:
IOException- if socket I/O error occursNXCException- if NetXMS server returns an error or operation was timed out
-
executeAction
public void executeAction(long nodeId, String action, String[] args) throws IOException, NXCExceptionExecute action on remote agent- Parameters:
nodeId- Node object IDaction- Action nameargs- Action arguments- Throws:
IOException- if socket I/O error occursNXCException- if NetXMS server returns an error or operation was timed out
-
executeAction
public void executeAction(long nodeId, String action, String[] args, boolean receiveOutput, TextOutputListener listener, Writer writer) throws IOException, NXCExceptionExecute action on remote agent- Parameters:
nodeId- Node object IDaction- Action nameargs- Action argumentsreceiveOutput- true if action's output has to be readlistener- listener for action's output or nullwriter- writer for action's output or null- Throws:
IOException- if socket I/O error occursNXCException- if NetXMS server returns an error or operation was timed out
-
wakeupNode
public void wakeupNode(long objectId) throws IOException, NXCExceptionWakeup 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:
IOException- if socket I/O error occursNXCException- if NetXMS server returns an error or operation was timed out
-
getNodePhysicalComponents
public PhysicalComponent getNodePhysicalComponents(long nodeId) throws IOException, NXCException
Get node's physical components (obtained from ENTITY-MIB).- Parameters:
nodeId- node object identifier- Returns:
- root component
- Throws:
IOException- if socket I/O error occursNXCException- if NetXMS server returns an error or operation was timed out
-
getNodeWinPerfObjects
public List<WinPerfObject> getNodeWinPerfObjects(long nodeId) throws IOException, NXCException
Get list of available Windows performance objects. Returns empty list if node does is not a Windows node or does not have WinPerf subagent installed.- Parameters:
nodeId- node object ID- Returns:
- list of available Windows performance objects
- Throws:
IOException- if socket I/O error occursNXCException- if NetXMS server returns an error or operation was timed out
-
getNodeSoftwarePackages
public List<SoftwarePackage> getNodeSoftwarePackages(long nodeId) throws IOException, NXCException
Get list of software packages installed on node.- Parameters:
nodeId- node object identifier- Returns:
- root component
- Throws:
IOException- if socket I/O error occursNXCException- if NetXMS server returns an error or operation was timed out
-
getNodeHardwareComponents
public List<HardwareComponent> getNodeHardwareComponents(long nodeId) throws IOException, NXCException
- Throws:
IOExceptionNXCException
-
getDependentNodes
public List<DependentNode> getDependentNodes(long nodeId) throws IOException, NXCException
Get list of dependent nodes for given node. Node is considered dependent if it use given node as any type of proxy or as data collection source for at least one DCI.- Parameters:
nodeId- node object ID- Returns:
- list of dependent node descriptors
- Throws:
IOException- if socket I/O error occursNXCException- if NetXMS server returns an error or operation was timed out
-
getServerJobList
public ServerJob[] getServerJobList() throws IOException, NXCException
Get list of server jobs- Returns:
- list of server jobs
- Throws:
IOException- if socket I/O error occursNXCException- if NetXMS server returns an error or operation was timed out
-
cancelServerJob
public void cancelServerJob(long jobId) throws IOException, NXCExceptionCancel server job- Parameters:
jobId- Job ID- Throws:
IOException- if socket I/O error occursNXCException- if NetXMS server returns an error or operation was timed out
-
holdServerJob
public void holdServerJob(long jobId) throws IOException, NXCExceptionPut server job on hold- Parameters:
jobId- Job ID- Throws:
IOException- if socket I/O error occursNXCException- if NetXMS server returns an error or operation was timed out
-
unholdServerJob
public void unholdServerJob(long jobId) throws IOException, NXCExceptionPut server on hold job to pending state- Parameters:
jobId- Job ID- Throws:
IOException- if socket I/O error occursNXCException- if NetXMS server returns an error or operation was timed out
-
deployAgentPolicy
public void deployAgentPolicy(long policyId, long nodeId) throws IOException, NXCExceptionDeploy policy on agent- Parameters:
policyId- Policy object IDnodeId- Node object ID- Throws:
IOException- if socket I/O error occursNXCException- if NetXMS server returns an error or operation was timed out
-
uninstallAgentPolicy
public void uninstallAgentPolicy(long policyId, long nodeId) throws IOException, NXCExceptionUninstall policy from agent- Parameters:
policyId- Policy object IDnodeId- Node object ID- Throws:
IOException- if socket I/O error occursNXCException- if NetXMS server returns an error or operation was timed out
-
getEventProcessingPolicy
public EventProcessingPolicy getEventProcessingPolicy() throws IOException, NXCException
Get read-only copy of event processing policy.- Returns:
- Event processing policy
- Throws:
IOException- if socket I/O error occursNXCException- if NetXMS server returns an error or operation was timed out
-
openEventProcessingPolicy
public EventProcessingPolicy openEventProcessingPolicy() throws 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:
IOException- if socket I/O error occursNXCException- if NetXMS server returns an error or operation was timed out
-
saveEventProcessingPolicy
public void saveEventProcessingPolicy(EventProcessingPolicy epp) throws 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:
IOException- if socket I/O error occursNXCException- if NetXMS server returns an error or operation was timed out
-
closeEventProcessingPolicy
public void closeEventProcessingPolicy() throws IOException, NXCExceptionClose 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:
IOException- if socket I/O error occursNXCException- if NetXMS server returns an error or operation was timed out
-
openDataCollectionConfiguration
public DataCollectionConfiguration openDataCollectionConfiguration(long nodeId) throws 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:
IOException- if socket I/O error occursNXCException- if NetXMS server returns an error or operation was timed out
-
openDataCollectionConfiguration
public DataCollectionConfiguration openDataCollectionConfiguration(long nodeId, DataCollectionConfigurationChangeListener changeListener) throws 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 identifierchangeListener- callback that will be called when DCO object is changed by server notification- Returns:
- Data collection configuration object
- Throws:
IOException- if socket I/O error occursNXCException- if NetXMS server returns an error or operation was timed out
-
clearAgentDataCollectionConfiguration
public void clearAgentDataCollectionConfiguration(long nodeId) throws IOException, NXCExceptionClear data collection configuration on agent. Will wipe out all configuration and collected data.- Parameters:
nodeId- node object ID- Throws:
IOException- if socket I/O error occursNXCException- if NetXMS server returns an error or operation was timed out
-
resyncAgentDataCollectionConfiguration
public void resyncAgentDataCollectionConfiguration(long nodeId) throws IOException, NXCExceptionForce re-synchronization of data collection configuration with agent.- Parameters:
nodeId- node object ID- Throws:
IOException- if socket I/O error occursNXCException- if NetXMS server returns an error or operation was timed out
-
testTransformationScript
public TransformationTestResult testTransformationScript(long nodeId, String script, String inputValue, DataCollectionObject dcObject) throws IOException, NXCException
Test DCI transformation script.- Parameters:
nodeId- ID of the node object to test script onscript- script source codeinputValue- input value for the scriptdcObject- optional data collection object data (for $dci variable in script)- Returns:
- test execution results
- Throws:
IOException- if socket I/O error occursNXCException- if NetXMS server returns an error or operation was timed out
-
executeLibraryScript
public void executeLibraryScript(long nodeId, String script, Map<String,String> inputFields, TextOutputListener listener) throws IOException, NXCExceptionExecute library script on object. Script name interpreted as command line with server-side macro substitution. Map inputValues can be used to pass data for %() macros.- Parameters:
nodeId- node ID to execute script onscript- script name and parametersinputFields- input values map for %() macro substitution (can be null)listener- script output listener- Throws:
IOException- if socket I/O error occursNXCException- if NetXMS server returns an error or operation was timed out
-
executeLibraryScript
public void executeLibraryScript(long nodeId, long alarmId, String script, Map<String,String> inputFields, TextOutputListener listener) throws IOException, NXCExceptionExecute library script on object. Script name interpreted as command line with server-side macro substitution. Map inputValues can be used to pass data for %() macros.- Parameters:
nodeId- node ID to execute script onalarmId- alarm ID to use for expansionscript- script name and parametersinputFields- input values map for %() macro substitution (can be null)listener- script output listener- Throws:
IOException- if socket I/O error occursNXCException- if NetXMS server returns an error or operation was timed out
-
executeScript
public void executeScript(long nodeId, String script, TextOutputListener listener) throws IOException, NXCExceptionExecute script.- Parameters:
nodeId- ID of the node object to test script onscript- script source codelistener- script output listener- Throws:
IOException- if socket I/O error occursNXCException- if NetXMS server returns an error or operation was timed out
-
compileScript
public ScriptCompilationResult compileScript(String source, boolean serialize) throws IOException, NXCException
Compile NXSL script on server. Field *success* in compilation result object will indicate compilation status. If compilation fails, field *errorMessage* will contain compilation error message.- Parameters:
source- script sourceserialize- flag to indicate if compiled script should be serialized and sent back to client- Returns:
- script compilation result object
- Throws:
IOException- if socket I/O error occursNXCException- if NetXMS server returns an error or operation was timed out
-
openServerLog
public Log openServerLog(String logName) throws IOException, NXCException
Open server log by name.- Parameters:
logName- Log name- Returns:
- Log object
- Throws:
IOException- if socket I/O error occursNXCException- if NetXMS server returns an error or operation was timed out
-
getAlarmCategories
public List<AlarmCategory> getAlarmCategories() throws IOException, NXCException
Get alarm categories from server- Returns:
- List of configured alarm categories
- Throws:
IOException- if socket I/O error occursNXCException- if NetXMS server returns an error or operation was timed out
-
modifyAlarmCategory
public long modifyAlarmCategory(AlarmCategory object) throws IOException, NXCException
Add or update alarm category in DB- Parameters:
object- alarm category- Returns:
- The ID of the category
- Throws:
IOException- if socket I/O error occursNXCException- if NetXMS server returns an error or operation was timed out
-
deleteAlarmCategory
public void deleteAlarmCategory(long id) throws IOException, NXCExceptionDelete alarm category in DB- Parameters:
id- of alarm category- Throws:
IOException- if socket I/O error occursNXCException- if NetXMS server returns an error or operation was timed out
-
syncAlarmCategories
public void syncAlarmCategories() throws IOException, NXCExceptionSynchronize alarm category configuration. After call to this method session object will maintain internal list of configured alarm categories- Throws:
IOException- if socket I/O error occursNXCException- if NetXMS server returns an error or operation was timed out
-
isAlarmCategoriesSynchronized
public boolean isAlarmCategoriesSynchronized()
Check if alarm categories are synchronized.- Returns:
- true if if alarm categories are synchronized
-
findAlarmCategoryById
public AlarmCategory findAlarmCategoryById(long id)
Find alarm category by id in alarm category database internally maintained by session object. You must call NXCSession.syncAlarmCategories() first to make local copy of event template database.- Parameters:
id- alarm category id- Returns:
- Event template object or null if not found
-
findAlarmCategoryByName
public AlarmCategory findAlarmCategoryByName(String name)
Find alarm category by name in alarm category database internally maintained by session object. You must call NXCSession.syncAlarmCategories() first to make local copy of event template database.- Parameters:
name- alarm category name- Returns:
- alarm category with given name or null if not found
-
findMultipleAlarmCategories
public List<AlarmCategory> findMultipleAlarmCategories(List<Long> ids)
Find multiple alarm categories by category id`s in alarm category database internally maintained by session object. You must call NXCSession.syncAlarmCategories() first to make local copy of alarm category database.- Parameters:
ids- List of alarm category id`s- Returns:
- List of found alarm categories
-
isEventObjectsSynchronized
public boolean isEventObjectsSynchronized()
Check if event configuratrion objects are synchronized.- Returns:
- true if event configuratrion objects are synchronized
-
syncEventTemplates
public void syncEventTemplates() throws IOException, NXCExceptionSynchronize event templates configuration. After call to this method session object will maintain internal list of configured event templates.- Throws:
IOException- if socket I/O error occursNXCException- 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
-
findEventTemplateByName
public EventTemplate findEventTemplateByName(String name)
Find event template by name in event template database internally maintained by session object. You must call NXCSession.syncEventObjects() first to make local copy of event template database.- Parameters:
name- Event name- Returns:
- Event template object or null if not found
-
getEventName
public String getEventName(long code)
Get event name from event code- Parameters:
code- event code- Returns:
- event name or event code as string if event not found
-
findEventTemplateByCode
public EventTemplate findEventTemplateByCode(long code)
Find event template by code in event template database internally maintained by session object. You must call NXCSession.syncEventObjects() first to make local copy of event template database.- Parameters:
code- Event code- Returns:
- Event template object or null if not found
-
findMultipleEventTemplates
public List<EventTemplate> findMultipleEventTemplates(Long[] codes)
Find multiple event templates by event codes in event template database internally maintained by session object. You must call NXCSession.syncEventObjects() first to make local copy of event template database.- Parameters:
codes- List of event codes- Returns:
- List of found event templates
-
findMultipleEventTemplates
public List<EventTemplate> findMultipleEventTemplates(long[] codes)
Find multiple event templates by event codes in event template database internally maintained by session object. You must call NXCSession.syncEventObjects() first to make local copy of event template database.- Parameters:
codes- List of event codes- Returns:
- List of found event templates
-
getEventTemplates
public List<EventTemplate> getEventTemplates() throws IOException, NXCException
Get event objects from server- Returns:
- List of configured event objects
- Throws:
IOException- if socket I/O error occursNXCException- if NetXMS server returns an error or operation was timed out
-
generateEventCode
public long generateEventCode() throws IOException, NXCExceptionGenerate code for new event template.- Returns:
- Code for new event template
- Throws:
IOException- if socket I/O error occursNXCException- if NetXMS server returns an error or operation was timed out
-
deleteEventTemplate
public void deleteEventTemplate(long eventCode) throws IOException, NXCExceptionDelete event template.- Parameters:
eventCode- Event code- Throws:
IOException- if socket I/O error occursNXCException- if NetXMS server returns an error or operation was timed out
-
modifyEventObject
public void modifyEventObject(EventTemplate tmpl) throws IOException, NXCException
Modify event template.- Parameters:
tmpl- Event template- Throws:
IOException- if socket I/O error occursNXCException- if NetXMS server returns an error or operation was timed out
-
sendEvent
public void sendEvent(long eventCode, String eventName, long objectId, String[] parameters, String userTag) throws IOException, NXCExceptionSend event to server. Event can be identified either by event code or event name. If event name is given, event code will be ignored.Node: sending events by name supported by server version 1.1.8 and higher.
- Parameters:
eventCode- event code. Ignored if event name is not null.eventName- event name. Must be set to null if event identified by code.objectId- Object ID to send event on behalf of. If set to 0, server will determine object ID by client IP address.parameters- event's parametersuserTag- event's user tag- Throws:
IOException- if socket I/O error occursNXCException- if NetXMS server returns an error or operation was timed out
-
sendEvent
public void sendEvent(long eventCode, String[] parameters) throws IOException, NXCExceptionConvenience wrapper for sendEvent interface.- Parameters:
eventCode- event codeparameters- event's parameters- Throws:
IOException- if socket I/O error occursNXCException- if NetXMS server returns an error or operation was timed out
-
sendEvent
public void sendEvent(String eventName, String[] parameters) throws IOException, NXCException
Convenience wrapper for sendEvent interface.- Parameters:
eventName- event nameparameters- event's parameters- Throws:
IOException- if socket I/O error occursNXCException- if NetXMS server returns an error or operation was timed out
-
getSnmpCommunities
public Map<Integer,List<String>> getSnmpCommunities() throws IOException, NXCException
Get list of well-known SNMP communities configured on server.- Returns:
- map of SNMP community strings
- Throws:
IOException- if socket I/O error occursNXCException- if NetXMS server returns an error or operation was timed out
-
updateSnmpCommunities
public void updateSnmpCommunities(Map<Integer,List<String>> map) throws IOException, NXCException
Update list of well-known SNMP community strings on server. Existing list will be replaced by given one.- Parameters:
map- New map of SNMP community strings- Throws:
IOException- if socket I/O error occursNXCException- if NetXMS server returns an error or operation was timed out
-
getSnmpUsmCredentials
public Map<Integer,List<SnmpUsmCredential>> getSnmpUsmCredentials() throws IOException, NXCException
Get list of well-known SNMP USM (user security model) credentials configured on server.- Returns:
- Map of SNMP USM credentials
- Throws:
IOException- if socket I/O error occursNXCException- if NetXMS server returns an error or operation was timed out
-
updateSnmpUsmCredentials
public void updateSnmpUsmCredentials(Map<Integer,List<SnmpUsmCredential>> map) throws IOException, NXCException
Update list of well-known SNMP USM credentials on server. Existing list will be replaced by given one.- Parameters:
map- New map of SNMP USM credentials- Throws:
IOException- if socket I/O error occursNXCException- if NetXMS server returns an error or operation was timed out
-
getAgentConfig
public String getAgentConfig(long nodeId) throws IOException, NXCException
Get agent's master configuration file.- Parameters:
nodeId- Node ID- Returns:
- Master configuration file of agent running on given node
- Throws:
IOException- if socket I/O error occursNXCException- if NetXMS server returns an error or operation was timed out
-
updateAgentConfig
public void updateAgentConfig(long nodeId, String config, boolean apply) throws IOException, NXCExceptionUpdate agent's master configuration file.- Parameters:
nodeId- Node IDconfig- New configuration file contentapply- Apply flag - if set to true, agent will restart automatically to apply changes- Throws:
IOException- if socket I/O error occursNXCException- if NetXMS server returns an error or operation was timed out
-
getSupportedParameters
public List<AgentParameter> getSupportedParameters(long nodeId, int origin) throws IOException, NXCException
Get list of parameters supported by entity defined by origin on given node.- Parameters:
nodeId- Node IDorigin- data origin (agent, driver, etc.)- Returns:
- List of parameters supported by agent
- Throws:
IOException- if socket I/O error occursNXCException- if NetXMS server returns an error or operation was timed out
-
getSupportedParameters
public List<AgentParameter> getSupportedParameters(long nodeId) throws 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:
IOException- if socket I/O error occursNXCException- if NetXMS server returns an error or operation was timed out
-
getSupportedTables
public List<AgentTable> getSupportedTables(long nodeId) throws IOException, NXCException
Get list of tables supported by agent running on given node.- Parameters:
nodeId- Node ID- Returns:
- List of tables supported by agent
- Throws:
IOException- if socket I/O error occursNXCException- if NetXMS server returns an error or operation was timed out
-
getDataCollectionEvents
public long[] getDataCollectionEvents(long objectId) throws IOException, NXCExceptionGet all events used in data collection by given node, cluster, or template object.- Parameters:
objectId- node, cluster, or template object ID- Returns:
- list of used event codes
- Throws:
IOException- if socket I/O error occursNXCException- if NetXMS server returns an error or operation was timed out
-
getDataCollectionScripts
public List<Script> getDataCollectionScripts(long objectId) throws IOException, NXCException
Get names of all scripts used in data collection by given node, cluster, or template object.- Parameters:
objectId- node, cluster, or template object ID- Returns:
- list of used library scripts
- Throws:
IOException- if socket I/O error occursNXCException- if NetXMS server returns an error or operation was timed out
-
exportConfiguration
public String exportConfiguration(String description, long[] events, long[] traps, long[] templates, UUID[] rules, long[] scripts, long[] objectTools, long[] dciSummaryTables, long[] actions) throws IOException, NXCException
Export server configuration. Returns requested configuration elements exported into XML.- Parameters:
description- Description of exported configurationevents- List of event codestraps- List of trap identifierstemplates- List of template object identifiersrules- List of event processing rule GUIDsscripts- List of library script identifiersobjectTools- List of object tool identifiersdciSummaryTables- List of DCI summary table identifiersactions- TODO- Returns:
- resulting XML document
- Throws:
IOException- if socket I/O error occursNXCException- if NetXMS server returns an error or operation was timed out
-
importConfiguration
public void importConfiguration(String config, int flags) throws IOException, NXCException
Import server configuration (events, traps, thresholds) from XML- Parameters:
config- Configuration in XML formatflags- Import flags- Throws:
IOException- if socket I/O error occursNXCException- if NetXMS server returns an error or operation was timed out
-
getServerStats
public Map<String,Object> getServerStats() throws 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, QSIZE_DCI_CACHE_LOADER, ALARM_COUNT long[]: ALARMS_BY_SEVERITY- Returns:
- Server stats as set of named properties.
- Throws:
IOException- if socket I/O error occursNXCException- if NetXMS server returns an error or operation was timed out
-
getActions
public List<ServerAction> getActions() throws IOException, NXCException
Get list of configured actions from server- Returns:
- List of configured actions
- Throws:
IOException- if socket I/O error occursNXCException- if NetXMS server returns an error or operation was timed out
-
createAction
public long createAction(String name) throws IOException, NXCException
Create new server action.- Parameters:
name- action name- Returns:
- ID assigned to new action
- Throws:
IOException- if socket I/O error occursNXCException- if NetXMS server returns an error or operation was timed out
-
modifyAction
public void modifyAction(ServerAction action) throws IOException, NXCException
Modify server action- Parameters:
action- Action object- Throws:
IOException- if socket I/O error occursNXCException- if NetXMS server returns an error or operation was timed out
-
deleteAction
public void deleteAction(long actionId) throws IOException, NXCExceptionDelete server action- Parameters:
actionId- Action ID- Throws:
IOException- if socket I/O error occursNXCException- if NetXMS server returns an error or operation was timed out
-
getCertificateList
public List<AuthCertificate> getCertificateList() throws IOException, NXCException
Get list of certificates- Returns:
- List of certificates
- Throws:
IOException- if socket I/O error occursNXCException- if NetXMS server returns an error or operation was timed out
-
createNewCertificate
public void createNewCertificate(byte[] data, String comments) throws IOException, NXCExceptionCreate new certificate- Parameters:
data- certificate file contentcomments- comment for certificate- Throws:
IOException- if socket I/O error occursNXCException- if NetXMS server returns an error or operation was timed out
-
deleteCertificate
public void deleteCertificate(long id) throws IOException, NXCExceptionDelete certificate- Parameters:
id- the certificate id- Throws:
IOException- if socket I/O error occursNXCException- if NetXMS server returns an error or operation was timed out
-
updateCertificate
public void updateCertificate(long id, String comment) throws IOException, NXCExceptionUpdate certificate- Parameters:
id- the certificate idcomment- the certificate comment- Throws:
IOException- if socket I/O error occursNXCException- if NetXMS server returns an error or operation was timed out
-
getObjectTools
public List<ObjectTool> getObjectTools() throws IOException, NXCException
Get list of configured object tools- Returns:
- List of object tools
- Throws:
IOException- if socket I/O error occursNXCException- if NetXMS server returns an error or operation was timed out
-
createToolTree
public ObjectToolFolder createToolTree(List<ObjectTool> tools)
Create object tool tree- Parameters:
tools- list of object tools- Returns:
- the root folder of the tree
-
getObjectToolsAsTree
public ObjectToolFolder getObjectToolsAsTree() throws IOException, NXCException
- Returns:
- root object tool folder
- Throws:
IOException- if socker or file I/O error occoursNXCException- if NetXMS server returns an error or operation was timed out
-
getObjectToolDetails
public ObjectToolDetails getObjectToolDetails(long toolId) throws IOException, NXCException
Get object tool details- Parameters:
toolId- Tool ID- Returns:
- Object tool details
- Throws:
IOException- if socket I/O error occursNXCException- if NetXMS server returns an error or operation was timed out
-
generateObjectToolId
public long generateObjectToolId() throws IOException, NXCExceptionGenerate unique ID for new object tool.- Returns:
- Unique ID for object tool
- Throws:
IOException- if socket I/O error occursNXCException- if NetXMS server returns an error or operation was timed out
-
modifyObjectTool
public void modifyObjectTool(ObjectToolDetails tool) throws IOException, NXCException
Modify object tool.- Parameters:
tool- Object tool- Throws:
IOException- if socket I/O error occursNXCException- if NetXMS server returns an error or operation was timed out
-
deleteObjectTool
public void deleteObjectTool(long toolId) throws IOException, NXCExceptionDelete object tool.- Parameters:
toolId- Object tool ID- Throws:
IOException- if socket I/O error occursNXCException- if NetXMS server returns an error or operation was timed out
-
changeObjecToolDisableStatuss
public void changeObjecToolDisableStatuss(long toolId, boolean enable) throws IOException, NXCExceptionDelete object tool.- Parameters:
toolId- Object tool IDenable- true if object tool should be enabled, false if disabled- Throws:
IOException- if socket I/O error occursNXCException- if NetXMS server returns an error or operation was timed out
-
executeTableTool
public Table executeTableTool(long toolId, long nodeId) throws IOException, NXCException
Execute object tool of "table" type against given node.- Parameters:
toolId- Tool IDnodeId- Node object ID- Returns:
- Table with tool execution results
- Throws:
IOException- if socket I/O error occursNXCException- if NetXMS server returns an error or operation was timed out
-
executeServerCommand
public void executeServerCommand(long objectId, String command, Map<String,String> inputFields) throws IOException, NXCExceptionExecute server command related to given object (usually defined as object tool)- Parameters:
objectId- object IDcommand- commandinputFields- values for input fields (can be null)- Throws:
IOException- if socket I/O error occursNXCException- if NetXMS server returns an error or operation was timed out
-
executeServerCommand
public void executeServerCommand(long objectId, String command, Map<String,String> inputFields, boolean receiveOutput, TextOutputListener listener, Writer writer) throws IOException, NXCExceptionExecute server command related to given object (usually defined as object tool)- Parameters:
objectId- object IDcommand- commandinputFields- values for input fields (can be null)receiveOutput- true if command's output has to be readlistener- listener for command's output or nullwriter- writer for command's output or null- Throws:
IOException- if socket I/O error occursNXCException- if NetXMS server returns an error or operation was timed out
-
stopServerCommand
public void stopServerCommand(long commandId) throws IOException, NXCExceptionStop server command- Parameters:
commandId- The command ID- Throws:
IOException- if socket I/O error occursNXCException- if NetXMS server returns an error or operation was timed out
-
getSnmpTrapsConfigurationSummary
public List<SnmpTrap> getSnmpTrapsConfigurationSummary() throws IOException, NXCException
Get summary of SNMP trap mapping. Trap configurations returned without parameter mapping.- Returns:
- List of SnmpTrap objects
- Throws:
IOException- if socket I/O error occursNXCException- if NetXMS server returns an error or operation was timed out
-
getSnmpTrapsConfiguration
public List<SnmpTrap> getSnmpTrapsConfiguration() throws IOException, NXCException
Get list of configured SNMP traps- Returns:
- List of configured SNMP traps.
- Throws:
IOException- if socket I/O error occursNXCException- if NetXMS server returns an error or operation was timed out
-
createSnmpTrapConfiguration
public long createSnmpTrapConfiguration() throws IOException, NXCExceptionCreate new trap configuration record.- Returns:
- ID of new record
- Throws:
IOException- if socket I/O error occursNXCException- if NetXMS server returns an error or operation was timed out
-
deleteSnmpTrapConfiguration
public void deleteSnmpTrapConfiguration(long trapId) throws IOException, NXCExceptionDelete SNMP trap configuration record from server.- Parameters:
trapId- Trap configuration record ID- Throws:
IOException- if socket I/O error occursNXCException- if NetXMS server returns an error or operation was timed out
-
modifySnmpTrapConfiguration
public void modifySnmpTrapConfiguration(SnmpTrap trap) throws IOException, NXCException
Modify SNMP trap configuration record.- Parameters:
trap- Modified trap configuration record- Throws:
IOException- if socket I/O error occursNXCException- if NetXMS server returns an error or operation was timed out
-
getMibFileTimestamp
public Date getMibFileTimestamp() throws IOException, NXCException
Get timestamp of server's MIB file.- Returns:
- Timestamp of server's MIB file
- Throws:
IOException- if socket I/O error occursNXCException- if NetXMS server returns an error or operation was timed out
-
downloadMibFile
public File downloadMibFile() throws IOException, NXCException
Download MIB file from server.- Returns:
- file handle for temporary file on local file system
- Throws:
IOException- if socket or file I/O error occursNXCException- if NetXMS server returns an error or operation was timed out
-
getPredefinedGraph
public GraphSettings getPredefinedGraph(long graphId) throws IOException, NXCException
Get predefined graph infromation by graph id- Parameters:
graphId- graph id- Returns:
- TODO
- Throws:
IOException- TODONXCException- TODO
-
getPredefinedGraphs
public List<GraphSettings> getPredefinedGraphs(boolean graphTemplates) throws IOException, NXCException
Get list of predefined graphs or graph templates- Parameters:
graphTemplates- defines if non template or template graph list should re requested- Returns:
- message with predefined graphs or with template graphs
- Throws:
IOException- if socket or file I/O error occursNXCException- if NetXMS server returns an error or operation was timed out
-
createGraphTree
public GraphFolder createGraphTree(List<GraphSettings> graphs)
Create graph tree from list- Parameters:
graphs- list of predefined graphs- Returns:
- graph tree
-
getPredefinedGraphsAsTree
public GraphFolder getPredefinedGraphsAsTree() throws IOException, NXCException
- Returns:
- root graph folder
- Throws:
IOException- if socket or file I/O error occursNXCException- if NetXMS server returns an error or operation was timed out
-
saveGraph
public long saveGraph(GraphSettings graph, boolean overwrite) throws IOException, NXCException
Checks if graph with specified name can be created/overwritten and creates/overwrites it in DB. If graph id is set to 0 it checks if graph with the same name exists, and if yes checks overwrite parameter. If it is set to false, then function returns error that graph with this name already exists. If there is no graph with the same name it just creates a new one. If id is set it checks that provided name is assigned only to this graph and overwrites it or throws error is the same name was already used. Also check if user have permissions to overwrite graph.If it can, then it returns 1. If graph with this name already exists, but can be overwritten by current user function returns 2. If graph with this name already exists, but can not be overwritten by current user function returns 0.
- Parameters:
graph- predefined graph configurationoverwrite- defines if existing graph should be overwritten- Returns:
- ID of predefined graph object
- Throws:
IOException- if socket or file I/O error occursNXCException- if NetXMS server returns an error or operation was timed out
-
deletePredefinedGraph
public void deletePredefinedGraph(long graphId) throws IOException, NXCExceptionDelete predefined graph.- Parameters:
graphId- predefined graph object ID- Throws:
IOException- if socket or file I/O error occursNXCException- if NetXMS server returns an error or operation was timed out
-
getScriptLibrary
public List<Script> getScriptLibrary() throws IOException, NXCException
Get list of all scripts in script library.- Returns:
- ID/name pairs for scripts in script library
- Throws:
IOException- if socket or file I/O error occursNXCException- if NetXMS server returns an error or operation was timed out
-
getScript
public Script getScript(long scriptId) throws IOException, NXCException
Get script from library- Parameters:
scriptId- script ID- Returns:
- script source code
- Throws:
IOException- if socket or file I/O error occursNXCException- if NetXMS server returns an error or operation was timed out
-
modifyScript
public long modifyScript(long scriptId, String name, String source) throws IOException, NXCExceptionModify script. If scriptId is 0, new script will be created in library.- Parameters:
scriptId- script IDname- script namesource- script source code- Returns:
- script ID (newly assigned if new script was created)
- Throws:
IOException- if socket or file I/O error occursNXCException- if NetXMS server returns an error or operation was timed out
-
renameScript
public void renameScript(long scriptId, String name) throws IOException, NXCExceptionRename script in script library.- Parameters:
scriptId- script IDname- new script name- Throws:
IOException- if socket or file I/O error occursNXCException- if NetXMS server returns an error or operation was timed out
-
deleteScript
public void deleteScript(long scriptId) throws IOException, NXCExceptionDelete script from library- Parameters:
scriptId- script ID- Throws:
IOException- if socket or file I/O error occursNXCException- if NetXMS server returns an error or operation was timed out
-
findConnectionPoint
public ConnectionPoint findConnectionPoint(long objectId) throws 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:
IOException- if socket or file I/O error occursNXCException- if NetXMS server returns an error or operation was timed out
-
findConnectionPoint
public ConnectionPoint findConnectionPoint(org.netxms.base.MacAddress macAddr) throws 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:
IOException- if socket or file I/O error occursNXCException- if NetXMS server returns an error or operation was timed out
-
findConnectionPoint
public ConnectionPoint findConnectionPoint(int zoneId, InetAddress ipAddr) throws IOException, NXCException
Find connection point (either directly connected or most close known interface on a switch) for given IP address. Will return null if connection point information cannot be found.- Parameters:
zoneId- zone IDipAddr- IP address to find- Returns:
- connection point information or null
- Throws:
IOException- if socket or file I/O error occursNXCException- if NetXMS server returns an error or operation was timed out
-
findNodesByHostname
public List<AbstractNode> findNodesByHostname(int zoneId, String hostname) throws IOException, NXCException
Find all nodes that contain the primary hostname- Parameters:
zoneId- zone IDhostname- Hostname to find- Returns:
- List of nodes found
- Throws:
IOException- if socket or file I/O error occursNXCException- if NetXMS server returns an error or operation was timed out
-
checkConnection
public boolean checkConnection()
Send KEEPALIVE message. Return true is connection is fine and false otherwise. If connection is broken, session notification with code CONNECTION_BROKEN will be sent to all subscribers. Note that this function will not throw exception in case of error.- Returns:
- true if connection is fine
-
getImageLibrary
public List<LibraryImage> getImageLibrary() throws IOException, NXCException
Get the whole image library- Returns:
- List of library images
- Throws:
IOException- if socket I/O error occursNXCException- if NetXMS server returns an error or operation was timed out
-
getImageLibrary
public List<LibraryImage> getImageLibrary(String category) throws IOException, NXCException
Get the image library of specific category- Parameters:
category- The name of the category- Returns:
- List of library images
- Throws:
IOException- if socket I/O error occursNXCException- if NetXMS server returns an error or operation was timed out
-
getImage
public LibraryImage getImage(UUID guid) throws IOException, NXCException
Get an image from the library- Parameters:
guid- UUID of the image- Returns:
- The image
- Throws:
IOException- if socket I/O error occursNXCException- if NetXMS server returns an error or operation was timed out
-
createImage
public LibraryImage createImage(LibraryImage image, ProgressListener listener) throws IOException, NXCException
Create an image- Parameters:
image- The Imagelistener- The ProgressListener- Returns:
- The image created
- Throws:
IOException- if socket I/O error occursNXCException- if NetXMS server returns an error or operation was timed out
-
deleteImage
public void deleteImage(LibraryImage image) throws IOException, NXCException
Delete an image- Parameters:
image- The image to delete- Throws:
IOException- if socket I/O error occursNXCException- if NetXMS server returns an error or operation was timed out
-
deleteImage
public void deleteImage(UUID guid) throws IOException, NXCException
Delete an image- Parameters:
guid- ID of image to delete- Throws:
IOException- if socket I/O error occursNXCException- if NetXMS server returns an error or operation was timed out
-
modifyImage
public void modifyImage(LibraryImage image, ProgressListener listener) throws IOException, NXCException
Modify an image- Parameters:
image- The image to modifylistener- The ProgressListener- Throws:
IOException- if socket I/O error occursNXCException- if NetXMS server returns an error or operation was timed out
-
pollNode
public void pollNode(long nodeId, NodePollType pollType, TextOutputListener listener) throws IOException, NXCExceptionPerform 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 IDpollType- poll typelistener- listener- Throws:
IOException- if socket or file I/O error occursNXCException- if NetXMS server returns an error or operation was timed out
-
getPersistentStorageList
public HashMap<String,String> getPersistentStorageList() throws IOException, NXCException
Get list of all values in persistent storage- Returns:
- Hash map wit persistent storage key, value
- Throws:
IOException- if socket I/O error occursNXCException- if NetXMS server returns an error or operation was timed out
-
setPersistentStorageValue
public void setPersistentStorageValue(String key, String value) throws IOException, NXCException
Set persistent storage value. Will create new or update existing- Parameters:
key- unique key of persistent storage valuevalue- value- Throws:
IOException- if socket I/O error occursNXCException- if NetXMS server returns an error or operation was timed out
-
deletePersistentStorageValue
public void deletePersistentStorageValue(String key) throws IOException, NXCException
Delete persistent storage value- Parameters:
key- unique key of persistent storage value- Throws:
IOException- if socket I/O error occursNXCException- if NetXMS server returns an error or operation was timed out
-
listServerFiles
public ServerFile[] listServerFiles() throws IOException, NXCException
List files in server's file store.- Returns:
- list of files in server's file store
- Throws:
IOException- if socket or file I/O error occursNXCException- if NetXMS server returns an error or operation was timed out
-
listServerFiles
public ServerFile[] listServerFiles(String[] filter) throws IOException, NXCException
List files in server's file store.- Parameters:
filter- array with required extension. Will be used as file filter. Give empty array or null if no filter should be applyed.- Returns:
- list of files in server's file store
- Throws:
IOException- if socket or file I/O error occursNXCException- if NetXMS server returns an error or operation was timed out
-
listAgentFiles
public List<AgentFile> listAgentFiles(AgentFile file, String fullPath, long objectId) throws IOException, NXCException
List files on agent file store.- Parameters:
file- parent of new coomming listfullPath- path that will be used on an agent to get list of subfilesobjectId- the ID of the node- Returns:
- will return the list of sub files or the list of allowed folders if full path is set to "/"
- Throws:
IOException- if socket or file I/O error occursNXCException- if NetXMS server returns an error or operation was timed out
-
getAgentFileInfo
public AgentFileInfo getAgentFileInfo(AgentFile file) throws IOException, NXCException
Return information about agent file- Parameters:
file- The AgentFile in question- Returns:
- AgentFileInfo object
- Throws:
IOException- if socket I/O error occursNXCException- if NetXMS server returns an error or operation was timed out
-
uploadFileToAgent
public long uploadFileToAgent(long nodeId, String serverFileName, String remoteFileName, boolean jobOnHold) throws IOException, NXCExceptionStart file upload from server's file store to agent. Returns ID of upload job.- Parameters:
nodeId- node object IDserverFileName- file name in server's file storeremoteFileName- fully qualified file name on target system or null to upload file to agent's file storejobOnHold- if true, upload job will be created in "hold" status- Returns:
- ID of upload job
- Throws:
IOException- if socket or file I/O error occursNXCException- if NetXMS server returns an error or operation was timed out
-
uploadFileToServer
public void uploadFileToServer(File localFile, String serverFileName, ProgressListener listener) throws IOException, NXCException
Upload local file to server's file store- Parameters:
localFile- local fileserverFileName- name under which file will be stored on serverlistener- The ProgressListener to set- Throws:
IOException- if socket or file I/O error occursNXCException- if NetXMS server returns an error or operation was timed out
-
uploadLocalFileToAgent
public void uploadLocalFileToAgent(long nodeId, File localFile, String remoteFileName, boolean overwrite, ProgressListener listener) throws IOException, NXCExceptionUpload local file to remote node via agent. If remote file name is not provided local file name will be used.- Parameters:
nodeId- node object IDlocalFile- local fileremoteFileName- remote file name (can be null or empty)overwrite- TODOlistener- progress listener (can be null)- Throws:
IOException- if socket or file I/O error occursNXCException- if NetXMS server returns an error or operation was timed out
-
createFolderOnAgent
public void createFolderOnAgent(long nodeId, String folder) throws IOException, NXCExceptionCreate folder on remote system via agent- Parameters:
nodeId- node object IDfolder- folder name- Throws:
IOException- if socket or file I/O error occursNXCException- if NetXMS server returns an error or operation was timed out
-
downloadFileFromAgent
public AgentFileData downloadFileFromAgent(long nodeId, String remoteFileName, long maxFileSize, boolean follow, ProgressListener listener, ServerJobIdUpdater updateServerJobId) throws IOException, NXCException
Download file from remote host via agent.- Parameters:
nodeId- node object IDremoteFileName- fully qualified file name on remote systemmaxFileSize- maximum download size, 0 == UNLIMITEDfollow- if set to true, server will send file updates as they appear (like for tail -f command)listener- The ProgressListener to setupdateServerJobId- callback for updating server job ID- Returns:
- agent file handle which contains server assigned ID and handle for local file
- Throws:
IOException- if socket or file I/O error occursNXCException- if NetXMS server returns an error or operation was timed out
-
downloadFileFromAgent
public AgentFileData downloadFileFromAgent(long nodeId, String remoteFileName, boolean expandMacros, long alarmId, Map<String,String> inputValues, long maxFileSize, boolean follow, ProgressListener listener, ServerJobIdUpdater updateServerJobId) throws IOException, NXCException
Download file from remote host via agent.- Parameters:
nodeId- node object IDremoteFileName- fully qualified file name on remote systemexpandMacros- if true, macros in remote file name will be expanded on server sidealarmId- alarm ID used for macro expansioninputValues- input field values for macro expansion (can be null if none provided)maxFileSize- maximum download size, 0 == UNLIMITEDfollow- if set to true, server will send file updates as they appear (like for tail -f command)listener- The ProgressListener to setupdateServerJobId- callback for updating server job ID- Returns:
- agent file handle which contains server assigned ID and handle for local file
- Throws:
IOException- if socket or file I/O error occursNXCException- if NetXMS server returns an error or operation was timed out
-
downloadFileFromServer
public File downloadFileFromServer(String remoteFileName) throws IOException, NXCException
Download file from server file storage.- Parameters:
remoteFileName- fully qualified file name on remote system- Returns:
- The downloaded file
- Throws:
IOException- if socket or file I/O error occursNXCException- if NetXMS server returns an error or operation was timed out
-
cancelFileMonitoring
public void cancelFileMonitoring(long nodeId, String remoteFileName) throws IOException, NXCExceptionCancel file monitoring- Parameters:
nodeId- node object IDremoteFileName- fully qualified file name on remote system- Throws:
IOException- if socket or file I/O error occursNXCException- if NetXMS server returns an error or operation was timed out
-
deleteServerFile
public void deleteServerFile(String serverFileName) throws IOException, NXCException
Delete file from server's file store- Parameters:
serverFileName- name of server file- Throws:
IOException- if socket or file I/O error occursNXCException- if NetXMS server returns an error or operation was timed out
-
deleteAgentFile
public void deleteAgentFile(long nodeId, String fileName) throws IOException, NXCExceptionDelete file from agent- Parameters:
nodeId- node idfileName- full path to file- Throws:
IOException- if socket or file I/O error occursNXCException- if NetXMS server returns an error or operation was timed out
-
renameAgentFile
public void renameAgentFile(long nodeId, String oldName, String newFileName, boolean overwrite) throws IOException, NXCExceptionRename agent's file- Parameters:
nodeId- node idoldName- old file pathnewFileName- new file pathoverwrite- should the file in destination be overwritten- Throws:
IOException- if socket or file I/O error occursNXCException- if NetXMS server returns an error or operation was timed out
-
moveAgentFile
public void moveAgentFile(long nodeId, String oldName, String newFileName, boolean overwrite) throws IOException, NXCExceptionMove file from agent- Parameters:
nodeId- node idoldName- old file pathnewFileName- new file pathoverwrite- should the file in destination be overwritten- Throws:
IOException- if socket or file I/O error occursNXCException- if NetXMS server returns an error or operation was timed out
-
copyAgentFile
public void copyAgentFile(long nodeId, String oldName, String newFileName, boolean overwrite) throws IOException, NXCExceptionCopy file from agent- Parameters:
nodeId- node idoldName- old file pathnewFileName- new file pathoverwrite- should the file in destination be overwritten- Throws:
IOException- if socket or file I/O error occursNXCException- if NetXMS server returns an error or operation was timed out
-
openConsole
public void openConsole() throws IOException, NXCExceptionOpen server console.- Throws:
IOException- if socket or file I/O error occursNXCException- if NetXMS server returns an error or operation was timed out
-
closeConsole
public void closeConsole() throws IOException, NXCExceptionClose server console.- Throws:
IOException- if socket or file I/O error occursNXCException- if NetXMS server returns an error or operation was timed out
-
processConsoleCommand
public boolean processConsoleCommand(String command) throws IOException, NXCException
Process console command on server. Output of the command delivered via console listener.- Parameters:
command- command to process- Returns:
- true if console should be closed (usually after "exit" command)
- Throws:
IOException- if socket or file I/O error occursNXCException- if NetXMS server returns an error or operation was timed out
-
isServerConsoleConnected
public boolean isServerConsoleConnected()
- Returns:
- the serverConsoleConnected
-
snmpWalk
public void snmpWalk(long nodeId, String rootOid, SnmpWalkListener listener) throws IOException, NXCExceptionDo SNMP walk. Operation will start at given root object, and callback will be called one or more times as data will come from server. This method will exit only when walk operation is complete.- Parameters:
nodeId- node object IDrootOid- root SNMP object ID (as text)listener- listener- Throws:
IOException- if socket or file I/O error occursNXCException- if NetXMS server returns an error or operation was timed out
-
getVlans
public List<VlanInfo> getVlans(long nodeId) throws IOException, NXCException
Get list of VLANs configured on given node- Parameters:
nodeId- node object ID- Returns:
- list of VLANs
- Throws:
IOException- if socket I/O error occursNXCException- if NetXMS server returns an error or operation was timed out
-
isObjectsSynchronized
public boolean isObjectsSynchronized()
- Returns:
- the objectsSynchronized
-
getAddressList
public List<InetAddressListElement> getAddressList(int listId) throws IOException, NXCException
Get address list.- Parameters:
listId- list identifier (defined in NXCSession as ADDRESS_LIST_xxx)- Returns:
- address list
- Throws:
IOException- if socket or file I/O error occursNXCException- if NetXMS server returns an error or operation was timed out
-
setAddressList
public void setAddressList(int listId, List<InetAddressListElement> list) throws IOException, NXCExceptionSet content of address list.- Parameters:
listId- list IDlist- new list content- Throws:
IOException- if socket or file I/O error occursNXCException- if NetXMS server returns an error or operation was timed out
-
resetServerComponent
public void resetServerComponent(int component) throws IOException, NXCExceptionReset server's internal component (defined by SERVER_COMPONENT_xxx)- Parameters:
component- component id- Throws:
IOException- if socket or file I/O error occursNXCException- if NetXMS server returns an error or operation was timed out
-
getNetworkPath
public NetworkPath getNetworkPath(long node1, long node2) throws IOException, NXCException
Get IPv4 network path between two nodes. Server will return path based on cached routing table information. Network path object may be incomplete if server does not have enough information to build full path. In this case, no exception thrown, and completness of path can be checked by calling NetworkPath.isComplete().- Parameters:
node1- source nodenode2- destination node- Returns:
- network path object
- Throws:
IOException- if socket or file I/O error occursNXCException- if NetXMS server returns an error or operation was timed out
-
getRoutingTable
public List<Route> getRoutingTable(long nodeId) throws IOException, NXCException
Get routing table from node- Parameters:
nodeId- node object ID- Returns:
- list of routing table entries
- Throws:
IOException- if socket or file I/O error occursNXCException- if NetXMS server returns an error or operation was timed out
-
getSwitchForwardingDatabase
public List<FdbEntry> getSwitchForwardingDatabase(long nodeId) throws IOException, NXCException
Get switch forwarding database (MAC address table) from node- Parameters:
nodeId- node object ID- Returns:
- list of switch forwarding database entries
- Throws:
IOException- if socket or file I/O error occursNXCException- if NetXMS server returns an error or operation was timed out
-
getWirelessStations
public List<WirelessStation> getWirelessStations(long nodeId) throws IOException, NXCException
Get list of wireless stations registered at given wireless controller.- Parameters:
nodeId- controller node ID- Returns:
- list of wireless stations
- Throws:
IOException- if socket or file I/O error occursNXCException- if NetXMS server returns an error or operation was timed out
-
removePackage
public void removePackage(long packageId) throws IOException, NXCExceptionRemove agent package from server- Parameters:
packageId- The package ID- Throws:
IOException- if socket or file I/O error occursNXCException- if NetXMS server returns an error or operation was timed out
-
installPackage
public long installPackage(PackageInfo info, File pkgFile, ProgressListener listener) throws IOException, NXCException
Install (upload) package on server- Parameters:
info- package informationpkgFile- package filelistener- progress listener (may be null)- Returns:
- unique ID assigned to package
- Throws:
IOException- if socket or file I/O error occursNXCException- if NetXMS server returns an error or operation was timed out
-
getInstalledPackages
public List<PackageInfo> getInstalledPackages() throws IOException, NXCException
Get list of installed packages- Returns:
- List of PackageInfo objects
- Throws:
IOException- if socket or file I/O error occursNXCException- if NetXMS server returns an error or operation was timed out
-
deployPackage
public void deployPackage(long packageId, Long[] nodeList, PackageDeploymentListener listener) throws IOException, NXCExceptionDeploy agent packages onto given nodes- Parameters:
packageId- package IDnodeList- list of nodeslistener- deployment progress listener (may be null)- Throws:
IOException- if socket or file I/O error occursNXCException- if NetXMS server returns an error or operation was timed out
-
sendNotification
public void sendNotification(String channelName, String phoneNumber, String subject, String message) throws IOException, NXCException
Send Notification via server. User should have appropriate rights to execute this command.- Parameters:
channelName- channel namephoneNumber- target phone numbersubject- message subjectmessage- message text- Throws:
IOException- if socket I/O error occursNXCException- if NetXMS server returns an error or operation was timed out
-
pushDciData
public void pushDciData(DciPushData[] data) throws IOException, NXCException
Push data to server.- Parameters:
data- push data- Throws:
IOException- if socket I/O error occursNXCException- if NetXMS server returns an error or operation was timed out
-
pushDciData
public void pushDciData(long nodeId, long dciId, String value) throws IOException, NXCExceptionPush value for single DCI.- Parameters:
nodeId- node IDdciId- DCI IDvalue- value to push- Throws:
IOException- if socket I/O error occursNXCException- if NetXMS server returns an error or operation was timed out
-
pushDciData
public void pushDciData(String nodeName, String dciName, String value) throws IOException, NXCException
Push value for single DCI.- Parameters:
nodeName- node namedciName- DCI namevalue- value to push- Throws:
IOException- if socket I/O error occursNXCException- if NetXMS server returns an error or operation was timed out
-
getClientType
public int getClientType()
- Returns:
- the clientType
-
setClientType
public void setClientType(int clientType)
Set client type. Can be one of the following: DESKTOP_CLIENT WEB_CLIENT MOBILE_CLIENT TABLET_CLIENT APPLICATION_CLIENT Must be called before connect(), otherwise will not have any effect. Ignored by servers prior to 1.2.2.- Parameters:
clientType- the clientType to set
-
getDateFormat
public String getDateFormat()
Get default date format provided by server- Returns:
- The current date format
-
getTimeFormat
public String getTimeFormat()
Get default time format provided by server- Returns:
- The current time format
-
getShortTimeFormat
public String getShortTimeFormat()
Get time format for short form (usually without seconds).- Returns:
- The current short time format
-
handover
public void handover(NXCSession target)
Handover object cache to new session. After call to this method, object cache of this session invalidated and should not be used.- Parameters:
target- target session object
-
getSessionId
public int getSessionId()
Get this session's ID on server.- Returns:
- the sessionId
-
listMappingTables
public List<MappingTableDescriptor> listMappingTables() throws IOException, NXCException
Get list of all configured mapping tables.- Returns:
- List of MappingTableDescriptor objects
- Throws:
IOException- if socket I/O error occursNXCException- if NetXMS server returns an error or operation was timed out
-
getMappingTable
public MappingTable getMappingTable(int id) throws IOException, NXCException
Get list of specific mapping table- Parameters:
id- The ID of mapping table- Returns:
- The MappingTable
- Throws:
IOException- if socket I/O error occursNXCException- if NetXMS server returns an error or operation was timed out
-
createMappingTable
public int createMappingTable(String name, String description, int flags) throws IOException, NXCException
Create new mapping table.- Parameters:
name- name of new tabledescription- description for new tableflags- flags for new table- Returns:
- ID of new table object
- Throws:
IOException- if socket I/O error occursNXCException- if NetXMS server returns an error or operation was timed out
-
updateMappingTable
public int updateMappingTable(MappingTable table) throws IOException, NXCException
Create or update mapping table. If table ID is 0, new table will be created on server.- Parameters:
table- mapping table- Returns:
- ID of new table object
- Throws:
IOException- if socket I/O error occursNXCException- if NetXMS server returns an error or operation was timed out
-
deleteMappingTable
public void deleteMappingTable(int id) throws IOException, NXCExceptionDelete mapping table- Parameters:
id- mapping table ID- Throws:
IOException- if socket I/O error occursNXCException- if NetXMS server returns an error or operation was timed out
-
getDefaultDciRetentionTime
public final int getDefaultDciRetentionTime()
Get the default DCI retention time- Returns:
- the default DCI retention time in days
-
getDefaultDciPollingInterval
public final int getDefaultDciPollingInterval()
Get the default DCI polling interval- Returns:
- the default DCI polling interval in seconds
-
getMinViewRefreshInterval
public int getMinViewRefreshInterval()
Get the minimal view refresh interval- Returns:
- the minViewRefreshInterval
-
isStrictAlarmStatusFlow
public final boolean isStrictAlarmStatusFlow()
Get the state of alarm status flow- Returns:
- true if alarm status flow set to "strict" mode
-
isTimedAlarmAckEnabled
public boolean isTimedAlarmAckEnabled()
- Returns:
- true if timed alarm acknowledgement is enabled
-
listDciSummaryTables
public List<DciSummaryTableDescriptor> listDciSummaryTables() throws IOException, NXCException
Get list of all configured DCI summary tables- Returns:
- List of DciSummaryTableDescriptor objects
- Throws:
IOException- if socket I/O error occursNXCException- if NetXMS server returns an error or operation was timed out
-
getDciSummaryTable
public DciSummaryTable getDciSummaryTable(int id) throws IOException, NXCException
Get DCI summary table configuration.- Parameters:
id- DCI summary table ID.- Returns:
- The DciSummaryTable object
- Throws:
IOException- if socket I/O error occursNXCException- if NetXMS server returns an error or operation was timed out
-
modifyDciSummaryTable
public int modifyDciSummaryTable(DciSummaryTable table) throws IOException, NXCException
Modify DCI summary table configuration. Will create new table object if id is 0.- Parameters:
table- DCI summary table configuration- Returns:
- assigned summary table ID
- Throws:
IOException- if socket I/O error occursNXCException- if NetXMS server returns an error or operation was timed out
-
deleteDciSummaryTable
public void deleteDciSummaryTable(int id) throws IOException, NXCExceptionDelete DCI summary table.- Parameters:
id- The ID of the summary table- Throws:
IOException- if socket I/O error occursNXCException- if NetXMS server returns an error or operation was timed out
-
queryDciSummaryTable
public Table queryDciSummaryTable(int tableId, long baseObjectId) throws IOException, NXCException
Query DCI summary table.- Parameters:
tableId- DCI summary table IDbaseObjectId- base container object ID- Returns:
- table with last values data for all nodes under given base container
- Throws:
IOException- if socket I/O error occursNXCException- if NetXMS server returns an error or operation was timed out
-
queryAdHocDciSummaryTable
public Table queryAdHocDciSummaryTable(long baseObjectId, List<DciSummaryTableColumn> columns, AggregationFunction function, Date periodStart, Date periodEnd, boolean multiInstance) throws IOException, NXCException
Query ad-hoc DCI summary table.- Parameters:
baseObjectId- base container object IDcolumns- columns for resulting tablefunction- data aggregation functionperiodStart- start of query periodperiodEnd- end of query periodmultiInstance- The multiInstance flag- Returns:
- table with last values data for all nodes under given base container
- Throws:
IOException- if socket I/O error occursNXCException- if NetXMS server returns an error or operation was timed out
-
listReports
public List<UUID> listReports() throws NXCException, IOException
List reports- Returns:
- List of report UUIDs
- Throws:
IOException- if socket I/O error occursNXCException- if NetXMS server returns an error or operation was timed out
-
getReportDefinition
public ReportDefinition getReportDefinition(UUID reportId) throws NXCException, IOException
Get the report definition- Parameters:
reportId- The UUID of the report- Returns:
- The ReportDefinition object
- Throws:
IOException- if socket I/O error occursNXCException- if NetXMS server returns an error or operation was timed out
-
executeReport
public UUID executeReport(UUID reportId, Map<String,String> parameters) throws NXCException, IOException
Execute a report- Parameters:
reportId- The report UUIDparameters- The parameters to set- Returns:
- the UUID of the report
- Throws:
IOException- if socket I/O error occursNXCException- if NetXMS server returns an error or operation was timed out
-
listReportResults
public List<ReportResult> listReportResults(UUID reportId) throws NXCException, IOException
List report results- Parameters:
reportId- The report UUID- Returns:
- List of ReportResult objects
- Throws:
IOException- if socket I/O error occursNXCException- if NetXMS server returns an error or operation was timed out
-
deleteReportResult
public void deleteReportResult(UUID reportId, UUID jobId) throws NXCException, IOException
Delete report result- Parameters:
reportId- The report UUIDjobId- The job UUID- Throws:
IOException- if socket I/O error occursNXCException- if NetXMS server returns an error or operation was timed out
-
renderReport
public File renderReport(UUID reportId, UUID jobId, ReportRenderFormat format) throws NXCException, IOException
Render report- Parameters:
reportId- The report UUIDjobId- The job UUIDformat- The format of the render- Returns:
- The render of the report
- Throws:
IOException- if socket I/O error occursNXCException- if NetXMS server returns an error or operation was timed out
-
scheduleReport
public void scheduleReport(ReportingJob job, Map<String,String> parameters) throws NXCException, IOException
Schedule a report- Parameters:
job- The ReportingJobparameters- The parameters to set- Throws:
IOException- if socket I/O error occursNXCException- if NetXMS server returns an error or operation was timed out
-
listScheduledJobs
public List<ReportingJob> listScheduledJobs(UUID reportId) throws NXCException, IOException
List scheduled jobs- Parameters:
reportId- The report UUID- Returns:
- List of ReportingJob objects
- Throws:
IOException- if socket I/O error occursNXCException- if NetXMS server returns an error or operation was timed out
-
deleteReportSchedule
public void deleteReportSchedule(UUID reportId, UUID jobId) throws NXCException, IOException
Delete report schedule- Parameters:
reportId- The report UUIDjobId- The job UUID- Throws:
IOException- if socket I/O error occursNXCException- if NetXMS server returns an error or operation was timed out
-
setClientAddress
public void setClientAddress(String clientAddress)
Set the client address- Parameters:
clientAddress- the clientAddress to set
-
getClientLanguage
public String getClientLanguage()
Get the client`s language- Returns:
- the clientLanguage
-
setClientLanguage
public void setClientLanguage(String clientLanguage)
Set client`s language- Parameters:
clientLanguage- the clientLanguage to set
-
getSubnetAddressMap
public long[] getSubnetAddressMap(long subnetId) throws NXCException, IOExceptionGet address map for subnet. Returned array contains one entry for each IP address in a subnet. Element value could be eithet ID of the node with that IP address, 0 for unused addresses, and 0xFFFFFFFF for subnet and broadcast addresses.- Parameters:
subnetId- The subnet ID- Returns:
- Address map
- Throws:
IOException- if socket I/O error occursNXCException- if NetXMS server returns an error or operation was timed out
-
getConfigList
public List<ConfigListElement> getConfigList() throws NXCException, IOException
Gets the list of configuration files.(Config id, name and sequence number)- Returns:
- the list of configuration files in correct sequence
- Throws:
IOException- if socket I/O error occursNXCException- if NetXMS server returns an error or operation was timed out
-
getConfigContent
public ConfigContent getConfigContent(long id) throws NXCException, IOException
Saves existing config- Parameters:
id- config id- Returns:
- content of requested by id configurations file
- Throws:
IOException- if socket I/O error occursNXCException- if NetXMS server returns an error or operation was timed out
-
saveAgentConfig
public void saveAgentConfig(ConfigContent conf) throws NXCException, IOException
Saves or creates new agent's config- Parameters:
conf- contents of config- Throws:
IOException- if socket I/O error occursNXCException- if NetXMS server returns an error or operation was timed out
-
deleteAgentConfig
public void deleteAgentConfig(long id) throws NXCException, IOExceptionDelete config with given id. Does not change sequence number of following elements.- Parameters:
id- agent configuration ID- Throws:
IOException- if socket I/O error occursNXCException- if NetXMS server returns an error or operation was timed out
-
swapAgentConfigs
public void swapAgentConfigs(long id1, long id2) throws NXCException, IOExceptionSwaps 2 configs sequence numbers- Parameters:
id1- The id of first configid2- The id of second config- Throws:
IOException- if socket I/O error occursNXCException- if NetXMS server returns an error or operation was timed out
-
getLocationHistory
public List<org.netxms.base.GeoLocation> getLocationHistory(long objectId, Date from, Date to) throws NXCException, IOException
Get location history for given object.- Parameters:
objectId- The object IDfrom- The date fromto- The date to- Returns:
- List of location history
- Throws:
IOException- if socket I/O error occursNXCException- if NetXMS server returns an error or operation was timed out
-
takeScreenshot
public byte[] takeScreenshot(long nodeId, String sessionName) throws NXCException, IOExceptionTake screenshot from given node. Session to take screenshot from can be identified either by ID or name. If ID is used name must be set to null.- Parameters:
nodeId- node object IDsessionName- session name for session to take screenshot from- Returns:
- Screenshot as PNG image
- Throws:
IOException- if socket I/O error occursNXCException- if NetXMS server returns an error or operation was timed out
-
getScheudledTaskHandlers
public List<String> getScheudledTaskHandlers() throws NXCException, IOException
Get list of available scheduled task handlers.- Returns:
- list of available scheduled task handlers.
- Throws:
IOException- if socket I/O error occursNXCException- if NetXMS server returns an error or operation was timed out
-
getScheduledTasks
public List<ScheduledTask> getScheduledTasks() throws IOException, NXCException
Get list of scheduled tasks.- Returns:
- list of scheduled tasks
- Throws:
IOException- if socket I/O error occursNXCException- if NetXMS server returns an error or operation was timed out
-
addScheduledTask
public void addScheduledTask(ScheduledTask task) throws NXCException, IOException
Add new scheduled task- Parameters:
task- new scheduled task- Throws:
IOException- if socket I/O error occursNXCException- if NetXMS server returns an error or operation was timed out
-
updateScheduledTask
public void updateScheduledTask(ScheduledTask task) throws IOException, NXCException
Update existing scheduled task.- Parameters:
task- updated scheduled task- Throws:
IOException- if socket I/O error occursNXCException- if NetXMS server returns an error or operation was timed out
-
deleteScheduledTask
public void deleteScheduledTask(long taskId) throws NXCException, IOExceptionDelete scheduled task.- Parameters:
taskId- scheduled task ID- Throws:
IOException- if socket I/O error occursNXCException- if NetXMS server returns an error or operation was timed out
-
setObjectMaintenanceMode
public void setObjectMaintenanceMode(long objectId, boolean inMaintenance, String comments) throws NXCException, IOExceptionSet maintenance mode for object- Parameters:
objectId- object IDinMaintenance- new maintenance mode setting (true = on, false = off)comments- comments for entering maintenance- Throws:
IOException- if socket I/O error occursNXCException- if NetXMS server returns an error or operation was timed out
-
setObjectMaintenanceMode
public void setObjectMaintenanceMode(long objectId, boolean inMaintenance) throws NXCException, IOExceptionSet maintenance mode for object- Parameters:
objectId- object IDinMaintenance- new maintenance mode setting (true = on, false = off)- Throws:
IOException- if socket I/O error occursNXCException- if NetXMS server returns an error or operation was timed out
-
updateZmqEventSubscription
public void updateZmqEventSubscription(long objectId, long dciId, boolean subscribe) throws IOException, NXCExceptionManage subscription for ZMQ event forwarder- Parameters:
objectId- Node iddciId- DCI ID. 0 means "disabled DCI source filter for events"subscribe- If true, the event will be subscribed to- Throws:
IOException- if socket I/O error occursNXCException- if NetXMS server returns an error or operation was timed out
-
updateZmqDataSubscription
public void updateZmqDataSubscription(long objectId, long dciId, boolean subscribe) throws IOException, NXCExceptionManage subscription for ZMQ data forwarder- Parameters:
objectId- The object IDdciId- The DCI IDsubscribe- If true, the event will be subscribed to- Throws:
IOException- if socket I/O error occursNXCException- if NetXMS server returns an error or operation was timed out
-
getZmqSubscriptions
public List<ZmqSubscription> getZmqSubscriptions(ZmqSubscriptionType type) throws IOException, NXCException
Get subscriptions for ZMQ data forwarder- Parameters:
type- Subscription type- Returns:
- List of subscriptions
- Throws:
IOException- if socket I/O error occursNXCException- if NetXMS server returns an error or operation was timed out
-
getRepositories
public List<Repository> getRepositories() throws IOException, NXCException
Get list of configured repositories- Returns:
- list of configured repositories
- Throws:
IOException- if socket I/O error occursNXCException- if NetXMS server returns an error or operation was timed out
-
addRepository
public void addRepository(Repository r) throws IOException, NXCException
Add repository. Will update given repository object with assigned ID.- Parameters:
r- The repository- Throws:
IOException- if socket I/O error occursNXCException- if NetXMS server returns an error or operation was timed out
-
modifyRepository
public void modifyRepository(Repository r) throws IOException, NXCException
Modify repository.- Parameters:
r- The repository- Throws:
IOException- if socket I/O error occursNXCException- if NetXMS server returns an error or operation was timed out
-
deleteRepository
public void deleteRepository(int id) throws IOException, NXCExceptionDelete repository.- Parameters:
id- The id- Throws:
IOException- if socket I/O error occursNXCException- if NetXMS server returns an error or operation was timed out
-
getPredictionEngines
public List<PredictionEngine> getPredictionEngines() throws IOException, NXCException
Get list of registered prediction engines- Returns:
- List of PredictionEngine objects
- Throws:
IOException- if socket I/O error occursNXCException- if NetXMS server returns an error or operation was timed out
-
getPredictedData
public DciData getPredictedData(long nodeId, long dciId, Date from, Date to) throws IOException, NXCException
Get predicted DCI data from server.- Parameters:
nodeId- Node IDdciId- DCI IDfrom- Start of time rangeto- End of time range- Returns:
- DCI data set
- Throws:
IOException- if socket I/O error occursNXCException- if NetXMS server returns an error or operation was timed out
-
getAgentTunnels
public List<AgentTunnel> getAgentTunnels() throws IOException, NXCException
Get list of agent tunnels- Returns:
- list of agent tunnels
- Throws:
IOException- if socket I/O error occursNXCException- if NetXMS server returns an error or operation was timed out
-
bindAgentTunnel
public void bindAgentTunnel(int tunnelId, long nodeId) throws IOException, NXCExceptionBind agent tunnel to node- Parameters:
tunnelId- tunnel IDnodeId- node ID- Throws:
IOException- if socket I/O error occursNXCException- if NetXMS server returns an error or operation was timed out
-
unbindAgentTunnel
public void unbindAgentTunnel(long nodeId) throws IOException, NXCExceptionUnbind agent tunnel to node- Parameters:
nodeId- node ID- Throws:
IOException- if socket I/O error occursNXCException- if NetXMS server returns an error or operation was timed out
-
substitureMacross
public List<String> substitureMacross(ObjectContextBase context, List<String> textsToExpand, Map<String,String> inputValues) throws IOException, NXCException
Substitute macross in may strings and one context- Parameters:
context- expansion context alarm and nodetextsToExpand- texts to be expandedinputValues- input values provided by used used for %() expansion- Returns:
- same count and order of strings already expanded
- Throws:
IOException- if socket I/O error occursNXCException- if NetXMS server returns an error or operation was timed out
-
substitureMacross
public List<String> substitureMacross(ObjectContextBase[] context, String textToExpand, Map<String,String> inputValues) throws IOException, NXCException
Substitute macross in many constexts for one string- Parameters:
context- expansion contexts alarm and nodetextToExpand- text to be expandedinputValues- input values provided by used used for %() expansion- Returns:
- same count and order of strings already expanded
- Throws:
IOException- if socket I/O error occursNXCException- if NetXMS server returns an error or operation was timed out
-
setupTcpProxy
public TcpProxy setupTcpProxy(long nodeId, InetAddress address, int port) throws IOException, NXCException
Setup new TCP proxy channel. Proxy object should be disposed with TcpProxy.close() call when no longer needed.- Parameters:
nodeId- proxy node ID (node that will initiate TCP connection to target)address- target IP addressport- target TCP port- Returns:
- TCP proxy object
- Throws:
IOException- if socket I/O error occursNXCException- if NetXMS server returns an error or operation was timed out
-
closeTcpProxy
protected void closeTcpProxy(int channelId)
Close TCP proxy channel.- Parameters:
channelId- proxy channel ID
-
getAgentPolicy
public AgentPolicy getAgentPolicy(long templateId, UUID policyGUID) throws IOException, NXCException
Get agent policy by template id and GUID- Parameters:
templateId- template id policy is inpolicyGUID- policy GUID- Returns:
- agent policy
- Throws:
IOException- if socket I/O error occursNXCException- if NetXMS server returns an error or operation was timed out
-
getAgentPolicyList
public HashMap<UUID,AgentPolicy> getAgentPolicyList(long templateId) throws IOException, NXCException
Returns agent policy list- Parameters:
templateId- id of the template where policy are defined- Returns:
- hash map of policy UUID to policy
- Throws:
IOException- if socket I/O error occursNXCException- if NetXMS server returns an error or operation was timed out
-
savePolicy
public UUID savePolicy(long templateId, AgentPolicy currentlySelectedElement, boolean duplicate) throws NXCException, IOException
Saves new or updated policy- Parameters:
templateId- id of template where policy is definedcurrentlySelectedElement- policy data to be updated or created. For new policy GUID should be null- Returns:
- UUID of saved policy
- Throws:
IOException- if socket I/O error occursNXCException- if NetXMS server returns an error or operation was timed out
-
deletePolicy
public void deletePolicy(long templateId, UUID guid) throws NXCException, IOExceptionDelete policy- Parameters:
templateId- id of template where policy is definedguid- guid of the policy that should be deleted- Throws:
IOException- if socket I/O error occursNXCException- if NetXMS server returns an error or operation was timed out
-
onPolicyEditorClose
public void onPolicyEditorClose(long templateId) throws NXCException, IOExceptionCommand sent on policyEditor close to send updates to all applied nodes- Parameters:
templateId- id of the closed template- Throws:
IOException- if socket I/O error occursNXCException- if NetXMS server returns an error or operation was timed out
-
forcePolicyInstallation
public void forcePolicyInstallation(long templateId) throws NXCException, IOExceptionForce policy installation on all nodes where template is applied- Parameters:
templateId- template id- Throws:
IOException- if socket I/O error occursNXCException- if NetXMS server returns an error or operation was timed out
-
getUserAgentNotifications
public List<UserAgentNotification> getUserAgentNotifications() throws NXCException, IOException
Get user agent notifications list- Returns:
- list of user agent notifications
- Throws:
IOException- if socket I/O error occursNXCException- if NetXMS server returns an error or operation was timed out
-
recallUserAgentNotification
public void recallUserAgentNotification(long id) throws NXCException, IOExceptionRecall user agent notification- Parameters:
id- recall id- Throws:
IOException- if socket I/O error occursNXCException- if NetXMS server returns an error or operation was timed out
-
createUserAgentNotification
public void createUserAgentNotification(String message, long[] objects, Date startTime, Date endTime, boolean startup) throws NXCException, IOException
Create new user agent notifications- Parameters:
message- notification messageobjects- objects to show notificationsstartTime- notification's activation timeendTime- notificaiton's display end time- Throws:
IOException- if socket I/O error occursNXCException- if NetXMS server returns an error or operation was timed out
-
createUserAgentNotification
public void createUserAgentNotification(String message, Collection<Long> objects, Date startTime, Date endTime, boolean onStartup) throws NXCException, IOException
Create new user agent notifications- Parameters:
message- notification messageobjects- objects to show notificationsstartTime- notification's activation timeendTime- notificaiton's display end time- Throws:
NXCExceptionIOException
-
getNotificationChannels
public List<NotificationChannel> getNotificationChannels() throws NXCException, IOException
Get server notification channels- Returns:
- list of server notifications channels
- Throws:
IOException- if socket I/O error occursNXCException- if NetXMS server returns an error or operation was timed out
-
createNotificationChannel
public void createNotificationChannel(NotificationChannel nc) throws NXCException, IOException
Create notification channel- Parameters:
nc- new notification channel- Throws:
IOException- if socket I/O error occursNXCException- if NetXMS server returns an error or operation was timed out
-
updateNotificationChannel
public void updateNotificationChannel(NotificationChannel nc) throws NXCException, IOException
Update notification channel- Parameters:
nc- update notification channel- Throws:
IOException- if socket I/O error occursNXCException- if NetXMS server returns an error or operation was timed out
-
deleteNotificationChannel
public void deleteNotificationChannel(String name) throws NXCException, IOException
Delete notification channel- Parameters:
name- name of notification channel to be deleted- Throws:
IOException- if socket I/O error occursNXCException- if NetXMS server returns an error or operation was timed out
-
renameNotificaiotnChannel
public void renameNotificaiotnChannel(String name, String newName) throws NXCException, IOException
Rename notification channel- Parameters:
name- old notification channel namenewName- new notification channel name- Throws:
IOException- if socket I/O error occursNXCException- if NetXMS server returns an error or operation was timed out
-
getDriverNames
public List<String> getDriverNames() throws NXCException, IOException
Get driver name list- Returns:
- driver name list
- Throws:
IOException- if socket I/O error occursNXCException- if NetXMS server returns an error or operation was timed out
-
startManualActiveDiscovery
public void startManualActiveDiscovery(List<InetAddressListElement> list) throws NXCException, IOException
Start active discovery for provided list manually- Parameters:
list- list of ranges- Throws:
NXCExceptionIOException
-
getPhysicalLinks
public List<PhysicalLink> getPhysicalLinks(long objectId, long patchPanelId) throws NXCException, IOException
Get list of physical links filtered by provided options- Parameters:
objectId- node id or rack id to filter out physical linkspatchPanelId- patch panel id to filter out it's physical links (first parameter should be rack id)- Returns:
- list of physical links
- Throws:
IOException- if socket I/O error occursNXCException- if NetXMS server returns an error or operation was timed out
-
updatePhysicalLink
public void updatePhysicalLink(PhysicalLink link) throws NXCException, IOException
Create new or update existing physical link- Parameters:
link- link to be created with ID 0 or link to be updated with correct ID- Throws:
IOException- if socket I/O error occursNXCException- if NetXMS server returns an error or operation was timed out
-
deletePhysicalLink
public void deletePhysicalLink(long linkId) throws NXCException, IOExceptionDelete physical link.- Parameters:
linkId- physical link ID- Throws:
IOException- if socket I/O error occursNXCException- if NetXMS server returns an error or operation was timed out
-
getWebServiceDefinitions
public List<WebServiceDefinition> getWebServiceDefinitions() throws NXCException, IOException
Get configured web service definitions.- Returns:
- list of configured web service definitions
- Throws:
IOException- if socket I/O error occursNXCException- if NetXMS server returns an error or operation was timed out
-
modifyWebServiceDefinition
public int modifyWebServiceDefinition(WebServiceDefinition definition) throws NXCException, IOException
Modify (or create new) web service definition. New definition will be created if ID of provided definition object set to 0.- Parameters:
definition- web service definition to create or modify- Returns:
- assigned ID of web service definition (same as provided if modifying existing definition)
- Throws:
IOException- if socket I/O error occursNXCException- if NetXMS server returns an error or operation was timed out
-
deleteWebServiceDefinition
public void deleteWebServiceDefinition(int id) throws NXCException, IOExceptionDelete web service definition.- Parameters:
id- web service definition ID- Throws:
IOException- if socket I/O error occursNXCException- if NetXMS server returns an error or operation was timed out
-
-