org.nodal
Interface Repository

All Known Implementing Classes:
storage.framework.AbstractRepository

public interface Repository

The primary top-level interface to a container of NODAL Nodes. Each such Repository has a unique name and represents an attachment to a location within which a specified user can access and possible store structured information.


Method Summary
 void close()
          Close this Repository and release its resources.
 Document document(Path path)
          Access a Document with the given relative path from the root of the Repository's filesystem.
 Document document(java.lang.String filename)
          Access a Document with the given relative name from the root of the Repository's filesystem.
 DocumentFormat documentFormat(java.lang.String mimeType)
          Access the DocumentFormat associated with the named MIME type.
 Directory filesystem()
          Access the Directory at the root of the filesystem for this Repository.
 Repository login(java.lang.String user, java.lang.String key)
          Login to this Repository.
 Path path()
          A Path that uniquely identifies this Repository.
 java.lang.String uri()
          The canonical URI that identifies this Repository.
 User user()
          The currently logged-in user for this Repository.
 User userNamed(java.lang.String name)
          The User record with the given name.
 

Method Detail

uri

public java.lang.String uri()
The canonical URI that identifies this Repository.


path

public Path path()
A Path that uniquely identifies this Repository.

Returns:
the Path that uniquely identifies this Repository

login

public Repository login(java.lang.String user,
                        java.lang.String key)
Login to this Repository.

Parameters:
user - the name of the User
key -
Returns:
a new Repository reference with the identified User or null if unsuccessful.

filesystem

public Directory filesystem()
Access the Directory at the root of the filesystem for this Repository.


document

public Document document(java.lang.String filename)
                  throws Path.Failure
Access a Document with the given relative name from the root of the Repository's filesystem.

Parameters:
filename - a String representing a filename relative to the Repository's root.
Returns:
a Document derived from the filename
Throws:
Path.Failure - if invalid filename is used

document

public Document document(Path path)
                  throws Path.Failure
Access a Document with the given relative path from the root of the Repository's filesystem.

Parameters:
path - a relative Path
Throws:
Path.Failure - if non-relative path

documentFormat

public DocumentFormat documentFormat(java.lang.String mimeType)
Access the DocumentFormat associated with the named MIME type.


user

public User user()
The currently logged-in user for this Repository.


userNamed

public User userNamed(java.lang.String name)
The User record with the given name.


close

public void close()
Close this Repository and release its resources. It is illegal to access any Node in this Repository after close() is called.