Interface AgentQuery

All Superinterfaces:
Extensible, OsidBrowsableQuery, OsidExtensibleQuery, OsidIdentifiableQuery, OsidObjectQuery, OsidQuery, Suppliable

public interface AgentQuery extends OsidObjectQuery

This is the query for searching agents. Each method specifies an AND term while multiple invocations of the same method produce a nested OR.

The following example returns agents whose display name begins with "Tom" and whose "login name" is "tom" or "tjcoppet" in an agent record specified by companyAgentType.

Agent Query query = session.getAgentQuery();

query.matchDisplayName("Tom*", wildcardStringMatchType, true);

companyAgentQuery = query.getAgentQueryRecord(companyAgentType);
companyAgentQuery.matchLoginName("tom");
companyAgentQuery = query.getAgentQueryRecord(companyAgentType);
companyAgentQuery.matchLoginName("tjcoppet");

AgentList agentList = session.getAgentsByQuery(query);
  
  • Method Details

    • matchResourceId

      void matchResourceId(Id agencyId, boolean match)
      Sets the resource Id for this query.
      Parameters:
      agencyId - a resource Id
      match - true for a positive match, false for a negative match
      Throws:
      NullArgumentException - agencyId is null
      Compliance:
      mandatory - This method must be implemented.
    • clearResourceIdTerms

      void clearResourceIdTerms()
      Clears the resource Id terms.
      Compliance:
      mandatory - This method must be implemented.
    • supportsResourceQuery

      boolean supportsResourceQuery()
      Tests if a ResourceQuery is available.
      Returns:
      true if a resource query is available, false otherwise
      Compliance:
      mandatory - This method must be implemented.
    • getResourceQuery

      ResourceQuery getResourceQuery()
      Gets the query for a resource. Multiple retrievals produce a nested OR term.
      Returns:
      the resource query
      Throws:
      UnimplementedException - supportsResourceQuery() is false
      Compliance:
      optional - This method must be implemented if {@code supportsResourceQuery()} is {@code true}.
    • matchAnyResource

      void matchAnyResource(boolean match)
      Matches agents with any resource.
      Parameters:
      match - true if to match agents with a resource, false to match agents with no resource
      Compliance:
      mandatory - This method must be implemented.
    • clearResourceTerms

      void clearResourceTerms()
      Clears the resource terms.
      Compliance:
      mandatory - This method must be implemented.
    • matchAgencyId

      void matchAgencyId(Id agencyId, boolean match)
      Sets the agency Id for this query.
      Parameters:
      agencyId - an agency Id
      match - true for a positive match, false for negative match
      Throws:
      NullArgumentException - agencyId is null
      Compliance:
      mandatory - This method must be implemented.
    • clearAgencyIdTerms

      void clearAgencyIdTerms()
      Clears the agency Id terms.
      Compliance:
      mandatory - This method must be implemented.
    • supportsAgencyQuery

      boolean supportsAgencyQuery()
      Tests if an AgencyQuery is available.
      Returns:
      true if an agency query is available, false otherwise
      Compliance:
      mandatory - This method must be implemented.
    • getAgencyQuery

      AgencyQuery getAgencyQuery()
      Gets the query for an agency. Multiple retrievals produce a nested OR term.
      Returns:
      the agency query
      Throws:
      UnimplementedException - supportsAgencyQuery() is false
      Compliance:
      optional - This method must be implemented if {@code supportsAgencyQuery()} is {@code true}.
    • clearAgencyTerms

      void clearAgencyTerms()
      Clears the agency terms.
      Compliance:
      mandatory - This method must be implemented.
    • getAgentQueryRecord

      AgentQueryRecord getAgentQueryRecord(Type agentRecordType) throws OperationFailedException
      Gets the agent query record corresponding to the given Agent record Type.Multiple retrievals produce a nested OR term.
      Parameters:
      agentRecordType - an agent record type
      Returns:
      the agent query record
      Throws:
      NullArgumentException - agentRecordType is null
      OperationFailedException - unable to complete request
      UnsupportedException - hasRecordType(agentRecordType) is false
      Compliance:
      mandatory - This method must be implemented.