public interface PlatformCommandAPI
CommandAPI
for more explanations of how to deploy, execute and undeploy a command. The only
difference between API and CommandAPI
is that these commands must extend org.bonitasoft.engine.command.PlatformCommand
.
Manipulate tenant commands, it can be registered, unregistered and executed with parameters.CommandAPI
for more explanations on how to deploy, execute and undeploy a command. The only
difference with CommandAPI
is that here commands must extends org.bonitasoft.engine.command.PlatformCommand
.CommandDescriptor
Modifier and Type | Method and Description |
---|---|
void |
addDependency(String name,
byte[] jar)
Adds a dependency to the tenant scope.
|
Serializable |
execute(String name,
Map<String,Serializable> parameters)
Execute a command according to its name and a list of parameters.
|
CommandDescriptor |
get(String name)
Deprecated.
As of release 6.2.1, replaced by
getCommand(String) that does not throw CreationException. |
CommandDescriptor |
getCommand(String commandName)
Returns the command descriptor corresponding to the command name passed as parameter.
|
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)
Remove a dependency to the tenant scope.
|
void |
unregister(String name)
Delete 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 was already taken by 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 provided 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 uses when executing the command.InvalidSessionException
- occurs when the session is not validAlreadyExistsException
- occurs when the command name was already taken by 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 deletion@Deprecated CommandDescriptor get(String name) throws CommandNotFoundException, CreationException
getCommand(String)
that does not throw CreationException.name
- the command nameInvalidSessionException
- occurs when the session is not validCommandNotFoundException
- occurs when the command name does not refer to an existing command.CreationException
CommandDescriptor getCommand(String commandName) throws CommandNotFoundException
commandName
- the name of the command.InvalidSessionException
- 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
- occurs when 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 © 2014 Bonitasoft S.A.. All Rights Reserved.