public interface PlatformCommandAPI
CommandAPI for an explanation of how to deploy, execute, ... a command. The only
difference between the CommandAPI and the PlatformCommandAPI is that a platform command must extend
org.bonitasoft.engine.command.PlatformCommand.CommandDescriptor| Modifier and Type | Method and Description |
|---|---|
void |
addDependency(String name,
byte[] jar)
Adds a dependency.
|
Serializable |
execute(String name,
Map<String,Serializable> parameters)
Executes a command according to its name and the list of parameters.
|
CommandDescriptor |
getCommand(String commandName)
Returns the command descriptor corresponding to the given command name.
|
List<CommandDescriptor> |
getCommands(int startIndex,
int maxResults,
CommandCriterion sort)
Returns the paginated list of command descriptors according to the sort criterion.
|
CommandDescriptor |
register(String name,
String description,
String implementation)
Adds a command and its descriptor.
|
void |
removeDependency(String name)
Removes the dependency.
|
void |
unregister(String name)
Deletes a command and its descriptor.
|
void |
update(String name,
CommandUpdater updater)
Updates a command according to the update descriptor.
|
void addDependency(String name, byte[] jar) throws AlreadyExistsException, CreationException
name - the dependency name.jar - the JAR contentInvalidSessionException - occurs when the session is not validAlreadyExistsException - occurs when the dependency name is already used for another dependencyCreationException - if a problem occurs when creating the dependencyvoid removeDependency(String name) throws DependencyNotFoundException, DeletionException
name - the dependency name.InvalidSessionException - if the current platform session is not validDependencyNotFoundException - if no dependency can be found with the specified nameDeletionException - if a problem occurs when deleting the dependencyCommandDescriptor register(String name, String description, String implementation) throws AlreadyExistsException, CreationException
name - the command namedescription - the command descriptionimplementation - the implementation class which will be used when executing the commandInvalidSessionException - occurs when the session is not validAlreadyExistsException - occurs when the command name is already used for another commandCreationException - if a problem occurs when registering the commandSerializable execute(String name, Map<String,Serializable> parameters) throws CommandNotFoundException, CommandParameterizationException, CommandExecutionException
name - the command nameparameters - the parameters (specific to the command to execute)InvalidSessionException - occurs when the session is not validCommandNotFoundException - occurs when the name does not refer to any existing commandCommandParameterizationException - when command parameters are not correctCommandExecutionException - occurs when an exception is thrown during command executionvoid unregister(String name) throws CommandNotFoundException, DeletionException
name - the command nameInvalidSessionException - occurs when the session is not validCommandNotFoundException - occurs when the name does not refer to an existing commandDeletionException - occurs when an exception is thrown during command deletionCommandDescriptor getCommand(String commandName) throws CommandNotFoundException
commandName - the name of the commandInvalidSessionException - occurs when the session is not validCommandNotFoundException - occurs when the command name does not refer to an existing command.List<CommandDescriptor> getCommands(int startIndex, int maxResults, CommandCriterion sort)
startIndex - the start indexmaxResults - the number of CommandDescriptor to retrievesort - the sorting criterionInvalidSessionException - occurs when the session is not validvoid update(String name, CommandUpdater updater) throws CommandNotFoundException, UpdateException
name - the command nameupdater - the update descriptorInvalidSessionException - if the session is not validCommandNotFoundException - occurs when the name does not refer to any existing commandUpdateException - occurs when an exception is thrown during command updateCopyright © 2018 Bonitasoft S.A.. All rights reserved.