|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface Session
Base client session interface. All client APIs for NetXMS based products expected to provide this interface.
Method Summary | |
---|---|
void |
addListener(SessionListener lst)
Add notification listener |
void |
checkConnection()
Send KEEPALIVE message. |
void |
connect()
Connect to the server. |
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()
|
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. |
int |
getUserId()
Get identifier of logged in user. |
java.lang.String |
getUserName()
Get login name of currently logged in user |
int |
getUserSystemRights()
Get system-wide rights of currently logged in user. |
boolean |
isConnected()
Get connection state |
boolean |
isPasswordExpired()
|
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. |
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 |
Method Detail |
---|
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 milliseconds
NetXMSClientException
- if message was not arrived within timeout intervalNXCPMessage waitForMessage(int code, long id) throws NetXMSClientException
code
- Message codeid
- Message id
NetXMSClientException
- if message was not arrived within timeout intervalNXCPMessage waitForRCC(long id) throws NetXMSClientException
id
- Message id
NetXMSClientException
- if message was not arrived within timeout interval or contains RCC other than RCC.SUCCESSNXCPMessage newMessage(int code)
code
- Message code
void connect() throws java.io.IOException, java.net.UnknownHostException, NetXMSClientException
java.io.IOException
java.net.UnknownHostException
NetXMSClientException
void 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()
int 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 value
java.io.IOException
- if socket I/O error occurs
NetXMSClientException
- 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 name
java.io.IOException
- if socket I/O error occurs
NetXMSClientException
- if NetXMS server returns an error or operation was timed outboolean isConnected()
void checkConnection() throws java.io.IOException, NetXMSClientException
java.io.IOException
NXCException
NetXMSClientException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |