OSID Logo
OSID Specifications
authentication package
Version 3.0.0
Release Candidate Preview
Interfaceosid.authentication.AgentQuery
Implementsosid.OsidObjectQuery
Description

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);
                     
                                 
                     
                
MethodmatchResourceId
Description

Sets the resource Id for this query.

Parametersosid.id.IdagencyIda resource Id
booleanmatch true for a positive match, false for a negative match
ErrorsNULL_ARGUMENT agencyId is null
CompliancemandatoryThis method must be implemented.
MethodclearResourceIdTerms
Description

Clears the resource Id terms.

CompliancemandatoryThis method must be implemented.
MethodsupportsResourceQuery
Description

Tests if a ResourceQuery is available.

Returnboolean true if a resource query is available, false otherwise
CompliancemandatoryThis method must be implemented.
MethodgetResourceQuery
Description

Gets the query for a resource. Multiple retrievals produce a nested OR term.

Returnosid.resource.ResourceQuerythe resource query
ErrorsUNIMPLEMENTED supportsResourceQuery() is false
ComplianceoptionalThis method must be implemented if supportsResourceQuery() is true.
MethodmatchAnyResource
Description

Matches agents with any resource.

Parametersbooleanmatch true if to match agents with a resource, false to match agents with no resource
CompliancemandatoryThis method must be implemented.
MethodclearResourceTerms
Description

Clears the resource terms.

CompliancemandatoryThis method must be implemented.
MethodmatchAgencyId
Description

Sets the agency Id for this query.

Parametersosid.id.IdagencyIdan agency Id
booleanmatch true for a positive match, false for negative match
ErrorsNULL_ARGUMENT agencyId is null
CompliancemandatoryThis method must be implemented.
MethodclearAgencyIdTerms
Description

Clears the agency Id terms.

CompliancemandatoryThis method must be implemented.
MethodsupportsAgencyQuery
Description

Tests if an AgencyQuery is available.

Returnboolean true if an agency query is available, false otherwise
CompliancemandatoryThis method must be implemented.
MethodgetAgencyQuery
Description

Gets the query for an agency. Multiple retrievals produce a nested OR term.

Returnosid.authentication.AgencyQuerythe agency query
ErrorsUNIMPLEMENTED supportsAgencyQuery() is false
ComplianceoptionalThis method must be implemented if supportsAgencyQuery() is true.
MethodclearAgencyTerms
Description

Clears the agency terms.

CompliancemandatoryThis method must be implemented.
MethodgetAgentQueryRecord
Description

Gets the agent query record corresponding to the given Agent record Type. Multiple retrievals produce a nested OR term.

Parametersosid.type.TypeagentRecordTypean agent record type
Returnosid.authentication.records.AgentQueryRecordthe agent query record
ErrorsNULL_ARGUMENT agentRecordType is null
OPERATION_FAILEDunable to complete request
UNSUPPORTED hasRecordType(agentRecordType) is false
CompliancemandatoryThis method must be implemented.