Interface Source

All Known Implementing Classes:
BaseSourceAdapter, EntitySourceAdapter, ExternalSubjectAutoSourceAdapter, GrouperJdbcSourceAdapter, GrouperJdbcSourceAdapter2, GrouperJdbcSourceAdapter2_5, GrouperJndiSourceAdapter, GrouperLdapSourceAdapter2_5, GrouperSourceAdapter, HelperGrouperJdbcSourceAdapter, HelperGrouperJdbcSourceAdapter2, HelperGrouperJndiSourceAdapter, InternalSourceAdapter, JDBCSourceAdapter, JDBCSourceAdapter2, JNDISourceAdapter, JNDISourceAdapterLegacy, LazySource, LdapSourceAdapter, NullSourceAdapter

public interface Source
Source to find and get Subjects and their attributes. You should probably extend BaseSourceAdapter instead of implement this interface
  • Method Details

    • loggingStart

      void loggingStart()
      start logging the source low level actions
    • loggingStop

      String loggingStop()
      stop logging and get the output
    • retrieveAllSubjectIds

      Set<String> retrieveAllSubjectIds()
      get all subject ids
      Returns:
      all subjectIds
      Throws:
      UnsupportedOperationException - if not implemented
    • getSubjectStatusConfig

      SubjectStatusConfig getSubjectStatusConfig()
      get the config bean for this source
      Returns:
      the config bean for this source
    • getId

      String getId()
      Returns the ID of this source.
      Returns:
      id
    • setId

      void setId(String id)
      Sets the ID of this source.
      Parameters:
      id -
    • getName

      String getName()
      Returns the name of this source.
      Returns:
      name
    • setName

      void setName(String name)
      Sets the name of this source.
      Parameters:
      name -
    • getSubjectTypes

      Set<SubjectType> getSubjectTypes()
      Gets the SubjectTypes supported by this source.
      Returns:
      set
    • getSubject

      Deprecated.
      use the overload instead
      Gets a Subject by its ID.
      Parameters:
      id -
      Returns:
      subject
      Throws:
      SubjectNotFoundException
      SubjectNotUniqueException
    • getSubjectByIdentifier

      Deprecated.
      use the overload instead
      Gets a Subject by other well-known identifiers, aside from the subject ID, for example, login ID.
      Parameters:
      id -
      Returns:
      subject
      Throws:
      SubjectNotFoundException
      SubjectNotUniqueException
    • getSubject

      Subject getSubject(String id, boolean exceptionIfNull) throws SubjectNotFoundException, SubjectNotUniqueException
      Gets a Subject by its ID.
      Parameters:
      id -
      exceptionIfNull - if SubjectNotFoundException should be throws if the subject is null, or if null should be returned
      Returns:
      subject
      Throws:
      SubjectNotFoundException
      SubjectNotUniqueException
    • getSubjectsByIds

      Map<String,Subject> getSubjectsByIds(Collection<String> ids)
      Get subjects by ids. Note, if the subjects arent found or arent unique, they wont be returned. Duplicates are ok on the input, but will return one output.
      Parameters:
      ids -
      Returns:
      a map of results never null indexed by the id
    • getSubjectsByIdentifiers

      Map<String,Subject> getSubjectsByIdentifiers(Collection<String> identifiers)
      Get subjects by identifiers. Note, if the subjects arent found or arent unique, they wont be returned. Identifiers are unique ways to refer to a subject that isnt its id (e.g. netid). Duplicates are ok on the input, but will return one output.
      Parameters:
      identifiers -
      Returns:
      a map of results never null indexed by the identifiers
    • getSubjectsByIdsOrIdentifiers

      Map<String,Subject> getSubjectsByIdsOrIdentifiers(Collection<String> idsOrIdentifiers)
      Get subjects by ids or identifiers. Note, if the subjects arent found or arent unique, they wont be returned. Identifiers are unique ways to refer to a subject that isnt its id (e.g. netid). Duplicates are ok on the input, but will return one output.
      Parameters:
      idsOrIdentifiers - each string could be a subject id or identifier
      Returns:
      a map of results never null indexed by the id or identifier that was passed in. Note, the same subject could be returned twice if looked up by id and identifier (two inputs)
    • getSubjectByIdOrIdentifier

      Subject getSubjectByIdOrIdentifier(String idOrIdentifier, boolean exceptionIfNull) throws SubjectNotFoundException, SubjectNotUniqueException
      find by id or identifier. pass in either an id or an identifier
      Parameters:
      idOrIdentifier -
      exceptionIfNull - if SubjectNotFoundException or null
      Returns:
      the subject
      Throws:
      SubjectNotFoundException
      SubjectNotUniqueException
    • getSubjectByIdentifier

      Subject getSubjectByIdentifier(String id, boolean exceptionIfNull) throws SubjectNotFoundException, SubjectNotUniqueException
      Gets a Subject by other well-known identifiers, aside from the subject ID, for example, login ID.
      Parameters:
      id -
      exceptionIfNull -
      Returns:
      subject
      Throws:
      SubjectNotFoundException
      SubjectNotUniqueException
    • search

      Set<Subject> search(String searchValue)
      Unstructured search for Subjects. Each implementation utilizes its own search algorithm tailored to the Subject repository and schema. Note if config param: throwErrorOnFindAllFailure is false, then swallow and log exceptions
      Parameters:
      searchValue -
      Returns:
      set
    • init

      void init() throws SourceUnavailableException
      Called by SourceManager when it loads this source.
      Throws:
      SourceUnavailableException
    • checkConfig

      void checkConfig()
      make sure the config is ok, and log descriptive errors if not
    • printConfig

      String printConfig()
      in the startup on this i2mi app, print helpful and brief info about this source
      Returns:
      the info
    • getInitParam

      String getInitParam(String name1)
      get the init param e.g. from the subject.properties
      Parameters:
      name1 -
      Returns:
      param
    • initParams

      Properties initParams()
      get the init params e.g. from the subject.properties
      Returns:
      params
    • getInternalAttributes

      Set<String> getInternalAttributes()
      Get a set of attributes that are marked as being internal attributes. Note, these will be in lower case
      Returns:
      set to lower case
    • getSubjectIdentifierAttributes

      Map<Integer,String> getSubjectIdentifierAttributes()
      Get the names of attributes that are subject identifiers. This only returns the first
      Returns:
      subject identifiers
    • getSubjectIdentifierAttributesAll

      Map<Integer,String> getSubjectIdentifierAttributesAll()
      Get all the names of attributes that are subject identifiers.
      Returns:
      subject identifiers
    • getSortAttributes

      Map<Integer,String> getSortAttributes()
      Get the names of attributes used for sorting.
      Returns:
      sort attributes in lower case
    • getSearchAttributes

      Map<Integer,String> getSearchAttributes()
      Get the names of attributes used for searching.
      Returns:
      search attributes in lower case
    • searchPage

      SearchPageResult searchPage(String searchValue)
      Unstructured search for Subjects. Each implementation utilizes its own search algorithm tailored to the Subject repository and schema. Note if config param: throwErrorOnFindAllFailure is false, then swallow and log exceptions if maxPageSize is set in subject.properties, then only return max that many, and if there are more, set the tooManyResults flag
      Parameters:
      searchValue -
      Returns:
      results and if there are too many, never return null!!!
    • searchPage

      SearchPageResult searchPage(String searchValue, String realm)
      Unstructured search for Subjects. Each implementation utilizes its own search algorithm tailored to the Subject repository and schema. Note if config param: throwErrorOnFindAllFailure is false, then swallow and log exceptions if maxPageSize is set in subject.properties, then only return max that many, and if there are more, set the tooManyResults flag
      Parameters:
      realm - string value that sets the realm for the search. The source can implement various realms to account for permissions of the calling user
      searchValue -
      Returns:
      results and if there are too many, never return null!!!
    • getSubject

      Subject getSubject(String id, boolean exceptionIfNull, String realm) throws SubjectNotFoundException, SubjectNotUniqueException
      Gets a Subject by its ID.
      Parameters:
      id -
      realm - string value that sets the realm for the search. The source can implement various realms to account for permissions of the calling user
      exceptionIfNull - if SubjectNotFoundException should be throws if the subject is null, or if null should be returned
      Returns:
      subject
      Throws:
      SubjectNotFoundException
      SubjectNotUniqueException
    • getSubjectByIdentifier

      Subject getSubjectByIdentifier(String id, boolean exceptionIfNull, String realm) throws SubjectNotFoundException, SubjectNotUniqueException
      Gets a Subject by other well-known identifiers, aside from the subject ID, for example, login ID.
      Parameters:
      id -
      exceptionIfNull -
      realm - string value that sets the realm for the search. The source can implement various realms to account for permissions of the calling user
      Returns:
      subject
      Throws:
      SubjectNotFoundException
      SubjectNotUniqueException
    • getSubjectByIdOrIdentifier

      Subject getSubjectByIdOrIdentifier(String idOrIdentifier, boolean exceptionIfNull, String realm) throws SubjectNotFoundException, SubjectNotUniqueException
      find by id or identifier. pass in either an id or an identifier
      Parameters:
      idOrIdentifier -
      exceptionIfNull - if SubjectNotFoundException or null
      realm - string value that sets the realm for the search. The source can implement various realms to account for permissions of the calling user
      Returns:
      the subject
      Throws:
      SubjectNotFoundException
      SubjectNotUniqueException
    • getSubjectsByIdentifiers

      Map<String,Subject> getSubjectsByIdentifiers(Collection<String> identifiers, String realm)
      Get subjects by identifiers. Note, if the subjects arent found or arent unique, they wont be returned. Identifiers are unique ways to refer to a subject that isnt its id (e.g. netid). Duplicates are ok on the input, but will return one output.
      Parameters:
      identifiers -
      realm - string value that sets the realm for the search. The source can implement various realms to account for permissions of the calling user
      Returns:
      a map of results never null indexed by the identifiers
    • getSubjectsByIds

      Map<String,Subject> getSubjectsByIds(Collection<String> ids, String realm)
      Get subjects by ids. Note, if the subjects arent found or arent unique, they wont be returned. Duplicates are ok on the input, but will return one output.
      Parameters:
      ids -
      realm - string value that sets the realm for the search. The source can implement various realms to account for permissions of the calling user
      Returns:
      a map of results never null indexed by the id
    • getSubjectsByIdsOrIdentifiers

      Map<String,Subject> getSubjectsByIdsOrIdentifiers(Collection<String> idsOrIdentifiers, String realm)
      Get subjects by ids or identifiers. Note, if the subjects arent found or arent unique, they wont be returned. Identifiers are unique ways to refer to a subject that isnt its id (e.g. netid). Duplicates are ok on the input, but will return one output.
      Parameters:
      idsOrIdentifiers - each string could be a subject id or identifier
      realm - string value that sets the realm for the search. The source can implement various realms to account for permissions of the calling user
      Returns:
      a map of results never null indexed by the id or identifier that was passed in. Note, the same subject could be returned twice if looked up by id and identifier (two inputs)
    • search

      Set<Subject> search(String searchValue, String realm)
      Unstructured search for Subjects. Each implementation utilizes its own search algorithm tailored to the Subject repository and schema. Note if config param: throwErrorOnFindAllFailure is false, then swallow and log exceptions
      Parameters:
      searchValue -
      realm - string value that sets the realm for the search. The source can implement various realms to account for permissions of the calling user
      Returns:
      set
    • isEditable

      boolean isEditable()
      Returns:
      true if the source is editable otherwise false
    • isEnabled

      boolean isEnabled()
      Returns:
      true if the source is active otherwise false
    • getConfigId

      String getConfigId()
      Returns:
      configId for this source
    • setConfigId

      void setConfigId(String configId)
      set config id for this source
    • convertSubjectAttributeToSourceAttribute

      String convertSubjectAttributeToSourceAttribute(String nameOfSubjectAttribute)
    • convertSourceAttributeToSubjectAttribute

      String convertSourceAttributeToSubjectAttribute(String nameOfSourceAttribute)