public interface Session
| Modifier and Type | Method and Description |
|---|---|
void |
addListener(SessionListener lst)
Add notification listener
|
boolean |
checkConnection()
Send KEEPALIVE message.
|
void |
connect()
Connect to the server.
|
int |
createMappingTable(String name,
String description,
int flags)
Create new mapping table.
|
void |
deleteMappingTable(int id)
Delete mapping table
|
void |
disconnect()
Disconnect from server.
|
String |
getAttributeForCurrentUser(String name)
Get custom attribute for currently logged in user.
|
String |
getConnClientInfo() |
String |
getDateFormat()
Get default date format provided by server
|
int |
getDefaultRecvBufferSize()
Get default receiver buffer size.
|
MappingTable |
getMappingTable(int id) |
int |
getMaxRecvBufferSize()
Get max receiver buffer size.
|
String |
getServerAddress()
Get server address
|
byte[] |
getServerId()
Get NetXMS server UID.
|
String |
getServerTimeZone() |
String |
getServerVersion()
Get NetXMS server version.
|
String |
getTimeFormat()
Get default time format provided by server
|
int |
getUserId()
Get identifier of logged in user.
|
String |
getUserName()
Get login name of currently logged in user
|
long |
getUserSystemRights()
Get system-wide rights of currently logged in user.
|
boolean |
isConnected()
Get connection state
|
boolean |
isEncrypted()
Get encryption state for current session.
|
boolean |
isPasswordExpired() |
List<MappingTableDescriptor> |
listMappingTables()
Get list of all configured mapping tables.
|
org.netxms.base.NXCPMessage |
newMessage(int code)
Create new NXCP message with unique id
|
void |
removeListener(SessionListener lst)
Remove notification listener
|
void |
setAttributeForCurrentUser(String name,
String value)
Set custom attribute for currently logged in user.
|
void |
setCommandTimeout(int commandTimeout)
Set command execution timeout.
|
void |
setConnClientInfo(String connClientInfo) |
void |
setRecvBufferSize(int defaultBufferSize,
int maxBufferSize)
Set receiver buffer size.
|
int |
updateMappingTable(MappingTable table)
Create or update mapping table.
|
org.netxms.base.NXCPMessage |
waitForMessage(int code,
long id)
Wait for message with specific code and id.
|
org.netxms.base.NXCPMessage |
waitForMessage(int code,
long id,
int timeout)
Wait for message with specific code and id.
|
org.netxms.base.NXCPMessage |
waitForRCC(long id)
Wait for CMD_REQUEST_COMPLETED message with given id using default timeout
|
org.netxms.base.NXCPMessage |
waitForRCC(long id,
int timeout)
Wait for CMD_REQUEST_COMPLETED message with given id
|
void addListener(SessionListener lst)
lst - Listener to addvoid removeListener(SessionListener lst)
lst - Listener to removeorg.netxms.base.NXCPMessage waitForMessage(int code,
long id,
int timeout)
throws NetXMSClientException
code - Message codeid - Message idtimeout - Wait timeout in millisecondsNetXMSClientException - if message was not arrived within timeout intervalorg.netxms.base.NXCPMessage waitForMessage(int code,
long id)
throws NetXMSClientException
code - Message codeid - Message idNetXMSClientException - if message was not arrived within timeout intervalorg.netxms.base.NXCPMessage waitForRCC(long id)
throws NetXMSClientException
id - Message idNetXMSClientException - if message was not arrived within timeout interval or contains RCC other than RCC.SUCCESSorg.netxms.base.NXCPMessage waitForRCC(long id,
int timeout)
throws NetXMSClientException
id - Message idtimeout - Timeout in millisecondsNetXMSClientException - if message was not arrived within timeout interval or contains RCC other than RCC.SUCCESSorg.netxms.base.NXCPMessage newMessage(int code)
code - Message codevoid connect()
throws IOException,
UnknownHostException,
NetXMSClientException,
IllegalStateException
void disconnect()
int getDefaultRecvBufferSize()
int getMaxRecvBufferSize()
void setRecvBufferSize(int defaultBufferSize,
int maxBufferSize)
defaultBufferSize - default size of receiver buffer in bytes.maxBufferSize - max size of receiver buffer in bytes.String getServerAddress()
String getUserName()
String getServerVersion()
byte[] getServerId()
String getServerTimeZone()
String getConnClientInfo()
void setConnClientInfo(String connClientInfo)
connClientInfo - the connClientInfo to setvoid setCommandTimeout(int commandTimeout)
commandTimeout - New command timeoutint getUserId()
long getUserSystemRights()
boolean isPasswordExpired()
void setAttributeForCurrentUser(String name, String value) throws IOException, NetXMSClientException
name - Attribute's namevalue - New attribute's valueIOException - if socket I/O error occursNetXMSClientException - if NetXMS server returns an error or operation was timed outString getAttributeForCurrentUser(String name) throws IOException, NetXMSClientException
name - Attribute's nameIOException - if socket I/O error occursNetXMSClientException - if NetXMS server returns an error or operation was timed outboolean isConnected()
boolean isEncrypted()
boolean checkConnection()
String getDateFormat()
String getTimeFormat()
List<MappingTableDescriptor> listMappingTables() throws IOException, NetXMSClientException
IOException - if socket I/O error occursNetXMSClientException - if NetXMS server returns an error or operation was timed outMappingTable getMappingTable(int id) throws IOException, NetXMSClientException
id - IOException - if socket I/O error occursNetXMSClientException - if NetXMS server returns an error or operation was timed outint createMappingTable(String name, String description, int flags) throws IOException, NetXMSClientException
name - name of new tabledescription - description for new tableflags - flags for new tableIOException - if socket I/O error occursNetXMSClientException - if NetXMS server returns an error or operation was timed outint updateMappingTable(MappingTable table) throws IOException, NetXMSClientException
table - mapping tableIOException - if socket I/O error occursNetXMSClientException - if NetXMS server returns an error or operation was timed outvoid deleteMappingTable(int id)
throws IOException,
NetXMSClientException
id - mapping table IDIOException - if socket I/O error occursNetXMSClientException - if NetXMS server returns an error or operation was timed outCopyright © 2015. All rights reserved.