Class Account
java.lang.Object
com.elpical.jclaro.admin.ws.server.Account
The Account class holds information about the privileges an account has and a login token to be used in communication with the server. If no user-management is used in the server a default
account is created after login with all privileges.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionint
Gets the privileges of the account concerning Account settings.int
Gets the privileges of the account concerning Configuration settings.getEmail()
Returns the email address of the Accountbyte[]
Gets the unique login id token which was created after logging in.int
Gets the privileges of the account concerning Maintenance settings.getName()
Returns the name of the Accountbyte[]
Returns the (encrypted) password of the Account.byte[]
Gets the public key of the server.int
Gets the privileges of the account concerning Task settings.void
setAccountPrivileges(int accountPrivileges)
Sets the privileges of the account concerning Account settings.void
setConfigurationPrivileges(int configurationPrivileges)
Sets the privileges of the account concerning Configuration settings.void
Sets the email address of the Accountvoid
setEncryptedToken(byte[] token)
Set's the unique login token.void
setMaintenancePrivileges(int maintenancePrivileges)
Sets the privileges of the account concerning Maintenance settings.void
Sets the name of the Accountvoid
setPassword(byte[] password)
Sets the password of the Account.void
setPublicKey(byte[] publicKey)
Sets the public key of the server.void
setTaskPrivileges(int taskPrivileges)
Sets the privileges of the account concerning Task settings.
-
Constructor Details
-
Account
Creates an Account with the supplied name and password.- Parameters:
name
- The name of the Account. If the name is empty a default "New" name is used.password
- The password of the Account. If empty a random password is generated.
-
Account
public Account()Default constructor. Creates a empty account without any values.
-
-
Method Details
-
getName
Returns the name of the Account- Returns:
- The Account name
-
setName
Sets the name of the Account- Parameters:
name
- The new name of the Account
-
getEmail
Returns the email address of the Account- Returns:
- The email address of the Account
-
setEmail
Sets the email address of the Account- Parameters:
email
- The email address of the Account
-
getPassword
public byte[] getPassword()Returns the (encrypted) password of the Account.- Returns:
- The (encrypted) password of the Account.
-
setPassword
public void setPassword(byte[] password)Sets the password of the Account. For safety reasons Claro expects that this password is encrypted using asymetric encryption as described in the example. If a user wants to change its password he or she has to do this via the Adminconnector changePassword method- Parameters:
password
- The password encrypted using asymetric encryption as described in the example- See Also:
- Description with example,
AdminConnector.changePassword(byte[], byte[], byte[])
-
getConfigurationPrivileges
public int getConfigurationPrivileges()Gets the privileges of the account concerning Configuration settings. NO_ACCESS(0),VIEW(1),EDIT(2)- Returns:
- The privileges of the account.
-
setConfigurationPrivileges
public void setConfigurationPrivileges(int configurationPrivileges)Sets the privileges of the account concerning Configuration settings. NO_ACCESS(0),VIEW(1),EDIT(2)- Parameters:
configurationPrivileges
- The privileges of the account concerning configuration settings.
-
getMaintenancePrivileges
public int getMaintenancePrivileges()Gets the privileges of the account concerning Maintenance settings. NO_ACCESS(0),VIEW(1),EDIT(2)- Returns:
- The privileges of the account.
-
setMaintenancePrivileges
public void setMaintenancePrivileges(int maintenancePrivileges)Sets the privileges of the account concerning Maintenance settings. NO_ACCESS(0),VIEW(1),EDIT(2)- Parameters:
maintenancePrivileges
- The privileges of the account concerning Maintenance settings.
-
getTaskPrivileges
public int getTaskPrivileges()Gets the privileges of the account concerning Task settings. NO_ACCESS(0),VIEW(1),EDIT(2)- Returns:
- The privileges of the account.
-
setTaskPrivileges
public void setTaskPrivileges(int taskPrivileges)Sets the privileges of the account concerning Task settings. NO_ACCESS(0),VIEW(1),EDIT(2)- Parameters:
taskPrivileges
- The privileges of the account concerning Tasks settings.
-
getAccountPrivileges
public int getAccountPrivileges()Gets the privileges of the account concerning Account settings. NO_ACCESS(0),VIEW(1),EDIT(2)- Returns:
- The privileges of the account.
-
setAccountPrivileges
public void setAccountPrivileges(int accountPrivileges)Sets the privileges of the account concerning Account settings. NO_ACCESS(0),VIEW(1),EDIT(2)- Parameters:
accountPrivileges
- The privileges of the account concerning Account settings.
-
getEncryptedToken
public byte[] getEncryptedToken()Gets the unique login id token which was created after logging in. Check the example in the Description- Returns:
- The encrypted unique login token
- See Also:
- Description with example
-
setEncryptedToken
public void setEncryptedToken(byte[] token)Set's the unique login token. Method only used by the server.- Parameters:
token
- The encrypted unique login token- See Also:
- Description with example
-
getPublicKey
public byte[] getPublicKey()Gets the public key of the server. Used for encrypting passwords and login-tokens.- Returns:
- The public key of the server
- See Also:
- Description with example
-
setPublicKey
public void setPublicKey(byte[] publicKey)Sets the public key of the server. Used for encrypting passwords and login-tokens.- Parameters:
publicKey
- The public key of the server
-