Class AbstractSnapshotStatement

java.lang.Object
com.tangosol.util.Base
com.tangosol.coherence.dslquery.statement.AbstractStatement
com.tangosol.coherence.dslquery.statement.persistence.AbstractSnapshotStatement
All Implemented Interfaces:
Statement
Direct Known Subclasses:
ArchiveSnapshotStatementBuilder.ArchiveSnapshotStatement, CreateSnapshotStatementBuilder.CreateSnapshotStatement, RecoverSnapshotStatementBuilder.RecoverSnapshotStatement, RemoveSnapshotStatementBuilder.RemoveSnapshotStatement, RetrieveSnapshotStatementBuilder.RetrieveSnapshotStatement

public abstract class AbstractSnapshotStatement extends AbstractStatement
Abstract implementation of an AbstractStatement providing functionality useful for generic snapshot statements.
  • Field Details

    • SUCCESS

      protected static final String SUCCESS
      Result to output on command success.
      See Also:
    • MONTH_NAME

      public static final SimpleDateFormat MONTH_NAME
      Format month name.
    • WEEKDAY_NAME

      public static final SimpleDateFormat WEEKDAY_NAME
      Format weekday name.
    • SLEEP_TIME

      public static final long SLEEP_TIME
      Sleep time between checking operation completion.
      See Also:
    • f_sSnapshotName

      protected final String f_sSnapshotName
      Snapshot name to utilize.
    • f_sServiceName

      protected final String f_sServiceName
      Service name to carry out operations for.
  • Constructor Details

    • AbstractSnapshotStatement

      public AbstractSnapshotStatement(String sSnapshotName, String sServiceName)
      Create a AbstractSnapshotStatement that will prove base functionality for other snapshot commands.
      Parameters:
      sSnapshotName - the snapshot name to create
      sServiceName - the service to snapshot
  • Method Details

    • showPlan

      public void showPlan(PrintWriter out)
      Description copied from interface: Statement
      Output to the provided PrintWriter a human readable trace of the actions that will be taken by this statement if or when executed.
      Parameters:
      out - the PrintWriter to write the trace to
    • getConfirmationMessage

      protected String getConfirmationMessage(String sAction)
      Return a confirmation message.
      Parameters:
      sAction - the action to be performed
      Returns:
      a confirmation message
    • validateSnapshotName

      protected void validateSnapshotName(String sSnapshotName) throws CohQLException
      Validate that the snapshot name conforms to standard.
      Parameters:
      sSnapshotName - the name of snapshot to validate
      Throws:
      CohQLException - if the name is not valid
    • validateServiceExists

      protected void validateServiceExists(com.tangosol.coherence.dslquery.internal.PersistenceToolsHelper helper)
      Validate that the service f_sServiceName exists.
      Parameters:
      helper - the PersistenceToolsHelper instance to use to validate
    • validateSnapshotExistsForService

      protected void validateSnapshotExistsForService(com.tangosol.coherence.dslquery.internal.PersistenceToolsHelper helper)
      Validate that a snapshot f_sSnapshotName exists for the given service f_sServiceName.
      Parameters:
      helper - the PersistenceToolsHelper instance to use to validate
    • validateArchivedSnapshotExistsForService

      protected void validateArchivedSnapshotExistsForService(com.tangosol.coherence.dslquery.internal.PersistenceToolsHelper helper)
      Validate that an archived snapshot f_sSnapshotName exists for the given service f_sServiceName.
      Parameters:
      helper - the PersistenceToolsHelper instance to use to validate
    • replaceDateMacros

      protected static String replaceDateMacros(String sSnapshotName)
      Replace the following macro's for the snapshot name:
      • %y - Year
      • %m - Month
      • %d - Day of month
      • %w - Day of week. mon,tues,wed, etc
      • %M - Month name - Jan, Feb, etc
      • %hh - Hour
      • %mm - Minute
      Parameters:
      sSnapshotName - the snapshot name to replace macros
      Returns:
      the formatted snapshot name