Interface PersistenceManager
-
- All Known Subinterfaces:
NotCachablePersistenceManager
- All Known Implementing Classes:
FilePersistenceManager
@ConsumerType @Deprecated(since="2021-04-30") public interface PersistenceManager
Deprecated.The use of this package is deprecated. Custom persistence managers are not supported in AEM as a Cloud Service.ThePersistenceManager
interface defines the API to be implemented to support persisting configuration data. This interface may be implemented by bundles, which support storing configuration data in different locations.The Apache Felix Configuration Admin Service bundles provides an implementation of this interface using the platform file system to store configuration data.
Implementations of this interface must support loading and storing
java.util.Dictionary
objects as defined in section 104.4.2, Configuration Properties, of the Configuration Admin Service Specification Version 1.2.To make implementations of this interface available to the Configuration Admin Service they must be registered as service for this interface. The Configuration Admin Service will consider all registered services plus the default platform file system based implementation to load configuration data. To store new configuration data, the persistence manager service with the highest rank value - the
service.ranking
service property - is used. If no persistence manager service has been registered, the platform file system based implementation is used.
-
-
Field Summary
Fields Modifier and Type Field Description static String
PROPERTY_NAME
Deprecated.Service registration property to define a unique name for the persistence manager.
-
Method Summary
All Methods Instance Methods Abstract Methods Deprecated Methods Modifier and Type Method Description void
delete(String pid)
Deprecated.Removes theDictionary
for the givenpid
.boolean
exists(String pid)
Deprecated.Returnstrue
if a persistedDictionary
exists for the givenpid
.Enumeration
getDictionaries()
Deprecated.Returns an enumeration of allDictionary
objects known to this persistence manager.Dictionary
load(String pid)
Deprecated.Returns theDictionary
for the givenpid
.void
store(String pid, Dictionary properties)
Deprecated.Stores theDictionary
under the givenpid
.
-
-
-
Field Detail
-
PROPERTY_NAME
static final String PROPERTY_NAME
Deprecated.Service registration property to define a unique name for the persistence manager.- Since:
- 1.2
- See Also:
- Constant Field Values
-
-
Method Detail
-
exists
boolean exists(String pid)
Deprecated.Returnstrue
if a persistedDictionary
exists for the givenpid
.- Parameters:
pid
- The identifier for the dictionary to test.- Returns:
true
if a persisted dictionary exists for the pid.
-
load
Dictionary load(String pid) throws IOException
Deprecated.Returns theDictionary
for the givenpid
.Implementations are expected to return dictionary instances which may be modified by the caller without affecting any underlying data or affecting future calls to this method with the same PID. In other words the reference equation
load(pid) != load(pid)
must holdtrue
.- Parameters:
pid
- The identifier for the dictionary to load.- Returns:
- The dictionary for the identifier. This must not be
null
but may be empty. - Throws:
IOException
- If an error occurs loading the dictionary. AnIOException
must also be thrown if no dictionary exists for the given identifier.
-
getDictionaries
Enumeration getDictionaries() throws IOException
Deprecated.Returns an enumeration of allDictionary
objects known to this persistence manager.Implementations of this method are allowed to return lazy enumerations. That is, it is allowable for the enumeration to not return a dictionary if loading it results in an error.
Implementations are expected to return dictionary instances which may be modified by the caller without affecting any underlying data or affecting future calls to this method.
The
Enumeration
returned from this method must be stable against concurrent calls to either of theload(String)
,store(String, Dictionary)
, anddelete(String)
methods.- Returns:
- A possibly empty Enumeration of all dictionaries.
- Throws:
IOException
- If an error occurs getting the dictionaries.
-
store
void store(String pid, Dictionary properties) throws IOException
Deprecated.Stores theDictionary
under the givenpid
.The dictionary provided to this method must be considered private to the caller. Any modification by the caller after this method finishes must not influence any internal storage of the provided data. Implementations must not modify the dictionary.
- Parameters:
pid
- The identifier of the dictionary.properties
- TheDictionary
to store.- Throws:
IOException
- If an error occurs storing the dictionary. If this exception is thrown, it is expected, thatexists(pid
returnsfalse
.
-
delete
void delete(String pid) throws IOException
Deprecated.Removes theDictionary
for the givenpid
. If such a dictionary does not exist, this method has no effect.- Parameters:
pid
- The identifier of the dictionary to delete.- Throws:
IOException
- If an error occurs deleting the dictionary. This exception must not be thrown if no dictionary with the given identifier exists.
-
-