JSCAPE MFT Server

com.jscape.inet.vfs
Class Account

java.lang.Object
  extended by com.jscape.inet.vfs.Account

public final class Account
extends java.lang.Object

Represents user account abstraction. The account is a named block of user available files. It also contains basic user information.

Author:
Alex Usun

Nested Class Summary
static class Account.Delegate
          An account persistence delegate.
static class Account.NameComparator
           
 
Constructor Summary
Account(Account that)
          Copy constructor.
Account(java.lang.String username, java.lang.String login, byte[] passwordHash, VirtualFileDescriptor[] resources, java.util.Date expirationDate)
          Creates a new account instance.
Account(java.lang.String username, java.lang.String login, char[] password, VirtualFileDescriptor[] resources, java.util.Date expirationDate)
          Creates a new account instance.
 
Method Summary
 void addGroup(java.lang.String groupName)
          Adds current account to the specified group.
 boolean equals(java.lang.Object o)
           
 DomainAdministration getAdministration()
          Gets domain administration parameters for account.
 java.lang.String[] getBindedKeys()
          Returns account binded public keys.
 com.jscape.inet.vfs.Company getCompany()
          Returns user's company.
 Quota getDownloadsQuota()
          Gets maximum downloads quota.
 java.lang.String getEmailAddress()
          Returns account email address.
 java.util.Date getExpirationDate()
          Returns the account expiration date.
 java.lang.String getGroupName()
          Deprecated. use getGroups() instead
 java.util.Set<java.lang.String> getGroups()
          Returns account groups.
 com.jscape.inet.vfs.IPAccessVerifier getIpAccessVerifier()
          Returns account's IP access verifier.
 java.util.Date getLastLoginDate()
          Returns user's last login date.
 java.lang.String getLogin()
          Returns the user login.
 com.jscape.inet.vfs.LoginRedirection getLoginRedirection()
          Returns account's login redirection.
 java.lang.String getNotes()
          Returns account's notes.
 java.util.Map getOptions()
          Returns custom options.
 java.lang.String getOwner()
          Gets username of owner account.
 boolean getPasswordChangingAllowed()
          Returns password change allowed flag.
 java.util.Date getPasswordDate()
          Gets password creation date.
 byte[] getPasswordHash()
          Returns account password hash.
 java.util.List getPasswordHistory()
          Gets password history.
 com.jscape.inet.vfs.Phone getPhone()
          Returns user's phone.
 VirtualFileDescriptor[] getResources()
          Gets the account virtual paths array.
 Quota getTransfersQuota()
          Gets maximum transfers quota.
 Quota getUploadsQuota()
          Gets maximum uploads quota.
 java.lang.String getUsername()
          Returns the user name.
 int hashCode()
           
 boolean isEmailFileTransferAllowed()
          Returns email file transfer allowed flag.
 boolean isEnabled()
          Checks if the account is enabled.
 boolean isExpired()
          Checks if this account is expired.
 boolean isIgnorePasswordAgingRules()
          Checks if password aging rules can be ignored for current account.
 boolean isMemberOfGroup(java.lang.String groupName)
          Checks if current account is a member of specified group.
 boolean isOwnedBy(java.lang.String owner)
          Checks if current account is owned by the specified.
 boolean isOwnerOf(Account account)
          Checks if specified account is owned by current one.
 boolean isSecured()
          Checks if the account must login using secure protocol.
 boolean isUsePhoneAuthentication()
          Checks if phone authentication must be used while user authentication.
 com.jscape.inet.vfs.Password password()
          Returns account's password.
 void removeGroup(java.lang.String groupName)
          Removes current account from the specified group.
 void setAdministration(DomainAdministration value)
          Sets domain administration parameters for account.
 void setBindedKeys(java.lang.String[] value)
          Sets account binded public keys.
 void setCompany(com.jscape.inet.vfs.Company value)
          Sets user's company
 void setDownloadsQuota(Quota value)
          Sets maximum downloads quota.
 void setEmailAddress(java.lang.String value)
          Sets new account email address.
 void setEmailFileTransferAllowed(boolean value)
          Sets email file transfer allowed flag.
 void setEnabled(boolean value)
          Sets account enabling indicator.
 void setExpirationDate(java.util.Date value)
          Sets the expiration date.
 void setGroupName(java.lang.String value)
          Deprecated. use setGroups() instead
 void setGroups(java.util.Set<java.lang.String> value)
          Sets account groups.
 void setIgnorePasswordAgingRules(boolean value)
          Sets password aging ignoring flag.
 void setIpAccessVerifier(com.jscape.inet.vfs.IPAccessVerifier value)
          Sets account's IP access verifier.
 void setLastLoginDate(java.util.Date value)
          Sets user's last login date.
 void setLogin(java.lang.String value)
          Sets user login.
 void setLoginRedirection(com.jscape.inet.vfs.LoginRedirection value)
          Sets account's login redirection.
 void setNotes(java.lang.String value)
          Sets account's notes.
 void setOptions(java.util.Map value)
          Sets custom options.
 void setOwner(java.lang.String value)
          Sets username of owner account.
 void setPassword(char[] value)
          Sets a new account password.
 void setPasswordChangingAllowed(boolean value)
          Sets password changing allowed flag.
 void setPasswordDate(java.util.Date value)
          Sets password creation date.
 void setPasswordHash(byte[] value)
          Sets the account password hash
 void setPasswordHistory(java.util.List value)
          Sets password history.
 void setPhone(com.jscape.inet.vfs.Phone value)
          Sets user's phone.
 void setResources(VirtualFileDescriptor[] value)
          Sets the account virtual paths.
 void setSecured(boolean value)
          Sets whether user must login using secure protocol.
 void setTransfersQuota(Quota value)
          Sets maximum transfers quota.
 void setUploadsQuota(Quota value)
          Sets maximum uploads quota.
 void setUsePhoneAuthentication(boolean value)
          Sets phone authentication flag.
 void setUsername(java.lang.String value)
          Sets the user name.
 java.lang.String toString()
           
 void verifyAddress(java.net.InetAddress address)
           
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Account

public Account(java.lang.String username,
               java.lang.String login,
               char[] password,
               VirtualFileDescriptor[] resources,
               java.util.Date expirationDate)
Creates a new account instance.

Parameters:
username - the user name
login - the user login
password - the user password
resources - the virtual paths associated with this user
expirationDate - the expiration date

Account

public Account(java.lang.String username,
               java.lang.String login,
               byte[] passwordHash,
               VirtualFileDescriptor[] resources,
               java.util.Date expirationDate)
Creates a new account instance.

Parameters:
username - the user name
login - the user login
passwordHash - the user password hash
resources - the virtual paths associated with this user
expirationDate - the expiration date

Account

public Account(Account that)
Copy constructor.

Parameters:
that - instance will be copied
Method Detail

getUsername

public java.lang.String getUsername()
Returns the user name.

Returns:
the user name

setUsername

public void setUsername(java.lang.String value)
Sets the user name.

Parameters:
value - the user name

getLogin

public java.lang.String getLogin()
Returns the user login.

Returns:
the user login

setLogin

public void setLogin(java.lang.String value)
Sets user login.

Parameters:
value - the user login

getPasswordHash

public byte[] getPasswordHash()
Returns account password hash.

Returns:
the account password hash

setPasswordHash

public void setPasswordHash(byte[] value)
Sets the account password hash

Parameters:
value - The account password hash will be set

setPassword

public void setPassword(char[] value)
Sets a new account password.

Parameters:
value - The new account password

getPasswordDate

public java.util.Date getPasswordDate()
Gets password creation date.

Returns:
password creation date

setPasswordDate

public void setPasswordDate(java.util.Date value)
Sets password creation date.

Parameters:
value - password creation date

getPasswordHistory

public java.util.List getPasswordHistory()
Gets password history.

Returns:
password history

setPasswordHistory

public void setPasswordHistory(java.util.List value)
Sets password history.

Parameters:
value - password history

getGroupName

public java.lang.String getGroupName()
Deprecated. use getGroups() instead

Returns the account group name.

Returns:
the group name which current account belongs to or null if account doesn't belong to any group

setGroupName

public void setGroupName(java.lang.String value)
Deprecated. use setGroups() instead

Sets a new group for the account.

Parameters:
value - the group name

getGroups

public java.util.Set<java.lang.String> getGroups()
Returns account groups.

Returns:
account group set

setGroups

public void setGroups(java.util.Set<java.lang.String> value)
Sets account groups.

Parameters:
value - account group set

addGroup

public void addGroup(java.lang.String groupName)
Adds current account to the specified group.

Parameters:
groupName - target group name

removeGroup

public void removeGroup(java.lang.String groupName)
Removes current account from the specified group.

Parameters:
groupName - target group name

isMemberOfGroup

public boolean isMemberOfGroup(java.lang.String groupName)
Checks if current account is a member of specified group.

Parameters:
groupName - target group name
Returns:
true if account is a memeber of the group; false otherwise

getEmailAddress

public java.lang.String getEmailAddress()
Returns account email address.

Returns:
account email address

setEmailAddress

public void setEmailAddress(java.lang.String value)
Sets new account email address.

Parameters:
value - account email address

getCompany

public com.jscape.inet.vfs.Company getCompany()
Returns user's company.

Returns:
user's company

setCompany

public void setCompany(com.jscape.inet.vfs.Company value)
Sets user's company

Parameters:
value - a user company

getPhone

public com.jscape.inet.vfs.Phone getPhone()
Returns user's phone.

Returns:
user's phone

setPhone

public void setPhone(com.jscape.inet.vfs.Phone value)
Sets user's phone.

Parameters:
value - a new phone value

getBindedKeys

public java.lang.String[] getBindedKeys()
Returns account binded public keys.

Returns:
account binded keys aliases

setBindedKeys

public void setBindedKeys(java.lang.String[] value)
Sets account binded public keys.

Parameters:
value - account binded keys aliases

getOwner

public java.lang.String getOwner()
Gets username of owner account.

Returns:
owner login

setOwner

public void setOwner(java.lang.String value)
Sets username of owner account.

Parameters:
value - owner login

isOwnerOf

public boolean isOwnerOf(Account account)
Checks if specified account is owned by current one.

Parameters:
account - target account
Returns:
true if specified account is owned by current; false otherwise

isOwnedBy

public boolean isOwnedBy(java.lang.String owner)
Checks if current account is owned by the specified.

Parameters:
owner - an owner account name
Returns:
true if current account is owned by the specified; false otherwise

getExpirationDate

public java.util.Date getExpirationDate()
Returns the account expiration date.

Returns:
exiration date

setExpirationDate

public void setExpirationDate(java.util.Date value)
Sets the expiration date.

Parameters:
value - the new expiration date

isExpired

public boolean isExpired()
Checks if this account is expired.

Returns:
true if account is expired; false otherwise

getUploadsQuota

public Quota getUploadsQuota()
Gets maximum uploads quota.

Returns:
uploads quota

setUploadsQuota

public void setUploadsQuota(Quota value)
Sets maximum uploads quota.

Parameters:
value - uploads quota

getDownloadsQuota

public Quota getDownloadsQuota()
Gets maximum downloads quota.

Returns:
downloads quota

setDownloadsQuota

public void setDownloadsQuota(Quota value)
Sets maximum downloads quota.

Parameters:
value - downloads quota

getTransfersQuota

public Quota getTransfersQuota()
Gets maximum transfers quota.

Returns:
transfers quota

setTransfersQuota

public void setTransfersQuota(Quota value)
Sets maximum transfers quota.

Parameters:
value - transfers quota

getResources

public VirtualFileDescriptor[] getResources()
Gets the account virtual paths array.

Returns:
Returns the user virtual paths

setResources

public void setResources(VirtualFileDescriptor[] value)
Sets the account virtual paths.

Parameters:
value - the new user virtual paths array

getAdministration

public DomainAdministration getAdministration()
Gets domain administration parameters for account.

Returns:
domain administration params

setAdministration

public void setAdministration(DomainAdministration value)
Sets domain administration parameters for account.

Parameters:
value - domain administration params

isSecured

public boolean isSecured()
Checks if the account must login using secure protocol.

Returns:
true if the account has secured access; false otherwise

setSecured

public void setSecured(boolean value)
Sets whether user must login using secure protocol.

Parameters:
value - if true the account will have only secured access

isEnabled

public boolean isEnabled()
Checks if the account is enabled.

Returns:
true if the account is enabled; false otherwise

setEnabled

public void setEnabled(boolean value)
Sets account enabling indicator.

Parameters:
value - if true the account will be enabled

getPasswordChangingAllowed

public boolean getPasswordChangingAllowed()
Returns password change allowed flag. Used for FTP/SFTP password changing.

Returns:
true if password changing is allowed; false otherwise

setPasswordChangingAllowed

public void setPasswordChangingAllowed(boolean value)
Sets password changing allowed flag.

Parameters:
value - if true password changing is allowed

isEmailFileTransferAllowed

public boolean isEmailFileTransferAllowed()
Returns email file transfer allowed flag.

Returns:
true if email file transfer is allowed; false otherwise

setEmailFileTransferAllowed

public void setEmailFileTransferAllowed(boolean value)
Sets email file transfer allowed flag.

Parameters:
value - if true email file transfer is allowed

isUsePhoneAuthentication

public boolean isUsePhoneAuthentication()
Checks if phone authentication must be used while user authentication.

Returns:
true if phone authentication must be used; false otherwise

setUsePhoneAuthentication

public void setUsePhoneAuthentication(boolean value)
Sets phone authentication flag.

Parameters:
value - if true the phone authentication must be used

isIgnorePasswordAgingRules

public boolean isIgnorePasswordAgingRules()
Checks if password aging rules can be ignored for current account.

Returns:
true if password aging rules can be ignored; false otherwise

setIgnorePasswordAgingRules

public void setIgnorePasswordAgingRules(boolean value)
Sets password aging ignoring flag.

Parameters:
value - if true password aging rules can be ignored for current account

getLastLoginDate

public java.util.Date getLastLoginDate()
Returns user's last login date.

Returns:
user's last login date

setLastLoginDate

public void setLastLoginDate(java.util.Date value)
Sets user's last login date.

Parameters:
value - last login date

getLoginRedirection

public com.jscape.inet.vfs.LoginRedirection getLoginRedirection()
Returns account's login redirection.

Returns:
account's login redirection

setLoginRedirection

public void setLoginRedirection(com.jscape.inet.vfs.LoginRedirection value)
Sets account's login redirection.

Parameters:
value - account's login redirection

getIpAccessVerifier

public com.jscape.inet.vfs.IPAccessVerifier getIpAccessVerifier()
Returns account's IP access verifier.

Returns:
accont's IP access verifier

setIpAccessVerifier

public void setIpAccessVerifier(com.jscape.inet.vfs.IPAccessVerifier value)
Sets account's IP access verifier.

Parameters:
value - account's IP access verifier

getNotes

public java.lang.String getNotes()
Returns account's notes.

Returns:
account's notes

setNotes

public void setNotes(java.lang.String value)
Sets account's notes.

Parameters:
value - account's notes

getOptions

public java.util.Map getOptions()
Returns custom options.

Returns:
custom options

setOptions

public void setOptions(java.util.Map value)
Sets custom options.

Parameters:
value - custom options

password

public com.jscape.inet.vfs.Password password()
Returns account's password.

Returns:
account's password

verifyAddress

public void verifyAddress(java.net.InetAddress address)
                   throws com.jscape.inet.vfs.IPAccessVerifier.AccessDeniedException
Throws:
com.jscape.inet.vfs.IPAccessVerifier.AccessDeniedException

equals

public boolean equals(java.lang.Object o)
Overrides:
equals in class java.lang.Object

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

JSCAPE MFT Server

Copyright © JSCAPE LLC. 1999-2011. All Rights Reserved