Class AbstractSourceableOsidObject

All Implemented Interfaces:
Browsable, Extensible, Identifiable, OsidObject, Sourceable
Direct Known Subclasses:
AbstractAsset, AbstractComposition, AbstractEntry, AbstractInstallationPackage, AbstractOsidCatalog, AbstractOsidGovernator, AbstractRecipe

public abstract class AbstractSourceableOsidObject extends AbstractOsidObject implements Sourceable, OsidObject
Defines a sourceable OsidObject. setProvider() should be used to set the provider information by subclasses.
  • Constructor Details

    • AbstractSourceableOsidObject

      public AbstractSourceableOsidObject()
      Constructs a new AbstractSourceableOsidObject.
  • Method Details

    • getProviderId

      @OSID public Id getProviderId()
      Gets the Id of the Provider of this Catalog.
      Specified by:
      getProviderId in interface Sourceable
      Returns:
      the Provider Id
    • getProvider

      @OSID public Resource getProvider() throws OperationFailedException
      Gets the Resource representing the provider of this catalog.
      Specified by:
      getProvider in interface Sourceable
      Returns:
      the provider
      Throws:
      OperationFailedException - unable to complete request
    • setProvider

      protected void setProvider(Provider provider)
      Sets the provider for this catalog.
      Parameters:
      provider - the new provider
      Throws:
      NullArgumentException - provider is null
    • setProvider

      protected void setProvider(Resource provider)
      Sets the provider.
      Parameters:
      provider - the new provider
      Throws:
      NullArgumentException - provider is null
    • getBrandingIds

      @OSID public IdList getBrandingIds()
      Gets the branding asset Ids, such as an image or logo, expressed using the Asset interface.
      Specified by:
      getBrandingIds in interface Sourceable
      Returns:
      a list of asset Ids
    • getBranding

      @OSID public AssetList getBranding() throws OperationFailedException
      Gets a branding, such as an image or logo, expressed using the Asset interface.
      Specified by:
      getBranding in interface Sourceable
      Returns:
      a list of assets
      Throws:
      OperationFailedException - unable to complete request
    • addAssetToBranding

      protected void addAssetToBranding(Asset asset)
      Adds an asset to the branding.
      Parameters:
      asset - an asset to add
      Throws:
      NullArgumentException - asset is null
    • addAssetsToBranding

      protected void addAssetsToBranding(Collection<Asset> assets)
      Adds assets to the branding.
      Parameters:
      assets - array of assets to add
      Throws:
      NullArgumentException - asset is null
    • setBranding

      protected void setBranding(Asset asset)
      Sets the branding to the given asset.
      Parameters:
      asset - an asset to set
      Throws:
      NullArgumentException - asset is null
    • setBranding

      protected void setBranding(Collection<Asset> assets)
      Sets the branding to the given assets.
      Parameters:
      assets - an array of assets to setd
      Throws:
      NullArgumentException - assets is null
    • getLicense

      @OSID public DisplayText getLicense()
      Gets the terms of usage. An empty license means the terms are unknown.
      Specified by:
      getLicense in interface Sourceable
      Returns:
      the license
    • setLicense

      protected void setLicense(DisplayText license)
      Sets the license.
      Parameters:
      license - the license
      Throws:
      NullArgumentException - license is null