|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface ExternalGadgetSpecStore
Provides a means for storing, retrieving, and modifying a collection of external gadget spec URIs. Host applications that wish to allow administrators to add or remove gadgets should implement this interface.
Collection members are stored internally as ExternalGadgetSpec
s. The implementation must create
these members on demand when the add(java.net.URI)
method is called.
Implementations should consider gadget spec URIs to be equal if they are semantically equivalent; formally, two gadget spec URIs are equal if the following is true:
firstURI.normalize().equals(secondURI.normalize());
Host applications that will not use the directory plugin do not need to implement this interface.
ExternalGadgetSpec
Method Summary | |
---|---|
ExternalGadgetSpec |
add(URI gadgetSpecUri)
Adds a gadget spec URI to this store and returns an ExternalGadgetSpec wrapper for it. |
boolean |
contains(URI gadgetSpecUri)
Returns true if the URI is in the store, false otherwise. |
Iterable<ExternalGadgetSpec> |
entries()
Retrieves all ExternalGadgetSpec s from the data store. |
void |
remove(ExternalGadgetSpecId externalGadgetSpecId)
Removes the spec URI corresponding to the specified externalGadgetSpecId from the persistent data store. |
Method Detail |
---|
Iterable<ExternalGadgetSpec> entries()
ExternalGadgetSpec
s from the data store. There is no guarantee that these will be
sequenced in any particular order. This method must not return null
; if the store is empty, it
must return an Iterable
with no contents.
ExternalGadgetSpec
s in the store, returned in an unspecified order
ExternalGadgetStoreException
- if there is a problem when retrieving the ExternalGadgetSpec
s
from the persistent storeExternalGadgetSpec add(URI gadgetSpecUri)
Adds a gadget spec URI to this store and returns an ExternalGadgetSpec
wrapper for it. The store must
not allow duplicate entries to be stored; if the gadget spec URI is already contained in this store, this
method should return the existing ExternalGadgetSpec
for it.
The implementation must consider syntactically different but semantically equivalent URIs to be equal for the
purposes of duplicate elimination; specifically, the implementation is responsible for calling
URI.normalize()
on gadgetSpecUri
before storing it.
gadgetSpecUri
- the gadget spec URI to store. Must not be null
.
ExternalGadgetSpec
object wrapping the specified gadget spec URI
ExternalGadgetStoreException
- if there is a problem when adding the gadget spec URI to the
persistent data store
NullPointerException
- if gadgetSpecUri
is null
void remove(ExternalGadgetSpecId externalGadgetSpecId)
externalGadgetSpecId
from the persistent data store.
If externalGadgetSpecId
does not correspond to any stored gadget spec URI, this method should do nothing
but return.
externalGadgetSpecId
- the gadget spec ID to be removed from the persistent data store. Must not be
null
.
ExternalGadgetStoreException
- thrown if there is a problem when removing the gadget from
the persistent data store
NullPointerException
- if externalGadgetSpecId
is null
boolean contains(URI gadgetSpecUri)
true
if the URI is in the store, false
otherwise.
gadgetSpecUri
- URI to check is in the store
true
if the URI is in the store, false
otherwise
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |