Wombat/Core/SessionFacade.pm untested

filter: Statementstmt 0.0% 0 / 40 Branchbran 0.0% 0 / 2 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 0.0% 0 / 16 Podpod 0.0% 0 / 12 totaltotal 0.0% 0 / 70 CC 2 SCAR 9.0
CC
2
Cov
0%
new
6.0
getAttribute
2.0
getAttributeNames
2.0
CRAP 2.5
1 # -*- Mode: Perl; indent-tabs-mode: nil; -*-
2  
3 package Wombat::Core::SessionFacade;
4  
5 =pod
6  
7 =head1 NAME
8  
9 Wombat::Core::SessionFacade - internal session facade
10  
11 =head1 SYNOPSIS
12  
13 =head1 DESCRIPTION
14  
15 Facade class that wraps an internal Session object. All methods are
16 delegated to the wrapped sessoin. The facade is presented to servlet
17 code so that the servlet code does not have access to internal Session
18 methods.
19  
20 =cut
21  
22 use base qw(Servlet::Http::HttpSession);
23 use fields qw(session);
24 use strict;
25 use warnings;
26  
27 =pod
28  
29 =head1 CONSTRUCTOR
30  
31 =over
32  
33 =item new()
34  
35 Construct and return a B<Wombat::Core::SessionFacade> instance,
36 initializing fields appropriately.
37  
38 B<Parameters:>
39  
40 =over
41  
42 =item $session
43  
44 the B<Wombat::Core::Session> for which this object is the facade.
45  
46 =back
47  
48 =back
49  
50 =cut
51  
52 sub new {
53 my $self = shift;
54 my $session = shift;
55  
56 $self = fields::new($self) unless ref $self;
57  
58 $self->{session} = $session;
59  
60 return $self;
61 }
62  
63 sub getAttribute {
64 my $self = shift;
65  
66 return $self->{session}->getAttribute(@_);
67 }
68  
69 sub getAttributeNames {
70 my $self = shift;
71  
72 return $self->{session}->getAttributeNames(@_);
73 }
74  
75 sub removeAttribute {
76 my $self = shift;
77  
78 return $self->{session}->removeAttribute(@_);
79 }
80  
81 sub setAttribute {
82 my $self = shift;
83  
84 return $self->{session}->setAttribute(@_);
85 }
86  
87 sub getCreationTime {
88 my $self = shift;
89  
90 return $self->{session}->getCreationTime(@_);
91 }
92  
93 sub getId {
94 my $self = shift;
95  
96 return $self->{session}->getId(@_);
97 }
98  
99 sub getLastAccessedTime {
100 my $self = shift;
101  
102 return $self->{session}->getLastAccessedTime(@_);
103 }
104  
105 sub getMaxInactiveInterval {
106 my $self = shift;
107  
108 return $self->{session}->getMaxInactiveInterval(@_);
109 }
110  
111 sub setMaxInactiveInterval {
112 my $self = shift;
113  
114 return $self->{session}->setMaxInactiveInterval(@_);
115 }
116  
117 sub isNew {
118 my $self = shift;
119  
120 return $self->{session}->isNew(@_);
121 }
122  
123 sub invalidate {
124 my $self = shift;
125  
126 return $self->{session}->invalidate(@_);
127 }
128  
129 1;
130 __END__