public class DefaultLocalPersistenceService extends java.lang.Object implements LocalPersistenceService
LocalPersistenceService.SafeSpaceIdentifier
MaintainableService.MaintenanceScope
Constructor and Description |
---|
DefaultLocalPersistenceService(DefaultPersistenceConfiguration persistenceConfiguration)
Creates a new service instance using the provided configuration.
|
Modifier and Type | Method and Description |
---|---|
void |
createSafeSpace(LocalPersistenceService.SafeSpaceIdentifier safeSpaceId)
Creates the safe space represented by
safeSpaceId , if it does not exist in the underlying physical space. |
LocalPersistenceService.SafeSpaceIdentifier |
createSafeSpaceIdentifier(java.lang.String owner,
java.lang.String identifier)
Creates a logical safe directory space for the owner and returns an identifying space Id.
|
void |
destroyAll(java.lang.String owner)
Destroys all safe spaces provided to this owner.
|
void |
destroySafeSpace(LocalPersistenceService.SafeSpaceIdentifier safeSpaceId,
boolean verbose)
Destroys the safe space.
|
void |
start(ServiceProvider<Service> serviceProvider)
Start this service using the provided configuration and
ServiceProvider . |
void |
startForMaintenance(ServiceProvider<? super MaintainableService> serviceProvider,
MaintainableService.MaintenanceScope maintenanceScope)
Start this service for maintenance, based on its default configuration.
|
void |
stop()
Stops this service.
|
public DefaultLocalPersistenceService(DefaultPersistenceConfiguration persistenceConfiguration)
persistenceConfiguration
- the configuration to usepublic void start(ServiceProvider<Service> serviceProvider)
ServiceProvider
.
The service provider allows a service to retrieve and use other services.
A Service
retrieved at this stage may not yet be started. The recommended usage pattern therefore, is to keep a
reference to the dependent Service
but use it only when specific methods are invoked on subtypes.
public void startForMaintenance(ServiceProvider<? super MaintainableService> serviceProvider, MaintainableService.MaintenanceScope maintenanceScope)
MaintainableService
startForMaintenance
in interface MaintainableService
serviceProvider
- enables to depend on other maintainable servicesmaintenanceScope
- the scope of the maintenancepublic LocalPersistenceService.SafeSpaceIdentifier createSafeSpaceIdentifier(java.lang.String owner, java.lang.String identifier)
createSafeSpaceIdentifier
in interface LocalPersistenceService
owner
- Service owner that owns the safe space.identifier
- Identifying name for the space.public void createSafeSpace(LocalPersistenceService.SafeSpaceIdentifier safeSpaceId) throws CachePersistenceException
safeSpaceId
, if it does not exist in the underlying physical space.createSafeSpace
in interface LocalPersistenceService
safeSpaceId
- Identifier to the created logical space on which the physical space needs to be createdCachePersistenceException
- If the space cannot be created or found, due to system errorspublic void destroySafeSpace(LocalPersistenceService.SafeSpaceIdentifier safeSpaceId, boolean verbose)
destroySafeSpace
in interface LocalPersistenceService
safeSpaceId
- Safe space identifier.verbose
- Log more information.public void destroyAll(java.lang.String owner)
destroyAll
in interface LocalPersistenceService
owner
- owner of safe spaces.