A - the type of storage area used by this providerL - the type of library created by this providerpublic interface ArealLibraryProvider<A extends LibraryStorageArea,L extends LibraryImplementation2>
LibraryImplementation should do this.| Modifier and Type | Field and Description |
|---|---|
static String |
PROP_OPEN_AREAS
Property to fire when
ArealLibraryProvider.getOpenAreas() might have changed. |
| Modifier and Type | Method and Description |
|---|---|
void |
addPropertyChangeListener(PropertyChangeListener listener)
Adds a listener to
ArealLibraryProvider.PROP_OPEN_AREAS. |
Class<A> |
areaType()
Gets the runtime type of the area used by this provider.
|
A |
createArea()
Creates or otherwise picks a storage area interactively.
|
L |
createLibrary(String type,
String name,
A area,
Map<String,List<URI>> contents)
Creates a new library.
|
LibraryProvider<L> |
getLibraries(A area)
Gets all libraries defined in a given area.
|
Set<A> |
getOpenAreas()
Looks for areas which should be somehow listed as open.
|
Class<L> |
libraryType()
Gets the runtime type of the libraries created by this provider.
|
A |
loadArea(URL location)
Loads a storage area (which may or may exist yet).
|
void |
remove(L library)
Deletes an existing library.
|
void |
removePropertyChangeListener(PropertyChangeListener listener)
Removes a listener to
ArealLibraryProvider.PROP_OPEN_AREAS. |
static final String PROP_OPEN_AREAS
ArealLibraryProvider.getOpenAreas() might have changed.void addPropertyChangeListener(PropertyChangeListener listener)
ArealLibraryProvider.PROP_OPEN_AREAS.listener - a listener to addvoid removePropertyChangeListener(PropertyChangeListener listener)
ArealLibraryProvider.PROP_OPEN_AREAS.listener - a listener to removeClass<A> areaType()
Class<L> libraryType()
A createArea()
A loadArea(URL location)
location - an abstract storage location which may or may not be recognized by this providerLibraryStorageArea.getLocation() matches the provided location,
or null if this type of location is not recognized by this providerSet<A> getOpenAreas()
ArealLibraryProvider.createArea().LibraryProvider<L> getLibraries(A area)
LibraryImplementation.getName(),
though it is permitted for libraries from different areas to have the same name.
Changes in the set of libraries defined in this area should be fired through LibraryProvider.PROP_LIBRARIES.
Since IOException is not thrown either from this method or from LibraryProvider.getLibraries(),
it is expected that any problems loading library definitions will be logged and that those libraries will be skipped.area - some storage area (which might not even exist yet, in which case the set of libraries will initially be empty)L createLibrary(String type, String name, A area, Map<String,List<URI>> contents) throws IOException
type - the kind of library to make, as in LibraryTypeProvider.getLibraryType() or LibraryImplementation.getType()name - the library name, as in LibraryImplementation.getName()area - the location to define the librarycontents - initial volume contents (keys must be contained in the appropriate LibraryTypeProvider.getSupportedVolumeTypes())IOException - if an error occurs creating the library definitionvoid remove(L library) throws IOException
library - a library produced by this providerIOException - if a problem can encountered deleting the library definition