NAME
Armadito::Agent::Storage - A data serializer/deserializer
SYNOPSIS
my
$storage
= Armadito::Agent::Storage->new(
directory
=>
'/tmp'
);
my
$data
=
$storage
->restore(
module
=>
"Armadito::Agent"
);
$data
->{foo} =
'bar'
;
$storage
->save(
data
=>
$data
);
DESCRIPTION
This is the object used by the agent to ensure data persistancy between invocations.
Each data structure is saved in a file, whose name is automatically determined according to object class name. An optional index number can be used to differentiate between consecutives usages.
METHODS
new(%params)
The constructor. The following parameters are allowed, as keys of the %params hash:
getDirectory
Returns the underlying directory for this storage.
has(%params)
Returns true if a saved data structure exists. The following arguments are allowed:
save(%params)
Save given data structure. The following parameters are allowed, as keys of the %params hash:
restore(%params)
Restore a saved data structure. The following parameters are allowed, as keys of the %params hash:
remove(%params)
Delete the file containing a seralized data structure for a given module. The following parameters are allowed, as keys of the %params hash: