Cumulus4j API
(1.1.0)

org.cumulus4j.store.datastoreversion
Interface DatastoreVersionCommand

All Known Implementing Classes:
AbstractDatastoreVersionCommand, IntroduceKeyStoreRefID, MigrateToSequence2, MinimumCumulus4jVersion, RecreateIndex

public interface DatastoreVersionCommand

Command for managing a datastore version (change).

A new instance of a class implementing this interface is created for each run of DatastoreVersionManager.applyOnce(org.cumulus4j.store.crypto.CryptoContext). Therefore, implementations do not need to be thread-safe and can share data in fields across implementation methods.

Implementations should subclass AbstractDatastoreVersionCommand instead of directly implementing this interface.

Implementations must be manually registered in DatastoreVersionManager!

Author:
Marco หงุ่ยตระกูล-Schulze - marco at nightlabs dot de

Method Summary
 void apply(CommandApplyParam commandApplyParam)
          Perform the upgrade or do whatever this command has to do.
 String getCommandID()
           
 int getCommandVersion()
          Get the version of this command.
 boolean isFinal()
          Is this command final, i.e.
 boolean isKeyStoreDependent()
          Is this command dependent on the key-store? If yes, it is applied separately for every key-store, i.e.
 

Method Detail

getCommandID

String getCommandID()

getCommandVersion

int getCommandVersion()
Get the version of this command.

This version must be incremented, if this command is modified!

Note, that a final command cannot be modified!!! You can only modify a final command if this command was newly introduced in the current SNAPSHOT. Never modify a command after it was released!!!

Returns:
the version of this command.

apply

void apply(CommandApplyParam commandApplyParam)
Perform the upgrade or do whatever this command has to do.

Parameters:
commandApplyParam - various arguments bundled for better compatibility with future extensions. Never null.

isFinal

boolean isFinal()
Is this command final, i.e. applied only once, or should this command be applied again, when the commandVersion was incremented?

Returns:
true, if this command is final; false otherwise.

isKeyStoreDependent

boolean isKeyStoreDependent()
Is this command dependent on the key-store? If yes, it is applied separately for every key-store, i.e. with different keyStoreRefIDs. If no, it is applied only once globally.

Returns:
true, if this command should be applied once per key-store (and per underlying PersistenceManager [there might be two if data and index is stored separately]); false otherwise.

Cumulus4j API
(1.1.0)

Copyright © 2013 NightLabs Consulting GmbH. All Rights Reserved.