Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

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

    public interface UserProvider

Among the interfaces of JReport security API, `UserProvider` is used to provide customized information of the principal user. In addition to getting user information from customer's external security system, this interface also provides the ability to modify user information in customer's external security system.

Since:
  version 8

Field Summary
`static java.lang.String` | `TAG_USER_CREATED_TIME` Property of user, indicates the time when a user is created, the value is "user_created_time".
`static java.lang.String` | `TAG_USER_DESCRIPTION` Property of user, indicates description of a user, the value is "user_description".
`static java.lang.String` | `TAG_USER_DISABLED_ACCOUNT` Property of user, indicates whether this user account is disabled in the security system, the value is "user_disabled_account".
`static java.lang.String` | `TAG_USER_EMAIL` Property of user, indicates a user's email address, the value is "user_email".
`static java.lang.String` | `TAG_USER_ENABLE_NULL_PWD` Property of user, indicates whether a user can have `null` password, the value is "user_enable_null_pwd".
`static java.lang.String` | `TAG_USER_EXPIRE_TIME` Property of user, indicates how long for when the user will expire after last time modification, the value is "user_expire_time".
`static java.lang.String` | `TAG_USER_FULLNAME` Property of user, indicates a user's full name, the value is "user_fullname".
`static java.lang.String` | `TAG_USER_LAST_MODIFY_TIME` Property of user, indicates the last time when user properties is modified, the value is "user_last_modify_time".
`static java.lang.String` | `TAG_USER_MIN_PWD_LENGTH` Property of user, indicates the minimum password length, the value is "user_min_pwd_length".
`static java.lang.String` | `TAG_USER_NAME` Property of user, indicates user name, the value is "user_name".
`static java.lang.String` | `TAG_USER_NEVER_EXPIRE` Property of user, indicates whether the user never expires, the value is "user_never_expire".
`static java.lang.String` | `TAG_USER_PASSWORD` Property of user, indicates the user's password, the value is "user_password".

Method Summary
`void` | `addUser(java.lang.String realmName, java.util.Properties props)` Adds a user into customer's external security system.
`java.util.Iterator` | `getAllUsers(java.lang.String realmName)` Gets all user names from customer's external security system.
`java.util.Properties` | `getUserProperties(java.lang.String realmName, java.lang.String userName)` Gets a `Properties` 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, invoking `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 cases.
`void` | `removeUser(java.lang.String realmName, java.lang.String userName)` Removes the specified user from customer's external security system.
`void` | `setUser(java.lang.String realmName, java.util.Properties props)` Updates the specified user's properties to customer's external security system.

Field Detail

### TAG_USER_NAME

    static final java.lang.String TAG_USER_NAME

  Property of user, indicates user name, the 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

  Property of user, indicates description of a user, the 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

  Property of user, indicates a user's full name, the 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

  Property of user, indicates a user's email address, the 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

  Property of user, indicates the time when a user is created, the value is "user_created_time". A user created time is a `Date` value. In a `Properties` to represent a user, the value of the key `TAG_USER_CREATED_TIME` is a `Date`.

  See Also:
    Constant Field Values

### TAG_USER_PASSWORD

    static final java.lang.String TAG_USER_PASSWORD

  Property of user, indicates the user's password, the 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

  Property of user, indicates whether a user can have `null` password, the value is "user_enable_null_pwd". This property is a `boolean` value. In a `Properties` to represent a user, the value of the 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

  Property of user, indicates the last time when user properties is modified, the value is "user_last_modify_time". A user's last modified time is a `Date` value. In a `Properties` to represent a user, the value of the 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

  Property of user, indicates whether the user never expires, the value is "user_never_expire". This property is a `boolean` value. In a `Properties` to represent a user, the value of the 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

  Property of user, indicates how long for when the user will expire after last time modification, the value is "user_expire_time". This property is a `int` value, the unit is day. In a `Properties` to represent a user, the value of the 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

  Property of user, indicates the minimum password length, the value is "user_min_pwd_length". This property is a `int` value. In a `Properties` to represent a user, the value of the 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

  Property of user, indicates whether this user account is disabled in the security system, the value is "user_disabled_account". This property is a `boolean` value. In a `Properties` to represent a user, the value of the 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

  Gets 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 thinks this error should be thrown to JReport server security system.

### getUserProperties

    java.util.Properties getUserProperties(java.lang.String realmName,
                                           java.lang.String userName)
                                           throws NoSuchUserException,
                                                  JRCustomerException

  Gets a `Properties` used to represent a user.

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

### addUser

    void addUser(java.lang.String realmName,
                 java.util.Properties props)
                 throws UserExistsException,
                        JRCustomerException

  Adds a user into customer's external security system. This user is represented by a `Properties`.

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

### setUser

    void setUser(java.lang.String realmName,
                 java.util.Properties props)
                 throws NoSuchUserException,
                        JRCustomerException

  Updates the specified user's properties to customer's external security system.

  Parameters:
    `realmName` - the realm name.
    `props` - a `Properties` that represents a user.
  Throws:
    `NoSuchUserException` - If there is no user with the 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 thinks this error should be thrown to JReport server security system.

### removeUser

    void removeUser(java.lang.String realmName,
                    java.lang.String userName)
                    throws NoSuchUserException,
                           JRCustomerException

  Removes the specified user from customer's external security system.

  Parameters:
    `realmName` - the realm name.
    `userName` - the user name to specify which user needs to be removed.
  Throws:
    `NoSuchUserException` - If there is no user with the 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 thinks this error should be thrown 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, invoking `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 cases. If customer's external security system will not be affected by invoking `addUser()`, `setUser()` or `removeUser()`, this method should return `false`.
  Returned value of the method `isEditing()` with parameters `SecurityWebAdaptor.ACTION_ADD_USER` `SecurityWebAdaptor.ACTION_REMOVE_USER` `SecurityWebAdaptor.ACTION_EDIT_USER_PROPERTIES` in `jet.server.api.SecurityWebAdaptor` is the same as 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`

Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD