Queries¶
Agent Query¶
-
class
dlkit.authentication.queries.
AgentQuery
¶ Bases:
dlkit.osid.queries.OsidObjectQuery
This is the query for searching agents.
Each method specifies an
AND
term while multiple invocations of the same method produce a nestedOR
.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);
-
match_resource_id
(agency_id, match)¶ Sets the resource
Id
for this query.Parameters: - agency_id (
osid.id.Id
) – a resourceId
- match (
boolean
) –true
for a positive match,false
for a negative match
Raise: NullArgument
–agency_id
isnull
compliance: mandatory – This method must be implemented.
- agency_id (
-
resource_id_terms
¶
-
supports_resource_query
()¶ Tests if a
ResourceQuery
is available.Returns: true
if a resource query is available,false
otherwiseReturn type: boolean
compliance: mandatory – This method must be implemented.
-
resource_query
¶ Gets the query for a resource.
Multiple retrievals produce a nested
OR
term.Returns: the resource query Return type: osid.resource.ResourceQuery
Raise: Unimplemented
–supports_resource_query()
isfalse
compliance: optional – This method must be implemented if ``supports_resource_query()`` is ``true``.
-
match_any_resource
(match)¶ Matches agents with any resource.
Parameters: match ( boolean
) –true
if to match agents with a resource,false
to match agents with no resourcecompliance: mandatory – This method must be implemented.
-
resource_terms
¶
-
match_agency_id
(agency_id, match)¶ Sets the agency
Id
for this query.Parameters: - agency_id (
osid.id.Id
) – an agencyId
- match (
boolean
) –true
for a positive match,false
for negative match
Raise: NullArgument
–agency_id
isnull
compliance: mandatory – This method must be implemented.
- agency_id (
-
agency_id_terms
¶
-
supports_agency_query
()¶ Tests if an
AgencyQuery
is available.Returns: true
if an agency query is available,false
otherwiseReturn type: boolean
compliance: mandatory – This method must be implemented.
-
agency_query
¶ Gets the query for an agency.
Multiple retrievals produce a nested
OR
term.Returns: the agency query Return type: osid.authentication.AgencyQuery
Raise: Unimplemented
–supports_agency_query()
isfalse
compliance: optional – This method must be implemented if ``supports_agency_query()`` is ``true``.
-
agency_terms
¶
-
get_agent_query_record
(agent_record_type)¶ Gets the agent query record corresponding to the given
Agent
recordType
.Multiple retrievals produce a nested
OR
term.Parameters: agent_record_type ( osid.type.Type
) – an agent record typeReturns: the agent query record Return type: osid.authentication.records.AgentQueryRecord
Raise: NullArgument
–agent_record_type
isnull
Raise: OperationFailed
– unable to complete requestRaise: Unsupported
–has_record_type(agent_record_type)
isfalse
compliance: mandatory – This method must be implemented.
-