FusionInventory::Agent::Storage - A data serializer/deserializer
my $storage = FusionInventory::Agent::Storage->new( directory => '/tmp' ); my $data = $storage->restore( name => "foobar" ); $data->{foo} = 'bar'; $storage->save( name => "foobar", data => $data );
This is the object used by the agent to ensure data persistancy between invocations.
The data structure is saved in a dedicated file. The file directory is a configuration parameter for each object.
The constructor. The following parameters are allowed, as keys of the %params hash:
the logger object to use
the directory to use for storing data (mandatory)
Returns the underlying directory for this storage.
Returns true if a saved data structure exists. The following arguments are allowed:
The file name to use for saving the data structure (mandatory).
Save given data structure. The following parameters are allowed, as keys of the %params hash:
The data to be saved (mandatory).
Restore a saved data structure. The following parameters are allowed, as keys of the %params hash:
Delete the file containing a seralized data structure for a given file name. The following parameters are allowed, as keys of the %params hash:
The file name used to save the data structure (mandatory).
To install FusionInventory::Agent, copy and paste the appropriate command in to your terminal.
cpanm
cpanm FusionInventory::Agent
CPAN shell
perl -MCPAN -e shell install FusionInventory::Agent
For more information on module installation, please visit the detailed CPAN module installation guide.