public class SnapshotServiceFactoryBean<K,V> extends AbstractFactoryBeanSupport<SnapshotServiceFactoryBean.SnapshotServiceAdapter<K,V>> implements InitializingBean, DisposableBean, ApplicationListener<SnapshotApplicationEvent<K,V>>
DisposableBean
,
FactoryBean
,
InitializingBean
,
ApplicationListener
,
SnapshotServiceFactoryBean.SnapshotServiceAdapter
,
CacheSnapshotService
,
RegionSnapshotService
Modifier and Type | Class and Description |
---|---|
protected static class |
SnapshotServiceFactoryBean.ArchiveFileFilter
The ArchiveFileFilter class is a Java FileFilter implementation accepting any File that is either
a JAR file or ZIP file.
|
protected static class |
SnapshotServiceFactoryBean.CacheSnapshotServiceAdapter
The CacheSnapshotServiceAdapter is a SnapshotServiceAdapter adapting Pivotal GemFire's CacheSnapshotService.
|
protected static class |
SnapshotServiceFactoryBean.RegionSnapshotServiceAdapter<K,V>
The RegionSnapshotServiceAdapter is a SnapshotServiceAdapter adapting Pivotal GemFire's RegionSnapshotService.
|
static class |
SnapshotServiceFactoryBean.SnapshotMetadata<K,V>
The SnapshotMetadata class encapsulates details of the Pivotal GemFire Cache or Region data snapshot
on either import or export.
|
static interface |
SnapshotServiceFactoryBean.SnapshotServiceAdapter<K,V>
The SnapshotServiceAdapter interface is an Adapter adapting both Pivotal GemFire CacheSnapshotService
and RegionSnapshotService to treat them uniformly.
|
protected static class |
SnapshotServiceFactoryBean.SnapshotServiceAdapterSupport<K,V>
SnapshotServiceAdapterSupport is an abstract base class for all SnapshotServiceAdapter implementations
encapsulating common reusable functionality.
|
Modifier and Type | Field and Description |
---|---|
protected static SnapshotServiceFactoryBean.SnapshotMetadata[] |
EMPTY_ARRAY |
DEFAULT_SINGLETON
OBJECT_TYPE_ATTRIBUTE
Constructor and Description |
---|
SnapshotServiceFactoryBean() |
Modifier and Type | Method and Description |
---|---|
void |
afterPropertiesSet()
Constructs and initializes the Pivotal GemFire Snapshot Service used to take a snapshot of the configured Cache
or Region if initialized.
|
protected SnapshotServiceFactoryBean.SnapshotServiceAdapter |
create()
Constructs an appropriate instance of the SnapshotServiceAdapter based on the FactoryBean configuration.
|
void |
destroy()
Performs an export of the Pivotal GemFire Cache or Region if configured.
|
protected org.apache.geode.cache.Cache |
getCache()
Gets a reference to the Pivotal GemFire Cache for which the snapshot will be taken.
|
protected SnapshotServiceFactoryBean.SnapshotMetadata<K,V>[] |
getExports()
Sets the meta-data (location, filter and format) used to create a snapshot from the Cache or Region data.
|
protected SnapshotServiceFactoryBean.SnapshotMetadata<K,V>[] |
getImports()
Gets the meta-data (location, filter and format) used to read a data snapshot into an entire Cache
or individual Region.
|
SnapshotServiceFactoryBean.SnapshotServiceAdapter<K,V> |
getObject()
Gets the reference to the Pivotal GemFire Snapshot Service created by this FactoryBean.
|
Class<?> |
getObjectType()
Gets the type of Snapshot Service created by this FactoryBean.
|
protected org.apache.geode.cache.Region<K,V> |
getRegion()
Gets a reference to the Pivotal GemFire Region for which the snapshot will be taken.
|
protected boolean |
getSuppressImportOnInit()
Determines whether importing on initialization should be suppressed.
|
protected boolean |
isMatch(SnapshotApplicationEvent event)
Determines whether the details of the given SnapshotApplicationEvent match the criteria of this factory
to trigger a Pivotal GemFire Cache or Region data export.
|
boolean |
isSingleton()
Determines this this FactoryBean creates single Pivotal GemFire Snapshot Service instances.
|
void |
onApplicationEvent(SnapshotApplicationEvent<K,V> event)
Listens for SnapshotApplicationEvents triggering a Pivotal GemFire Cache-wide or Region data snapshot import/export
when details of the event match the criteria of this factory's constructed Pivotal GemFire SnapshotService.
|
protected SnapshotServiceFactoryBean.SnapshotMetadata<K,V>[] |
resolveSnapshotMetadata(SnapshotApplicationEvent<K,V> event)
Resolves the SnapshotMetadata used to perform the Pivotal GemFire Cache or Region data snapshot import/export.
|
void |
setCache(org.apache.geode.cache.Cache cache)
Sets a reference to the Pivotal GemFire Cache for which the snapshot will be taken.
|
void |
setExports(SnapshotServiceFactoryBean.SnapshotMetadata<K,V>[] exports)
Sets the meta-data (location, filter and format) used to create a snapshot from the Cache or Region data.
|
void |
setImports(SnapshotServiceFactoryBean.SnapshotMetadata<K,V>[] imports)
Sets the meta-data (location, filter and format) used to read a data snapshot into an entire Cache
or individual Region.
|
void |
setRegion(org.apache.geode.cache.Region<K,V> region)
Sets a reference to the Pivotal GemFire Region for which the snapshot will be taken.
|
void |
setSuppressImportOnInit(Boolean suppressImportOnInit)
Sets a boolean condition to indicate whether importing on initialization should be suppressed.
|
protected SnapshotServiceFactoryBean.SnapshotServiceAdapter<Object,Object> |
wrap(org.apache.geode.cache.snapshot.CacheSnapshotService cacheSnapshotService)
Wraps the Pivotal GemFire CacheSnapshotService into an appropriate Adapter to uniformly access snapshot operations
on the Cache and Regions alike.
|
protected SnapshotServiceFactoryBean.SnapshotServiceAdapter<K,V> |
wrap(org.apache.geode.cache.snapshot.RegionSnapshotService<K,V> regionSnapshotService)
Wraps Pivotal GemFire's RegionSnapshotService into an appropriate Adapter to uniformly access snapshot operations
on the Cache and Regions alike.
|
getBeanClassLoader, getBeanFactory, getBeanName, getLog, logDebug, logDebug, logError, logError, logInfo, logInfo, logWarning, logWarning, newLog, setBeanClassLoader, setBeanFactory, setBeanName
protected static final SnapshotServiceFactoryBean.SnapshotMetadata[] EMPTY_ARRAY
public void afterPropertiesSet() throws Exception
afterPropertiesSet
in interface InitializingBean
Exception
- if the construction and initialization of the Pivotal GemFire Snapshot Service fails.SnapshotServiceFactoryBean.SnapshotServiceAdapter
,
getSuppressImportOnInit()
,
getImports()
,
create()
protected SnapshotServiceFactoryBean.SnapshotServiceAdapter create()
wrap(CacheSnapshotService)
,
wrap(RegionSnapshotService)
,
getRegion()
protected SnapshotServiceFactoryBean.SnapshotServiceAdapter<Object,Object> wrap(org.apache.geode.cache.snapshot.CacheSnapshotService cacheSnapshotService)
cacheSnapshotService
- the Pivotal GemFire CacheSnapshotService to wrap.SnapshotServiceFactoryBean.SnapshotServiceAdapter
,
SnapshotServiceFactoryBean.CacheSnapshotServiceAdapter
,
CacheSnapshotService
protected SnapshotServiceFactoryBean.SnapshotServiceAdapter<K,V> wrap(org.apache.geode.cache.snapshot.RegionSnapshotService<K,V> regionSnapshotService)
regionSnapshotService
- the Pivotal GemFire RegionSnapshotService to wrap.SnapshotServiceFactoryBean.SnapshotServiceAdapter
,
SnapshotServiceFactoryBean.RegionSnapshotServiceAdapter
,
RegionSnapshotService
public void setCache(org.apache.geode.cache.Cache cache)
cache
- the Pivotal GemFire Cache used to create an instance of CacheSnapshotService.IllegalArgumentException
- if the Cache reference is null.Cache
,
getCache()
protected org.apache.geode.cache.Cache getCache()
IllegalStateException
- if the Cache argument is null.Cache
,
setCache(Cache)
public void setExports(SnapshotServiceFactoryBean.SnapshotMetadata<K,V>[] exports)
exports
- an array of snapshot meta-data used for each export.SnapshotServiceFactoryBean.SnapshotMetadata
protected SnapshotServiceFactoryBean.SnapshotMetadata<K,V>[] getExports()
SnapshotServiceFactoryBean.SnapshotMetadata
public void setImports(SnapshotServiceFactoryBean.SnapshotMetadata<K,V>[] imports)
imports
- an array of snapshot meta-data used for each import.SnapshotServiceFactoryBean.SnapshotMetadata
protected SnapshotServiceFactoryBean.SnapshotMetadata<K,V>[] getImports()
SnapshotServiceFactoryBean.SnapshotMetadata
public void setRegion(org.apache.geode.cache.Region<K,V> region)
region
- the Pivotal GemFire Region used to create an instance of the RegionSnapshotService.Region
,
getRegion()
protected org.apache.geode.cache.Region<K,V> getRegion()
Region
,
getRegion()
public void setSuppressImportOnInit(Boolean suppressImportOnInit)
suppressImportOnInit
- a Boolean value to indicate whether importing on initialization should be suppressed.getSuppressImportOnInit()
protected boolean getSuppressImportOnInit()
setSuppressImportOnInit(Boolean)
,
afterPropertiesSet()
public SnapshotServiceFactoryBean.SnapshotServiceAdapter<K,V> getObject() throws Exception
getObject
in interface FactoryBean<SnapshotServiceFactoryBean.SnapshotServiceAdapter<K,V>>
Exception
- if the Pivotal GemFire Snapshot Service failed to be created.SnapshotServiceFactoryBean.SnapshotServiceAdapter
public Class<?> getObjectType()
getObjectType
in interface FactoryBean<SnapshotServiceFactoryBean.SnapshotServiceAdapter<K,V>>
SnapshotServiceFactoryBean.SnapshotServiceAdapter
,
SnapshotServiceFactoryBean.CacheSnapshotServiceAdapter
,
SnapshotServiceFactoryBean.RegionSnapshotServiceAdapter
public boolean isSingleton()
isSingleton
in interface FactoryBean<SnapshotServiceFactoryBean.SnapshotServiceAdapter<K,V>>
isSingleton
in class AbstractFactoryBeanSupport<SnapshotServiceFactoryBean.SnapshotServiceAdapter<K,V>>
FactoryBean.isSingleton()
public void destroy() throws Exception
destroy
in interface DisposableBean
Exception
- if the Cache/Region data export operation fails.SnapshotServiceFactoryBean.SnapshotServiceAdapter
,
getExports()
,
getObject()
public void onApplicationEvent(SnapshotApplicationEvent<K,V> event)
onApplicationEvent
in interface ApplicationListener<SnapshotApplicationEvent<K,V>>
event
- the SnapshotApplicationEvent triggering a Pivotal GemFire Cache or Region data import/export.SnapshotServiceFactoryBean.SnapshotServiceAdapter
,
ExportSnapshotApplicationEvent
,
ImportSnapshotApplicationEvent
,
SnapshotApplicationEvent
,
isMatch(SnapshotApplicationEvent)
,
resolveSnapshotMetadata(SnapshotApplicationEvent)
,
getObject()
protected boolean isMatch(SnapshotApplicationEvent event)
event
- the SnapshotApplicationEvent containing details of the application requested data export.SnapshotApplicationEvent
protected SnapshotServiceFactoryBean.SnapshotMetadata<K,V>[] resolveSnapshotMetadata(SnapshotApplicationEvent<K,V> event)
event
- the SnapshotApplicationEvent from which to resolve the SnapshotMetadata.SnapshotApplicationEvent.getSnapshotMetadata()
,
getExports()
,
getImports()
Copyright © 2011–2021 Pivotal Software, Inc.. All rights reserved.