jet.server.api.custom.security.relation
Interface RoleGroupRelationProvider


public interface RoleGroupRelationProvider

Among the interfaces of JReport security API, RoleGroupProvider is used to provide customized relation information among roles and groups. In addition to getting relation information among roles and groups from customer's external security system, this interface also provides the ability to modify relation information among roles and groups in customer's external security system.

Since:
version 8

Method Summary
 void addGroupToRole(java.lang.String realmName, java.lang.String roleName, java.lang.String groupName)
          Associates a group with the specified role in customer's external security system.
 java.util.Iterator getGroupsByRole(java.lang.String realmName, java.lang.String roleName)
          Gets group names which associate with the specified role from customer's external security system.
 boolean isEnableEdit()
          Indicates whether customer's external security system will be modified by invoking some methods in RoleGroupRelationProvider.
In common cases, invokes addGroupToRole() or removeGroupFromRole() 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 removeGroupFromRole(java.lang.String realmName, java.lang.String roleName, java.lang.String groupName)
          Removes association between the specified role and group in customer's external security system.
 

Method Detail

getGroupsByRole

java.util.Iterator getGroupsByRole(java.lang.String realmName,
                                   java.lang.String roleName)
                                   throws NoSuchRoleException,
                                          JRCustomerException
Gets group names which associate with the specified role from customer's external security system.

Parameters:
realmName - the realm name.
roleName - the role name.
Returns:
group names which associate with the specified role.
Throws:
NoSuchRoleException - If there is no role with the specified role 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.

addGroupToRole

void addGroupToRole(java.lang.String realmName,
                    java.lang.String roleName,
                    java.lang.String groupName)
                    throws NoSuchRoleException,
                           NoSuchGroupException,
                           GroupExistsException,
                           JRCustomerException
Associates a group with the specified role in customer's external security system.

Parameters:
realmName - the realm name.
roleName - the role name which the group will associate with
groupName - the group name which will associate with the specific role
Throws:
NoSuchRoleException - If the specified role does not exist in customer's external security system.
NoSuchGroupException - If the specified group does not exist in customer's external security system.
GroupExistsException - If the group has associated with the specified role 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.

removeGroupFromRole

void removeGroupFromRole(java.lang.String realmName,
                         java.lang.String roleName,
                         java.lang.String groupName)
                         throws NoSuchRoleException,
                                NoSuchGroupException,
                                JRCustomerException
Removes association between the specified role and group in customer's external security system.

Parameters:
realmName - the realm name.
roleName - the parent role name.
groupName - the group name.
Throws:
NoSuchRoleException - If the specified role does not exist in customer's external security system.
NoSuchGroupException - If the specified 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 RoleGroupRelationProvider.
In common cases, invokes addGroupToRole() or removeGroupFromRole() 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 addGroupToRole() or removeGroupFromRole(), this method should return false.
Returned value of the method isEditing() with parameter SecurityWebAdaptor.ACTION_EDIT_RELATION_ROLE_GROUP 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 addGroupToRole() or removeGroupFromRole(), otherwise return false.
See Also:
SecurityWebAdaptor