Package org.bonitasoft.engine.command
Interface CommandService
-
- All Superinterfaces:
LifecycleService,TenantLifecycleService
- All Known Implementing Classes:
CommandServiceImpl
public interface CommandService extends TenantLifecycleService
- Since:
- 6.0
- Author:
- Matthieu Chaffotte
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.StringCOMMAND
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidcreate(SCommand command)Create command by given commandvoiddelete(long commandId)Delete command by given command idvoiddelete(java.lang.String name)Delete command by given command namevoiddeleteAll()Delete all commandsSCommandget(long commandId)Get command by given idSCommandget(java.lang.String name)Get command by given namejava.util.List<SCommand>getAllCommands(int startIndex, int maxResults, SCommandCriterion sort)Retrieves a paginated list of commands, The returned list is paginatedlonggetNumberOfCommands(QueryOptions options)Get total number of commands according to the specific criteriajava.util.List<SCommand>getUserCommands(int startIndex, int maxResults, SCommandCriterion sCommandCriterion)Retrieves a paginated list of commands with System is falsejava.util.List<SCommand>searchCommands(QueryOptions options)Get a list of commands according to the specific criteriavoidupdate(SCommand command, EntityUpdateDescriptor updateDescriptor)Update the command by its id-
Methods inherited from interface org.bonitasoft.engine.commons.LifecycleService
pause, resume, start, stop
-
Methods inherited from interface org.bonitasoft.engine.commons.TenantLifecycleService
init
-
-
-
-
Field Detail
-
COMMAND
static final java.lang.String COMMAND
- See Also:
- Constant Field Values
-
-
Method Detail
-
create
void create(SCommand command) throws SCommandAlreadyExistsException, SCommandCreationException
Create command by given command- Parameters:
command- command without Id- Throws:
SCommandAlreadyExistsException- Error thrown when relative command already existsSCommandCreationException- Error thrown if has exceptions during the creating command.
-
delete
void delete(java.lang.String name) throws SCommandNotFoundException, SCommandDeletionExceptionDelete command by given command name- Parameters:
name- Name of command which will be deleted- Throws:
SCommandNotFoundException- Error thrown if no command have name corresponding to the parameter.SCommandDeletionException- Error thrown if has exception during the deleting command.
-
deleteAll
void deleteAll() throws SCommandDeletionExceptionDelete all commands- Throws:
SCommandDeletionException- Error thrown if has exception during the deleting command.
-
get
SCommand get(java.lang.String name) throws SCommandNotFoundException
Get command by given name- Parameters:
name- Name of command- Returns:
- a command object
- Throws:
SCommandNotFoundException- Error thrown if no command have name corresponding to the parameter.
-
getAllCommands
java.util.List<SCommand> getAllCommands(int startIndex, int maxResults, SCommandCriterion sort) throws SCommandGettingException
Retrieves a paginated list of commands, The returned list is paginated- Parameters:
startIndex- Start index of command recordmaxResults- Number of commands we want to get. Maximum number of commands returned.sort- The criterion used to sort the retried commands- Returns:
- a list of command objects
- Throws:
SCommandGettingException- Error thrown if has exception during the command getting.
-
update
void update(SCommand command, EntityUpdateDescriptor updateDescriptor) throws SCommandNotFoundException, SCommandUpdateException
Update the command by its id- Parameters:
command- The command will be updatedupdateDescriptor- The description for update command- Throws:
SCommandNotFoundException- Error thrown if no command have name corresponding to the parameter.SCommandUpdateException- Error thrown if has exception during the command updating.
-
getUserCommands
java.util.List<SCommand> getUserCommands(int startIndex, int maxResults, SCommandCriterion sCommandCriterion) throws SCommandGettingException
Retrieves a paginated list of commands with System is false- Parameters:
startIndex- Start index of command recordmaxResults- Number of commands we want to get. Maximum number of commands returned.sCommandCriterion- The criterion used to sort the retried commands- Returns:
- A list of command objects
- Throws:
SCommandGettingException- Error thrown if has exception during the command getting.- Since:
- 6.0
-
get
SCommand get(long commandId) throws SCommandNotFoundException
Get command by given id- Parameters:
commandId- identifier of command- Returns:
- a command object
- Throws:
SCommandNotFoundException- Error thrown if no command have name corresponding to the parameter.
-
delete
void delete(long commandId) throws SCommandNotFoundException, SCommandDeletionExceptionDelete command by given command id- Parameters:
commandId- identifier of command which will be deleted- Throws:
SCommandNotFoundException- Error thrown if no command have name corresponding to the parameter.SCommandDeletionException- Error thrown if has exception during the deleting command.
-
getNumberOfCommands
long getNumberOfCommands(QueryOptions options) throws SBonitaReadException
Get total number of commands according to the specific criteria- Parameters:
options- search criteria- Returns:
- total number of commands corresponding to the specific criteria
- Throws:
SBonitaReadException
-
searchCommands
java.util.List<SCommand> searchCommands(QueryOptions options) throws SBonitaReadException
Get a list of commands according to the specific criteria- Parameters:
options- search criteria- Returns:
- a list of command objects
- Throws:
SBonitaReadException
-
-