Adun  0.83
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Public Member Functions
ULFileSystemDatabaseBackend Class Reference

#import <ULFileSystemDatabaseBackend.h>

List of all members.

Public Member Functions

(id) - initWithDatabaseIdentifier:error:
(id) - initWithDatabaseIdentifier:clientName:error:
(id) - initWithDatabaseIdentifier:clientName:host:user:password:error:
(id) - initWithDatabaseIdentifier:clientName:host:scheme:port:user:password:error:
(NSURL *) - adunServerURL
(NSString *) - simulationDir
(NSString *) - templateDir
(NSString *) - systemDir
(NSString *) - dataSetDir
(void) - reindexAll
(void) - autoUpdateIndexes:
(void) - updateIndexes
(void) - saveIndexes
(void) - saveDatabase
(void) - autosaveIndexes:
(NSString *) - databaseIdentifier

Detailed Description

A ULDatabaseBackendDidModifyContentsNotification is sent on each successful write operation.

Todo:

implement reindexAll

connection/disconnection checking


Member Function Documentation

- (NSURL *) adunServerURL

Returns the URL of the database which can potentially be used to connect to it using AdunServer For a file-system database this method requires that there is a distributed AdunServer running on the local host The URL may change depending on if you are connected to the internet or not.

Note:
The URL returned by this method will only provide access to the database if it is shared using an AdunServer. For example, if the receiver is a ULFileSystemDatabaseBackend instance it may not be shared and the given URL cannot be used to connect to it - However if it is shared this URL can be used. For ULRemoteDatabaseBackend instances the URL returned is the URL used to connected to it.
- (void) autosaveIndexes: (id)  info

Deprecated

- (void) autoUpdateIndexes: (id)  info

Description forthcomming

- (NSString*) databaseIdentifier

See ULDatabaseBackendMetadataInterface protocol for definition. In this case this method simply returns the databaseName();

- (NSString*) dataSetDir

Description forthcomming

- (id) initWithDatabaseIdentifier: (NSString*)  path
clientName: (NSString*)  name
error: (NSError**)  error 

As initWithDatabaseIdentifier:clientName:host:user:password:error: passing nil for host, user, password & error.

- (id) initWithDatabaseIdentifier: (NSString*)  path
clientName: (NSString*)  name
host: (NSHost*)  host
scheme: (NSString*)  scheme
port: (int)  port
user: (NSString*)  user
password: (NSString*)  password
error: (NSError**)  error 

Initialises a new ULFileSystemDatabaseBackend instance for accessing the database at path.

Parameters:
pathThe path to an Adun file system database directory - the structure of path depends on scheme If path is nil it defaults to the application default database. If path cannot be accessed error contains an NSError object detailing the problem.
nameAn NSString that will be associated with the returned object. If no database exits at path its created if possible. name should be unique. If name is nil it defaults to path @ localhost .
hostAn NSHost object detailing the host the database is located on - it defaults to localhost.
schemeThe scheme (protocol - e.g. http, file, ftp) to use to read the database. Defaults to file
portThe port to connect using - applicability depends on scheme. Pass -1 if no port necessary.
userThe user to connect to the database as
passwordThe password to use to connect to the database
Note:
Only the file scheme can be written to.
If any subdirectory of the database is missing it is created if possible. If it cant be created an error is set.
The possible errors are
  • ULDatabaseConnectionNotAvailableError
    • Cant find any database at path and one could not be created
  • ULDatabaseCorruptedError
    • One of the databases indexes has been deleted
  • A database index cannot be read even though the database directory has read permissions
  • The database directory is write only
- (id) initWithDatabaseIdentifier: (NSString*)  path
clientName: (NSString*)  name
host: (NSHost*)  host
user: (NSString*)  user
password: (NSString*)  password
error: (NSError**)  error 

Initialises a new ULFileSystemDatabaseBackend instance for accessing the database at path. As initWithDatabaseIdentifier:clientName:host:user:password:error: passing "file" for scheme and -1 for port.

- (id) initWithDatabaseIdentifier: (NSString*)  path
error: (NSError**)  error 

As initWithDatabaseIdentifier:clientName:error: passing path @ localhost for name.

- (void) reindexAll

Not sure if this is still needed

- (void) saveDatabase

Deprecated

- (void) saveIndexes

Deprecated

- (NSString*) simulationDir

Description forthcomming

- (NSString*) systemDir

Description forthcomming

- (NSString *) templateDir

Description forthcomming

- (void) updateIndexes

Causes the receiver to re-read the database indexes. If the receiver detects a change in the index it broadcasts a ULDatabase