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
FieldsModifier and TypeFieldDescriptionprotected final StringService name to carry out operations for.protected final StringSnapshot name to utilize.static final SimpleDateFormatFormat month name.static final longSleep time between checking operation completion.protected static final StringResult to output on command success.static final SimpleDateFormatFormat weekday name. -
Constructor Summary
ConstructorsConstructorDescriptionAbstractSnapshotStatement(String sSnapshotName, String sServiceName) Create a AbstractSnapshotStatement that will prove base functionality for other snapshot commands. -
Method Summary
Modifier and TypeMethodDescriptionprotected 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, sanityCheckMethods 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, newHashMap, newHashMap, newHashSet, newHashSet, 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, waitMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods 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: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
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- 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
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
-