visad.data
Class Repository
- java.lang.Object
-
- visad.data.Repository
-
- Direct Known Subclasses:
- DirectoryRepository
public abstract class Repository extends java.lang.ObjectA repository of persistent data objects. This class implements the "abstract factory" design pattern. The concrete implementation of this class could either be "DirectoryRepository" (for accessing files residing on local disk) or "RemoteRepository" (for accessing remote files via a server) or something else. The concrete class of the "Form" objects will be determined by this class's concrete class (and, hence, so will the concrete class of any constructed "FileAccessor").
-
-
Constructor Summary
Constructors Constructor and Description Repository(java.lang.String name, java.lang.String location)Construct a data repository.
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method and Description voidadd(java.lang.String id, Data data, boolean replace)Add a data object to an existing data object in the repository.abstract java.util.EnumerationgetEnumeration()Return an enumeration of the data objects in this repository.FormNodegetForms()Return the forms of data that are supported by this repository.FormNodegetForms(Data data)Return the forms of data that are both supported by this repository and compatible with a data object.java.lang.StringgetLocation()Return the location of this repository.java.lang.StringgetName()Return the name of this repository.DataImplopen(java.lang.String id)Open an existing data object in the repository.DataImplopen(java.net.URL url)Open a data object specified as a URL.voidsave(java.lang.String id, Data data, boolean replace)Save a data object in the first compatible data form.voidsave(java.lang.String id, Data data, FormNode form, boolean replace)Save a data object in a particular form.
-
-
-
Constructor Detail
-
Repository
public Repository(java.lang.String name, java.lang.String location)Construct a data repository.
-
-
Method Detail
-
getName
public java.lang.String getName()
Return the name of this repository.
-
getLocation
public java.lang.String getLocation()
Return the location of this repository.
-
getForms
public FormNode getForms()
Return the forms of data that are supported by this repository.
-
getForms
public FormNode getForms(Data data) throws VisADException, java.io.IOException, java.rmi.RemoteException
Return the forms of data that are both supported by this repository and compatible with a data object.- Throws:
VisADExceptionjava.io.IOExceptionjava.rmi.RemoteException
-
getEnumeration
public abstract java.util.Enumeration getEnumeration() throws BadRepositoryException, java.lang.SecurityExceptionReturn an enumeration of the data objects in this repository.- Throws:
BadRepositoryExceptionjava.lang.SecurityException
-
save
public void save(java.lang.String id, Data data, boolean replace) throws VisADException, java.io.IOException, java.rmi.RemoteExceptionSave a data object in the first compatible data form.- Throws:
VisADExceptionjava.io.IOExceptionjava.rmi.RemoteException
-
save
public void save(java.lang.String id, Data data, FormNode form, boolean replace) throws VisADException, java.rmi.RemoteException, java.io.IOExceptionSave a data object in a particular form.- Throws:
VisADExceptionjava.rmi.RemoteExceptionjava.io.IOException
-
add
public void add(java.lang.String id, Data data, boolean replace) throws VisADExceptionAdd a data object to an existing data object in the repository.- Throws:
VisADException
-
open
public DataImpl open(java.lang.String id) throws VisADException, java.io.IOException
Open an existing data object in the repository.- Throws:
VisADExceptionjava.io.IOException
-
open
public DataImpl open(java.net.URL url) throws VisADException, java.io.IOException
Open a data object specified as a URL. Strictly speaking, this shouldn't be here because a URL can lie outside the domain of the repository. A repository, however, is characterized by the data forms that it handles as well as its "location". Consequently, we have this method.- Throws:
VisADExceptionjava.io.IOException
-
-
DMelt 3.0 © DataMelt by jWork.ORG