Siebel::Srvrmgr::Log::Enterprise::Archive - a Moose Role for Enterprise log file data archiving
package MyArchive; with 'Siebel::Srvrmgr::Log::Enterprise::Archive'; sub add { # code implementation } # keep adding other required methods
This module is a Moose::Role, basically definying a interface to acommodate the persistence of data read from a Siebel Enterprise log file with Siebel::Srvrmgr::OS::UNIX.
Being a role, it doesn't provide much implementation: how the persistance of the will be done is left to the programmer. Since the data itself will be a hash reference, there are a lot of options available out there.
A hash reference. It is a required attribute during object creation.
It is also a read-only attribute.
The keys on the hash reference will be PIDs, the values the component alias of the Siebel Enterprise log file, when applicable.
The required methods to be implemented are:
add: adds a new key/value item to the archive. Expects as parameters a the PID and a string to be used as value.
remove: removes a key/value item from the archive. Expects as parameter the PID.
get_set: returns a Set::Tiny object created with the keys (PIDs) available in the archive.
get_alias: returns the stored component alias or undef if the PID does not exists. Expects as parameter a PID.
reset: remove all key/values from the archive.
has_digest: returns true if a hash computed from the Siebel Enteprise log file header is available, false otherwise.
get_digest: returns the hash computed from the Siebel Enteprise log file header.
_set_digest: sets the hash calculated from the Siebel Enterprise log file header. "Private" method.
validate_archive: validates if the archive is still valid. Receives as parameter the header of the Siebel Enterprise log, creates a hash for it and compares with the hash already stored.
A hash of the Siebel Enterprise log file must be taken to allow identification of the bounce of the Siebel Server (and the need to reset the archive). On the other hand, this role does not implement any hash, this is left to the programmer. A example of hash would be Digest::MD5.
The constructor expects a hash reference with the archive as the required attribute.
Implementations of this role also will need to implement a BUILD method and invoke the "private" method _init_last_line without any parameter. This is required to set the control of lines read from the Siebel Enterprise log file.
_init_last_line
Sets the last line read from the Siebel Enterprise log file. Expects as parameter a integer.
Returns a integer representing the last line read from the Siebel Enterprise log file.
Moose::Role
Siebel::Srvrmgr::OS::UNIX
Scalar::Util::Numeric
Alceu Rodrigues de Freitas Junior, <arfreitas@cpan.org>
This software is copyright (c) 2015 of Alceu Rodrigues de Freitas Junior, <arfreitas@cpan.org>
This file is part of Siebel Monitoring Tools.
Siebel Monitoring Tools is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
Siebel Monitoring Tools is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with Siebel Monitoring Tools. If not, see <http://www.gnu.org/licenses/>.
To install Siebel::Srvrmgr, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Siebel::Srvrmgr
CPAN shell
perl -MCPAN -e shell install Siebel::Srvrmgr
For more information on module installation, please visit the detailed CPAN module installation guide.