NAME
PITA::Guest::Storage::Simple - A (relatively) simple Guest Storage object
DESCRIPTION
The PITA::Guest::Storage class provides an API for cataloguing and retrieving Guest images, with all the data stored on the filesystem using the native XML file formats.
Guest image location and searching is done the long way, with no indexing.
METHODS
new
my $store = PITA::Guest::Storage::Simple->new(
storage_dir => '/var/pita/storage',
);
The new
method creates a new simple storage object. It takes a single named param
Returns a PITA::Guest::Storage::Simple
object, or throws an exception on error.
storage_dir
The storage_dir
accessor returns the location of the directory that serves as the root of the data store.
create
my $store = PITA::Guest::Storage::Simple->new(
storage_dir =>
);
The create
constructor creates a new PITA::Guest::Storage::Simple
repository.
storage_lock
The storage_lock
method returns the location of the storage lock file.
The lock file is taken by a PITA::Guest::Storage::Simple
object at constructor-time, and hold for the duration of the object's existance.
Returns a file path string.
storage_lock_take
The storage_lock_take
method takes a lock on the storage_lock
file, creating it if needed (in the create
method case).
It does not wait to take the lock, failing immediately if the lock cannot be taken.
Returns true if the lock is taken, false if the lock cannot be taken, or throws an exception on error.
storage_lock_object
If we have a lock on the storage, returns the lock object for the lock.
Returns a XXXXXX
object or false if we do not have a lock
storage_lock_release
If we have a lock on the storage, release the lock.
Returns true once the lock is released, or throws an exception on error or if the object does not hold the lock.
SUPPORT
Bugs should be reported via the CPAN bug tracker at
http://rt.cpan.org/NoAuth/ReportBug.html?Queue=PITA
For other issues, contact the author.
AUTHOR
Adam Kennedy <adamk@cpan.org>
SEE ALSO
PITA::Guest::Storage, PITA, http://ali.as/pita/
COPYRIGHT
Copyright 2005, 2006 Adam Kennedy.
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
The full text of the license can be found in the LICENSE file included with this module.