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.role
Interface RoleProvider

    public interface RoleProvider

Within interfaces of JReport security API, `RoleProvider` is used to provide customized information of principal: role, includes relation information between 2 roles. Except getting role infomation from customer's external security system, this interface also provide ability to modify role information in customer's external security system.

Since:
  version 8

Field Summary
`static java.lang.String` | `TAG_ROLE_DESCRIPTION` TAG_ROLE_DESCRIPTION Property of role, indicates description of role, value is "role_description".
`static java.lang.String` | `TAG_ROLE_NAME` TAG_ROLE_NAME Property of role, indicates role name, value is "role_name".

Method Summary
`void` | `addRole(java.lang.String realmName, java.util.Properties props)` Add a role into customer's external security system, this role is reprsented by a `Properties`.
`void` | `addSubRole(java.lang.String realmName, java.lang.String roleName, java.lang.String subRole)` Add a sub-role into specified parent role in customer's external security system.
`java.util.Iterator` | `getAllRoles(java.lang.String realmName)` Get all role names from customer's external security system.
`java.util.Properties` | `getRoleProperties(java.lang.String realmName, java.lang.String roleName)` Get a `Properties` which used to represent a role.
`java.util.Iterator` | `getSubRoles(java.lang.String realmName, java.lang.String roleName)` Get sub-role names of the specified parent role from customer's external security system.
`boolean` | `isEnableEdit()` Indicates whether customer's external security system will be modified by invoking some methods in `RoleProvider`. In common cases, invokeing `addRole()`, `removeRole()`, `addSubRole()` or `removeSubRole()` 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` | `removeRole(java.lang.String realmName, java.lang.String roleName)` Remove specified role from customer's external security system.
`void` | `removeSubRole(java.lang.String realmName, java.lang.String roleName, java.lang.String subRole)` Remove a sub-role from specified parent role in customer's external security system.

Field Detail

### TAG_ROLE_NAME

    static final java.lang.String TAG_ROLE_NAME

  TAG_ROLE_NAME Property of role, indicates role name, value is "role_name". A role name is a `String` value that non-null, length is bigger than zero.

  See Also:
    Constant Field Values

### TAG_ROLE_DESCRIPTION

    static final java.lang.String TAG_ROLE_DESCRIPTION

  TAG_ROLE_DESCRIPTION Property of role, indicates description of role, value is "role_description". A role description is a `String` value.

  See Also:
    Constant Field Values

Method Detail

### getAllRoles

    java.util.Iterator getAllRoles(java.lang.String realmName)
                                   throws JRCustomerException

  Get all role names from customer's external security system.

  Parameters:
    `realmName` - the realm name
  Returns:
    all role 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.

### getRoleProperties

    java.util.Properties getRoleProperties(java.lang.String realmName,
                                           java.lang.String roleName)
                                           throws NoSuchRoleException,
                                                  JRCustomerException

  Get a `Properties` which used to represent a role.

  Parameters:
    `realmName` - the realm name
    `roleName` - the role name
  Returns:
    a `Properties` that represent a role. If a `null` or a empty `Properties` returned, means there is no any property for specified role.
  Throws:
    `NoSuchRoleException` - If there is no a role 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.

### getSubRoles

    java.util.Iterator getSubRoles(java.lang.String realmName,
                                   java.lang.String roleName)
                                   throws NoSuchRoleException,
                                          JRCustomerException

  Get sub-role names of the specified parent role from customer's external security system.

  Parameters:
    `realmName` - the realm name
    `roleName` - the parent role name.
  Returns:
    sub-role names of specified parent role.
  Throws:
    `NoSuchRoleException` - If there is no a role has specified parent role 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.

### addRole

    void addRole(java.lang.String realmName,
                 java.util.Properties props)
                 throws RoleExistsException,
                        JRCustomerException

  Add a role into customer's external security system, this role is reprsented by a `Properties`.

  Parameters:
    `realmName` - the realm name
    `props` - a `Properties` that represent a role.
  Throws:
    `RoleExistsException` - If there is a role 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.

### removeRole

    void removeRole(java.lang.String realmName,
                    java.lang.String roleName)
                    throws NoSuchRoleException,
                           JRCustomerException

  Remove specified role from customer's external security system.

  Parameters:
    `realmName` - the realm name
    `roleName` - the role name to specify which role need to be removed
  Throws:
    `NoSuchRoleException` - If there is no a role has specified name (indicated by `TAG_ROLE_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.

### addSubRole

    void addSubRole(java.lang.String realmName,
                    java.lang.String roleName,
                    java.lang.String subRole)
                    throws NoSuchRoleException,
                           RoleExistsException,
                           JRCustomerException

  Add a sub-role into specified parent role in customer's external security system.

  Parameters:
    `realmName` - the realm name
    `roleName` - the parent role name which will add sub-role to.
    `subRole` - the sub-role name which will be added into specifiec parent role
  Throws:
    `NoSuchRoleException` - If specified parent role or sub-role does not exist in customer's external security system.
    `RoleExistsException` - If parent role contains a sub-role, which has same name with `subRole` 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.

### removeSubRole

    void removeSubRole(java.lang.String realmName,
                       java.lang.String roleName,
                       java.lang.String subRole)
                       throws NoSuchRoleException,
                              JRCustomerException

  Remove a sub-role from specified parent role in customer's external security system.

  Parameters:
    `realmName` - the realm name
    `roleName` - the parent role name, from which a sub-role will be removed.
    `subRole` - the sub-role name which will be removed from specifiec parent role
  Throws:
    `NoSuchRoleException` - If specified parent role or sub-role does not exist 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 `RoleProvider`.
  In common cases, invokeing `addRole()`, `removeRole()`, `addSubRole()` or `removeSubRole()` 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 `addRole()`, `removeRole()`, `addSubRole()` or `removeSubRole()`, this method should return `false`.
  Return value of method `isEditing()` with paramters `SecurityWebAdaptor.ACTION_ADD_ROLE` `SecurityWebAdaptor.ACTION_REMOVE_ROLE` `SecurityWebAdaptor.ACTION_EDIT_RELATION_ROLE_SUBROLE` in `jet.server.api.SecurityWebAdaptor` is same with this method's return value.

  Returns:
    `true` if external security system will be affected by invoking `addRole()`, `removeRole()`, `addSubRole()` or `removeSubRole()`, 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