AckHandler
- Class to handle ack-files in the ack-folder of the notification-service
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();
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.
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.
Adds an ack-file to the Notification-services ack-folder.
Takes two parameters in the following order:
id The notification ID. See the Notification-class for more information.
rid The RID to create the ack-file for. See the Notification-class for more information.
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 an ack-file from the Notification-services ack-folder.
Takes two parameters in the following order:
id The notification ID. See the Notification-class for more information.
rid The RID to remove the ack-file for. See the Notification-class for more information.
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.
Touches the mtime of an ack-file in the Notification-services ack-folder.
Takes these parameters in the following order:
id The notification ID. See the Notification-class for more information.
rid The RID of the ack-file to touch. See the Notification-class for more information.
Returns 1 upon success, 0 upon failure. Check the error()-method for more information upon a failure.
Get an ack-file's mtime.
Takes these parameters in the following order:
id The notification ID. See the Notification-class for more information.
rid The RID of the ack-file to get the mtime for. See the Notification-class for more information.
Returns 1 upon success, undef upon failure. Check the error()-method for more information upon a failure.
Checks if an ack-file exists or not.
Takes these parameters in the following order:
id The notification ID. See the Notification-class for more information.
rid The RID of the ack-file to check if exists or not. See the Notification-class for more information.
Returns 1 upon success, 0 upon failure. Check the error()-method for more information upon a failure.
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.