Queries¶
Agent Query¶
-
class
dlkit.authentication.queries.AgentQuery¶ Bases:
dlkit.osid.queries.OsidObjectQueryThis is the query for searching agents.
Each method specifies an
ANDterm 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
Idfor this query.Parameters: - agency_id (
osid.id.Id) – a resourceId - match (
boolean) –truefor a positive match,falsefor a negative match
Raise: NullArgument–agency_idisnullcompliance: mandatory – This method must be implemented.
- agency_id (
-
resource_id_terms¶
-
supports_resource_query()¶ Tests if a
ResourceQueryis available.Returns: trueif a resource query is available,falseotherwiseReturn type: booleancompliance: mandatory – This method must be implemented.
-
resource_query¶ Gets the query for a resource.
Multiple retrievals produce a nested
ORterm.Returns: the resource query Return type: osid.resource.ResourceQueryRaise: Unimplemented–supports_resource_query()isfalsecompliance: optional – This method must be implemented if ``supports_resource_query()`` is ``true``.
-
match_any_resource(match)¶ Matches agents with any resource.
Parameters: match ( boolean) –trueif to match agents with a resource,falseto match agents with no resourcecompliance: mandatory – This method must be implemented.
-
resource_terms¶
-
match_agency_id(agency_id, match)¶ Sets the agency
Idfor this query.Parameters: - agency_id (
osid.id.Id) – an agencyId - match (
boolean) –truefor a positive match,falsefor negative match
Raise: NullArgument–agency_idisnullcompliance: mandatory – This method must be implemented.
- agency_id (
-
agency_id_terms¶
-
supports_agency_query()¶ Tests if an
AgencyQueryis available.Returns: trueif an agency query is available,falseotherwiseReturn type: booleancompliance: mandatory – This method must be implemented.
-
agency_query¶ Gets the query for an agency.
Multiple retrievals produce a nested
ORterm.Returns: the agency query Return type: osid.authentication.AgencyQueryRaise: Unimplemented–supports_agency_query()isfalsecompliance: 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
AgentrecordType.Multiple retrievals produce a nested
ORterm.Parameters: agent_record_type ( osid.type.Type) – an agent record typeReturns: the agent query record Return type: osid.authentication.records.AgentQueryRecordRaise: NullArgument–agent_record_typeisnullRaise: OperationFailed– unable to complete requestRaise: Unsupported–has_record_type(agent_record_type)isfalsecompliance: mandatory – This method must be implemented.
-