Class CommandAPIImpl

  • All Implemented Interfaces:
    org.bonitasoft.engine.api.CommandAPI

    public class CommandAPIImpl
    extends java.lang.Object
    implements org.bonitasoft.engine.api.CommandAPI
    Author:
    Zhang Bole, Matthieu Chaffotte, Celine Souchet, Emmanuel Duchastenier, Laurent Vaills
    • Constructor Summary

      Constructors 
      Constructor Description
      CommandAPIImpl()  
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void addDependency​(java.lang.String name, byte[] jar)  
      java.io.Serializable execute​(long commandId, java.util.Map<java.lang.String,​java.io.Serializable> parameters)  
      java.io.Serializable execute​(java.lang.String commandName, java.util.Map<java.lang.String,​java.io.Serializable> parameters)  
      java.io.Serializable executeWithUserTransactions​(long commandId, java.util.Map<java.lang.String,​java.io.Serializable> parameters)  
      java.io.Serializable executeWithUserTransactions​(java.lang.String commandName, java.util.Map<java.lang.String,​java.io.Serializable> parameters)  
      org.bonitasoft.engine.command.CommandDescriptor get​(long commandId)  
      java.util.List<org.bonitasoft.engine.command.CommandDescriptor> getAllCommands​(int startIndex, int maxResults, org.bonitasoft.engine.command.CommandCriterion sort)  
      org.bonitasoft.engine.command.CommandDescriptor getCommand​(java.lang.String commandName)  
      protected static TenantServiceAccessor getTenantAccessor()  
      java.util.List<org.bonitasoft.engine.command.CommandDescriptor> getUserCommands​(int startIndex, int maxResults, org.bonitasoft.engine.command.CommandCriterion sort)  
      org.bonitasoft.engine.command.CommandDescriptor register​(java.lang.String name, java.lang.String description, java.lang.String implementation)  
      void removeDependency​(java.lang.String name)  
      org.bonitasoft.engine.search.SearchResult<org.bonitasoft.engine.command.CommandDescriptor> searchCommands​(org.bonitasoft.engine.search.SearchOptions searchOptions)  
      void unregister​(long commandId)  
      void unregister​(java.lang.String name)  
      void unregisterAll()  
      void update​(long commandId, org.bonitasoft.engine.command.CommandUpdater updateDescriptor)  
      void update​(java.lang.String commandName, org.bonitasoft.engine.command.CommandUpdater updateDescriptor)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • CommandAPIImpl

        public CommandAPIImpl()
    • Method Detail

      • addDependency

        public void addDependency​(java.lang.String name,
                                  byte[] jar)
                           throws org.bonitasoft.engine.exception.AlreadyExistsException,
                                  org.bonitasoft.engine.exception.CreationException
        Specified by:
        addDependency in interface org.bonitasoft.engine.api.CommandAPI
        Throws:
        org.bonitasoft.engine.exception.AlreadyExistsException
        org.bonitasoft.engine.exception.CreationException
      • removeDependency

        public void removeDependency​(java.lang.String name)
                              throws org.bonitasoft.engine.command.DependencyNotFoundException,
                                     org.bonitasoft.engine.exception.DeletionException
        Specified by:
        removeDependency in interface org.bonitasoft.engine.api.CommandAPI
        Throws:
        org.bonitasoft.engine.command.DependencyNotFoundException
        org.bonitasoft.engine.exception.DeletionException
      • register

        public org.bonitasoft.engine.command.CommandDescriptor register​(java.lang.String name,
                                                                        java.lang.String description,
                                                                        java.lang.String implementation)
                                                                 throws org.bonitasoft.engine.exception.AlreadyExistsException,
                                                                        org.bonitasoft.engine.exception.CreationException
        Specified by:
        register in interface org.bonitasoft.engine.api.CommandAPI
        Throws:
        org.bonitasoft.engine.exception.AlreadyExistsException
        org.bonitasoft.engine.exception.CreationException
      • execute

        public java.io.Serializable execute​(java.lang.String commandName,
                                            java.util.Map<java.lang.String,​java.io.Serializable> parameters)
                                     throws org.bonitasoft.engine.command.CommandNotFoundException,
                                            org.bonitasoft.engine.command.CommandParameterizationException,
                                            org.bonitasoft.engine.command.CommandExecutionException
        Specified by:
        execute in interface org.bonitasoft.engine.api.CommandAPI
        Throws:
        org.bonitasoft.engine.command.CommandNotFoundException
        org.bonitasoft.engine.command.CommandParameterizationException
        org.bonitasoft.engine.command.CommandExecutionException
      • execute

        public java.io.Serializable execute​(long commandId,
                                            java.util.Map<java.lang.String,​java.io.Serializable> parameters)
                                     throws org.bonitasoft.engine.command.CommandNotFoundException,
                                            org.bonitasoft.engine.command.CommandParameterizationException,
                                            org.bonitasoft.engine.command.CommandExecutionException
        Specified by:
        execute in interface org.bonitasoft.engine.api.CommandAPI
        Throws:
        org.bonitasoft.engine.command.CommandNotFoundException
        org.bonitasoft.engine.command.CommandParameterizationException
        org.bonitasoft.engine.command.CommandExecutionException
      • executeWithUserTransactions

        public java.io.Serializable executeWithUserTransactions​(java.lang.String commandName,
                                                                java.util.Map<java.lang.String,​java.io.Serializable> parameters)
                                                         throws org.bonitasoft.engine.command.CommandNotFoundException,
                                                                org.bonitasoft.engine.command.CommandParameterizationException,
                                                                org.bonitasoft.engine.command.CommandExecutionException
        Specified by:
        executeWithUserTransactions in interface org.bonitasoft.engine.api.CommandAPI
        Throws:
        org.bonitasoft.engine.command.CommandNotFoundException
        org.bonitasoft.engine.command.CommandParameterizationException
        org.bonitasoft.engine.command.CommandExecutionException
      • executeWithUserTransactions

        public java.io.Serializable executeWithUserTransactions​(long commandId,
                                                                java.util.Map<java.lang.String,​java.io.Serializable> parameters)
                                                         throws org.bonitasoft.engine.command.CommandNotFoundException,
                                                                org.bonitasoft.engine.command.CommandParameterizationException,
                                                                org.bonitasoft.engine.command.CommandExecutionException
        Specified by:
        executeWithUserTransactions in interface org.bonitasoft.engine.api.CommandAPI
        Throws:
        org.bonitasoft.engine.command.CommandNotFoundException
        org.bonitasoft.engine.command.CommandParameterizationException
        org.bonitasoft.engine.command.CommandExecutionException
      • unregister

        public void unregister​(long commandId)
                        throws org.bonitasoft.engine.command.CommandNotFoundException,
                               org.bonitasoft.engine.exception.DeletionException
        Specified by:
        unregister in interface org.bonitasoft.engine.api.CommandAPI
        Throws:
        org.bonitasoft.engine.command.CommandNotFoundException
        org.bonitasoft.engine.exception.DeletionException
      • unregister

        public void unregister​(java.lang.String name)
                        throws org.bonitasoft.engine.command.CommandNotFoundException,
                               org.bonitasoft.engine.exception.DeletionException
        Specified by:
        unregister in interface org.bonitasoft.engine.api.CommandAPI
        Throws:
        org.bonitasoft.engine.command.CommandNotFoundException
        org.bonitasoft.engine.exception.DeletionException
      • unregisterAll

        public void unregisterAll()
                           throws org.bonitasoft.engine.exception.DeletionException
        Specified by:
        unregisterAll in interface org.bonitasoft.engine.api.CommandAPI
        Throws:
        org.bonitasoft.engine.exception.DeletionException
      • get

        public org.bonitasoft.engine.command.CommandDescriptor get​(long commandId)
                                                            throws org.bonitasoft.engine.command.CommandNotFoundException
        Specified by:
        get in interface org.bonitasoft.engine.api.CommandAPI
        Throws:
        org.bonitasoft.engine.command.CommandNotFoundException
      • getCommand

        public org.bonitasoft.engine.command.CommandDescriptor getCommand​(java.lang.String commandName)
                                                                   throws org.bonitasoft.engine.command.CommandNotFoundException
        Specified by:
        getCommand in interface org.bonitasoft.engine.api.CommandAPI
        Throws:
        org.bonitasoft.engine.command.CommandNotFoundException
      • getAllCommands

        public java.util.List<org.bonitasoft.engine.command.CommandDescriptor> getAllCommands​(int startIndex,
                                                                                              int maxResults,
                                                                                              org.bonitasoft.engine.command.CommandCriterion sort)
        Specified by:
        getAllCommands in interface org.bonitasoft.engine.api.CommandAPI
      • update

        public void update​(long commandId,
                           org.bonitasoft.engine.command.CommandUpdater updateDescriptor)
                    throws org.bonitasoft.engine.exception.UpdateException
        Specified by:
        update in interface org.bonitasoft.engine.api.CommandAPI
        Throws:
        org.bonitasoft.engine.exception.UpdateException
      • update

        public void update​(java.lang.String commandName,
                           org.bonitasoft.engine.command.CommandUpdater updateDescriptor)
                    throws org.bonitasoft.engine.exception.UpdateException
        Specified by:
        update in interface org.bonitasoft.engine.api.CommandAPI
        Throws:
        org.bonitasoft.engine.exception.UpdateException
      • getUserCommands

        public java.util.List<org.bonitasoft.engine.command.CommandDescriptor> getUserCommands​(int startIndex,
                                                                                               int maxResults,
                                                                                               org.bonitasoft.engine.command.CommandCriterion sort)
        Specified by:
        getUserCommands in interface org.bonitasoft.engine.api.CommandAPI
      • searchCommands

        public org.bonitasoft.engine.search.SearchResult<org.bonitasoft.engine.command.CommandDescriptor> searchCommands​(org.bonitasoft.engine.search.SearchOptions searchOptions)
                                                                                                                  throws org.bonitasoft.engine.exception.SearchException
        Specified by:
        searchCommands in interface org.bonitasoft.engine.api.CommandAPI
        Throws:
        org.bonitasoft.engine.exception.SearchException