Class RBACHome


  • public final class RBACHome
    extends java.lang.Object
    This class provides instances management methods (create, find, ...) for RBAC objects
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static RBAC create​(RBAC rBAC)
      Creation of an instance of rBAC
      static java.util.Collection<RBAC> findAll()
      Returns a collection of rBACs objects
      static java.util.Collection<RBAC> findByPermissionAndRoles​(java.lang.String strPermission, java.util.Collection<java.lang.String> roles)
      Find all entries for a given permission and collection of roles
      static java.util.Collection<RBAC> findByPermissionsAndRoles​(java.util.Collection<java.lang.String> permissions, java.util.Collection<java.lang.String> roles)
      Find all entries for a given collection of permissions and roles
      static RBAC findByPrimaryKey​(int nKey)
      Returns an instance of a rBAC whose identifier is specified in parameter
      static java.util.Collection<RBAC> findResourcesByCode​(java.lang.String strRoleKey)
      Find all the entries for a given role key
      static java.util.Collection<java.lang.String> findRoleKeys​(java.lang.String strTypeCode, java.lang.String strId, java.lang.String strPermission)
      Gets all role keys
      static void remove​(int nKey)
      Remove the RBAC whose identifier is specified in parameter
      static void removeForResource​(java.lang.String strResourceType, java.lang.String strResourceId)
      Remove all the entries of the given resource type and the given resource id
      static void removeForRoleKey​(java.lang.String strRoleKey)
      Remove all the entries of the given role key
      static RBAC update​(RBAC rBAC)
      Update of the rBAC which is specified in parameter
      static void updateRoleKey​(java.lang.String strOldRoleKey, java.lang.String strNewRoleKey)
      Update the role key of all the entries of a given role key
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • create

        public static RBAC create​(RBAC rBAC)
        Creation of an instance of rBAC
        Parameters:
        rBAC - The instance of the rBAC which contains the informations to store
        Returns:
        The instance of rBAC which has been created with its primary key.
      • update

        public static RBAC update​(RBAC rBAC)
        Update of the rBAC which is specified in parameter
        Parameters:
        rBAC - The instance of the rBAC which contains the data to store
        Returns:
        The instance of the rBAC which has been updated
      • remove

        public static void remove​(int nKey)
        Remove the RBAC whose identifier is specified in parameter
        Parameters:
        nKey - The Primary key of the rBAC to remove
      • findByPrimaryKey

        public static RBAC findByPrimaryKey​(int nKey)
        Returns an instance of a rBAC whose identifier is specified in parameter
        Parameters:
        nKey - The Primary key of the rBAC
        Returns:
        An instance of rBAC
      • findAll

        public static java.util.Collection<RBAC> findAll()
        Returns a collection of rBACs objects
        Returns:
        A collection of rBACs
      • findResourcesByCode

        public static java.util.Collection<RBAC> findResourcesByCode​(java.lang.String strRoleKey)
        Find all the entries for a given role key
        Parameters:
        strRoleKey - the role key to search for
        Returns:
        A collection of rBACs
      • updateRoleKey

        public static void updateRoleKey​(java.lang.String strOldRoleKey,
                                         java.lang.String strNewRoleKey)
        Update the role key of all the entries of a given role key
        Parameters:
        strOldRoleKey - the role key to update
        strNewRoleKey - the new role key
      • findRoleKeys

        public static java.util.Collection<java.lang.String> findRoleKeys​(java.lang.String strTypeCode,
                                                                          java.lang.String strId,
                                                                          java.lang.String strPermission)
        Gets all role keys
        Parameters:
        strTypeCode - The code type
        strId - The ID
        strPermission - The permission
        Returns:
        A collection of role keys
      • findByPermissionAndRoles

        public static java.util.Collection<RBAC> findByPermissionAndRoles​(java.lang.String strPermission,
                                                                          java.util.Collection<java.lang.String> roles)
        Find all entries for a given permission and collection of roles
        Parameters:
        strPermission - the permission
        roles - the roles
        Returns:
        a collection of matching RBACs
      • findByPermissionsAndRoles

        public static java.util.Collection<RBAC> findByPermissionsAndRoles​(java.util.Collection<java.lang.String> permissions,
                                                                           java.util.Collection<java.lang.String> roles)
        Find all entries for a given collection of permissions and roles
        Parameters:
        permissions - the permissions
        roles - the roles
        Returns:
        a collection of matching RBACs
      • removeForRoleKey

        public static void removeForRoleKey​(java.lang.String strRoleKey)
        Remove all the entries of the given role key
        Parameters:
        strRoleKey - the role key of the entries to remove
      • removeForResource

        public static void removeForResource​(java.lang.String strResourceType,
                                             java.lang.String strResourceId)
        Remove all the entries of the given resource type and the given resource id
        Parameters:
        strResourceType - the type of the resource
        strResourceId - the id of the resource