Queries

Log Entry Query

class dlkit.logging_.queries.LogEntryQuery

Bases: dlkit.osid.queries.OsidObjectQuery

This is the query for searching log entries.

Each method specifies an AND term while multiple invocations of the same method produce a nested OR.

match_priority(priority_type, match)

Matches a priority Type for the log entry.

Parameters:
  • priority_type (osid.type.Type) – Type to match
  • match (boolean) – true if for a positive match, false for a negative match
Raise:

NullArgumentpriority_type is null

compliance: mandatory – This method must be implemented.

match_any_priority(match)

Matches log entries with any priority.

Parameters:match (boolean) – true to match log entries with any priority, false to match log entries with no priority

compliance: mandatory – This method must be implemented.

priority_terms
match_minimum_priority(priority_type, match)

Matches a log entries including and above the given priority type.

Parameters:
  • priority_type (osid.type.Type) – Type to match
  • match (boolean) – true if for a positive match, false for a negative match
Raise:

NullArgumentpriority_type is null

compliance: mandatory – This method must be implemented.

minimum_priority_terms
match_timestamp(start_time, end_time, match)

Matches the time of this log entry.

Parameters:
  • start_time (osid.calendaring.DateTime) – start time
  • end_time (osid.calendaring.DateTime) – end time
  • match (boolean) – true if for a positive match, false for a negative match
Raise:

InvalidArgumentstart_time is greater than end_time

Raise:

NullArgumentstart_time or end_time is null

compliance: mandatory – This method must be implemented.

timestamp_terms
match_resource_id(resource_id, match)

Matches a resource in this log entry.

Parameters:
  • resource_id (osid.id.Id) – Id to match
  • match (boolean) – true if for a positive match, false for a negative match
Raise:

NullArgumentresource_id is null

compliance: mandatory – This method must be implemented.

resource_id_terms
supports_resource_query()

Tests if a ResourceQuery is available for querying agents.

Returns:true if a resource query is available, false otherwise
Return type:boolean

compliance: mandatory – This method must be implemented.

resource_query

Gets the query for a resource.

Returns:the resource query
Return type:osid.resource.ResourceQuery
Raise:Unimplementedsupports_resource_query() is false

compliance: optional – This method must be implemented if ``supports_resource_query()`` is ``true``.

resource_terms
match_agent_id(agent_id, match)

Matches an agent in this log entry.

Parameters:
  • agent_id (osid.id.Id) – Id to match
  • match (boolean) – true if for a positive match, false for a negative match
Raise:

NullArgumentagent_id is null

compliance: mandatory – This method must be implemented.

agent_id_terms
supports_agent_query()

Tests if an AgentQuery is available for querying agents.

Returns:true if an agent query is available, false otherwise
Return type:boolean

compliance: mandatory – This method must be implemented.

agent_query

Gets the query for an agent.

Returns:the agent query
Return type:osid.authentication.AgentQuery
Raise:Unimplementedsupports_agent_query() is false

compliance: optional – This method must be implemented if ``supports_agent_query()`` is ``true``.

agent_terms
match_log_id(log_id, match)

Matches a log.

Parameters:
  • log_id (osid.id.Id) – Id to match
  • match (boolean) – true if for a positive match, false for a negative match
Raise:

NullArgumentlog_id is null

compliance: mandatory – This method must be implemented.

log_id_terms
supports_log_query()

Tests if a LogQuery is available for querying logs.

Returns:true if a log query is available, false otherwise
Return type:boolean

compliance: mandatory – This method must be implemented.

log_query

Gets the query for a log.

Returns:the log query
Return type:osid.logging.LogQuery
Raise:Unimplementedsupports_log_query() is false

compliance: optional – This method must be implemented if ``supports_log_query()`` is ``true``.

log_terms
get_log_entry_query_record(log_entry_record_type)

Gets the log entry query corresponding to the given LogEntry record Type.

Multiple record retrievals produce a nested OR term.

Parameters:log_entry_record_type (osid.type.Type) – a log entry record type
Returns:the log entry query record
Return type:osid.logging.records.LogEntryQueryRecord
Raise:NullArgumentlog_entry_record_type is null
Raise:OperationFailed – unable to complete request
Raise:Unsupportedhas_record_type(log_eutry_record_type) is false

compliance: mandatory – This method must be implemented.

Log Query

class dlkit.logging_.queries.LogQuery

Bases: dlkit.osid.queries.OsidCatalogQuery

This is the query for searching for logs.

Each method specifies an AND term while multiple invocations of the same method produce a nested OR.

match_log_entry_id(log_entry_id, match)

Sets a log entry Id.

Parameters:
  • log_entry_id (osid.id.Id) – a log entry Id
  • match (boolean) – true for a positive match, false for a negative match
Raise:

NullArgumentlog_entry_id is null

compliance: mandatory – This method must be implemented.

log_entry_id_terms
supports_log_entry_query()

Tests if a log entry query is available.

Returns:true if a log entry query is available, false otherwise
Return type:boolean

compliance: mandatory – This method must be implemented.

log_entry_query

Gets the query for a log entry.

Returns:the log entry query
Return type:osid.logging.LogEntryQuery
Raise:Unimplementedsupports_log_entry_query() is false

compliance: optional – This method must be implemented if ``supports_log_entry_query()`` is ``true``.

match_any_log_entry(match)

Matches logs with any log entry.

Parameters:match (boolean) – true to match logs with any entry, false to match logs with no log entries

compliance: mandatory – This method must be implemented.

log_entry_terms
match_ancestor_log_id(log_id, match)

Sets the log Id for this query to match logs that have the specified log as an ancestor.

Parameters:
  • log_id (osid.id.Id) – a log Id
  • match (boolean) – true for a positive match, false for a negative match
Raise:

NullArgumentlog_id is null

compliance: mandatory – This method must be implemented.

ancestor_log_id_terms
supports_ancestor_log_query()

Tests if a LogQuery is available.

Returns:true if a log query is available, false otherwise
Return type:boolean

compliance: mandatory – This method must be implemented.

ancestor_log_query

Gets the query for a log.

Multiple retrievals produce a nested OR term.

Returns:the log query
Return type:osid.logging.LogQuery
Raise:Unimplementedsupports_ancestor_log_query() is false

compliance: optional – This method must be implemented if ``supports_ancestor_log_query()`` is ``true``.

match_any_ancestor_log(match)

Matches logs with any ancestor.

Parameters:match (boolean) – true to match logs with any ancestor, false to match root logs

compliance: mandatory – This method must be implemented.

ancestor_log_terms
match_descendant_log_id(log_id, match)

Sets the log Id for this query to match logs that have the specified log as a descendant.

Parameters:
  • log_id (osid.id.Id) – a log Id
  • match (boolean) – true for a positive match, false for a negative match
Raise:

NullArgumentlog_id is null

compliance: mandatory – This method must be implemented.

descendant_log_id_terms
supports_descendant_log_query()

Tests if a LogQuery is available.

Returns:true if a log query is available, false otherwise
Return type:boolean

compliance: mandatory – This method must be implemented.

descendant_log_query

Gets the query for a log.

Multiple retrievals produce a nested OR term.

Returns:the log query
Return type:osid.logging.LogQuery
Raise:Unimplementedsupports_descendant_log_query() is false

compliance: optional – This method must be implemented if ``supports_descendant_log_query()`` is ``true``.

match_any_descendant_log(match)

Matches logs with any descendant.

Parameters:match (boolean) – true to match logs with any descendant, false to match leaf logs

compliance: mandatory – This method must be implemented.

descendant_log_terms
get_log_query_record(log_record_type)

Gets the log query record corresponding to the given Log record Type.

Multiple record retrievals produce a nested boolean OR term.

Parameters:log_record_type (osid.type.Type) – a log record type
Returns:the log query record
Return type:osid.logging.records.LogQueryRecord
Raise:NullArgumentlog_record_type is null
Raise:OperationFailed – unable to complete request
Raise:Unsupportedhas_record_type(log_record_type) is false

compliance: mandatory – This method must be implemented.