Interface Resource

All Superinterfaces:
Browsable, Extensible, Identifiable, OsidObject

public interface Resource extends OsidObject

A Resource represents an arbitrary entity. Resources are used to define an object to accompany an OSID Id used in other OSIDs. A resource may be used to represent a meeting room in the Scheduling OSID, or a student in the Course OSID.

A Resource may also represent a group or organization. A provider may present such a group in an opaque manner through a single resource definition, or the provider may expose the resource collection for examination or manipulation. If such a resource collection is visible, isGroup() is true and can be used in one of the group sessions available in this OSID.

  • Method Details

    • isGroup

      boolean isGroup()
      Tests if this resource is a group. A resource that is a group can be used in the group sessions.
      Returns:
      true if this resource is a group, false otherwise
      Compliance:
      mandatory - This method must be implemented.
    • isDemographic

      boolean isDemographic()
      Tests if this resource is a demographic. A resource that is a demographic can be used in the demographic service and the group sessions.
      Returns:
      true if this resource is a demographic, false otherwise
      Compliance:
      mandatory - This method must be implemented.
    • hasAvatar

      boolean hasAvatar()
      Tests if this resource has an avatar.
      Returns:
      true if this resource has an avatar, false otherwise
      Compliance:
      mandatory - This method must be implemented.
    • getAvatarId

      Id getAvatarId()
      Gets the asset Id .
      Returns:
      the asset Id
      Throws:
      IllegalStateException - hasAvatar() is false
      Compliance:
      mandatory - This method must be implemented.
    • getAvatar

      Asset getAvatar() throws OperationFailedException
      Gets the asset.
      Returns:
      the asset
      Throws:
      IllegalStateException - hasAvatar() is false
      OperationFailedException - unable to complete request
      Compliance:
      mandatory - This method must be implemented.
    • getResourceRecord

      ResourceRecord getResourceRecord(Type resourceRecordType) throws OperationFailedException
      Gets the resource record corresponding to the given Resource record Type .This method is used to retrieve an object implementing the requested record. The resourceRecordType may be the Type returned in getRecordTypes() or any of its parents in a Type hierarchy where hasRecordType(resourceRecordType) is true .
      Parameters:
      resourceRecordType - the resource record type
      Returns:
      the resource record
      Throws:
      NullArgumentException - resourceRecordType is null
      OperationFailedException - unable to complete request
      UnsupportedException - hasRecordType(resourceRecordType) is false
      Compliance:
      mandatory - This method must be implemented.