The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.

NAME

Siebel::Srvrmgr::Log::Enterprise::Archive - a Moose Role for Enterprise log file data archiving

SYNOPSIS

    package MyArchive;
    
    with 'Siebel::Srvrmgr::Log::Enterprise::Archive';
    
    sub add {
    
        # code implementation
    
    }
    
    # keep adding other required methods

DESCRIPTION

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.

ATTRIBUTES

archive

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.

METHODS

Required methods

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.

new

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.

set_last_line

Sets the last line read from the Siebel Enterprise log file. Expects as parameter a integer.

get_last_line

Returns a integer representing the last line read from the Siebel Enterprise log file.

SEE ALSO

AUTHOR

Alceu Rodrigues de Freitas Junior, <arfreitas@cpan.org>

COPYRIGHT AND LICENSE

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/>.