public interface Session
| Modifier and Type | Method and Description |
|---|---|
void |
addListener(SessionListener lst)
Add notification listener
|
void |
checkConnection()
Send KEEPALIVE message.
|
void |
connect()
Connect to the server.
|
int |
createMappingTable(java.lang.String name,
java.lang.String description,
int flags)
Create new mapping table.
|
void |
deleteMappingTable(int id)
Delete mapping table
|
void |
disconnect()
Disconnect from server.
|
java.lang.String |
getAttributeForCurrentUser(java.lang.String name)
Get custom attribute for currently logged in user.
|
java.lang.String |
getConnClientInfo() |
java.lang.String |
getDateFormat()
Get default date format provided by server
|
MappingTable |
getMappingTable(int id) |
int |
getRecvBufferSize()
Get receiver buffer size.
|
java.lang.String |
getServerAddress()
Get server address
|
byte[] |
getServerId()
Get NetXMS server UID.
|
java.lang.String |
getServerTimeZone() |
java.lang.String |
getServerVersion()
Get NetXMS server version.
|
java.lang.String |
getTimeFormat()
Get default time format provided by server
|
int |
getUserId()
Get identifier of logged in user.
|
java.lang.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 |
isPasswordExpired() |
java.util.List<MappingTableDescriptor> |
listMappingTables()
Get list of all configured mapping tables.
|
NXCPMessage |
newMessage(int code)
Create new NXCP message with unique id
|
void |
removeListener(SessionListener lst)
Remove notification listener
|
void |
setAttributeForCurrentUser(java.lang.String name,
java.lang.String value)
Set custom attribute for currently logged in user.
|
void |
setCommandTimeout(int commandTimeout)
Set command execution timeout.
|
void |
setConnClientInfo(java.lang.String connClientInfo) |
void |
setRecvBufferSize(int recvBufferSize)
Set receiver buffer size.
|
int |
updateMappingTable(MappingTable table)
Create or update mapping table.
|
NXCPMessage |
waitForMessage(int code,
long id)
Wait for message with specific code and id.
|
NXCPMessage |
waitForMessage(int code,
long id,
int timeout)
Wait for message with specific code and id.
|
NXCPMessage |
waitForRCC(long id)
Wait for CMD_REQUEST_COMPLETED message with given id using default timeout
|
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 removeNXCPMessage 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 intervalNXCPMessage waitForMessage(int code, long id) throws NetXMSClientException
code - Message codeid - Message idNetXMSClientException - if message was not arrived within timeout intervalNXCPMessage waitForRCC(long id) throws NetXMSClientException
id - Message idNetXMSClientException - if message was not arrived within timeout interval or contains RCC other than RCC.SUCCESSNXCPMessage 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.SUCCESSNXCPMessage newMessage(int code)
code - Message codevoid connect()
throws java.io.IOException,
java.net.UnknownHostException,
NetXMSClientException
java.io.IOExceptionjava.net.UnknownHostExceptionNetXMSClientExceptionvoid disconnect()
int getRecvBufferSize()
void setRecvBufferSize(int recvBufferSize)
recvBufferSize - Size of receiver buffer in bytes.java.lang.String getServerAddress()
java.lang.String getUserName()
java.lang.String getServerVersion()
byte[] getServerId()
java.lang.String getServerTimeZone()
java.lang.String getConnClientInfo()
void setConnClientInfo(java.lang.String connClientInfo)
connClientInfo - the connClientInfo to setvoid setCommandTimeout(int commandTimeout)
commandTimeout - New command timeoutint getUserId()
long getUserSystemRights()
boolean isPasswordExpired()
void setAttributeForCurrentUser(java.lang.String name,
java.lang.String value)
throws java.io.IOException,
NetXMSClientException
name - Attribute's namevalue - New attribute's valuejava.io.IOException - if socket I/O error occursNetXMSClientException - if NetXMS server returns an error or operation was timed outjava.lang.String getAttributeForCurrentUser(java.lang.String name)
throws java.io.IOException,
NetXMSClientException
name - Attribute's namejava.io.IOException - if socket I/O error occursNetXMSClientException - if NetXMS server returns an error or operation was timed outboolean isConnected()
void checkConnection()
throws java.io.IOException,
NetXMSClientException
java.io.IOExceptionNXCExceptionNetXMSClientExceptionjava.lang.String getDateFormat()
java.lang.String getTimeFormat()
java.util.List<MappingTableDescriptor> listMappingTables() throws java.io.IOException, NetXMSClientException
java.io.IOException - if socket I/O error occursNetXMSClientException - if NetXMS server returns an error or operation was timed outMappingTable getMappingTable(int id) throws java.io.IOException, NetXMSClientException
id - java.io.IOException - if socket I/O error occursNetXMSClientException - if NetXMS server returns an error or operation was timed outint createMappingTable(java.lang.String name,
java.lang.String description,
int flags)
throws java.io.IOException,
NetXMSClientException
name - name of new tabledescription - description for new tableflags - flags for new tablejava.io.IOException - if socket I/O error occursNetXMSClientException - if NetXMS server returns an error or operation was timed outint updateMappingTable(MappingTable table) throws java.io.IOException, NetXMSClientException
table - mapping tablejava.io.IOException - if socket I/O error occursNetXMSClientException - if NetXMS server returns an error or operation was timed outvoid deleteMappingTable(int id)
throws java.io.IOException,
NetXMSClientException
id - mapping table IDjava.io.IOException - if socket I/O error occursNetXMSClientException - if NetXMS server returns an error or operation was timed outCopyright © 2013. All Rights Reserved.