NAME

AckHandler - Class to handle ack-files in the ack-folder of the notification-service

SYNOPSIS

use AckHandler;

# create instance
my $ah=AckHandler->new();

# add ack-file
$ah->add($id,$rid);

# touch ack-file
$ah->touch($id,$rid);

# get ack-file mtime
my $mtime=$ah->mtime($id,$rid);

# remove ack-file
$ah->remove($id,$rid);

# get last error
my $err=$ah->error();

DESCRIPTION

A class to handle ack-files in the ack-folder of the notification-service.

The class enables ack-files to be added, removed, touched and retrieved mtime of.

CONSTRUCTOR

new()

Instantiates class.

The method takes one optional input: folder. It specifies the folder where the AURORA Notification-service saves its ack-files.

Returns an instance upon success.

METHODS

add()

Adds an ack-file to the Notification-services ack-folder.

Takes two parameters in the following order:

Returns 1 upon success, 0 upon failure. It will also return 1 if the file already exists. To get more information on a potential error call the error()-method.

remove()

Remove an ack-file from the Notification-services ack-folder.

Takes two parameters in the following order:

Returns 1 upon success, 0 upon failure. It will also return 1 if the file doesnt exist. To get more information on a failure, call the error()-metod.

touch()

Touches the mtime of an ack-file in the Notification-services ack-folder.

Takes these parameters in the following order:

Returns 1 upon success, 0 upon failure. Check the error()-method for more information upon a failure.

mtime()

Get an ack-file's mtime.

Takes these parameters in the following order:

Returns 1 upon success, undef upon failure. Check the error()-method for more information upon a failure.

exists()

Checks if an ack-file exists or not.

Takes these parameters in the following order:

Returns 1 upon success, 0 upon failure. Check the error()-method for more information upon a failure.

error()

Gets the last error of the module, if any.

No input accepted.

Returns the last error message generated by the module, if any at all.