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 anAbstractStatementproviding functionality useful for generic snapshot statements.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class com.tangosol.util.Base
Base.LoggingWriter
-
-
Field Summary
Fields Modifier and Type Field Description protected Stringf_sServiceNameService name to carry out operations for.protected Stringf_sSnapshotNameSnapshot name to utilize.static SimpleDateFormatMONTH_NAMEFormat month name.static longSLEEP_TIMESleep time between checking operation completion.protected static StringSUCCESSResult to output on command success.static SimpleDateFormatWEEKDAY_NAMEFormat weekday name.
-
Constructor Summary
Constructors Constructor Description AbstractSnapshotStatement(String sSnapshotName, String sServiceName)Create a AbstractSnapshotStatement that will prove base functionality for other snapshot commands.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected StringgetConfirmationMessage(String sAction)Return a confirmation message.protected static StringreplaceDateMacros(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 - MinutevoidshowPlan(PrintWriter out)Output to the providedPrintWritera human readable trace of the actions that will be taken by this statement if or when executed.protected voidvalidateArchivedSnapshotExistsForService(com.tangosol.coherence.dslquery.internal.PersistenceToolsHelper helper)Validate that an archived snapshot f_sSnapshotName exists for the given service f_sServiceName.protected voidvalidateServiceExists(com.tangosol.coherence.dslquery.internal.PersistenceToolsHelper helper)Validate that the service f_sServiceName exists.protected voidvalidateSnapshotExistsForService(com.tangosol.coherence.dslquery.internal.PersistenceToolsHelper helper)Validate that a snapshot f_sSnapshotName exists for the given service f_sServiceName.protected voidvalidateSnapshotName(String sSnapshotName)Validate that the snapshot name conforms to standard.-
Methods inherited from class com.tangosol.coherence.dslquery.statement.AbstractStatement
assertCacheName, getExecutionConfirmation, sanityCheck
-
Methods inherited from class com.tangosol.util.Base
azzert, azzert, azzert, azzertFailed, breakLines, breakLines, capitalize, checkNotEmpty, checkNotNull, checkRange, computeSafeWaitTime, decimalValue, dup, dup, ensureBigDecimal, ensureClassLoader, ensureRuntimeException, ensureRuntimeException, equals, equalsDeep, err, err, err, err, err, escape, formatDateTime, getCallerStackFrame, getCommonMonitor, getCommonMonitor, getCommonMonitor, getContextClassLoader, getContextClassLoader, getDeepMessage, getErr, getLastSafeTimeMillis, getLog, getMaxDecDigits, getMaxHexDigits, getOriginalException, getOut, getProcessRandom, getRandom, getRandomBinary, getRandomBinary, getRandomString, getSafeTimeMillis, getStackFrame, getStackFrames, getStackTrace, getStackTrace, getStackTrace, getThreadFactory, getTimeZone, getUpTimeMillis, hashCode, hexValue, indentString, indentString, isDecimal, isHex, isLogEcho, isOctal, log, log, log, log, log, makeInteger, makeLong, makeThread, mergeArray, mergeBooleanArray, mergeByteArray, mergeCharArray, mergeDoubleArray, mergeFloatArray, mergeIntArray, mergeLongArray, mod, mod, octalValue, out, out, out, out, out, pad, parseBandwidth, parseBandwidth, parseDelimitedString, parseHex, parseHex, parseMemorySize, parseMemorySize, parsePercentage, parseTime, parseTime, parseTimeNanos, parseTimeNanos, printStackTrace, randomize, randomize, randomize, randomize, read, read, read, read, read, read, read, replace, setErr, setLog, setLogEcho, setOut, sleep, toBandwidthString, toBandwidthString, toCharEscape, toCrc, toCrc, toCrc, toCrc, toCrc, toDecString, toDelimitedString, toDelimitedString, toDelimitedString, toDelimitedString, toHex, toHex, toHexDump, toHexEscape, toHexEscape, toHexEscape, toHexEscape, toHexString, toMemorySizeString, toMemorySizeString, toQuotedCharEscape, toQuotedStringEscape, toSqlString, toString, toString, toStringEscape, toUnicodeEscape, trace, trace, trace, trace, trace, trace, trace, trace, trace, truncateString, truncateString, wait
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface com.tangosol.coherence.dslquery.Statement
execute, executeAsync, isManagingTimeout
-
-
-
-
Field Detail
-
SUCCESS
protected static final String SUCCESS
Result to output on command success.- See Also:
- Constant Field Values
-
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:
- Constant Field Values
-
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.
-
-
Method Detail
-
showPlan
public void showPlan(PrintWriter out)
Description copied from interface:StatementOutput to the providedPrintWritera 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- thePersistenceToolsHelperinstance 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- thePersistenceToolsHelperinstance 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- thePersistenceToolsHelperinstance 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
-
-