Package net.sf.basedb.core
Class GlobalDefaultSetting
- java.lang.Object
-
- net.sf.basedb.core.BasicItem
-
- net.sf.basedb.core.Setting
-
- net.sf.basedb.core.GlobalDefaultSetting
-
- All Implemented Interfaces:
AccessControlled
,Identifiable
public class GlobalDefaultSetting extends Setting
This class is used to represent a global default setting.- Version:
- 2.0
- Author:
- Nicklas
-
-
Field Summary
Fields Modifier and Type Field Description static Item
TYPE
The type of item represented by this class.-
Fields inherited from class net.sf.basedb.core.Setting
MAX_NAME_LENGTH, MAX_VALUE_LENGTH
-
-
Constructor Summary
Constructors Constructor Description GlobalDefaultSetting(GlobalDefaultSettingData data)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static GlobalDefaultSetting
getById(DbControl dc, int id)
Get aClientDefaultSetting
item when you know the ID.(package private) GlobalDefaultSettingData
getData()
Get theBasicData
object that holds all data for this item.static GlobalDefaultSetting
getNew(DbControl dc, String name, String value)
Create a newGlobalDefaultSetting
item.static ItemQuery<GlobalDefaultSetting>
getQuery()
Get a query configured to retrieve global default settings.Item
getType()
Get the type of item represented by the object.(package private) void
initPermissions(int granted, int denied)
READ permission is always granted.-
Methods inherited from class net.sf.basedb.core.BasicItem
addAnnotatableParents, addUsingItems, addUsingItems, breakCircularReferences, checkBatchAnnotatableUsage, checkPermission, equals, getBasicData, getDbControl, getId, getPermissions, getPluginPermissions, getSessionControl, getUsingItems, getVersion, hashCode, hasPermission, isDetached, isInDatabase, isUsed, onAfterCommit, onAfterInsert, onBeforeCommit, onRollback, setDbControl, setProjectDefaults, toString, validate
-
-
-
-
Field Detail
-
TYPE
public static final Item TYPE
The type of item represented by this class.- See Also:
Item.GLOBALDEFAULTSETTING
,getType()
-
-
Constructor Detail
-
GlobalDefaultSetting
GlobalDefaultSetting(GlobalDefaultSettingData data)
-
-
Method Detail
-
getNew
public static GlobalDefaultSetting getNew(DbControl dc, String name, String value) throws BaseException
Create a newGlobalDefaultSetting
item.- Parameters:
dc
- TheDbControl
which will be used for permission checking and database accessname
- The name of the settingvalue
- The value of the setting- Returns:
- The new
ClientDefaultSetting
item - Throws:
BaseException
- If there is an error
-
getById
public static GlobalDefaultSetting getById(DbControl dc, int id) throws ItemNotFoundException, PermissionDeniedException, BaseException
Get aClientDefaultSetting
item when you know the ID.- Parameters:
dc
- TheDbControl
which will be used for permission checking and database access.id
- The ID of the item to load- Returns:
- The
ClientDefaultSetting
item - Throws:
ItemNotFoundException
- If an item with the specified ID is not foundPermissionDeniedException
- If the logged in user doesn't havePermission.READ
permission to the itemBaseException
- If there is another error
-
getQuery
public static ItemQuery<GlobalDefaultSetting> getQuery()
Get a query configured to retrieve global default settings.- Returns:
- An
ItemQuery
object
-
getData
GlobalDefaultSettingData getData()
Description copied from class:BasicItem
Get theBasicData
object that holds all data for this item.
-
getType
public Item getType()
Description copied from interface:Identifiable
Get the type of item represented by the object. The returned value is one of the values defined in theItem
enumeration.- Returns:
- A value indicating the type of item
-
initPermissions
void initPermissions(int granted, int denied) throws BaseException
READ permission is always granted.- Overrides:
initPermissions
in classSetting
- Parameters:
granted
- Permissions that have been granted by the subclassdenied
- Permissions that have been denied by the subclass- Throws:
BaseException
- If the permissions couldn't be initialised
-
-