| 1 | package Ubic::Service; | ||||||||||
| 2 | 157 | $Ubic::Service::VERSION = '1.59'; | |||||||||
| 3 | 157 | ▶ | use strict; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 4 | 157 | ▶ | use warnings; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 5 | |||||||||||
| 6 | 157 | ▶ | use Ubic::Settings; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 7 | |||||||||||
| 8 | # ABSTRACT: interface and the base class for any ubic service | ||||||||||
| 9 | |||||||||||
| 10 | |||||||||||
| 11 | 157 | ▶ | use Ubic::Result qw(result); | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 12 | |||||||||||
| 13 | sub start { | ||||||||||
| 14 | 0 | ▶ | die "not implemented"; | ||||||||
|
Subroutine
start: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||
| 15 | } | ||||||||||
| 16 | |||||||||||
| 17 | sub stop { | ||||||||||
| 18 | 0 | ▶ | die "not implemented"; | ||||||||
|
Subroutine
stop: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||
| 19 | } | ||||||||||
| 20 | |||||||||||
| 21 | sub status { | ||||||||||
| 22 | 0 | ▶ | my ($self) = @_; | ||||||||
|
Subroutine
status: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||
| 23 | 0 | die "not implemented"; | |||||||||
| 24 | } | ||||||||||
| 25 | |||||||||||
| 26 | sub reload { | ||||||||||
| 27 | 0 | ▶ | my ($self) = @_; | ||||||||
|
Subroutine
reload: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||
| 28 | 0 | return result('unknown', 'not implemented'); | |||||||||
| 29 | } | ||||||||||
| 30 | |||||||||||
| 31 | sub port { | ||||||||||
| 32 | 0 | ▶ | my ($self) = @_; | ||||||||
|
Subroutine
port: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||
| 33 | 0 | return; # by default, service has no port | |||||||||
| 34 | } | ||||||||||
| 35 | |||||||||||
| 36 | sub user { | ||||||||||
| 37 | 516 | ▶ | my $self = shift; | ||||||||
|
Subroutine
user: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||
| 38 | 516 | return Ubic::Settings->default_user; | |||||||||
| 39 | } | ||||||||||
| 40 | |||||||||||
| 41 | sub group { | ||||||||||
| 42 | 514 | ▶ | return (); | ||||||||
|
Subroutine
group: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||
| 43 | } | ||||||||||
| 44 | |||||||||||
| 45 | sub check_period { | ||||||||||
| 46 | 0 | ▶ | my ($self) = @_; | ||||||||
|
Subroutine
check_period: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||
| 47 | 0 | return 60; | |||||||||
| 48 | } | ||||||||||
| 49 | |||||||||||
| 50 | sub check_timeout { | ||||||||||
| 51 | 78 | ▶ | return 60; | ||||||||
|
Subroutine
check_timeout: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||
| 52 | } | ||||||||||
| 53 | |||||||||||
| 54 | sub custom_commands { | ||||||||||
| 55 | 5 | ▶ | return (); | ||||||||
|
Subroutine
custom_commands: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||
| 56 | } | ||||||||||
| 57 | |||||||||||
| 58 | sub do_custom_command { | ||||||||||
| 59 | 0 | ▶ | die "No such command"; | ||||||||
|
Subroutine
do_custom_command: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||
| 60 | } | ||||||||||
| 61 | |||||||||||
| 62 | sub name($;$) { | ||||||||||
| 63 | 5353 | ▶ | my ($self, $name) = @_; | ||||||||
|
Subroutine
name: called CC=2 SCAR=6.9
Pod
documented
| |||||||||||
| 64 | 5353 | ▶ | if (defined $name) { | ||||||||
|
Branch: 1 branch
| |||||||||||
| 65 | 1345 | $self->{name} = $name; | |||||||||
| 66 | } | ||||||||||
| 67 | else { | ||||||||||
| 68 | 4008 | return $self->{name}; | |||||||||
| 69 | } | ||||||||||
| 70 | } | ||||||||||
| 71 | |||||||||||
| 72 | sub full_name($) { | ||||||||||
| 73 | 2638 | ▶ | my ($self) = @_; | ||||||||
|
Subroutine
full_name: called CC=2 SCAR=6.9
Pod
documented
| |||||||||||
| 74 | 2638 | my $parent_name = $self->parent_name; | |||||||||
| 75 | 2638 | ▶ | if (defined $parent_name) { | ||||||||
|
Branch: 1 branch
| |||||||||||
| 76 | 426 | return $parent_name.".".$self->name; | |||||||||
| 77 | } | ||||||||||
| 78 | else { | ||||||||||
| 79 | 2212 | return $self->name; | |||||||||
| 80 | } | ||||||||||
| 81 | } | ||||||||||
| 82 | |||||||||||
| 83 | sub parent_name($;$) { | ||||||||||
| 84 | 3990 | ▶ | my ($self, $name) = @_; | ||||||||
|
Subroutine
parent_name: called CC=2 SCAR=6.9
Pod
documented
| |||||||||||
| 85 | 3990 | ▶ | if (defined $name) { | ||||||||
|
Branch: 1 branch
| |||||||||||
| 86 | 426 | $self->{parent_name} = $name; | |||||||||
| 87 | } | ||||||||||
| 88 | else { | ||||||||||
| 89 | 3564 | return $self->{parent_name}; | |||||||||
| 90 | } | ||||||||||
| 91 | } | ||||||||||
| 92 | |||||||||||
| 93 | sub auto_start($) { | ||||||||||
| 94 | 36 | ▶ | return 0; | ||||||||
|
Subroutine
auto_start: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||
| 95 | } | ||||||||||
| 96 | |||||||||||
| 97 | |||||||||||
| 98 | 157 | 1; | |||||||||
| 99 | |||||||||||
| 100 | __END__ | ||||||||||