| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151 |
- ################################################################################
- # $Id: ServiceModule.pm 2880 2007-04-12 18:52:02Z b4rt $
- # $Date: 2007-04-12 13:52:02 -0500 (Thu, 12 Apr 2007) $
- # $Revision: 2880 $
- ################################################################################
- # #
- # LICENSE #
- # #
- # This program is free software; you can redistribute it and/or #
- # modify it under the terms of the GNU General Public License (GPL) #
- # as published by the Free Software Foundation; either version 2 #
- # of the License, or (at your option) any later version. #
- # #
- # This program 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. #
- # #
- # To read the license please visit http://www.gnu.org/copyleft/gpl.html #
- # #
- # #
- ################################################################################
- package ServiceModule;
- use strict;
- use warnings;
- ################################################################################
- ################################################################################
- # fields #
- ################################################################################
- # version in a var
- my $VERSION = "0.2";
- # state
- my $state = Fluxd::MOD_STATE_NULL;
- # message, error etc. keep it in one string for simplicity atm.
- my $message = "";
- ################################################################################
- # constructor + destructor #
- ################################################################################
- #------------------------------------------------------------------------------#
- # Sub: new #
- # Arguments: Null #
- # Returns: object reference #
- #------------------------------------------------------------------------------#
- sub new {
- my $class = shift;
- my $self = bless ({}, ref ($class) || $class);
- return $self;
- }
- #------------------------------------------------------------------------------#
- # Sub: destroy #
- # Arguments: Null #
- # Returns: Null #
- #------------------------------------------------------------------------------#
- sub destroy {
- # set state
- $state = Fluxd::MOD_STATE_NULL;
- # log
- Fluxd::printMessage("ServiceModule", "shutdown\n");
- }
- ################################################################################
- # public methods #
- ################################################################################
- #------------------------------------------------------------------------------#
- # Sub: initialize. this is separated from constructor to call it independent #
- # from object-creation. #
- # Arguments: null #
- # Returns: 0|1 #
- #------------------------------------------------------------------------------#
- sub initialize {
- Fluxd::printMessage("ServiceModule", "initializing\n");
- # set state
- $state = Fluxd::MOD_STATE_OK;
- # return
- return 1;
- }
- #------------------------------------------------------------------------------#
- # Sub: getVersion #
- # Arguments: null #
- # Returns: VERSION #
- #------------------------------------------------------------------------------#
- sub getVersion {
- return $VERSION;
- }
- #------------------------------------------------------------------------------#
- # Sub: getState #
- # Arguments: null #
- # Returns: state #
- #------------------------------------------------------------------------------#
- sub getState {
- return $state;
- }
- #------------------------------------------------------------------------------#
- # Sub: getMessage #
- # Arguments: null #
- # Returns: message #
- #------------------------------------------------------------------------------#
- sub getMessage {
- return $message;
- }
- #------------------------------------------------------------------------------#
- # Sub: set #
- # Arguments: Variable [value] #
- # Returns: #
- #------------------------------------------------------------------------------#
- sub set {
- }
- #------------------------------------------------------------------------------#
- # Sub: main #
- # Arguments: Null #
- # Returns: #
- #------------------------------------------------------------------------------#
- sub main {
- Fluxd::printMessage("ServiceModule", "main\n");
- }
- #------------------------------------------------------------------------------#
- # Sub: command #
- # Arguments: command-string #
- # Returns: result-string #
- #------------------------------------------------------------------------------#
- sub command {
- return "";
- }
- #------------------------------------------------------------------------------#
- # Sub: status #
- # Arguments: Null #
- # Returns: Status information #
- #------------------------------------------------------------------------------#
- sub status {
- return "\n-= ServiceModule Revision ".$VERSION." =-\n";
- }
- ################################################################################
- # make perl happy #
- ################################################################################
- 1;
|