| java.lang.Object org.space4j.Command
All known Subclasses: org.space4j.commands.CollectionAddCmd, org.space4j.demos.phonebook.commands.RemovePhoneCmd, org.space4j.commands.IncrementSeqCmd, org.space4j.commands.MapPutCmd, org.space4j.commands.ObjCreateCmd, org.space4j.indexing.CreateIndexCmd, org.space4j.commands.MapRemoveCmd, org.space4j.commands.CollectionRemoveCmd, org.space4j.demos.phonebook.commands.CreatePhoneCmd, org.space4j.indexing.DropIndexCmd, org.space4j.commands.MapCreateCmd,
Command | abstract public class Command implements Serializable(Code) | | A command representing an update to the Space4J database of objects in RAM.
All clients must alter the Space through a Command, so they can be logged and reapplied later.
|
Method Summary | |
abstract public int | execute(Space space) This method accesses the Space and its objects to do any modifications it wants.
Parameters: space - The Space where the objects are stored. | public void | executeSQL(Connection conn) This method will let you replicate your data in a relational database,
so you can continue creating your reports and using data data warehousing tools with SQL.
Doing this with Space4J and Commands is possible, but not recommended at all.
Note that this method is not abstract, therefore it is not required. | public long | getLogNumber() This method is important when Space4J is replicated.
It tells the replicas in what log this command is stored.
This will be very important when a replica wants to take a snapshot. | public long | getReplicaId() | public void | setLogNumber(long lognumber) | public void | setReplicaId(long replica_id) |
execute | abstract public int execute(Space space) throws CommandException(Code) | | This method accesses the Space and its objects to do any modifications it wants.
Parameters: space - The Space where the objects are stored. An int with the number of objects altered by this operation. throws: CommandException - If there was an error executing this command. |
executeSQL | public void executeSQL(Connection conn) throws SQLException(Code) | | This method will let you replicate your data in a relational database,
so you can continue creating your reports and using data data warehousing tools with SQL.
Doing this with Space4J and Commands is possible, but not recommended at all.
Note that this method is not abstract, therefore it is not required.
It is up to the system to replicate its data in a relational database.
Rodolfo de Paula was the first one to raise this issue! Why not have the best of both worlds?
Parameters: conn - A connection to the database where this command will be executed through SQL. throws: SQLException - If there was an error executing the SQL. |
getLogNumber | public long getLogNumber()(Code) | | This method is important when Space4J is replicated.
It tells the replicas in what log this command is stored.
This will be very important when a replica wants to take a snapshot. It will need to know this number.
The number of the log where this command is stored. |
getReplicaId | public long getReplicaId()(Code) | | This method is important when Space4J is replicated.
It tells from which replica this command came from.
This will be very important when a replica has to wait for a command to return from the main replica.
The unique id of the replica. |
setLogNumber | public void setLogNumber(long lognumber)(Code) | | Sets the log number where this command is stored.
Parameters: lognumber - The log number where this command is stored.
|
setReplicaId | public void setReplicaId(long replica_id)(Code) | | Sets the number of the replica this commands belongs to.
Parameters: replica_id - The unique id of the replica.
|
|
|