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
Abstract implementation of an
AbstractStatement
providing functionality
useful for generic snapshot statements.-
Nested Class Summary
Nested classes/interfaces inherited from class com.tangosol.util.Base
Base.LoggingWriter
-
Field Summary
Modifier and TypeFieldDescriptionprotected final String
Service name to carry out operations for.protected final String
Snapshot name to utilize.static final SimpleDateFormat
Format month name.static final long
Sleep time between checking operation completion.protected static final String
Result to output on command success.static final SimpleDateFormat
Format weekday name. -
Constructor Summary
ConstructorDescriptionAbstractSnapshotStatement
(String sSnapshotName, String sServiceName) Create a AbstractSnapshotStatement that will prove base functionality for other snapshot commands. -
Method Summary
Modifier and TypeMethodDescriptionprotected String
getConfirmationMessage
(String sAction) Return a confirmation message.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 - Minutevoid
showPlan
(PrintWriter out) Output to the providedPrintWriter
a human readable trace of the actions that will be taken by this statement if or when executed.protected void
validateArchivedSnapshotExistsForService
(com.tangosol.coherence.dslquery.internal.PersistenceToolsHelper helper) Validate that an archived snapshot f_sSnapshotName exists for the given service f_sServiceName.protected void
validateServiceExists
(com.tangosol.coherence.dslquery.internal.PersistenceToolsHelper helper) Validate that the service f_sServiceName exists.protected void
validateSnapshotExistsForService
(com.tangosol.coherence.dslquery.internal.PersistenceToolsHelper helper) Validate that a snapshot f_sSnapshotName exists for the given service f_sServiceName.protected void
validateSnapshotName
(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 Details
-
SUCCESS
Result to output on command success.- See Also:
-
MONTH_NAME
Format month name. -
WEEKDAY_NAME
Format weekday name. -
SLEEP_TIME
public static final long SLEEP_TIMESleep time between checking operation completion.- See Also:
-
f_sSnapshotName
Snapshot name to utilize. -
f_sServiceName
Service name to carry out operations for.
-
-
Constructor Details
-
AbstractSnapshotStatement
Create a AbstractSnapshotStatement that will prove base functionality for other snapshot commands.- Parameters:
sSnapshotName
- the snapshot name to createsServiceName
- the service to snapshot
-
-
Method Details
-
showPlan
Description copied from interface:Statement
Output to the providedPrintWriter
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
Return a confirmation message.- Parameters:
sAction
- the action to be performed- Returns:
- a confirmation message
-
validateSnapshotName
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
- thePersistenceToolsHelper
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
- thePersistenceToolsHelper
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
- thePersistenceToolsHelper
instance to use to validate
-
replaceDateMacros
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
-