| 1 | # ABSTRACT: One fixed set of connection parameters as an AccessBroker | ||||||||||||
| 2 | package DBIO::AccessBroker::Static; | ||||||||||||
| 3 | |||||||||||||
| 4 | 17 | ▶ | use strict; | ||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||
| 5 | 17 | ▶ | use warnings; | ||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||
| 6 | |||||||||||||
| 7 | 17 | our $VERSION = '0.900007'; | |||||||||||
| 8 | |||||||||||||
| 9 | 17 | ▶ | use base 'DBIO::AccessBroker'; | ||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||
| 10 | |||||||||||||
| 11 | 17 | __PACKAGE__->mk_group_accessors('simple' => qw( | |||||||||||
| 12 | host port dbname username password | ||||||||||||
| 13 | )); | ||||||||||||
| 14 | |||||||||||||
| 15 | |||||||||||||
| 16 | |||||||||||||
| 17 | 48 | ▶ | sub new { | ||||||||||
|
Subroutine
new: called CC=6 SCAR=17.9
Pod
documented
| |||||||||||||
| 18 | 48 | my ($class, %args) = @_; | |||||||||||
| 19 | 48 | my $self = $class->SUPER::new(%args); | |||||||||||
| 20 | 48 | ▶ | $self->host($args{host}) if exists $args{host}; | ||||||||||
|
Branch: 1 branch
| |||||||||||||
| 21 | 48 | ▶ | $self->port($args{port}) if exists $args{port}; | ||||||||||
|
Branch: 1 branch
| |||||||||||||
| 22 | 48 | ▶ | $self->dbname($args{dbname}) if exists $args{dbname}; | ||||||||||
|
Branch: 1 branch
| |||||||||||||
| 23 | 48 | ▶ | $self->username($args{username} // ''); | ||||||||||
|
Condition100%2/2
$args{"username"} // ""
MC/DC100%1/1
$args{"username"} // ""
$args{"username"}
Truth table100%2/2
A
A= $args{"username"}
| |||||||||||||
| 24 | 48 | ▶ | $self->password($args{password} // ''); | ||||||||||
|
Condition100%2/2
$args{"password"} // ""
MC/DC100%1/1
$args{"password"} // ""
$args{"password"}
Truth table100%2/2
A
A= $args{"password"}
| |||||||||||||
| 25 | 48 | return $self; | |||||||||||
| 26 | } | ||||||||||||
| 27 | |||||||||||||
| 28 | |||||||||||||
| 29 | 95 | ▶ | sub connect_info_for { | ||||||||||
|
Subroutine
connect_info_for: called CC=2 SCAR=7.0
Pod
documented
| |||||||||||||
| 30 | 95 | my ($self, $mode) = @_; | |||||||||||
| 31 | 95 | ▶ | $mode //= 'write'; | ||||||||||
|
Condition50%1/2
$mode //= "write"
MC/DC0%0/1
$mode //= "write"
$mode
Truth table50%1/2
A
A= $mode
| |||||||||||||
| 32 | |||||||||||||
| 33 | 95 | my %info = ( | |||||||||||
| 34 | host => $self->host, | ||||||||||||
| 35 | port => $self->port, | ||||||||||||
| 36 | dbname => $self->dbname, | ||||||||||||
| 37 | user => $self->username, | ||||||||||||
| 38 | password => $self->password, | ||||||||||||
| 39 | ); | ||||||||||||
| 40 | |||||||||||||
| 41 | 95 | return \%info; | |||||||||||
| 42 | } | ||||||||||||
| 43 | |||||||||||||
| 44 | |||||||||||||
| 45 | 95 | ▶ | sub needs_refresh { 0 } | ||||||||||
|
Subroutine
needs_refresh: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||||
| 46 | |||||||||||||
| 47 | 17 | 1; | |||||||||||
| 48 | |||||||||||||
| 49 | __END__ | ||||||||||||