Bin

Bin

class dlkit.services.resource.Bin(provider_manager, catalog, runtime, proxy, **kwargs)

Bases: dlkit.osid.objects.OsidCatalog, dlkit.osid.sessions.OsidSession

An inventory defines a collection of resources.

get_bin_record(bin_record_type)

Gets the bin record corresponding to the given Bin record Type.

This method is used to retrieve an object implementing the requested record. The bin_record_type may be the Type returned in get_record_types() or any of its parents in a Type hierarchy where has_record_type(bin_record_type) is true .

Parameters:bin_record_type (osid.type.Type) – the bin record type
Returns:the bin record
Return type:osid.resource.records.BinRecord
Raise:NullArgumentbin_record_type is null
Raise:OperationFailed – unable to complete request
Raise:Unsupportedhas_record_type(bin_record_type) is false

compliance: mandatory – This method must be implemented.

Resource Lookup Methods

Bin.bin_id

Gets the Bin Id associated with this session.

Returns:the Bin Id associated with this session
Return type:osid.id.Id

compliance: mandatory – This method must be implemented.

Bin.bin

Gets the Bin associated with this session.

Returns:the Bin associated with this session
Return type:osid.resource.Bin
Raise:OperationFailed – unable to complete request
Raise:PermissionDenied – authorization failure

compliance: mandatory – This method must be implemented.

Bin.can_lookup_resources()

Tests if this user can perform Resource lookups.

A return of true does not guarantee successful authorization. A return of false indicates that it is known all methods in this session will result in a PermissionDenied. This is intended as a hint to an application that may opt not to offer lookup operations.

Returns:false if lookup methods are not authorized, true otherwise
Return type:boolean

compliance: mandatory – This method must be implemented.

Bin.use_comparative_resource_view()

The returns from the lookup methods may omit or translate elements based on this session, such as authorization, and not result in an error.

This view is used when greater interoperability is desired at the expense of precision.

compliance: mandatory – This method is must be implemented.

Bin.use_plenary_resource_view()

A complete view of the Resource returns is desired.

Methods will return what is requested or result in an error. This view is used when greater precision is desired at the expense of interoperability.

compliance: mandatory – This method is must be implemented.

Bin.use_federated_bin_view()

Federates the view for methods in this session.

A federated view will include resources in bins which are children of this bin in the bin hierarchy.

compliance: mandatory – This method is must be implemented.

Bin.use_isolated_bin_view()

Isolates the view for methods in this session.

An isolated view restricts lookups to this bin only.

compliance: mandatory – This method is must be implemented.

Bin.get_resource(resource_id)

Gets the Resource specified by its Id.

In plenary mode, the exact Id is found or a NotFound results. Otherwise, the returned Resource may have a different Id than requested, such as the case where a duplicate Id was assigned to a Resource and retained for compatibility.

Parameters:resource_id (osid.id.Id) – the Id of the Resource to retrieve
Returns:the returned Resource
Return type:osid.resource.Resource
Raise:NotFound – no Resource found with the given Id
Raise:NullArgumentresource_id is null
Raise:OperationFailed – unable to complete request
Raise:PermissionDenied – authorization failure

compliance: mandatory – This method must be implemented.

Bin.get_resources_by_ids(resource_ids)

Gets a ResourceList corresponding to the given IdList.

In plenary mode, the returned list contains all of the resources specified in the Id list, in the order of the list, including duplicates, or an error results if an Id in the supplied list is not found or inaccessible. Otherwise, inaccessible Resources may be omitted from the list and may present the elements in any order including returning a unique set.

Parameters:resource_ids (osid.id.IdList) – the list of Ids to retrieve
Returns:the returned Resource list
Return type:osid.resource.ResourceList
Raise:NotFound – an Id was not found
Raise:NullArgumentresource_ids is null
Raise:OperationFailed – unable to complete request
Raise:PermissionDenied – authorization failure

compliance: mandatory – This method must be implemented.

Bin.get_resources_by_genus_type(resource_genus_type)

Gets a ResourceList corresponding to the given resource genus Type which does not include resources of types derived from the specified Type.

In plenary mode, the returned list contains all known resources or an error results. Otherwise, the returned list may contain only those resources that are accessible through this session.

Parameters:resource_genus_type (osid.type.Type) – a resource genus type
Returns:the returned Resource list
Return type:osid.resource.ResourceList
Raise:NullArgumentresource_genus_type is null
Raise:OperationFailed – unable to complete request
Raise:PermissionDenied – authorization failure

compliance: mandatory – This method must be implemented.

Bin.get_resources_by_parent_genus_type(resource_genus_type)

Gets a ResourceList corresponding to the given resource genus Type and include any additional resources with genus types derived from the specified Type.

In plenary mode, the returned list contains all known resources or an error results. Otherwise, the returned list may contain only those resources that are accessible through this session.

Parameters:resource_genus_type (osid.type.Type) – a resource genus type
Returns:the returned Resource list
Return type:osid.resource.ResourceList
Raise:NullArgumentresource_genus_type is null
Raise:OperationFailed – unable to complete request
Raise:PermissionDenied – authorization failure

compliance: mandatory – This method must be implemented.

Bin.get_resources_by_record_type(resource_record_type)

Gets a ResourceList containing the given resource record Type.

In plenary mode, the returned list contains all known resources or an error results. Otherwise, the returned list may contain only those resources that are accessible through this session.

Parameters:resource_record_type (osid.type.Type) – a resource record type
Returns:the returned Resource list
Return type:osid.resource.ResourceList
Raise:NullArgumentresource_record_type is null
Raise:OperationFailed – unable to complete request
Raise:PermissionDenied – authorization failure

compliance: mandatory – This method must be implemented.

Bin.resources

Gets all Resources.

In plenary mode, the returned list contains all known resources or an error results. Otherwise, the returned list may contain only those resources that are accessible through this session.

Returns:a list of Resources
Return type:osid.resource.ResourceList
Raise:OperationFailed – unable to complete request
Raise:PermissionDenied – authorization failure

compliance: mandatory – This method must be implemented.

Resource Query Methods

Bin.bin_id

Gets the Bin Id associated with this session.

Returns:the Bin Id associated with this session
Return type:osid.id.Id

compliance: mandatory – This method must be implemented.

Bin.bin

Gets the Bin associated with this session.

Returns:the Bin associated with this session
Return type:osid.resource.Bin
Raise:OperationFailed – unable to complete request
Raise:PermissionDenied – authorization failure

compliance: mandatory – This method must be implemented.

Bin.can_search_resources()

Tests if this user can perform Resource searches.

A return of true does not guarantee successful authorization. A return of false indicates that it is known all methods in this session will result in a PermissionDenied. This is intended as a hint to an application that may opt not to offer search operations to unauthorized users.

Returns:false if search methods are not authorized, true otherwise
Return type:boolean

compliance: mandatory – This method must be implemented.

Bin.use_federated_bin_view()

Federates the view for methods in this session.

A federated view will include resources in bins which are children of this bin in the bin hierarchy.

compliance: mandatory – This method is must be implemented.

Bin.use_isolated_bin_view()

Isolates the view for methods in this session.

An isolated view restricts lookups to this bin only.

compliance: mandatory – This method is must be implemented.

Bin.resource_query

Gets a resource query.

The returned query will not have an extension query.

Returns:the resource query
Return type:osid.resource.ResourceQuery

compliance: mandatory – This method must be implemented.

Bin.get_resources_by_query(resource_query)

Gets a list of Resources matching the given resource query.

Parameters:resource_query (osid.resource.ResourceQuery) – the resource query
Returns:the returned ResourceList
Return type:osid.resource.ResourceList
Raise:NullArgumentresource_query is null
Raise:OperationFailed – unable to complete request
Raise:PermissionDenied – authorization failure
Raise:Unsupportedresource_query is not of this service

compliance: mandatory – This method must be implemented.

Resource Search Methods

Gets a resource search.

Returns:the resource search
Return type:osid.resource.ResourceSearch

compliance: mandatory – This method must be implemented.

Bin.resource_search_order

Gets a resource search order.

The ResourceSearchOrder is supplied to a ResourceSearch to specify the ordering of results.

Returns:the resource search order
Return type:osid.resource.ResourceSearchOrder

compliance: mandatory – This method must be implemented.

Gets the search results matching the given search query using the given search.

Parameters:
  • resource_query (osid.resource.ResourceQuery) – the resource query
  • resource_search (osid.resource.ResourceSearch) – the resource search
Returns:

the resource search results

Return type:

osid.resource.ResourceSearchResults

Raise:

NullArgumentresource_query or resource_search is null

Raise:

OperationFailed – unable to complete request

Raise:

PermissionDenied – authorization failure

Raise:

Unsupportedresource_query or resource_search is not of this service

compliance: mandatory – This method must be implemented.

Bin.get_resource_query_from_inspector(resource_query_inspector)

Gets a resource query from an inspector.

The inspector is available from a ResourceSearchResults.

Parameters:resource_query_inspector (osid.resource.ResourceQueryInspector) – a resource query inspector
Returns:the resource query
Return type:osid.resource.ResourceQuery
Raise:NullArgumentresource_query_inspector is null
Raise:Unsupportedresource_query_inspector is not of this service

compliance: mandatory – This method must be implemented.

Resource Admin Methods

Bin.bin_id

Gets the Bin Id associated with this session.

Returns:the Bin Id associated with this session
Return type:osid.id.Id

compliance: mandatory – This method must be implemented.

Bin.bin

Gets the Bin associated with this session.

Returns:the Bin associated with this session
Return type:osid.resource.Bin
Raise:OperationFailed – unable to complete request
Raise:PermissionDenied – authorization failure

compliance: mandatory – This method must be implemented.

Bin.can_create_resources()

Tests if this user can create Resources.

A return of true does not guarantee successful authorization. A return of false indicates that it is known creating a Resource will result in a PermissionDenied. This is intended as a hint to an application that may opt not to offer create operations to an unauthorized user.

Returns:false if Resource creation is not authorized, true otherwise
Return type:boolean

compliance: mandatory – This method must be implemented.

Bin.can_create_resource_with_record_types(resource_record_types)

Tests if this user can create a single Resource using the desired record types.

While ResourceManager.getResourceRecordTypes() can be used to examine which records are supported, this method tests which record(s) are required for creating a specific Resource. Providing an empty array tests if a Resource can be created with no records.

Parameters:resource_record_types (osid.type.Type[]) – array of resource record types
Returns:true if Resource creation using the specified Types is supported, false otherwise
Return type:boolean
Raise:NullArgumentresource_record_types is null

compliance: mandatory – This method must be implemented.

Bin.get_resource_form_for_create(resource_record_types)

Gets the resource form for creating new resources.

A new form should be requested for each create transaction.

Parameters:resource_record_types (osid.type.Type[]) – array of resource record types
Returns:the resource form
Return type:osid.resource.ResourceForm
Raise:NullArgumentresource_record_types is null
Raise:OperationFailed – unable to complete request
Raise:PermissionDenied – authorization failure
Raise:Unsupported – unable to get form with requested record types

compliance: mandatory – This method must be implemented.

Bin.create_resource(resource_form)

Creates a new Resource.

Parameters:resource_form (osid.resource.ResourceForm) – the form for this Resource
Returns:the new Resource
Return type:osid.resource.Resource
Raise:IllegalStateresource_form already used in a create transaction
Raise:InvalidArgument – one or more of the form elements is invalid
Raise:NullArgumentresource_form is null
Raise:OperationFailed – unable to complete request
Raise:PermissionDenied – authorization failure
Raise:Unsupportedresource_form did not originate from get_resource_form_for_create()

compliance: mandatory – This method must be implemented.

Bin.can_update_resources()

Tests if this user can update Resources.

A return of true does not guarantee successful authorization. A return of false indicates that it is known updating a Resource will result in a PermissionDenied. This is intended as a hint to an application that may opt not to offer update operations to an unauthorized user.

Returns:false if Resource modification is not authorized, true otherwise
Return type:boolean

compliance: mandatory – This method must be implemented.

Bin.get_resource_form_for_update(resource_id)

Gets the resource form for updating an existing resource.

A new resource form should be requested for each update transaction.

Parameters:resource_id (osid.id.Id) – the Id of the Resource
Returns:the resource form
Return type:osid.resource.ResourceForm
Raise:NotFoundresource_id is not found
Raise:NullArgumentresource_id is null
Raise:OperationFailed – unable to complete request
Raise:PermissionDenied – authorization failure

compliance: mandatory – This method must be implemented.

Bin.update_resource(resource_form)

Updates an existing resource.

Parameters:resource_form (osid.resource.ResourceForm) – the form containing the elements to be updated
Raise:IllegalStateresource_form already used in an update transaction
Raise:InvalidArgument – the form contains an invalid value
Raise:NullArgumentresource_form is null
Raise:OperationFailed – unable to complete request
Raise:PermissionDenied – authorization failure
Raise:Unsupportedresource_form did not originate from get_resource_form_for_update()

compliance: mandatory – This method must be implemented.

Bin.can_delete_resources()

Tests if this user can delete Resources.

A return of true does not guarantee successful authorization. A return of false indicates that it is known deleting a Resource will result in a PermissionDenied. This is intended as a hint to an application that may opt not to offer delete operations to an unauthorized user.

Returns:false if Resource deletion is not authorized, true otherwise
Return type:boolean

compliance: mandatory – This method must be implemented.

Bin.delete_resource(resource_id)

Deletes a Resource.

Parameters:resource_id (osid.id.Id) – the Id of the Resource to remove
Raise:NotFoundresource_id not found
Raise:NullArgumentresource_id is null
Raise:OperationFailed – unable to complete request
Raise:PermissionDenied – authorization failure

compliance: mandatory – This method must be implemented.

Bin.can_manage_resource_aliases()

Tests if this user can manage Id aliases for Resources.

A return of true does not guarantee successful authorization. A return of false indicates that it is known changing an alias will result in a PermissionDenied. This is intended as a hint to an application that may opt not to offer alias operations to an unauthorized user.

Returns:false if Resource aliasing is not authorized, true otherwise
Return type:boolean

compliance: mandatory – This method must be implemented.

Bin.alias_resource(resource_id, alias_id)

Adds an Id to a Resource for the purpose of creating compatibility.

The primary Id of the Resource is determined by the provider. The new Id performs as an alias to the primary Id. If the alias is a pointer to another resource it is reassigned to the given resource Id.

Parameters:
  • resource_id (osid.id.Id) – the Id of a Resource
  • alias_id (osid.id.Id) – the alias Id
Raise:

AlreadyExistsalias_id is already assigned

Raise:

NotFoundresource_id not found

Raise:

NullArgumentalias_id or resource_id is null

Raise:

OperationFailed – unable to complete request

Raise:

PermissionDenied – authorization failure

compliance: mandatory – This method must be implemented.

Resource Notification Methods

Bin.bin_id

Gets the Bin Id associated with this session.

Returns:the Bin Id associated with this session
Return type:osid.id.Id

compliance: mandatory – This method must be implemented.

Bin.bin

Gets the Bin associated with this session.

Returns:the Bin associated with this session
Return type:osid.resource.Bin
Raise:OperationFailed – unable to complete request
Raise:PermissionDenied – authorization failure

compliance: mandatory – This method must be implemented.

Bin.can_register_for_resource_notifications()

Tests if this user can register for Resource notifications.

A return of true does not guarantee successful authorization. A return of false indicates that it is known all methods in this session will result in a PermissionDenied. This is intended as a hint to an application that may opt not to offer notification operations.

Returns:false if notification methods are not authorized, true otherwise
Return type:boolean

compliance: mandatory – This method must be implemented.

Bin.use_federated_bin_view()

Federates the view for methods in this session.

A federated view will include resources in bins which are children of this bin in the bin hierarchy.

compliance: mandatory – This method is must be implemented.

Bin.use_isolated_bin_view()

Isolates the view for methods in this session.

An isolated view restricts lookups to this bin only.

compliance: mandatory – This method is must be implemented.

Bin.register_for_new_resources()

Register for notifications of new resources.

ResourceReceiver.newResources() is invoked when a new Resource is appears in this bin.

Raise:OperationFailed – unable to complete request
Raise:PermissionDenied – authorization failure

compliance: mandatory – This method must be implemented.

Bin.register_for_changed_resources()

Registers for notification of updated resources.

ResourceReceiver.changedResources() is invoked when a resource in this bin is changed.

Raise:OperationFailed – unable to complete request
Raise:PermissionDenied – authorization failure

compliance: mandatory – This method must be implemented.

Bin.register_for_changed_resource(resource_id)

Registers for notification of an updated resource.

ResourceReceiver.changedResources() is invoked when the specified resource in this bin is changed.

Parameters:resource_id (osid.id.Id) – the Id of the Resource to monitor
Raise:NullArgumentresource_id is null
Raise:OperationFailed – unable to complete request
Raise:PermissionDenied – authorization failure

compliance: mandatory – This method must be implemented.

Bin.register_for_deleted_resources()

Registers for notification of deleted resources.

ResourceReceiver.deletedResources() is invoked when a resource is deleted or removed from this bin.

Raise:OperationFailed – unable to complete request
Raise:PermissionDenied – authorization failure

compliance: mandatory – This method must be implemented.

Bin.register_for_deleted_resource(resource_id)

Registers for notification of a deleted resource.

ResourceReceiver.deletedResources() is invoked when the specified resource is deleted or removed from this bin.

Parameters:resource_id (osid.id.Id) – the Id of the Resource to monitor
Raise:NullArgumentresource_id is null
Raise:OperationFailed – unable to complete request
Raise:PermissionDenied – authorization failure

compliance: mandatory – This method must be implemented.

Bin.reliable_resource_notifications()

Reliable notifications are desired.

In reliable mode, notifications are to be acknowledged using acknowledge_item_notification() .

compliance: mandatory – This method is must be implemented.

Bin.unreliable_resource_notifications()

Unreliable notifications are desired.

In unreliable mode, notifications do not need to be acknowledged.

compliance: mandatory – This method is must be implemented.

Bin.acknowledge_resource_notification(notification_id)

Acknowledge an resource notification.

Parameters:notification_id (osid.id.Id) – the Id of the notification
Raise:OperationFailed – unable to complete request
Raise:PermissionDenied – authorization failure

compliance: mandatory – This method must be implemented.

Resource Bin Methods

Bin.use_comparative_bin_view()

The returns from the lookup methods may omit or translate elements based on this session, such as authorization, and not result in an error.

This view is used when greater interoperability is desired at the expense of precision.

compliance: mandatory – This method is must be implemented.

Bin.use_plenary_bin_view()

A complete view of the Resource and Bin returns is desired.

Methods will return what is requested or result in an error. This view is used when greater precision is desired at the expense of interoperability.

compliance: mandatory – This method is must be implemented.

Bin.can_lookup_resource_bin_mappings()

Tests if this user can perform lookups of resource/bin mappings.

A return of true does not guarantee successful authorization. A return of false indicates that it is known lookup methods in this session will result in a PermissionDenied. This is intended as a hint to an application that may opt not to offer lookup operations to unauthorized users.

Returns:false if looking up mappings is not authorized, true otherwise
Return type:boolean

compliance: mandatory – This method must be implemented.

Bin.get_resource_ids_by_bin(bin_id)

Gets the list of Resource Ids associated with a Bin.

Parameters:bin_id (osid.id.Id) – Id of a Bin
Returns:list of related resource Ids
Return type:osid.id.IdList
Raise:NotFoundbin_id is not found
Raise:NullArgumentbin_id is null
Raise:OperationFailed – unable to complete request
Raise:PermissionDenied – authorization failure

compliance: mandatory – This method must be implemented.

Bin.get_resources_by_bin(bin_id)

Gets the list of Resources associated with a Bin.

Parameters:bin_id (osid.id.Id) – Id of a Bin
Returns:list of related resources
Return type:osid.resource.ResourceList
Raise:NotFoundbin_id is not found
Raise:NullArgumentbin_id is null
Raise:OperationFailed – unable to complete request
Raise:PermissionDenied – authorization failure

compliance: mandatory – This method must be implemented.

Bin.get_resource_ids_by_bins(bin_ids)

Gets the list of Resource Ids corresponding to a list of Bin objects.

Parameters:bin_ids (osid.id.IdList) – list of bin Ids
Returns:list of resource Ids
Return type:osid.id.IdList
Raise:NullArgumentbin_ids is null
Raise:OperationFailed – unable to complete request
Raise:PermissionDenied – authorization failure

compliance: mandatory – This method must be implemented.

Bin.get_resources_by_bins(bin_ids)

Gets the list of Resources corresponding to a list of Bins.

Parameters:bin_ids (osid.id.IdList) – list of bin Ids
Returns:list of resources
Return type:osid.resource.ResourceList
Raise:NullArgumentbin_ids is null
Raise:OperationFailed – unable to complete request
Raise:PermissionDenied – authorization failure

compliance: mandatory – This method must be implemented.

Bin.get_bin_ids_by_resource(resource_id)

Gets the list of Bin Ids mapped to a Resource.

Parameters:resource_id (osid.id.Id) – Id of a Resource
Returns:list of bin Ids
Return type:osid.id.IdList
Raise:NotFoundresource_id is not found
Raise:NullArgumentresource_id is null
Raise:OperationFailed – unable to complete request
Raise:PermissionDenied – authorization failure

compliance: mandatory – This method must be implemented.

Bin.get_bins_by_resource(resource_id)

Gets the list of Bin objects mapped to a Resource.

Parameters:resource_id (osid.id.Id) – Id of a Resource
Returns:list of bins
Return type:osid.resource.BinList
Raise:NotFoundresource_id is not found
Raise:NullArgumentresource_id is null
Raise:OperationFailed – unable to complete request
Raise:PermissionDenied – authorization failure

compliance: mandatory – This method must be implemented.

Resource Bin Assignment Methods

Bin.can_assign_resources()

Tests if this user can alter resource/bin mappings.

A return of true does not guarantee successful authorization. A return of false indicates that it is known mapping methods in this session will result in a PermissionDenied. This is intended as a hint to an application that may opt not to offer assignment operations to unauthorized users.

Returns:false if mapping is not authorized, true otherwise
Return type:boolean

compliance: mandatory – This method must be implemented.

Bin.can_assign_resources_to_bin(bin_id)

Tests if this user can alter resource/bin mappings.

A return of true does not guarantee successful authorization. A return of false indicates that it is known mapping methods in this session will result in a PermissionDenied . This is intended as a hint to an application that may opt not to offer assignment operations to unauthorized users.

Parameters:bin_id (osid.id.Id) – the Id of the Bin
Returns:false if mapping is not authorized, true otherwise
Return type:boolean
Raise:NullArgumentbin_id is null

compliance: mandatory – This method must be implemented.

Bin.get_assignable_bin_ids(bin_id)

Gets a list of bins including and under the given bin node in which any resource can be assigned.

Parameters:bin_id (osid.id.Id) – the Id of the Bin
Returns:list of assignable bin Ids
Return type:osid.id.IdList
Raise:NullArgumentbin_id is null
Raise:OperationFailed – unable to complete request

compliance: mandatory – This method must be implemented.

Bin.get_assignable_bin_ids_for_resource(bin_id, resource_id)

Gets a list of bins including and under the given bin node in which a specific resource can be assigned.

Parameters:
  • bin_id (osid.id.Id) – the Id of the Bin
  • resource_id (osid.id.Id) – the Id of the Resource
Returns:

list of assignable bin Ids

Return type:

osid.id.IdList

Raise:

NullArgumentbin_id or resource_id is null

Raise:

OperationFailed – unable to complete request

compliance: mandatory – This method must be implemented.

Bin.assign_resource_to_bin(resource_id, bin_id)

Adds an existing Resource to a Bin.

Parameters:
  • resource_id (osid.id.Id) – the Id of the Resource
  • bin_id (osid.id.Id) – the Id of the Bin
Raise:

AlreadyExistsresource_id is already assigned to bin_id

Raise:

NotFoundresource_id or bin_id not found

Raise:

NullArgumentresource_id or bin_id is null

Raise:

OperationFailed – unable to complete request

Raise:

PermissionDenied – authorization failure

compliance: mandatory – This method must be implemented.

Bin.unassign_resource_from_bin(resource_id, bin_id)

Removes a Resource from a Bin.

Parameters:
  • resource_id (osid.id.Id) – the Id of the Resource
  • bin_id (osid.id.Id) – the Id of the Bin
Raise:

NotFoundresource_id or bin_id not found or resource_id not assigned to bin_id

Raise:

NullArgumentresource_id or bin_id is null

Raise:

OperationFailed – unable to complete request

Raise:

PermissionDenied – authorization failure

compliance: mandatory – This method must be implemented.

Resource Agent Methods

Bin.bin_id

Gets the Bin Id associated with this session.

Returns:the Bin Id associated with this session
Return type:osid.id.Id

compliance: mandatory – This method must be implemented.

Bin.bin

Gets the Bin associated with this session.

Returns:the Bin associated with this session
Return type:osid.resource.Bin
Raise:OperationFailed – unable to complete request
Raise:PermissionDenied – authorization failure

compliance: mandatory – This method must be implemented.

Bin.can_lookup_resource_agent_mappings()

Tests if this user can perform lookups of resource/agent mappings.

A return of true does not guarantee successful authorization. A return of false indicates that it is known lookup methods in this session will result in a PermissionDenied. This is intended as a hint to an application that may opt not to offer lookup operations to unauthorized users.

Returns:false if looking up mappings is not authorized, true otherwise
Return type:boolean

compliance: mandatory – This method must be implemented.

Bin.use_comparative_agent_view()

The returns from the lookup methods may omit or translate elements based on this session, such as authorization, and not result in an error.

This view is used when greater interoperability is desired at the expense of precision.

compliance: mandatory – This method is must be implemented.

Bin.use_plenary_agent_view()

A complete view of the Agent returns is desired.

Methods will return what is requested or result in an error. This view is used when greater precision is desired at the expense of interoperability.

compliance: mandatory – This method is must be implemented.

Bin.use_federated_bin_view()

Federates the view for methods in this session.

A federated view will include resources in bins which are children of this bin in the bin hierarchy.

compliance: mandatory – This method is must be implemented.

Bin.use_isolated_bin_view()

Isolates the view for methods in this session.

An isolated view restricts lookups to this bin only.

compliance: mandatory – This method is must be implemented.

Bin.get_resource_id_by_agent(agent_id)

Gets the Resource Id associated with the given agent.

Parameters:agent_id (osid.id.Id) – Id of the Agent
Returns:associated resource
Return type:osid.id.Id
Raise:NotFoundagent_id is not found
Raise:NullArgumentagent_id is null
Raise:OperationFailed – unable to complete request
Raise:PermissionDenied – authorization failure

compliance: mandatory – This method must be implemented.

Bin.get_resource_by_agent(agent_id)

Gets the Resource associated with the given agent.

Parameters:agent_id (osid.id.Id) – Id of the Agent
Returns:associated resource
Return type:osid.resource.Resource
Raise:NotFoundagent_id is not found
Raise:NullArgumentagent_id is null
Raise:OperationFailed – unable to complete request
Raise:PermissionDenied – authorization failure

compliance: mandatory – This method must be implemented.

Bin.get_agent_ids_by_resource(resource_id)

Gets the list of Agent Ids mapped to a Resource.

Parameters:resource_id (osid.id.Id) – Id of a Resource
Returns:list of agent Ids
Return type:osid.id.IdList
Raise:NotFoundresource_id is not found
Raise:NullArgumentresource_id is null
Raise:OperationFailed – unable to complete request
Raise:PermissionDenied – authorization failure

compliance: mandatory – This method must be implemented.

Bin.get_agents_by_resource(resource_id)

Gets the list of Agents mapped to a Resource.

Parameters:resource_id (osid.id.Id) – Id of a Resource
Returns:list of agents
Return type:osid.authentication.AgentList
Raise:NotFoundresource_id is not found
Raise:NullArgumentresource_id is null
Raise:OperationFailed – unable to complete request
Raise:PermissionDenied – authorization failure

compliance: mandatory – This method must be implemented.

Resource Agent Assignment Methods

Bin.bin_id

Gets the Bin Id associated with this session.

Returns:the Bin Id associated with this session
Return type:osid.id.Id

compliance: mandatory – This method must be implemented.

Bin.bin

Gets the Bin associated with this session.

Returns:the Bin associated with this session
Return type:osid.resource.Bin
Raise:OperationFailed – unable to complete request
Raise:PermissionDenied – authorization failure

compliance: mandatory – This method must be implemented.

Bin.can_assign_agents()

Tests if this user can alter resource/agent mappings.

A return of true does not guarantee successful authorization. A return of false indicates that it is known mapping methods in this session will result in a PermissionDenied. This is intended as a hint to an application that may opt not to offer assignment operations to unauthorized users.

Returns:false if mapping is not authorized, true otherwise
Return type:boolean

compliance: mandatory – This method must be implemented.

Bin.can_assign_agents_to_resource(resource_id)

Tests if this user can alter resource/agent mappings.

A return of true does not guarantee successful authorization. A return of false indicates that it is known location methods in this session will result in a PermissionDenied. This is intended as a hint to an application that may opt not to offer assignment operations to unauthorized users.

Parameters:resource_id (osid.id.Id) – the Id of the Resource
Returns:false if mapping is not authorized, true otherwise
Return type:boolean
Raise:NullArgumentresource_id is null

compliance: mandatory – This method must be implemented.

Bin.assign_agent_to_resource(agent_id, resource_id)

Adds an existing Agent to a Resource.

Parameters:
  • agent_id (osid.id.Id) – the Id of the Agent
  • resource_id (osid.id.Id) – the Id of the Resource
Raise:

AlreadyExistsagent_id is already assigned to resource_id

Raise:

NotFoundagent_id or resource_id not found

Raise:

NullArgumentagent_id or resource_id is null

Raise:

OperationFailed – unable to complete request

Raise:

PermissionDenied – authorization failure

compliance: mandatory – This method must be implemented.

Bin.unassign_agent_from_resource(agent_id, resource_id)

Removes an Agent from a Resource.

Parameters:
  • agent_id (osid.id.Id) – the Id of the Agent
  • resource_id (osid.id.Id) – the Id of the Resource
Raise:

NotFoundagent_id or resource_id not found or agent_id not assigned to resource_id

Raise:

NullArgumentagent_id or resource_id is null

Raise:

OperationFailed – unable to complete request

Raise:

PermissionDenied – authorization failure

compliance: mandatory – This method must be implemented.