Class ExtSourceGoogle

All Implemented Interfaces:
ExtSourceApi, ExtSourceSimpleApi, Serializable, Comparable<PerunBean>

public class ExtSourceGoogle extends ExtSourceImpl implements ExtSourceApi
Ext source implementation for Google Groups.
Author:
Sona Mastrakova
See Also:
  • Constructor Details

    • ExtSourceGoogle

      public ExtSourceGoogle()
  • Method Details

    • close

      public void close() throws ExtSourceUnsupportedOperationException
      Description copied from interface: ExtSourceSimpleApi
      If extSource needs to be closed, this method must be called.
      Specified by:
      close in interface ExtSourceSimpleApi
      Throws:
      ExtSourceUnsupportedOperationException
    • findSubjects

      public List<Map<String,String>> findSubjects(String searchString)
      Description copied from interface: ExtSourceApi
      Finds all subjects with attributes in the external source, that contains searchString.

      This method is used for getting all logins of subjects in external source with all possible attributes.

      Specified by:
      findSubjects in interface ExtSourceApi
      Parameters:
      searchString -
      Returns:
      list of maps, which contains attr_name->attr_value (for all extSource attributes)
    • findSubjectsLogins

      public List<Map<String,String>> findSubjectsLogins(String searchString) throws ExtSourceUnsupportedOperationException
      Description copied from interface: ExtSourceSimpleApi
      Finds all subjects logins in the external source, that contains searchString.

      This method is used for getting all logins of subjects in external source and then use them to searching in external source for other subjects attributes.

      Specified by:
      findSubjectsLogins in interface ExtSourceSimpleApi
      Parameters:
      searchString -
      Returns:
      list of maps, which contains attr_name->attr_value but only for login definition eg. login;MichalS
      Throws:
      ExtSourceUnsupportedOperationException
    • getDirectoryService

      public com.google.api.services.directory.Directory getDirectoryService()
      Build and returns a Directory service object authorized with the service accounts that act on behalf of the given user.
      Returns:
      Directory service object that is ready to make requests.
    • getDomainName

      public String getDomainName()
    • getGroupSubjects

      public List<Map<String,String>> getGroupSubjects(Map<String,String> attributes)
      Description copied from interface: ExtSourceSimpleApi
      Get the list of the subjects in the external group.
      Specified by:
      getGroupSubjects in interface ExtSourceSimpleApi
      Parameters:
      attributes - map of attributes used for quering the external source
      Returns:
      list of maps, which contains attr_name->attr_value, e.g. firstName->Michal
    • getSubjectByLogin

      public Map<String,String> getSubjectByLogin(String login) throws SubjectNotExistsException
      Description copied from interface: ExtSourceSimpleApi
      Finds subject from the external source by the primary login used in external source.
      Specified by:
      getSubjectByLogin in interface ExtSourceSimpleApi
      Parameters:
      login - login used in the external source
      Returns:
      map which contains attr_name -> attr_value, e.g. firstName->Michal
      Throws:
      SubjectNotExistsException - if the subject cannot be found
    • getSubjectsByLogins

      public Map<String, Map<String,String>> getSubjectsByLogins(List<String> logins)
      Description copied from interface: ExtSourceSimpleApi
      Finds subjects from the external source by their primary logins used in the external source. For most ext sources, this method is just a loop of `getSubjectByLogin`, but some, such as SQLExtSource, can implement a hefty optimization here. Instead of throwing a `SubjectNotExistsException`, this method just sets the subject as null for the corresponding login, leaving the caller to deal with this case.
      Specified by:
      getSubjectsByLogins in interface ExtSourceSimpleApi
      Parameters:
      logins - logins used in the external source
      Returns:
      map of logins to subject maps that contain attr_name -> attr_value, e.g. firstName->Michal
    • getSubjectGroups

      public List<Map<String,String>> getSubjectGroups(Map<String,String> attributes) throws ExtSourceUnsupportedOperationException
      Description copied from interface: ExtSourceSimpleApi
      Get the list of the subject groups in the external source.
      Specified by:
      getSubjectGroups in interface ExtSourceSimpleApi
      Parameters:
      attributes - map of attributes used for quering the external source
      Returns:
      list of maps, which contains attr name and attr value
      Throws:
      ExtSourceUnsupportedOperationException
    • getUsersSubjects

      public List<Map<String,String>> getUsersSubjects()
      Description copied from interface: ExtSourceSimpleApi
      Get the list of subjects from the external source.
      Specified by:
      getUsersSubjects in interface ExtSourceSimpleApi
      Returns:
      list of maps, which contains attr_name->attr_value, e.g. firstName->Michal