Interface AuthorityDAO

  • All Known Implementing Classes:
    AuthorityDAOImpl

    public interface AuthorityDAO
    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      void addAuthority​(java.util.Collection<java.lang.String> parentNames, java.lang.String childName)
      Add a child authority to the given parent authorities
      void addAuthorityToZones​(java.lang.String authorityName, java.util.Set<java.lang.String> zones)
      Add an authority to zones
      boolean authorityExists​(java.lang.String name)
      Test if an authority already exists.
      void createAuthority​(java.lang.String name, java.lang.String authorityDisplayName, java.util.Set<java.lang.String> authorityZones)
      Create an authority.
      void deleteAuthority​(java.lang.String name)
      Delete an authority.
      java.util.Set<java.lang.String> findAuthorities​(org.alfresco.service.cmr.security.AuthorityType type, java.lang.String parentAuthority, boolean immediate, java.lang.String displayNamePattern, java.lang.String zoneName)
      Find authorities by display name pattern.
      java.util.Set<java.lang.String> getAllAuthoritiesInZone​(java.lang.String zoneName, org.alfresco.service.cmr.security.AuthorityType type)
      Gets the names of all authorities in a zone, optionally filtered by type.
      org.alfresco.query.PagingResults<java.lang.String> getAuthorities​(org.alfresco.service.cmr.security.AuthorityType type, java.lang.String zoneName, java.lang.String displayNameFilter, boolean sortByDisplayName, boolean sortAscending, org.alfresco.query.PagingRequest pagingRequest)
      Get authority names by type and/or zone (both cannot be null).
      org.alfresco.query.PagingResults<AuthorityInfo> getAuthoritiesInfo​(org.alfresco.service.cmr.security.AuthorityType type, java.lang.String zoneName, java.lang.String displayNameFilter, java.lang.String sortBy, boolean sortAscending, org.alfresco.query.PagingRequest pagingRequest)
      Get AuthorityInfo by type and/or zone (both cannot be null).
      java.lang.String getAuthorityDisplayName​(java.lang.String authorityName)
      Get the display name for an authority
      java.lang.String getAuthorityName​(org.alfresco.service.cmr.repository.NodeRef authorityRef)
      Gets the name for the given authority node
      org.alfresco.service.cmr.repository.NodeRef getAuthorityNodeRefOrNull​(java.lang.String name)
      Get a node ref for the authority if one exists
      java.util.Set<java.lang.String> getAuthorityZones​(java.lang.String name)
      Gets the name of the zone containing the specified authority.
      java.util.Set<java.lang.String> getContainedAuthorities​(org.alfresco.service.cmr.security.AuthorityType type, java.lang.String parentName, boolean immediate)
      Get contained authorities.
      java.util.Set<java.lang.String> getContainingAuthorities​(org.alfresco.service.cmr.security.AuthorityType type, java.lang.String name, boolean immediate)
      Get the authorities that contain the one given.
      java.util.Set<java.lang.String> getContainingAuthoritiesInZone​(org.alfresco.service.cmr.security.AuthorityType type, java.lang.String authority, java.lang.String zoneName, AuthorityService.AuthorityFilter filter, int size)
      Get a set of authorities with varying filter criteria
      long getGroupCount()
      Count groups i.e.
      java.lang.String getName​(org.alfresco.service.cmr.security.AuthorityType type, java.lang.String shortName)
      Create the full identifier for an authority given its short name and type.
      org.alfresco.service.cmr.repository.NodeRef getOrCreateZone​(java.lang.String zoneName)
      Gets or creates an authority zone node with the specified name
      long getPersonCount()
      Count people i.e.
      java.util.Set<java.lang.String> getRootAuthorities​(org.alfresco.service.cmr.security.AuthorityType type, java.lang.String zoneName)
      Get root authorities
      java.lang.String getShortName​(java.lang.String name)
      Extract the short name of an authority from its full identifier.
      org.alfresco.service.cmr.repository.NodeRef getZone​(java.lang.String zoneName)
      Gets an authority zone node with the specified name
      boolean isAuthorityContained​(java.lang.String authority, java.lang.String authorityToFind, java.util.Set<java.lang.String> positiveHits, java.util.Set<java.lang.String> negativeHits)  
      void removeAuthority​(java.lang.String parentName, java.lang.String childName)
      Remove an authority.
      void removeAuthority​(java.lang.String parentName, java.lang.String childName, boolean cacheRefresh)
      Remove an authority without authorityBridgeTableCache refresh.
      void removeAuthorityFromZones​(java.lang.String authorityName, java.util.Set<java.lang.String> zones)
      Remove an authority from zones.
      void setAuthorityDisplayName​(java.lang.String authorityName, java.lang.String authorityDisplayName)
      Set the display name for an authority
    • Method Detail

      • getPersonCount

        long getPersonCount()
        Count people i.e. nodes of type cm:person.
        Returns:
        the number of people
      • getGroupCount

        long getGroupCount()
        Count groups i.e. nodes of type cm:authorityContainer.
        Returns:
        the number of groups
      • addAuthority

        void addAuthority​(java.util.Collection<java.lang.String> parentNames,
                          java.lang.String childName)
        Add a child authority to the given parent authorities
      • createAuthority

        void createAuthority​(java.lang.String name,
                             java.lang.String authorityDisplayName,
                             java.util.Set<java.lang.String> authorityZones)
        Create an authority.
      • deleteAuthority

        void deleteAuthority​(java.lang.String name)
        Delete an authority.
      • getContainedAuthorities

        java.util.Set<java.lang.String> getContainedAuthorities​(org.alfresco.service.cmr.security.AuthorityType type,
                                                                java.lang.String parentName,
                                                                boolean immediate)
        Get contained authorities.
        Parameters:
        parentName - the name of the containing authority
      • isAuthorityContained

        boolean isAuthorityContained​(java.lang.String authority,
                                     java.lang.String authorityToFind,
                                     java.util.Set<java.lang.String> positiveHits,
                                     java.util.Set<java.lang.String> negativeHits)
      • removeAuthority

        void removeAuthority​(java.lang.String parentName,
                             java.lang.String childName)
        Remove an authority.
      • removeAuthority

        void removeAuthority​(java.lang.String parentName,
                             java.lang.String childName,
                             boolean cacheRefresh)
        Remove an authority without authorityBridgeTableCache refresh.
      • getContainingAuthorities

        java.util.Set<java.lang.String> getContainingAuthorities​(org.alfresco.service.cmr.security.AuthorityType type,
                                                                 java.lang.String name,
                                                                 boolean immediate)
        Get the authorities that contain the one given.
      • getContainingAuthoritiesInZone

        java.util.Set<java.lang.String> getContainingAuthoritiesInZone​(org.alfresco.service.cmr.security.AuthorityType type,
                                                                       java.lang.String authority,
                                                                       java.lang.String zoneName,
                                                                       AuthorityService.AuthorityFilter filter,
                                                                       int size)
        Get a set of authorities with varying filter criteria
        Parameters:
        type - authority type or null for all types
        authority - if non-null, only return those authorities who contain this authority
        zoneName - if non-null, only include authorities in the named zone
        filter - optional callback to apply further filter criteria or null
        size - if greater than zero, the maximum results to return. The search strategy used is varied depending on this number.
        Returns:
        a set of authorities
      • getAuthoritiesInfo

        org.alfresco.query.PagingResults<AuthorityInfo> getAuthoritiesInfo​(org.alfresco.service.cmr.security.AuthorityType type,
                                                                           java.lang.String zoneName,
                                                                           java.lang.String displayNameFilter,
                                                                           java.lang.String sortBy,
                                                                           boolean sortAscending,
                                                                           org.alfresco.query.PagingRequest pagingRequest)
        Get AuthorityInfo by type and/or zone (both cannot be null).
        Parameters:
        sortBy - either "displayName", "shortName", "authorityName" or null if no sorting.
      • getAuthorities

        org.alfresco.query.PagingResults<java.lang.String> getAuthorities​(org.alfresco.service.cmr.security.AuthorityType type,
                                                                          java.lang.String zoneName,
                                                                          java.lang.String displayNameFilter,
                                                                          boolean sortByDisplayName,
                                                                          boolean sortAscending,
                                                                          org.alfresco.query.PagingRequest pagingRequest)
        Get authority names by type and/or zone (both cannot be null).
      • authorityExists

        boolean authorityExists​(java.lang.String name)
        Test if an authority already exists.
      • getAuthorityNodeRefOrNull

        org.alfresco.service.cmr.repository.NodeRef getAuthorityNodeRefOrNull​(java.lang.String name)
        Get a node ref for the authority if one exists
      • getAuthorityName

        java.lang.String getAuthorityName​(org.alfresco.service.cmr.repository.NodeRef authorityRef)
        Gets the name for the given authority node
        Parameters:
        authorityRef - authority node
      • getAuthorityDisplayName

        java.lang.String getAuthorityDisplayName​(java.lang.String authorityName)
        Get the display name for an authority
        Returns:
        the display name
      • setAuthorityDisplayName

        void setAuthorityDisplayName​(java.lang.String authorityName,
                                     java.lang.String authorityDisplayName)
        Set the display name for an authority
      • getRootAuthorities

        java.util.Set<java.lang.String> getRootAuthorities​(org.alfresco.service.cmr.security.AuthorityType type,
                                                           java.lang.String zoneName)
        Get root authorities
      • findAuthorities

        java.util.Set<java.lang.String> findAuthorities​(org.alfresco.service.cmr.security.AuthorityType type,
                                                        java.lang.String parentAuthority,
                                                        boolean immediate,
                                                        java.lang.String displayNamePattern,
                                                        java.lang.String zoneName)
        Find authorities by display name pattern.
        Parameters:
        parentAuthority - if non-null, will look only for authorities who are a child of the named parent
        immediate - if true then only search root groups if parentAuthority is null, or immediate children of parentAuthority if it is non-null.
        zoneName - - may be null to indicate all zones
      • getShortName

        java.lang.String getShortName​(java.lang.String name)
        Extract the short name of an authority from its full identifier.
      • getName

        java.lang.String getName​(org.alfresco.service.cmr.security.AuthorityType type,
                                 java.lang.String shortName)
        Create the full identifier for an authority given its short name and type.
      • getOrCreateZone

        org.alfresco.service.cmr.repository.NodeRef getOrCreateZone​(java.lang.String zoneName)
        Gets or creates an authority zone node with the specified name
        Parameters:
        zoneName - the zone name
        Returns:
        reference to the zone node
      • getZone

        org.alfresco.service.cmr.repository.NodeRef getZone​(java.lang.String zoneName)
        Gets an authority zone node with the specified name
        Parameters:
        zoneName - the zone name
        Returns:
        reference to the zone node ot null if the zone does not exists
      • getAuthorityZones

        java.util.Set<java.lang.String> getAuthorityZones​(java.lang.String name)
        Gets the name of the zone containing the specified authority.
        Parameters:
        name - the authority long name
        Returns:
        the set of names of all zones containing the specified authority, an empty set if the authority exists but has no zone, or null if the authority does not exist.
      • getAllAuthoritiesInZone

        java.util.Set<java.lang.String> getAllAuthoritiesInZone​(java.lang.String zoneName,
                                                                org.alfresco.service.cmr.security.AuthorityType type)
        Gets the names of all authorities in a zone, optionally filtered by type.
        Parameters:
        zoneName - the zone name
        type - the authority type to filter by or null for all authority types
        Returns:
        the names of all authorities in a zone, optionally filtered by type
      • addAuthorityToZones

        void addAuthorityToZones​(java.lang.String authorityName,
                                 java.util.Set<java.lang.String> zones)
        Add an authority to zones
      • removeAuthorityFromZones

        void removeAuthorityFromZones​(java.lang.String authorityName,
                                      java.util.Set<java.lang.String> zones)
        Remove an authority from zones.