|
2.17.2: 2011-06-17 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object net.sf.basedb.core.BasicItem<D> net.sf.basedb.core.ChildItem<JobAgentSettingsData> net.sf.basedb.core.JobAgentSettings
public class JobAgentSettings
This class contains a job agent's settings for a specific plugin. The settings may override the default settings for the JAR path where to plugin is located, maximum memory to use, and if the plugin is trusted or not.
Field Summary | |
---|---|
static int |
MAX_JARPATH_LENGTH
The maximum length of the jar path that can be stored in the database. |
private static QueryRuntimeFilter |
RUNTIME_FILTER
This filter will only return items if the logged in user has generic read permission to job agents. |
static Item |
TYPE
The type of item represented by this class. |
Constructor Summary | |
---|---|
JobAgentSettings(JobAgentSettingsData data)
|
Method Summary | |
---|---|
static JobAgentSettings |
getById(DbControl dc,
int id)
Get a JobAgentSettings item when you know the ID. |
String |
getEffectiveJarPath()
Get the effective path to the JAR file that contains the plugin implementation. |
Long |
getEffectiveMaxMemory()
Get the effective maximum amount of memory the plugin is allowed to use. |
int |
getEffectivePriority(Job job)
Get the effective priority for the specified job, when the priority boost is taken into account. |
String |
getJarPath()
Get the path to the JAR file that contains the plugin implementation. |
JobAgent |
getJobAgent()
Get the job agent that owns these settings. |
Long |
getMaxMemory()
Get the maximum amount of memory the plugin is allowed to use. |
(package private) static JobAgentSettings |
getNew(DbControl dc,
JobAgent agent,
PluginDefinition plugin)
Create a new JobAgentSettings item. |
PluginDefinition |
getPluginDefinition()
Get the plugin that these settings are used for. |
int |
getPriorityBoost()
Get the priority boost given to jobs executed by this plugin. |
(package private) static ItemQuery<JobAgentSettings> |
getQuery(JobAgent agent)
Get a query configured to retrieve settings for the specified agent. |
(package private) static ItemQuery<JobAgentSettings> |
getQuery(PluginDefinition plugin)
Get a query configured to retrieve settings for the specified plugin. |
(package private) SharedData |
getSharedParent()
Get the shareable parent item of this child item. |
Item |
getType()
Get the type of item represented by the object. |
boolean |
isEffectivelyTrusted()
If the plugin is a trusted plugin or not. |
Boolean |
isTrusted()
If the plugin is a trusted plugin or not. |
void |
setJarPath(String jarPath)
Set the path to the JAR file that contains the plugin implementation. |
private void |
setJobAgent(JobAgent agent)
|
void |
setMaxMemory(Long maxMemory)
Set maximim amount of memory the plugin is allowed to use. |
private void |
setPluginDefinition(PluginDefinition plugin)
|
void |
setPriorityBoost(int priorityBoost)
Set the priority boost given to jobs executed by this plugin. |
void |
setTrusted(Boolean trusted)
Set the trusted flag for this plugin. |
Methods inherited from class net.sf.basedb.core.ChildItem |
---|
getPermissionForWriteDeleteAndCreate, getPluginPermissions, initPermissions |
Methods inherited from class net.sf.basedb.core.BasicItem |
---|
addUsingItems, addUsingItems, checkPermission, equals, getData, getDbControl, getId, getPermissions, getSessionControl, getUsingItems, getVersion, hashCode, hasPermission, isDetached, isInDatabase, isUsed, onAfterCommit, onAfterInsert, onBeforeCommit, onRollback, setDbControl, setProjectDefaults, toString, toTransferable, validate |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final Item TYPE
Item.JOBAGENTSETTINGS
,
getType()
private static final QueryRuntimeFilter RUNTIME_FILTER
public static final int MAX_JARPATH_LENGTH
setJarPath(String)
,
Constant Field ValuesConstructor Detail |
---|
JobAgentSettings(JobAgentSettingsData data)
Method Detail |
---|
static JobAgentSettings getNew(DbControl dc, JobAgent agent, PluginDefinition plugin)
JobAgentSettings
item.
dc
- The DbControl
which will be used for
permission checking and database accessagent
- The job agent these settings belong toplugin
- The plugin definition these settings are for
JobAgentSettings
item
BaseException
- If there is another errorpublic static JobAgentSettings getById(DbControl dc, int id) throws ItemNotFoundException, PermissionDeniedException, BaseException
JobAgentSettings
item when you know the ID.
dc
- The DbControl
which will be used for
permission checking and database accessid
- The ID of the item to load
JobAgentSettings
item
ItemNotFoundException
- If an item with the specified ID is not found
PermissionDeniedException
- If the logged in user doesn't have
read permission for the item
BaseException
- If there is another errorstatic ItemQuery<JobAgentSettings> getQuery(JobAgent agent)
agent
- The job agent to retreive settings for, null is not allowed
ItemQuery
objectJobAgent.getSettings()
static ItemQuery<JobAgentSettings> getQuery(PluginDefinition plugin)
plugin
- The plugin to retreive settings for, null is not allowed
ItemQuery
objectpublic Item getType()
Identifiable
Item
enumeration.
SharedData getSharedParent()
ChildItem
ChildItem.initPermissions(int, int)
method to calculate
the logged in user's permissions for the child item.
getSharedParent
in class ChildItem<JobAgentSettingsData>
public JobAgent getJobAgent() throws PermissionDeniedException, BaseException
JobAgent
item
PermissionDeniedException
- If the logged in user doesn't have
read permission to the item
BaseException
- If there is another errorprivate void setJobAgent(JobAgent agent)
public PluginDefinition getPluginDefinition()
PluginDefinition
item
PermissionDeniedException
- If the logged in user doesn't have
read permission to the item
BaseException
- If there is another errorprivate void setPluginDefinition(PluginDefinition plugin)
public String getJarPath()
PluginDefinition.getJarPath()
,
getEffectiveJarPath()
public String getEffectiveJarPath()
PluginDefinition.getJarPath()
,
getJarPath()
public void setJarPath(String jarPath) throws PermissionDeniedException, InvalidDataException
jarPath
- The JAR path or null to use the JAR path specified by the
plugin definition
PermissionDeniedException
- If the logged in user doesn't have
write permission
InvalidDataException
- If the new value is longer than
MAX_JARPATH_LENGTH
public Boolean isTrusted()
PluginDefinition.isTrusted()
,
isEffectivelyTrusted()
public boolean isEffectivelyTrusted()
PluginDefinition.isTrusted()
,
isTrusted()
public void setTrusted(Boolean trusted)
trusted
- A boolean value or null if the plugin definition setting should be usedPluginDefinition.isTrusted()
public Long getMaxMemory()
PluginDefinition.getMaxMemory()
,
getEffectiveMaxMemory()
public Long getEffectiveMaxMemory()
PluginDefinition.getMaxMemory()
,
getMaxMemory()
public void setMaxMemory(Long maxMemory) throws PermissionDeniedException, InvalidDataException
maxMemory
- The maximum amount or null to use the amount specified
by the plugin definition
PermissionDeniedException
- If the logged in user doesn't have
write permission
InvalidDataException
- If the new value is less than zeropublic int getPriorityBoost()
The priority boost is useful if we, for example, want to use one server mainly for importing data. By giving all import plugins a priority boost they will be executed before all other jobs.
Job.getPriority()
public void setPriorityBoost(int priorityBoost)
priorityBoost
- The priority boost, must be between 0 and 10
PermissionDeniedException
- If the logged in user doesn't have
write permission
InvalidDataException
- If the new value is less than 0 or greater than 10public int getEffectivePriority(Job job) throws InvalidDataException
job
- The job to get the prioriy for
InvalidDataException
- If the job is null or has a different plugin
definition than these settingsJob.getPriority()
|
2.17.2: 2011-06-17 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |