1 package org.simantics.scl.commands;
3 import org.simantics.db.RequestProcessor;
4 import org.simantics.db.Resource;
5 import org.simantics.db.exception.DatabaseException;
6 import org.simantics.db.procedure.Procedure;
9 * Command object represents a UI-operation that makes changes to the database.
11 * @author Hannu Niemistö
13 public interface Command {
15 * Checks that parameter values satisfy conditions needed for execution of the command.
16 * It is not necessary to give all the parameters that are given to commit-method. In that
17 * case this function makes just a partial checking of the given parameters.
19 boolean check(RequestProcessor processor, Resource model, Object ... parameters) throws DatabaseException;
22 * Tries to execute the command.
24 Object execute(RequestProcessor processor, Resource model, Object ... parameters) throws DatabaseException;
27 * Tries to execute the command asynchronously.
29 void asyncExecute(RequestProcessor processor, Resource model, Object[] parameters,
30 Procedure<Object> procedure);