Package org.bonitasoft.engine.parameter
Class ParameterServiceImpl
- java.lang.Object
-
- org.bonitasoft.engine.parameter.ParameterServiceImpl
-
- All Implemented Interfaces:
ParameterService
public class ParameterServiceImpl extends java.lang.Object implements ParameterService
- Author:
- Baptiste Mesta
-
-
Constructor Summary
Constructors Constructor Description ParameterServiceImpl(Recorder recorder, ReadPersistenceService persistenceService, TechnicalLoggerService technicalLoggerService)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddAll(long processDefinitionId, java.util.Map<java.lang.String,java.lang.String> parameters)Store all parameters provided to the specific process in file systembooleancontainsNullValues(long processDefinitionId)Check if the specific process contains null-valued parameter or not.voiddeleteAll(long processDefinitionId)Delete all parameters for a specific processDefinitionjava.util.List<SParameter>get(long processDefinitionId, int fromIndex, int numberOfResult, OrderBy order)Get parameters in a specific interval for specific process, this is used for paginationSParameterget(long processDefinitionId, java.lang.String parameterName)Get parameter by name in specific processjava.util.Map<java.lang.String,java.lang.String>getAll(long processDefinitionId)return all parameters in a mapjava.util.List<SParameter>getNullValues(long processDefinitionId, int fromIndex, int numberOfResult, OrderBy order)Get a list of parameters will null values in order in specific processprotected java.lang.StringinterpretParameterValue(java.lang.String s)Handle null values.voidmerge(long processDefinitionId, java.util.Map<java.lang.String,java.lang.String> parameters)Merge given parameters with existing ones.voidupdate(long processDefinitionId, java.lang.String parameterName, java.lang.String parameterValue)Update specific parameter value in a process
-
-
-
Field Detail
-
PAGE_SIZE
public static final int PAGE_SIZE
- See Also:
- Constant Field Values
-
PARAMETER
public static final java.lang.String PARAMETER
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
ParameterServiceImpl
public ParameterServiceImpl(Recorder recorder, ReadPersistenceService persistenceService, TechnicalLoggerService technicalLoggerService)
-
-
Method Detail
-
update
public void update(long processDefinitionId, java.lang.String parameterName, java.lang.String parameterValue) throws SParameterNameNotFoundException, SBonitaReadException, SObjectModificationExceptionDescription copied from interface:ParameterServiceUpdate specific parameter value in a process- Specified by:
updatein interfaceParameterService- Parameters:
processDefinitionId- identifier of processDefinitionparameterName- name of the parameter will be updatedparameterValue- new value of the parameter- Throws:
SParameterNameNotFoundException- error thrown if no parameter found for the specific parameterNameSBonitaReadExceptionSObjectModificationException
-
merge
public void merge(long processDefinitionId, java.util.Map<java.lang.String,java.lang.String> parameters) throws SBonitaReadException, SObjectModificationExceptionDescription copied from interface:ParameterServiceMerge given parameters with existing ones. Unknown parameters are ignored.- Specified by:
mergein interfaceParameterService- Parameters:
processDefinitionId- identifier of processDefinitionparameters- parameters to merge- Throws:
SBonitaReadException- error thrown if an error occured while retrieving the process definitionSObjectModificationException- error thrown if an error occured while updating the parameter value
-
interpretParameterValue
protected java.lang.String interpretParameterValue(java.lang.String s)
Handle null values. If input isParameterContribution.NULL, convert it tonull
-
addAll
public void addAll(long processDefinitionId, java.util.Map<java.lang.String,java.lang.String> parameters) throws SObjectCreationException, SBonitaReadException, SObjectModificationExceptionDescription copied from interface:ParameterServiceStore all parameters provided to the specific process in file system- Specified by:
addAllin interfaceParameterService- Parameters:
processDefinitionId- identifier of processDefinitionparameters- parameters will be stored in file system- Throws:
SObjectCreationExceptionSBonitaReadExceptionSObjectModificationException
-
getAll
public java.util.Map<java.lang.String,java.lang.String> getAll(long processDefinitionId) throws SParameterProcessNotFoundException, SBonitaReadExceptionDescription copied from interface:ParameterServicereturn all parameters in a map- Specified by:
getAllin interfaceParameterService- Throws:
SParameterProcessNotFoundExceptionSBonitaReadException
-
deleteAll
public void deleteAll(long processDefinitionId) throws SParameterProcessNotFoundException, SBonitaReadException, SObjectModificationExceptionDescription copied from interface:ParameterServiceDelete all parameters for a specific processDefinition- Specified by:
deleteAllin interfaceParameterService- Parameters:
processDefinitionId- ID of processDefinition- Throws:
SParameterProcessNotFoundException- error thrown if no parameters configuration file found in file systemSBonitaReadExceptionSObjectModificationException
-
get
public java.util.List<SParameter> get(long processDefinitionId, int fromIndex, int numberOfResult, OrderBy order) throws SBonitaReadException
Description copied from interface:ParameterServiceGet parameters in a specific interval for specific process, this is used for pagination- Specified by:
getin interfaceParameterService- Parameters:
processDefinitionId- identifier of processDefinitionfromIndex- index of the record to be retrieved from. First record has index 0numberOfResult- number of result we want to get. Maximum number of result returned.order- OrderBy object, contains information to do order- Returns:
- a list of SParameter objects
- Throws:
SBonitaReadException
-
get
public SParameter get(long processDefinitionId, java.lang.String parameterName) throws SBonitaReadException
Description copied from interface:ParameterServiceGet parameter by name in specific process- Specified by:
getin interfaceParameterService- Parameters:
processDefinitionId- identifier of processDefinitionparameterName- name of parameter- Returns:
- the parameter or null if it does not exists
- Throws:
SBonitaReadException
-
getNullValues
public java.util.List<SParameter> getNullValues(long processDefinitionId, int fromIndex, int numberOfResult, OrderBy order) throws SParameterProcessNotFoundException, SBonitaReadException
Description copied from interface:ParameterServiceGet a list of parameters will null values in order in specific process- Specified by:
getNullValuesin interfaceParameterService- Parameters:
processDefinitionId- identifier of processDefinitionfromIndex- index of the record to be retrieved from. First record has index 0numberOfResult- number of result we want to get. Maximum number of result returned.order- OrderBy object, contains information to do order- Returns:
- a list of parameters
- Throws:
SParameterProcessNotFoundException- error thrown if no parameters configuration file found in file systemSBonitaReadException
-
containsNullValues
public boolean containsNullValues(long processDefinitionId) throws SBonitaReadExceptionDescription copied from interface:ParameterServiceCheck if the specific process contains null-valued parameter or not.- Specified by:
containsNullValuesin interfaceParameterService- Parameters:
processDefinitionId- The ID of the process definition- Returns:
- true if at least one parameter contains a null value, false otherwise.
- Throws:
SBonitaReadException
-
-