|
Oracle Fusion Middleware Java API Reference for Oracle PDK Java 11g Release 1 (11.1.1) E10691-01 |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object oracle.portal.provider.v2.preference.PreferenceStore
public abstract class PreferenceStore
A PreferenceStore
is a generic storage mechanism for loading
and saving data items held in PreferenceDataObject
s. Data is stored
under a 'key' represented by a Preference
whose primary components
are a 'reference path' and a 'preference type'. See the Preference
class for more details.
Note that a reference path, as returned by Preference.getReferencePath()
, is a standard Java unicode String, and as such
may contain multibyte characters. Implementations of
PreferenceStore
may therefore have to encode the String into a
format more suitable for the underlying storage mechanism.
Field Summary | |
---|---|
static java.lang.String |
DEFAULT_CUSTOMIZATION_TYPE
Path type used for storing system default and locale default level portlet customizations. |
static char |
PATH_SEPARATOR_CHAR
The character used betwen path components in reference paths. |
static java.lang.String |
PATH_SEPARATOR_STRING
String containing the single character used betwen path components in reference paths. |
static java.lang.String |
USER_CUSTOMIZATION_TYPE
Path type used for storing user level portlet customizations. |
Constructor Summary | |
---|---|
PreferenceStore()
|
Method Summary | |
---|---|
void |
copy(Preference sourcePref,
Preference destPref,
boolean overwrite)
Copies the data persisted for the given source Preference
to the given destination Preference . |
void |
copy(java.lang.String sourceContext,
java.lang.String destContext,
boolean overwrite)
Copies the data from all the Preference objects in this
PreferenceStore with the given source context path to the
given destination context path. |
void |
copy(java.lang.String sourceContext,
java.lang.String destContext,
boolean overwrite,
java.util.List preferenceTypes)
Copies the data from all the Preference objects in this
PreferenceStore with the given source context path and one
of the given preference types to the given destination context
path. |
abstract void |
destroy(Preference pref)
Destroys the data persisted for the given Preference . |
void |
destroy(java.lang.String context)
Destroys all of the Preference objects in this
PreferenceStore stored under the given context path. |
abstract void |
destroy(java.lang.String context,
java.util.List preferenceTypes)
Destroys all of the Preference objects in this
PreferenceStore stored under the given context path with
one of the given preference types. |
abstract boolean |
exists(Preference pref)
Returns true if persisted data exists for the given
Preference . |
abstract java.io.InputStream |
getInputStream(Preference pref)
Gets an InputStream for reading the data of the given
Preference . |
java.lang.String |
getName()
Gets the name that should be used to identify this PreferenceStore . |
abstract java.io.OutputStream |
getOutputStream(Preference pref,
boolean overwrite)
Gets an OutputStream for writing the data of the given
Preference directly into storage. |
java.util.Iterator |
list(java.lang.String context)
Gets an Iterator over all of the Preference objects
in this PreferenceStore stored under the given context
path. |
abstract java.util.Iterator |
list(java.lang.String context,
java.util.List preferenceTypes)
Gets an Iterator over all of the Preference objects
in this PreferenceStore stored under the given context path
with one of the given preference types. |
void |
read(Preference pref)
Loads a PreferenceDataObject into the given
Preference . |
void |
setName(java.lang.String name)
Sets the name that should be used to identify this PreferenceStore . |
void |
validate(java.lang.String context,
ValidationError errors)
Validates the internal state of this PreferenceStore
instance. |
void |
write(Preference pref,
boolean overwrite)
Saves the PreferenceDataObject in the given
Preference to storage. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final char PATH_SEPARATOR_CHAR
public static final java.lang.String PATH_SEPARATOR_STRING
public static final java.lang.String USER_CUSTOMIZATION_TYPE
PreferenceStore
implementations, hence the reason why it is
defined at this level.
public static final java.lang.String DEFAULT_CUSTOMIZATION_TYPE
PreferenceStore
implementations, hence the reason
why it is defined at this level.
Constructor Detail |
---|
public PreferenceStore()
Method Detail |
---|
public void setName(java.lang.String name)
PreferenceStore
.
name
- name that should be used to identify this
PreferenceStore
.public final java.lang.String getName()
PreferenceStore
.
PreferenceStore
.public java.util.Iterator list(java.lang.String context) throws PreferenceStoreException
Iterator
over all of the Preference
objects
in this PreferenceStore
stored under the given context
path. Note that this listing is 'recursive', in that
Preference
s stored in context paths below the given one
will also be returned. Provided as shorthand for list(context, null)
.
context
- the context path under which Preference
s
should be listed.
PreferenceStoreException
- if an error occurs during the
operation.public abstract java.util.Iterator list(java.lang.String context, java.util.List preferenceTypes) throws PreferenceStoreException
Iterator
over all of the Preference
objects
in this PreferenceStore
stored under the given context path
with one of the given preference types. Note that this listing is
'recursive', in that Preference
s stored in context paths
below the given one will also be returned. Note also that the data
object is not loaded into any of the listed Preference
s.
context
- the context path under which Preference
s
should be listed.preferenceTypes
- a list of strings, naming the preference types to
include, or null
if all preference types should be
included.
PreferenceStoreException
- if an error occurs during the
operation.public void copy(java.lang.String sourceContext, java.lang.String destContext, boolean overwrite) throws EntryAlreadyExistsException, PreferenceStoreException
Preference
objects in this
PreferenceStore
with the given source context path to the
given destination context path. Note that this copy is 'recursive', in
that Preference
s stored in context paths below the given
source context path will also be copied (with new context paths
calculated relative to the given destination context path). Provided as
shorthand for copy(sourceContext, destContext, overwrite, null)
.
sourceContext
- the source context path from which
Preference
s should be copied.destContext
- the destination context path to which
Preference
s should be copied.overwrite
- boolean indicating whether preferences existing under
the destination context path should be overwritten.
EntryAlreadyExistsException
- if overwrite
was
false and one or more Preference
s were found to already
exist under their destination context paths.
PreferenceStoreException
- if any other error occurs during the
operation.public void copy(java.lang.String sourceContext, java.lang.String destContext, boolean overwrite, java.util.List preferenceTypes) throws EntryAlreadyExistsException, PreferenceStoreException
Preference
objects in this
PreferenceStore
with the given source context path and one
of the given preference types to the given destination context
path. Note that this copy is 'recursive', in that
Preference
s stored in context paths below the given source
context path will also be copied (with new context paths calculated
relative to the given destination context path).
sourceContext
- the source context path from which
Preference
s should be copied.destContext
- the destination context path to which
Preference
s should be copied.overwrite
- boolean indicating whether preferences existing under
the destination context path should be overwritten.preferenceTypes
- a list of strings, naming the preference types to
include, or null
if all preference types should be
included.
EntryAlreadyExistsException
- if overwrite
was
false and one or more Preference
s were found to already
exist under their destination context paths.
PreferenceStoreException
- if any other error occurs during the
operation.public void destroy(java.lang.String context) throws PreferenceStoreException
Preference
objects in this
PreferenceStore
stored under the given context path. Note
that this operation is 'recursive', in that Preference
s
stored in context paths below the given one will also be
destroyed. Provided as shorthand for destroy(context, null)
.
context
- the context path under which Preference
s
should be listed.
PreferenceStoreException
- if an error occurs during the
operation.public abstract void destroy(java.lang.String context, java.util.List preferenceTypes) throws PreferenceStoreException
Preference
objects in this
PreferenceStore
stored under the given context path with
one of the given preference types. Note that this operation is
'recursive', in that Preference
s stored in context paths
below the given one will also be destroyed.
context
- the context path under which Preference
s
should be listed.preferenceTypes
- a list of strings, naming the preference types to
include, or null
if all preference types should be
included.
PreferenceStoreException
- if an error occurs during the
operation.public abstract boolean exists(Preference pref) throws PreferenceStoreException
true
if persisted data exists for the given
Preference
.
true
if persisted data exists for the given
Preference
, false
otherwise.
PreferenceStoreException
public void read(Preference pref) throws EntryNotFoundException, PreferenceStoreException
PreferenceDataObject
into the given
Preference
.
EntryNotFoundException
- if no data for the given
Preference
exists.
PreferenceStoreException
- if any other error occurs during the
operation.public abstract java.io.InputStream getInputStream(Preference pref) throws EntryNotFoundException, PreferenceStoreException
InputStream
for reading the data of the given
Preference
.
This method is provided in conjunction with getOutputStream(oracle.portal.provider.v2.preference.Preference, boolean)
as
a way of streamlining the process of copying data between
PreferenceStore
s, since data can be copied directly from
the InputStream
of one Preference
to the
OutputStream
of another, without having to instantiate a
PreferenceDataObject
.
EntryNotFoundException
- if no data for the given
Preference
exists.
PreferenceStoreException
- if any other error occurs during the
operation.public void write(Preference pref, boolean overwrite) throws EntryAlreadyExistsException, PreferenceStoreException
PreferenceDataObject
in the given
Preference
to storage.
overwrite
- boolean indicating whether data already existing for
this Preference
should be overwritten.
EntryAlreadyExistsException
- if overwrite
was
false
and data for the given Preference
already exists in storage.
PreferenceStoreException
- if any other error occurs during the
operation.public abstract java.io.OutputStream getOutputStream(Preference pref, boolean overwrite) throws EntryAlreadyExistsException, PreferenceStoreException
OutputStream
for writing the data of the given
Preference
directly into storage.
This method is provided in conjunction with getInputStream(oracle.portal.provider.v2.preference.Preference)
as a
way of streamlining the process of copying data between
PreferenceStore
s, since data can be copied directly from
the InputStream
of one Preference
to the
OutputStream
of another, without having to instantiate a
PreferenceDataObject
.
EntryAlreadyExistsException
- if overwrite
was
false
and data for the given Preference
already exists in storage.
PreferenceStoreException
- if any other error occurs during the
operation.public void copy(Preference sourcePref, Preference destPref, boolean overwrite) throws EntryAlreadyExistsException, PreferenceStoreException
Preference
to the given destination Preference
.
sourcePref
- the Preference
to copy data from.destPref
- the Preference
to copy data to.overwrite
- boolean indicating whether data already existing for
destPref
should be overwritten.
EntryAlreadyExistsException
- if overwrite
was
false and data was found to already exist for destPref
.
PreferenceStoreException
- if any other error occurs during the
operation.public abstract void destroy(Preference pref) throws PreferenceStoreException
Preference
.
pref
- the Preference
whose persisted data should be
destroyed.
PreferenceStoreException
- if an error occurs during the
operation.public void validate(java.lang.String context, ValidationError errors)
PreferenceStore
instance. Errors found are reported using the supplied ValidationError
instance.
validate
in interface Validateable
context
- The context of the calling instance.errors
- The current list of errors.
|
Oracle Fusion Middleware Java API Reference for Oracle PDK Java 11g Release 1 (11.1.1) E10691-01 |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |