Class CommandServiceImpl
java.lang.Object
org.bonitasoft.engine.command.api.impl.CommandServiceImpl
- All Implemented Interfaces:
CommandService
,LifecycleService
,TenantLifecycleService
- Author:
- Zhang Bole, Matthieu Chaffotte, Hongwen Zang, Celine Souchet
-
Field Summary
Fields inherited from interface org.bonitasoft.engine.command.CommandService
COMMAND
-
Constructor Summary
ConstructorDescriptionCommandServiceImpl
(ReadPersistenceService persistenceService, Recorder recorder, EventService eventService, QueriableLoggerService queriableLoggerService, CommandProvider defaultCommandProvider) CommandServiceImpl
(ReadPersistenceService persistenceService, Recorder recorder, EventService eventService, QueriableLoggerService queriableLoggerService, CommandProvider defaultCommandProvider, int fetchSize) -
Method Summary
Modifier and TypeMethodDescriptionvoid
Create command by given commandvoid
delete
(long commandId) Delete command by given command idvoid
Delete command by given command nameprotected void
delete
(SCommand command, SCommandLogBuilder logBuilder) void
Delete all commandsget
(long commandId) Get command by given idGet command by given namegetAllCommands
(int startIndex, int maxResults, SCommandCriterion sCommandCriterion) Retrieves a paginated list of commands, The returned list is paginatedlong
getNumberOfCommands
(QueryOptions options) Get total number of commands according to the specific criteriagetUserCommands
(int startIndex, int maxResults, SCommandCriterion sCommandCriterion) Retrieves a paginated list of commands with System is falsesearchCommands
(QueryOptions options) Get a list of commands according to the specific criteriavoid
start()
Start the servicevoid
update
(SCommand command, EntityUpdateDescriptor updateDescriptor) Update the command by its idMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.bonitasoft.engine.commons.LifecycleService
pause, resume, stop
Methods inherited from interface org.bonitasoft.engine.commons.TenantLifecycleService
init
-
Field Details
-
FETCH_SIZE
public static final int FETCH_SIZE- See Also:
-
-
Constructor Details
-
CommandServiceImpl
public CommandServiceImpl(ReadPersistenceService persistenceService, Recorder recorder, EventService eventService, QueriableLoggerService queriableLoggerService, CommandProvider defaultCommandProvider) -
CommandServiceImpl
public CommandServiceImpl(ReadPersistenceService persistenceService, Recorder recorder, EventService eventService, QueriableLoggerService queriableLoggerService, CommandProvider defaultCommandProvider, int fetchSize)
-
-
Method Details
-
create
public void create(SCommand command) throws SCommandAlreadyExistsException, SCommandCreationException Description copied from interface:CommandService
Create command by given command- Specified by:
create
in interfaceCommandService
- Parameters:
command
- command without Id- Throws:
SCommandAlreadyExistsException
- Error thrown when relative command already existsSCommandCreationException
- Error thrown if has exceptions during the creating command.
-
delete
Description copied from interface:CommandService
Delete command by given command id- Specified by:
delete
in interfaceCommandService
- 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.
-
delete
protected void delete(SCommand command, SCommandLogBuilder logBuilder) throws SCommandDeletionException - Throws:
SCommandDeletionException
-
delete
Description copied from interface:CommandService
Delete command by given command name- Specified by:
delete
in interfaceCommandService
- Parameters:
commandName
- 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
Description copied from interface:CommandService
Delete all commands- Specified by:
deleteAll
in interfaceCommandService
- Throws:
SCommandDeletionException
- Error thrown if has exception during the deleting command.
-
get
Description copied from interface:CommandService
Get command by given name- Specified by:
get
in interfaceCommandService
- Parameters:
commandName
- Name of command- Returns:
- a command object
- Throws:
SCommandNotFoundException
- Error thrown if no command have name corresponding to the parameter.
-
getAllCommands
public List<SCommand> getAllCommands(int startIndex, int maxResults, SCommandCriterion sCommandCriterion) throws SCommandGettingException Description copied from interface:CommandService
Retrieves a paginated list of commands, The returned list is paginated- Specified by:
getAllCommands
in interfaceCommandService
- 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.
-
update
public void update(SCommand command, EntityUpdateDescriptor updateDescriptor) throws SCommandUpdateException Description copied from interface:CommandService
Update the command by its id- Specified by:
update
in interfaceCommandService
- Parameters:
command
- The command will be updatedupdateDescriptor
- The description for update command- Throws:
SCommandUpdateException
- Error thrown if has exception during the command updating.
-
getUserCommands
public List<SCommand> getUserCommands(int startIndex, int maxResults, SCommandCriterion sCommandCriterion) throws SCommandGettingException Description copied from interface:CommandService
Retrieves a paginated list of commands with System is false- Specified by:
getUserCommands
in interfaceCommandService
- 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.
-
get
Description copied from interface:CommandService
Get command by given id- Specified by:
get
in interfaceCommandService
- Parameters:
commandId
- identifier of command- Returns:
- a command object
- Throws:
SCommandNotFoundException
- Error thrown if no command have name corresponding to the parameter.
-
getNumberOfCommands
Description copied from interface:CommandService
Get total number of commands according to the specific criteria- Specified by:
getNumberOfCommands
in interfaceCommandService
- Parameters:
options
- search criteria- Returns:
- total number of commands corresponding to the specific criteria
- Throws:
SBonitaReadException
-
searchCommands
Description copied from interface:CommandService
Get a list of commands according to the specific criteria- Specified by:
searchCommands
in interfaceCommandService
- Parameters:
options
- search criteria- Returns:
- a list of command objects
- Throws:
SBonitaReadException
-
start
Description copied from interface:LifecycleService
Start the service- Specified by:
start
in interfaceLifecycleService
- Throws:
SBonitaException
-