This module defines interfaces for the Data Access Layer.
This is the interface for raster data stored in a database. It inherits from LocationInterface and adds some methods.
This method shall return the hostname of the database manager.
This method shall return the number of the port where the database manager listens for connections, or None if the port is undefined.
This method shall return the database name, or None if it is undefined.
This method shall return the user name to be used for opening database connections, or None if it is undefined.
This method shall return the password to be used for opening database connections, or None if it is undefined.
This is the interface for locations on the local file system. It inherits from LocationInterface.
This method shall return the path to the resource on the local file system.
This method shall attempt to open the file at this location and return a file object. It accepts one optional parameter mode which is passed on to the builtin open() command (defaults to 'r'). The method shall raise DataAccessError if the file cannot be opened, or if the object at the location is not a file.
This is the base interface for locations where to find data, metadata or resources in general. It is not intended to be instantiated directly, but rather through its descendant interfaces. It inherits from RecordWrapperInterface.
This method shall return the capabilities of the underlying storage implementation. See StorageInterface.getStorageCapabilities().
This method shall return the size of the object at the location or None if it cannot be retrieved. Note that InternalError will be raised if this operation is not supported by the underlying storage implementation. See StorageInterface.getSize().
This method shall retrieve a local copy of the object at the location and save it to target. This parameter may be a path to a file or directory. The method shall return the location of the local copy, i.e. an implementation of LocalPathInterface.
This method shall return a list of locations of objects matching the given search_pattern to be found under the location, which is expected to be a tree-like object, most commonly a directory. If search_pattern is omitted all the locations shall be returned.
This is the interface for data and metadata files stored on a remote server. It inherits from LocationInterface.
This method shall return the type of the remote storage, e.g. "ftp".
This method shall return the host name of the remote storage.
This method shall return the port number of the remote storage, or None if it is not defined.
This method shall return the user name to be used for access to the remote storage, or None if it is not defined.
This method shall return the password to be used for access to the remote storage, or None if it is not defined.
This method shall return the path to the resource on the remote storage.
This is the interface for any kind of storage (local file system, remote repositories, databases, ...). It defines three methods:
This method shall return a string designating the type of the storage wrapped by the implementation. Current choices are:
Additional modules may add more choices in the future.
This method shall return which of the optional methods a storage implements.
The following methods are optional in the sense that they are not needed to be implemented in a meaningful way, either because the storage type does not support it, or because it is not needed. Even in this case, they need to be present and should raise InternalError.
This method shall return the size in bytes of the object at location or None if it cannot be retrieved (e.g. for some FTP server implementations).
This method shall make a local copy of the object at location at the path target.
The method shall return the location of the local copy, i.e. an implementation of a descendant of LocationInterface.
In case the type of location cannot be handled by the specific storage InternalError shall be raised. In case the copying of resources fails DataAccessError shall be raised.
This method shall return a list of object locations found at the given location (which may designate some kind of collection, like a directory) that match the given search_pattern. If search_pattern is omitted any object location shall be returned.