public class CommandServiceImpl extends java.lang.Object implements CommandService
| Modifier and Type | Field and Description |
|---|---|
static int |
FETCH_SIZE |
COMMAND| Constructor and Description |
|---|
CommandServiceImpl(ReadPersistenceService persistenceService,
Recorder recorder,
EventService eventService,
TechnicalLoggerService logger,
QueriableLoggerService queriableLoggerService,
CommandProvider defaultCommandProvider) |
CommandServiceImpl(ReadPersistenceService persistenceService,
Recorder recorder,
EventService eventService,
TechnicalLoggerService logger,
QueriableLoggerService queriableLoggerService,
CommandProvider defaultCommandProvider,
int fetchSize) |
| Modifier and Type | Method and Description |
|---|---|
void |
create(SCommand command)
Create command by given command
|
void |
delete(long commandId)
Delete command by given command id
|
protected void |
delete(SCommand command,
SCommandLogBuilder logBuilder) |
void |
delete(java.lang.String commandName)
Delete command by given command name
|
void |
deleteAll()
Delete all commands
|
SCommand |
get(long commandId)
Get command by given id
|
SCommand |
get(java.lang.String commandName)
Get command by given name
|
java.util.List<SCommand> |
getAllCommands(int startIndex,
int maxResults,
SCommandCriterion sCommandCriterion)
Retrieves a paginated list of commands, The returned list is paginated
|
long |
getNumberOfCommands(QueryOptions options)
Get total number of commands according to the specific criteria
|
java.util.List<SCommand> |
getUserCommands(int startIndex,
int maxResults,
SCommandCriterion sCommandCriterion)
Retrieves a paginated list of commands with System is false
|
void |
pause()
Temporary halt the execution of this service.
|
void |
resume()
resume the execution the service
|
java.util.List<SCommand> |
searchCommands(QueryOptions options)
Get a list of commands according to the specific criteria
|
void |
start()
Start the service
|
void |
stop() |
void |
update(SCommand command,
EntityUpdateDescriptor updateDescriptor)
Update the command by its id
|
public static final int FETCH_SIZE
public CommandServiceImpl(ReadPersistenceService persistenceService, Recorder recorder, EventService eventService, TechnicalLoggerService logger, QueriableLoggerService queriableLoggerService, CommandProvider defaultCommandProvider)
public CommandServiceImpl(ReadPersistenceService persistenceService, Recorder recorder, EventService eventService, TechnicalLoggerService logger, QueriableLoggerService queriableLoggerService, CommandProvider defaultCommandProvider, int fetchSize)
public void create(SCommand command) throws SCommandAlreadyExistsException, SCommandCreationException
CommandServicecreate in interface CommandServicecommand - command without IdSCommandAlreadyExistsException - Error thrown when relative command already existsSCommandCreationException - Error thrown if has exceptions during the creating command.public void delete(long commandId)
throws SCommandNotFoundException,
SCommandDeletionException
CommandServicedelete in interface CommandServicecommandId - identifier of command which will be deletedSCommandNotFoundException - Error thrown if no command have name corresponding to the parameter.SCommandDeletionException - Error thrown if has exception during the deleting command.protected void delete(SCommand command, SCommandLogBuilder logBuilder) throws SCommandDeletionException
SCommandDeletionExceptionpublic void delete(java.lang.String commandName)
throws SCommandNotFoundException,
SCommandDeletionException
CommandServicedelete in interface CommandServicecommandName - Name of command which will be deletedSCommandNotFoundException - Error thrown if no command have name corresponding to the parameter.SCommandDeletionException - Error thrown if has exception during the deleting command.public void deleteAll()
throws SCommandDeletionException
CommandServicedeleteAll in interface CommandServiceSCommandDeletionException - Error thrown if has exception during the deleting command.public SCommand get(java.lang.String commandName) throws SCommandNotFoundException
CommandServiceget in interface CommandServicecommandName - Name of commandSCommandNotFoundException - Error thrown if no command have name corresponding to the parameter.public java.util.List<SCommand> getAllCommands(int startIndex, int maxResults, SCommandCriterion sCommandCriterion) throws SCommandGettingException
CommandServicegetAllCommands in interface CommandServicestartIndex - 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 commandsSCommandGettingException - Error thrown if has exception during the command getting.public void update(SCommand command, EntityUpdateDescriptor updateDescriptor) throws SCommandUpdateException
CommandServiceupdate in interface CommandServicecommand - The command will be updatedupdateDescriptor - The description for update commandSCommandUpdateException - Error thrown if has exception during the command updating.public java.util.List<SCommand> getUserCommands(int startIndex, int maxResults, SCommandCriterion sCommandCriterion) throws SCommandGettingException
CommandServicegetUserCommands in interface CommandServicestartIndex - 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 commandsSCommandGettingException - Error thrown if has exception during the command getting.public SCommand get(long commandId) throws SCommandNotFoundException
CommandServiceget in interface CommandServicecommandId - identifier of commandSCommandNotFoundException - Error thrown if no command have name corresponding to the parameter.public long getNumberOfCommands(QueryOptions options) throws SBonitaReadException
CommandServicegetNumberOfCommands in interface CommandServiceoptions - search criteriaSBonitaReadExceptionpublic java.util.List<SCommand> searchCommands(QueryOptions options) throws SBonitaReadException
CommandServicesearchCommands in interface CommandServiceoptions - search criteriaSBonitaReadExceptionpublic void start()
throws SBonitaException
LifecycleServicestart in interface LifecycleServiceSBonitaExceptionpublic void stop()
throws SBonitaException
stop in interface LifecycleServiceSBonitaExceptionpublic void pause()
throws SBonitaException
LifecycleServicepause in interface LifecycleServiceSBonitaExceptionpublic void resume()
throws SBonitaException
LifecycleServiceresume in interface LifecycleServiceSBonitaException