Notification
- Class to send notifications by the AURORA-system quickly and effortlessly
use Not;
my $n=Not->new();
my $res=$n->send(type=>11,about=>1,from=>-3,message=>"Please note that the dataset is expiring in 1 second. We recommend that you take evasive action.");
if (!$res) {
print "Error sending notification: ".$n->error();
}
Class to send notifications by the AURORA-system in a easy and quick way.
Constructor of class.
Returns class instance.
It takes two paramters: location. Location is the path to the notification-folder of the AURORA-system.
No parameters are required. Location will be attempted read from the environment-variable AURORA_PATH and then combined with /notification to signify the path. If no environment parameter is found, location will be set to /local/app/aurora. In other words the location-parameters gives the path to the Aurora-installation.
Attempts to send a notification.
Parameters to functions are: timestamp, type, about, from and message.
No parameters are required, but you should set type, about, from and message. Time will be set automatically at the time of adding it to a file.
See the Notification-class and specification for explanation of these field values.
Returns the Notification's ID upon success, 0 upon failure.
The error message upon failure can be read by calling the error()-method.
Get the last error message from the Notification-instance.