jet.server.api.custom.security.group
Interface GroupProvider


public interface GroupProvider

Among the interfaces of JReport security API, GroupProvider is used to provide customized information of the principal group, including relation information between 2 groups. In addition to getting group information from customer's external security system, this interface also provides the ability to modify group information in customer's external security system.

Since:
version 8

Field Summary
static java.lang.String TAG_GROUP_DESCRIPTION
          Property of group, indicates the description of a group, the value is "group_description".
static java.lang.String TAG_GROUP_NAME
          Property of group, indicates group name, the value is "group_name".
 
Method Summary
 void addGroup(java.lang.String realmName, java.util.Properties props)
          Adds a group into customer's external security system.
 void addSubGroup(java.lang.String realmName, java.lang.String groupName, java.lang.String subGroup)
          Adds a sub-group into the specified parent group in customer's external security system.
 java.util.Iterator getAllGroups(java.lang.String realmName)
          Gets all group names from customer's external security system.
 java.util.Properties getGroupProperties(java.lang.String realmName, java.lang.String groupName)
          Gets a Properties used to represent a group.
 java.util.Iterator getSubGroups(java.lang.String realmName, java.lang.String groupName)
          Gets sub-group names of the specified parent group from customer'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, invoking 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 cases.
 void removeGroup(java.lang.String realmName, java.lang.String groupName)
          Removes the specified group from customer's external security system.
 void removeSubGroup(java.lang.String realmName, java.lang.String groupName, java.lang.String subGroup)
          Removes a sub-group from the specified parent group in customer's external security system.
 

Field Detail

TAG_GROUP_NAME

static final java.lang.String TAG_GROUP_NAME
Property of group, indicates group name, the value is "group_name". A group name is a String value that non-null, length is greater than zero.

See Also:
Constant Field Values

TAG_GROUP_DESCRIPTION

static final java.lang.String TAG_GROUP_DESCRIPTION
Property of group, indicates the description of a group, the 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
Gets 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 thinks this error should be thrown to JReport Server security system.

getGroupProperties

java.util.Properties getGroupProperties(java.lang.String realmName,
                                        java.lang.String groupName)
                                        throws NoSuchGroupException,
                                               JRCustomerException
Gets a Properties used to represent a group.

Parameters:
realmName - the realm name.
groupName - the group name.
Returns:
a Properties that represents a group. If a null or an empty Properties is returned, it means there are no properties for the specified group.
Throws:
NoSuchGroupException - If there is no group 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.

getSubGroups

java.util.Iterator getSubGroups(java.lang.String realmName,
                                java.lang.String groupName)
                                throws NoSuchGroupException,
                                       JRCustomerException
Gets sub-group names of the specified parent group from customer'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 group that has the 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 thinks this error should be thrown to JReport Server security system.

addGroup

void addGroup(java.lang.String realmName,
              java.util.Properties props)
              throws GroupExistsException,
                     JRCustomerException
Adds a group into customer's external security system. This group is represented by a Properties.

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

removeGroup

void removeGroup(java.lang.String realmName,
                 java.lang.String groupName)
                 throws NoSuchGroupException,
                        JRCustomerException
Removes the specified group from customer's external security system.

Parameters:
realmName - the realm name.
groupName - the group name to specify which group needs to be removed.
Throws:
NoSuchGroupException - If there is no group with the 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 thinks this error should be thrown to JReport Server security system.

addSubGroup

void addSubGroup(java.lang.String realmName,
                 java.lang.String groupName,
                 java.lang.String subGroup)
                 throws NoSuchGroupException,
                        GroupExistsException,
                        JRCustomerException
Adds a sub-group into the specified parent group in customer's external security system.

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

removeSubGroup

void removeSubGroup(java.lang.String realmName,
                    java.lang.String groupName,
                    java.lang.String subGroup)
                    throws NoSuchGroupException,
                           JRCustomerException
Removes a sub-group from the 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 the specified parent group
Throws:
NoSuchGroupException - If the 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 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 GroupProvider.
In common cases, invoking 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 cases. If customer's external security system will not be affected by invoking addGroup(), removeGroup(), addSubGroup() or removeSubGroup(), this method should return false.
Returned value of the method isEditing() with parameters SecurityWebAdaptor.ACTION_ADD_GROUP SecurityWebAdaptor.ACTION_REMOVE_GROUP SecurityWebAdaptor.ACTION_EDIT_RELATION_GROUP_SUBGROUP 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 addGroup(), removeGroup(), addSubGroup() or removeSubGroup(), otherwise return false.
See Also:
SecurityWebAdaptor