Table Of Contents
User Login and Logout Functions
checkUserEULAStatus
login
logout
User Login and Logout Functions
This chapter provides information about the following user login and logout functions:
•
checkUserEULAStatus
•
login
•
logout
checkUserEULAStatus
Synopsis
EulaInfo checkUserEULAStatus(String user, String server_host, int port)
Description
This function checks to see if the user has already signed an end-user license agreement (EULA).
Input Parameters
Parameter
|
Type
|
Value
|
Description
|
username
|
String, mandatory
|
—
|
The username.
|
server_host
|
String, mandatory
|
Hostname or IP address
|
The hostname or IP address where the Cisco License Manager server is running. If the Cisco License Manager server and the client program are running on the same host, this argument can be set to null.
|
port
|
Integer, mandatory
|
Range from 1024 to 65535
|
The port on which the Cisco License Manager server is serving clients. If the Cisco License Manager server and the client program are running on the same host, this argument can be set to zero.
|
Return
This function returns a EulaInfo object. This object contains EULA information (such as whether EULA is signed, when it was signed, and so forth).
Error and Exception
When an error occurs, this function returns null.
If a system error prevents the operation from completing, a RemoteException is thrown.
login
Synopsis
UserToken login(String user, String password, String server_host, int port, int
idle_timeout, EulaInfo eula) throws RemoteException;
Description
Use this function to log into the system and acquire a UserToken that gives you authorization on subsequent function calls. A user can only log into the system one session at a time. A second login by the same user automatically logs out the previous login session.
Input Parameters
Parameter
|
Type
|
Value
|
Description
|
username
|
String, mandatory
|
—
|
The username.
|
password
|
String, mandatory
|
—
|
The user password.
|
server_host
|
String, mandatory
|
Hostname or IP address
|
The hostname or IP address where the Cisco License Manager server is running. If the Cisco License Manager server and the client program are running on the same host, this argument can be set to null.
|
port
|
Integer, mandatory
|
Range from 0 to 65535
|
The port on which the Cisco License Manager server is serving clients. If the Cisco License Manager server and the client program are running on the same host, this argument can be set to zero.
|
idle_timeout
|
Integer, mandatory
|
Range from 0 to 2147483657
|
Time interval, in minutes, allowed for idling before the token expires. When it is set to 0, the token never expires.
|
eula
|
EulaInfo, mandatory
|
—
|
The EulaInfo object contains whether EULA is accepted and whether to ask for EULA again in the next session.
|
Return
This function returns a UserToken object that represents the user's authorization pass. If the EULA is not accepted, the authorization pass is rejected.
Error and Exception
When an error occurs, this function returns null.
If a system error prevents the operation from completing, a RemoteException is thrown.
logout
Synopsis
void logout(UserToken token) throws RemoteException;
Description
This function logs the user out of the system and deletes the UserToken object.
Input Parameters
Parameter
|
Type
|
Value
|
Description
|
token
|
UserToken, mandatory
|
—
|
A token that represents your authorization pass, which is obtained after you invoke the login function and are authenticated by the back-end server.
|
Return
None.
Error and Exception
If a system error prevents the operation from completing, a RemoteException is thrown.