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


public interface RoleUserRelationProvider

Within interfaces of JReport security API, RoleUserProvider is used to provide customized relation information among roles and users. Except getting relation infomation among roles and users from customer's external security system, this interface also provide ability to modify relation information among roles and users in customer's external security system.

Since:
version 8

Method Summary
 void addUserToRole(java.lang.String realmName, java.lang.String roleName, java.lang.String userName)
          Associate a user with specified role in customer's external security system.
 java.util.Iterator getUsersByRole(java.lang.String realmName, java.lang.String roleName)
          Get user names which associate with the specified role from cusotmer's external security system.
 boolean isEnableEdit()
          Indicates whether customer's external security system will be modified by invoking some methods in RoleUserRelationProvider.
In common cases, invokeing addUserToRole() or removeUserFromRole() 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 removeUserFromRole(java.lang.String realmName, java.lang.String roleName, java.lang.String userName)
          Remove association between specified role and user in customer's external security system.
 

Method Detail

getUsersByRole

java.util.Iterator getUsersByRole(java.lang.String realmName,
                                  java.lang.String roleName)
                                  throws NoSuchRoleException,
                                         JRCustomerException
Get user names which associate with the specified role from cusotmer's external security system.

Parameters:
realmName - the realm name
roleName - the role name.
Returns:
user names which associate with specified role.
Throws:
NoSuchRoleException - If there is no a role has 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 think should throw this error to JReport server security system.

addUserToRole

void addUserToRole(java.lang.String realmName,
                   java.lang.String roleName,
                   java.lang.String userName)
                   throws NoSuchRoleException,
                          NoSuchUserException,
                          UserExistsException,
                          JRCustomerException
Associate a user with specified role in customer's external security system.

Parameters:
realmName - the realm name
roleName - the role name which user will associate with
userName - the user name which will associate with specifiec role
Throws:
NoSuchRoleException - If specified role does not exist in customer's external security system.
NoSuchUserException - If specified user does not exist in customer's external security system.
UserExistsException - If the user has associated with specified role 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.

removeUserFromRole

void removeUserFromRole(java.lang.String realmName,
                        java.lang.String roleName,
                        java.lang.String userName)
                        throws NoSuchRoleException,
                               NoSuchUserException,
                               JRCustomerException
Remove association between specified role and user in customer's external security system.

Parameters:
realmName - the realm name
roleName - the parent role name
userName - the user name
Throws:
NoSuchRoleException - If specified role does not exist in customer's external security system.
NoSuchUserException - If specified user 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 RoleUserRelationProvider.
In common cases, invokeing addUserToRole() or removeUserFromRole() 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 addUserToRole() or removeUserFromRole(), this method should return false.
Return value of method isEditing() with paramter SecurityWebAdaptor.ACTION_EDIT_RELATION_ROLE_USER in jet.server.api.SecurityWebAdaptor is same with this method's return value.

Returns:
true if external security system will be affected by invoking addUserToRole() or removeUserFromRole(), otherwise return false.
See Also:
SecurityWebAdaptor