Last update: 2011-06-23

org.proteios.core
Interface Ownable

All Superinterfaces:
AccessControlled, Identifiable
All Known Subinterfaces:
DiskConsumable, Shareable
All Known Implementing Classes:
Acquisition, AnnotatedItem, AnnotationType, BioMaterial, BioSource, Client, CommonItem, DataProcessingStep, DigestParameter, Directory, Extract, File, GelElectrophoresis, Hardware, HardwareConfiguration, InstrumentConfiguration, IPG, Job, Label, LabeledExtract, LiquidChromatography, MascotParameterSetStorage, MeasuredArea, MeasuredBioMaterial, Modification, ObservedModification, OMSSAParameterSetStorage, OwnedItem, PeakList, PeakListSet, Peptide, PluginConfiguration, PluginDefinition, PolyPeptide, Project, Protein, Protocol, Sample, SearchDatabase, SearchModification, SearchResult, SeparationMethod, SharedItem, Software, SoftwareConfiguration, SpectrumSearch, XTandemParameterSetStorage

public interface Ownable
extends Identifiable

An Ownable item is an item which has a User as its owner. The OwnableUtil class provides methods that includes data validation to make it easy to implement this interface.

Reference implementation

public User getOwner()
   throws PermissionDeniedException, BaseException
{
   return getDbControl().getItem(User.class, getData().getOwner());
}
public void setOwner(User owner)
   throws PermissionDeniedException, InvalidDataException
{
   checkPermission(Permission.SET_OWNER);
   OwnableUtil.setOwner(getData(), owner);
}

Version:
2.0
Author:
Nicklas
See Also:
OwnedItem, OwnableUtil
Last modified
$Date: 2009-04-09 08:48:11 +0200 (Thu, 09 Apr 2009) $

Method Summary
 User getOwner()
          Get the User that is the owner of the item.
 void setOwner(User owner)
          Change the owner of the item.
 
Methods inherited from interface org.proteios.core.Identifiable
getId, getType, getVersion
 
Methods inherited from interface org.proteios.core.AccessControlled
checkPermission, hasPermission
 

Method Detail

getOwner

User getOwner()
              throws PermissionDeniedException,
                     BaseException
Get the User that is the owner of the item.

Returns:
The owner of the item
Throws:
PermissionDeniedException - If the logged in user doesn't have read permission to the owner
BaseException - If there is another error

setOwner

void setOwner(User owner)
              throws PermissionDeniedException,
                     InvalidDataException
Change the owner of the item.

Parameters:
owner - The new owner of the item
Throws:
PermissionDeniedException - If the logged in user doesn't have permission to change the owner on the item
InvalidDataException - If the owner is null

Last update: 2011-06-23