Class Bundle

All Implemented Interfaces:
Serializable, DSpaceObjectLegacySupport, ReloadableEntity<UUID>

@Entity public class Bundle extends DSpaceObject implements DSpaceObjectLegacySupport
Class representing bundles of bitstreams stored in the DSpace system

The corresponding Bitstream objects are loaded into memory. At present, there is no metadata associated with bundles - they are simple containers. Thus, the update method doesn't do much yet. Creating, adding or removing bitstreams has instant effect in the database.

Version:
$Revision$
Author:
Robert Tansley
See Also:
  • Field Details

    • bundleService

      protected transient BundleService bundleService
  • Constructor Details

  • Method Details

    • getLegacyId

      public Integer getLegacyId()
      Specified by:
      getLegacyId in interface DSpaceObjectLegacySupport
      Returns:
      the old integer based legacy identifier
    • getName

      public String getName()
      Get the name of the bundle
      Specified by:
      getName in class DSpaceObject
      Returns:
      name of the bundle (ORIGINAL, TEXT, THUMBNAIL) or NULL if not set
    • setName

      public void setName(Context context, String name) throws SQLException
      Set the name of the bundle
      Parameters:
      context - context
      name - string name of the bundle (ORIGINAL, TEXT, THUMBNAIL) are the values currently used
      Throws:
      SQLException - if database error
    • getPrimaryBitstream

      public Bitstream getPrimaryBitstream()
      Get the primary bitstream ID of the bundle
      Returns:
      primary bitstream ID or -1 if not set
    • setPrimaryBitstreamID

      public void setPrimaryBitstreamID(Bitstream bitstream)
      Set the primary bitstream ID of the bundle
      Parameters:
      bitstream - primary bitstream (e.g. index html file)
    • unsetPrimaryBitstreamID

      public void unsetPrimaryBitstreamID()
      Unset the primary bitstream ID of the bundle
    • getBitstreams

      public List<Bitstream> getBitstreams()
      Get a copy of the bitstream list of this bundle Note that this is a copy and if you wish to manipulate the bitstream list, you should use , or
      Returns:
      the bitstreams
    • clearBitstreams

      public void clearBitstreams()
      Clear the list of bitstream of this bundle
    • removeBitstream

      public void removeBitstream(Bitstream bitstream)
      Remove the given bitstream from this bundles bitstream list
      Parameters:
      bitstream - The bitstream to remove
    • getItems

      public List<Item> getItems()
      Get the items this bundle appears in
      Returns:
      array of Item s this bundle appears in
    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • getType

      public int getType()
      return type found in Constants
      Specified by:
      getType in class DSpaceObject
      Returns:
      bundle type