org.wso2.usermanager
Interface Realm

All Known Implementing Classes:
AcegiRealm, DefaultRealm, JDBCRealm, LDAPRealm

public interface Realm


Method Summary
 void addRole(java.lang.String roleName)
          Add a role to the userstore
 void addUser(java.lang.String userName, java.lang.Object credential)
          Add a user to the userstore.
 void addUserToRole(java.lang.String userName, java.lang.String roleName)
          Adds a User to the Role
 boolean authenticate(java.lang.String userName, java.lang.Object credentials)
          Authenticates a user against a userstore
 void authorizeRole(java.lang.String roleName, java.lang.String resourceId, java.lang.String action)
          Allows the role to perform the given action on the given resource
 void authorizeUser(java.lang.String userName, java.lang.String resourceId, java.lang.String action)
          Allows the user to perform the given action on the given resource
 void clearResourceAuthorizations(java.lang.String resourceId)
          Removes all authorizations specified on a resource.
 void clearRoleAuthorization(java.lang.String roleName, java.lang.String resourceId, java.lang.String action)
          Removes the "role, action, resource" relationship.
 void clearUserAuthorization(java.lang.String userName, java.lang.String resourceId, java.lang.String action)
          Removes the "user, action, resource" relationship.
 void copyAuthorizations(java.lang.String fromResourceId, java.lang.String toResourceId)
          Copies all authorization of "fromResourceId" to "toResourceId".
 void deleteRole(java.lang.String roleName)
          Delete role from userstore given the rolename.
 void deleteUser(java.lang.String userName)
          Deletes a user in the userstore
 void denyRole(java.lang.String roleName, java.lang.String resourceId, java.lang.String action)
          Blocks the role performing the given action on the given resource
 void denyUser(java.lang.String userName, java.lang.String resourceId, java.lang.String action)
          Blocks the user performing the given action on the given resource
 java.lang.String[] getAllRoleNames()
          Returns an array of all rolenames int the userstore
 java.lang.String[] getAllUserNames()
          Returns an array of Usernames from the userstore
 java.lang.String[] getAuthorizedRolesForResource(java.lang.String resourceId, java.lang.String action)
          Returns a list of roles authorized to perform an action on a resource
 java.lang.String[] getAuthorizedUsersForResource(java.lang.String resourceId, java.lang.String action)
          Returns a list of users authorized to perform an action on a resource
 java.lang.Object getRealmConfiguration()
          Returns the realm configuration bean.
 java.util.Map getRoleProperties(java.lang.String roleName)
          Gets role property
 java.util.Map getUserProperties(java.lang.String userName)
          Gets user property
 java.lang.String[] getUserRoles(java.lang.String userName)
          Returns an array of Role given a user name
 void init(java.lang.Object configBean)
          Initializes the realm using the properties from the configuration bean passed in.
 boolean isRoleAuthorized(java.lang.String roleName, java.lang.String resourceId, java.lang.String action)
          Checks whether the role is allowed to perform the given action on the given resource
 boolean isUserAuthorized(java.lang.String userName, java.lang.String resourceId, java.lang.String action)
          Checks whether the user is allowed to perform the given action on the given resource
 void removeUserFromRole(java.lang.String userName, java.lang.String roleName)
          Removes a user from role
 void setRoleProperties(java.lang.String roleName, java.util.Map properties)
          Sets role property
 void setUserProperties(java.lang.String userName, java.util.Map properties)
          Sets user property
 void updateUser(java.lang.String userName, java.lang.Object credential)
          Updates a user in the userstore.
 

Method Detail

getRealmConfiguration

java.lang.Object getRealmConfiguration()
                                       throws UserManagerException
Returns the realm configuration bean.

Throws:
UserManagerException - TODO

init

void init(java.lang.Object configBean)
          throws UserManagerException
Initializes the realm using the properties from the configuration bean passed in.

Throws:
UserManagerException - TODO

addUser

void addUser(java.lang.String userName,
             java.lang.Object credential)
             throws UserManagerException
Add a user to the userstore.

Throws:
UserManagerException

updateUser

void updateUser(java.lang.String userName,
                java.lang.Object credential)
                throws UserManagerException
Updates a user in the userstore. Updates his password and properties.

Throws:
UserManagerException

deleteUser

void deleteUser(java.lang.String userName)
                throws UserManagerException
Deletes a user in the userstore

Throws:
UserManagerException

getUserProperties

java.util.Map getUserProperties(java.lang.String userName)
                                throws UserManagerException
Gets user property

Throws:
UserManagerException

setUserProperties

void setUserProperties(java.lang.String userName,
                       java.util.Map properties)
                       throws UserManagerException
Sets user property

Throws:
UserManagerException

getAllUserNames

java.lang.String[] getAllUserNames()
                                   throws UserManagerException
Returns an array of Usernames from the userstore

Throws:
UserManagerException

addRole

void addRole(java.lang.String roleName)
             throws UserManagerException
Add a role to the userstore

Throws:
UserManagerException

deleteRole

void deleteRole(java.lang.String roleName)
                throws UserManagerException
Delete role from userstore given the rolename.

Throws:
UserManagerException

getRoleProperties

java.util.Map getRoleProperties(java.lang.String roleName)
                                throws UserManagerException
Gets role property

Throws:
UserManagerException

setRoleProperties

void setRoleProperties(java.lang.String roleName,
                       java.util.Map properties)
                       throws UserManagerException
Sets role property

Throws:
UserManagerException

getAllRoleNames

java.lang.String[] getAllRoleNames()
                                   throws UserManagerException
Returns an array of all rolenames int the userstore

Throws:
UserManagerException

getUserRoles

java.lang.String[] getUserRoles(java.lang.String userName)
                                throws UserManagerException
Returns an array of Role given a user name

Throws:
UserManagerException

addUserToRole

void addUserToRole(java.lang.String userName,
                   java.lang.String roleName)
                   throws UserManagerException
Adds a User to the Role

Throws:
UserManagerException

removeUserFromRole

void removeUserFromRole(java.lang.String userName,
                        java.lang.String roleName)
                        throws UserManagerException
Removes a user from role

Throws:
UserManagerException

authenticate

boolean authenticate(java.lang.String userName,
                     java.lang.Object credentials)
                     throws UserManagerException
Authenticates a user against a userstore

Throws:
UserManagerException

authorizeUser

void authorizeUser(java.lang.String userName,
                   java.lang.String resourceId,
                   java.lang.String action)
                   throws UserManagerException
Allows the user to perform the given action on the given resource

Throws:
UserManagerException

denyUser

void denyUser(java.lang.String userName,
              java.lang.String resourceId,
              java.lang.String action)
              throws UserManagerException
Blocks the user performing the given action on the given resource

Throws:
UserManagerException

isUserAuthorized

boolean isUserAuthorized(java.lang.String userName,
                         java.lang.String resourceId,
                         java.lang.String action)
                         throws UserManagerException
Checks whether the user is allowed to perform the given action on the given resource

Throws:
UserManagerException

clearUserAuthorization

void clearUserAuthorization(java.lang.String userName,
                            java.lang.String resourceId,
                            java.lang.String action)
                            throws UserManagerException
Removes the "user, action, resource" relationship. User, action and resource will exist, but the relationship will be removed.

Throws:
UserManagerException

authorizeRole

void authorizeRole(java.lang.String roleName,
                   java.lang.String resourceId,
                   java.lang.String action)
                   throws UserManagerException
Allows the role to perform the given action on the given resource

Throws:
UserManagerException

denyRole

void denyRole(java.lang.String roleName,
              java.lang.String resourceId,
              java.lang.String action)
              throws UserManagerException
Blocks the role performing the given action on the given resource

Throws:
UserManagerException

isRoleAuthorized

boolean isRoleAuthorized(java.lang.String roleName,
                         java.lang.String resourceId,
                         java.lang.String action)
                         throws UserManagerException
Checks whether the role is allowed to perform the given action on the given resource

Throws:
UserManagerException

clearRoleAuthorization

void clearRoleAuthorization(java.lang.String roleName,
                            java.lang.String resourceId,
                            java.lang.String action)
                            throws UserManagerException
Removes the "role, action, resource" relationship. Role, action and resource will exist, but the relationship will be removed.

Throws:
UserManagerException

clearResourceAuthorizations

void clearResourceAuthorizations(java.lang.String resourceId)
                                 throws UserManagerException
Removes all authorizations specified on a resource.

Throws:
UserManagerException

getAuthorizedUsersForResource

java.lang.String[] getAuthorizedUsersForResource(java.lang.String resourceId,
                                                 java.lang.String action)
                                                 throws UserManagerException
Returns a list of users authorized to perform an action on a resource

Throws:
UserManagerException

getAuthorizedRolesForResource

java.lang.String[] getAuthorizedRolesForResource(java.lang.String resourceId,
                                                 java.lang.String action)
                                                 throws UserManagerException
Returns a list of roles authorized to perform an action on a resource

Throws:
UserManagerException

copyAuthorizations

void copyAuthorizations(java.lang.String fromResourceId,
                        java.lang.String toResourceId)
                        throws UserManagerException
Copies all authorization of "fromResourceId" to "toResourceId". All means all - including user authorizations and role authorizations.

Throws:
UserManagerException