Basic classes and interfaces

NOTE! This document is outdated and has been replaced with newer documentation. See The database schema and the Data Layer API

This document contains information about the basic classes and interfaces in this package. They are important since all dataclasses must extend/implement these classes when they need certain functionality.

Contents

  1. Class diagram
  2. Classes
  3. Interfaces

Last updated: $Date: 2009-04-06 14:52:39 +0200 (må, 06 apr 2009) $

1. Class diagram

Each data-class must inherit from one of the already existing abstract base classes. They contain code that is common to all classes, for example implementations of the equals() and hashCode() methods or how to link with the owner of an item.

Classes

BasicData [API]
The root class. It overrides the equals(), hashCode() and toString() methods in the Object class. It also defines the id and version properties.
OwnedData [API]
This class extends the BasicData class and adds an owner property. The owner is a required link to a UserData object.
SharedData [API]
This class extends the OwnerData class and adds methods for properties that holds access permission information for an item. Access permissions are held in ItemKeyData and/or ProjectKeyData objects. These objects only exists if the item has been shared.
CommonData [API]
This is a convenience class for items that extends the SharedData class and implements the NameableData and RemoveableData interfaces. For many of the data classes it will be convenient to extend this class and just add a few new properties.
AnnotatedData [API]
This is a convenience class for items that can be annotated. Annotations are held in AnnotationSetData objects. The annotation set only exists if annotations has been created for the item.

Interfaces

IdentifiableData [API]
All items are identifiable, which means that they have a unique id. The id is unique for all items of a specific type (ie. class). The id is number that is automatically generated by the database and has no other meaning outside of the application. The version property is used for detecting and preventing concurrent modifications to an item.
OwnableData [API]
An ownable item is an item which has an owner. The owner is represented as a required link to a UserData object.
ShareableData [API]
A shareable item is an item which can be shared to other users, groups or projects. Access permissions are held in ItemKeyData and/or ProjectKeyData objects.
NameableData [API]
A nameable item is an item that has a name and, optionally, a description.
RemovableData [API]
A removable item is an item that can be flagged as removed. This doesn't remove the information about the item from the database, but can be used by client applications to hide items that the user is not interested in. At regular intervals a purge application is cheking for removed items and deletes them for real.
SystemData [API]
A system item is an item which has an additional id in the form of string. A system id is required when we need to make sure that we can get a specific item without knowing the numeric id. Example of such items are the root user and the everyone group. A system id is generally constructed like: net.sf.basedb.core.User.ROOT. The system id:s are defined in the core layer by each item class.
FileAttachableData [API]
This interface is used by items that can have an optional file attached to them, for example protocols.
DiskConsumableData [API]
This interface is used by items which occupies a lot of disk space and must be part of the quota system, for example files. The required DiskUsageData contains information about the size, location, owner etc. of the item.
AnnotatableData [API]
This interface is used by items which can be annotated. Annotations are name/value pairs that are attached as extra information to an item. All annotations are contained in an AnnotationSetData object.
ExtendableData [API]
This interface is used by items which can have extra administrator-defined columns. The functionality is similar to annotations. It is not as flexible, since it is a global configuration, but has better performance.
BatchableData [API]
This interface is a tagging interface which is used by items that needs batch functionality in the core.