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.group
Interface GroupProvider

    public interface GroupProvider

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

Since:
  version 8

Field Summary
`static java.lang.String` | `TAG_GROUP_DESCRIPTION` TAG_GROUP_DESCRIPTION Property of group, indicates description of group, value is "group_description".
`static java.lang.String` | `TAG_GROUP_NAME` TAG_GROUP_NAME Property of group, indicates group name, value is "group_name".

Method Summary
`void` | `addGroup(java.lang.String realmName, java.util.Properties props)` Add a group into customer's external security system, this group is reprsented by a `Properties`.
`void` | `addSubGroup(java.lang.String realmName, java.lang.String groupName, java.lang.String subGroup)` Add a sub-group into specified parent group in customer's external security system.
`java.util.Iterator` | `getAllGroups(java.lang.String realmName)` Get all group names from customer's external security system.
`java.util.Properties` | `getGroupProperties(java.lang.String realmName, java.lang.String groupName)` Get a `Properties` which used to represent a group.
`java.util.Iterator` | `getSubGroups(java.lang.String realmName, java.lang.String groupName)` Get sub-group names of the specified parent group from cusotmer's external security system.
`boolean` | `isEnableEdit()` Indicates whether customer's external security system will be modified by invoking some methods in `GroupProvider`. In common cases, invokeing `addGroup()`, `removeGroup()`, `addSubGroup()` or `removeSubGroup()` 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` | `removeGroup(java.lang.String realmName, java.lang.String groupName)` Remove specified group from customer's external security system.
`void` | `removeSubGroup(java.lang.String realmName, java.lang.String groupName, java.lang.String subGroup)` Remove a sub-group from specified parent group in customer's external security system.

Field Detail

### TAG_GROUP_NAME

    static final java.lang.String TAG_GROUP_NAME

  TAG_GROUP_NAME Property of group, indicates group name, value is "group_name". A group name is a `String` value that non-null, length is bigger than zero.

  See Also:
    Constant Field Values

### TAG_GROUP_DESCRIPTION

    static final java.lang.String TAG_GROUP_DESCRIPTION

  TAG_GROUP_DESCRIPTION Property of group, indicates description of group, value is "group_description". A group description is a `String` value.

  See Also:
    Constant Field Values

Method Detail

### getAllGroups

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

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

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

### getGroupProperties

    java.util.Properties getGroupProperties(java.lang.String realmName,
                                            java.lang.String groupName)
                                            throws NoSuchGroupException,
                                                   JRCustomerException

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

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

### getSubGroups

    java.util.Iterator getSubGroups(java.lang.String realmName,
                                    java.lang.String groupName)
                                    throws NoSuchGroupException,
                                           JRCustomerException

  Get sub-group names of the specified parent group from cusotmer's external security system.

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

### addGroup

    void addGroup(java.lang.String realmName,
                  java.util.Properties props)
                  throws GroupExistsException,
                         JRCustomerException

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

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

### removeGroup

    void removeGroup(java.lang.String realmName,
                     java.lang.String groupName)
                     throws NoSuchGroupException,
                            JRCustomerException

  Remove specified group from customer's external security system.

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

### addSubGroup

    void addSubGroup(java.lang.String realmName,
                     java.lang.String groupName,
                     java.lang.String subGroup)
                     throws NoSuchGroupException,
                            GroupExistsException,
                            JRCustomerException

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

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

### removeSubGroup

    void removeSubGroup(java.lang.String realmName,
                        java.lang.String groupName,
                        java.lang.String subGroup)
                        throws NoSuchGroupException,
                               JRCustomerException

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

  Parameters:
    `realmName` - the realm name
    `groupName` - the parent group name, from which a sub-group will be removed.
    `subGroup` - the sub-group name which will be removed from specifiec parent group
  Throws:
    `NoSuchGroupException` - If specified parent group or sub-group 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 `GroupProvider`.
  In common cases, invokeing `addGroup()`, `removeGroup()`, `addSubGroup()` or `removeSubGroup()` 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 `addGroup()`, `removeGroup()`, `addSubGroup()` or `removeSubGroup()`, this method should return `false`.
  Return value of method `isEditing()` with paramters `SecurityWebAdaptor.ACTION_ADD_GROUP` `SecurityWebAdaptor.ACTION_REMOVE_GROUP` `SecurityWebAdaptor.ACTION_EDIT_RELATION_GROUP_SUBGROUP` in `jet.server.api.SecurityWebAdaptor` is same with this method's return value.

  Returns:
    `true` if external security system will be affected by invoking `addGroup()`, `removeGroup()`, `addSubGroup()` or `removeSubGroup()`, 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