jet.server.api.custom.security.user
Interface UserProvider


public interface UserProvider

Within interfaces of JReport security API, UserProvider is used to provide customized information of principal: user. Except getting user infomation from customer's external security system, this interface also provide ability to modify user information in customer's external security system.

Since:
version 8

Field Summary
static java.lang.String TAG_USER_CREATED_TIME
          TAG_USER_CREATED_TIME Property of user, indicates the time that user created, value is "user_created_time".
static java.lang.String TAG_USER_DESCRIPTION
          TAG_USER_DESCRIPTION Property of user, indicates description of user, value is "user_description".
static java.lang.String TAG_USER_DISABLED_ACCOUNT
          TAG_USER_DIABLED_ACCOUNT Property of user, indicates whether this user account is disabled in security system, value is "user_disabled_account".
static java.lang.String TAG_USER_EMAIL
          TAG_USER_EMAIL Property of user, indicates user's email address, value is "user_email".
static java.lang.String TAG_USER_ENABLE_NULL_PWD
          TAG_USER_ENABLE_NULL_PWD Property of user, indicates whether user can have null password, value is "user_enable_null_pwd".
static java.lang.String TAG_USER_EXPIRE_TIME
          TAG_USER_EXPIRE_TIME Property of user, indicates how long the user will expire after last time modification, value is "user_expire_time".
static java.lang.String TAG_USER_FULLNAME
          TAG_USER_FULLNAME Property of user, indicates user's full name, value is "user_fullname".
static java.lang.String TAG_USER_LAST_MODIFY_TIME
          TAG_USER_LAST_MODIFY_TIME Property of user, indicates the last time that modify user properties, value is "user_last_modify_time".
static java.lang.String TAG_USER_MIN_PWD_LENGTH
          TAG_USER_MIN_PWD_LENGTH Property of user, indicates the minimum password length, value is "user_min_pwd_length".
static java.lang.String TAG_USER_NAME
          TAG_USER_NAME Property of user, indicates user name, value is "user_name".
static java.lang.String TAG_USER_NEVER_EXPIRE
          TAG_USER_NEVER_ERPIRE Property of user, indicates whether the user never expire, value is "user_never_expire".
static java.lang.String TAG_USER_PASSWORD
          TAG_USER_PASSWORD Property of user, indicates the user's password, value is "user_password".
 
Method Summary
 void addUser(java.lang.String realmName, java.util.Properties props)
          Add a user into customer's external security system, this user is reprsented by a Properties.
 java.util.Iterator getAllUsers(java.lang.String realmName)
          Get all user names from customer's external security system.
 java.util.Properties getUserProperties(java.lang.String realmName, java.lang.String userName)
          Get a Properties which used to represent a user.
 boolean isEnableEdit()
          Indicates whether customer's external security system will be modified by invoking some methods in UserProvider.
In common cases, invokeing addUser(), setUser() or removeUser() should take effect on customer's external security system, and cause modification of external security system, this method should return true in such case.
 void removeUser(java.lang.String realmName, java.lang.String userName)
          Remove specified user from customer's external security system.
 void setUser(java.lang.String realmName, java.util.Properties props)
          Update specified user's properties to customer's external security system.
 

Field Detail

TAG_USER_NAME

static final java.lang.String TAG_USER_NAME
TAG_USER_NAME Property of user, indicates user name, value is "user_name". A user name is a String value that non-null, length is bigger than zero.

See Also:
Constant Field Values

TAG_USER_DESCRIPTION

static final java.lang.String TAG_USER_DESCRIPTION
TAG_USER_DESCRIPTION Property of user, indicates description of user, value is "user_description". A user description is a String value.

See Also:
Constant Field Values

TAG_USER_FULLNAME

static final java.lang.String TAG_USER_FULLNAME
TAG_USER_FULLNAME Property of user, indicates user's full name, value is "user_fullname". A user full name is a String value.

See Also:
Constant Field Values

TAG_USER_EMAIL

static final java.lang.String TAG_USER_EMAIL
TAG_USER_EMAIL Property of user, indicates user's email address, value is "user_email". A user email address is a String value.

See Also:
Constant Field Values

TAG_USER_CREATED_TIME

static final java.lang.String TAG_USER_CREATED_TIME
TAG_USER_CREATED_TIME Property of user, indicates the time that user created, value is "user_created_time". A user created time is a Date value. In a Properties to represent a user, value of key TAG_USER_CREATED_TIME is a Date.

See Also:
Constant Field Values

TAG_USER_PASSWORD

static final java.lang.String TAG_USER_PASSWORD
TAG_USER_PASSWORD Property of user, indicates the user's password, value is "user_password". A user password is a String value.

See Also:
Constant Field Values

TAG_USER_ENABLE_NULL_PWD

static final java.lang.String TAG_USER_ENABLE_NULL_PWD
TAG_USER_ENABLE_NULL_PWD Property of user, indicates whether user can have null password, value is "user_enable_null_pwd". This property is a boolean value. In a Properties to represent a user, value of key TAG_USER_ENABLE_NULL_PWD is a string representation of boolean value.

See Also:
Constant Field Values

TAG_USER_LAST_MODIFY_TIME

static final java.lang.String TAG_USER_LAST_MODIFY_TIME
TAG_USER_LAST_MODIFY_TIME Property of user, indicates the last time that modify user properties, value is "user_last_modify_time". A user's last modify time is a Date value. In a Properties to represent a user, value of key TAG_USER_LAST-MODIFY_TIME is a Date.

See Also:
Constant Field Values

TAG_USER_NEVER_EXPIRE

static final java.lang.String TAG_USER_NEVER_EXPIRE
TAG_USER_NEVER_ERPIRE Property of user, indicates whether the user never expire, value is "user_never_expire". This property is a boolean value. In a Properties to represent a user, value of key TAG_USER_NEVER_EXPIRE is a string representation of boolean value.

See Also:
Constant Field Values

TAG_USER_EXPIRE_TIME

static final java.lang.String TAG_USER_EXPIRE_TIME
TAG_USER_EXPIRE_TIME Property of user, indicates how long the user will expire after last time modification, value is "user_expire_time". This property is a int value, unit is day. In a Properties to represent a user, value of key TAG_USER_EXPIRE_TIME is a string representation of int value.

See Also:
Constant Field Values

TAG_USER_MIN_PWD_LENGTH

static final java.lang.String TAG_USER_MIN_PWD_LENGTH
TAG_USER_MIN_PWD_LENGTH Property of user, indicates the minimum password length, value is "user_min_pwd_length". This property is a int value. In a Properties to represent a user, value of key TAG_USER_MIN_PWD_LENGTH is a string representation of int value.

See Also:
Constant Field Values

TAG_USER_DISABLED_ACCOUNT

static final java.lang.String TAG_USER_DISABLED_ACCOUNT
TAG_USER_DIABLED_ACCOUNT Property of user, indicates whether this user account is disabled in security system, value is "user_disabled_account". This property is a boolean value. In a Properties to represent a user, value of key TAG_USER_DISABLED_ACCOUNT is a string representation of boolean value.

See Also:
Constant Field Values
Method Detail

getAllUsers

java.util.Iterator getAllUsers(java.lang.String realmName)
                               throws JRCustomerException
Get all user names from customer's external security system.

Parameters:
realmName - the realm name
Returns:
all user names.
Throws:
JRCustomerException - If an error occurs during JReport server security system invoking this method, and the implementation think should throw this error to JReport server security system.

getUserProperties

java.util.Properties getUserProperties(java.lang.String realmName,
                                       java.lang.String userName)
                                       throws NoSuchUserException,
                                              JRCustomerException
Get a Properties which used to represent a user.

Parameters:
realmName - the realm name
userName - the user name
Returns:
a Properties that represent a user. If a null or a empty Properties returned, means there is no any property for specified user.
Throws:
NoSuchUserException - If there is no a user has specified name in customer's external security system.
JRCustomerException - If an error occurs during JReport server security system invoking this method, and the implementation think should throw this error to JReport server security system.

addUser

void addUser(java.lang.String realmName,
             java.util.Properties props)
             throws UserExistsException,
                    JRCustomerException
Add a user into customer's external security system, this user is reprsented by a Properties.

Parameters:
realmName - the realm name
props - a Properties that represent a user.
Throws:
UserExistsException - If there is a user has same name in customer's external security system.
JRCustomerException - If an error occurs during JReport server security system invoking this method, and the implementation think should throw this error to JReport server security system.

setUser

void setUser(java.lang.String realmName,
             java.util.Properties props)
             throws NoSuchUserException,
                    JRCustomerException
Update specified user's properties to customer's external security system.

Parameters:
realmName - the realm name
props - a Properties that represent a user.
Throws:
NoSuchUserException - If there is no a user has specified name (indicated by TAG_USER_NAME in props) in customer's external security system.
JRCustomerException - If an error occurs during JReport server security system invoking this method, and the implementation think should throw this error to JReport server security system.

removeUser

void removeUser(java.lang.String realmName,
                java.lang.String userName)
                throws NoSuchUserException,
                       JRCustomerException
Remove specified user from customer's external security system.

Parameters:
realmName - the realm name
userName - the user name to specify which user need to be removed
Throws:
NoSuchUserException - If there is no a user has specified name (indicated by TAG_USER_NAME in props) in customer's external security system.
JRCustomerException - If an error occurs during JReport server security system invoking this method, and the implementation think should throw this error to JReport server security system.

isEnableEdit

boolean isEnableEdit()
Indicates whether customer's external security system will be modified by invoking some methods in UserProvider.
In common cases, invokeing addUser(), setUser() or removeUser() should take effect on customer's external security system, and cause modification of external security system, this method should return true in such case. If cusotmer's external security system will not be affected by invoking addUser(), setUser() or removeUser(), this method should return false.
Return value of method isEditing() with paramters SecurityWebAdaptor.ACTION_ADD_USER SecurityWebAdaptor.ACTION_REMOVE_USER SecurityWebAdaptor.ACTION_EDIT_USER_PROPERTIES in jet.server.api.SecurityWebAdaptor is same with this method's return value.

Returns:
true if external security system will be affected by invoking addUser(), setUser() or removeUser(), otherwise return false.
See Also:
SecurityWebAdaptor