| 1 | # ===================================================================== | ||
| 2 | # Copyright (c) 2002,2003 IBM Corporation | ||
| 3 | # All rights reserved. This program and the accompanying materials | ||
| 4 | # are made available under the terms of the Common Public License v1.0 | ||
| 5 | # which accompanies this distribution, and is available at | ||
| 6 | # http://www.opensource.org/licenses/cpl.php | ||
| 7 | # | ||
| 8 | # ===================================================================== | ||
| 9 | package LS::Service::Response; | ||
| 10 | |||
| 11 | use strict; | ||
| 12 | use warnings; | ||
| 13 | |||
| 14 | use vars qw( $METHODS ); | ||
| 15 | |||
| 16 | use LS; | ||
| 17 | |||
| 18 | sub BEGIN { | ||
| 19 | |||
| 20 | $METHODS =[ | ||
| 21 | ]; | ||
| 22 | |||
| 23 | LS::makeAccessorMethods($METHODS, __PACKAGE__); | ||
| 24 | } | ||
| 25 | |||
| 26 | |||
| 27 | # | ||
| 28 | # new( %params ) - | ||
| 29 | # | ||
| 30 | sub new { | ||
| 31 | |||
| 32 | my ($self, %params) = @_; | ||
| 33 | |||
| 34 | unless (ref $self) { | ||
| 35 | |||
| 36 | $self = bless { | ||
| 37 | _expiration=> undef, | ||
| 38 | _response=> undef, | ||
| 39 | _format=> undef, | ||
| 40 | }, $self; | ||
| 41 | |||
| 42 | $self->expiration($params{'expiration'}) | ||
| 43 | if($params{'expiration'}); | ||
| 44 | |||
| 45 | $self->response($params{'response'}) | ||
| 46 | if($params{'response'}); | ||
| 47 | |||
| 48 | $self->format($params{'format'}) | ||
| 49 | if($params{'format'}); | ||
| 50 | } | ||
| 51 | |||
| 52 | return $self; | ||
| 53 | } | ||
| 54 | |||
| 55 | |||
| 56 | # | ||
| 57 | # expiration( $expiration ) - | ||
| 58 | # | ||
| 59 | sub expiration { | ||
| 60 | |||
| 61 | my $self = shift->new(); | ||
| 62 | |||
| 63 | $_[0] ? ($self->{'_expiration'} = $_[0], return $self) : $self->{'_expiration'}; | ||
| 64 | } | ||
| 65 | |||
| 66 | |||
| 67 | # | ||
| 68 | # response( $response ) - | ||
| 69 | # | ||
| 70 | sub response { | ||
| 71 | |||
| 72 | my $self = shift->new(); | ||
| 73 | |||
| 74 | $_[0] ? ($self->{'_response'} = $_[0], return $self) : $self->{'_response'}; | ||
| 75 | } | ||
| 76 | |||
| 77 | |||
| 78 | # | ||
| 79 | # format( $format ) - | ||
| 80 | # | ||
| 81 | sub format { | ||
| 82 | |||
| 83 | my $self = shift->new(); | ||
| 84 | |||
| 85 | $_[0] ? ($self->{'_format'} = $_[0], return $self) : $self->{'_format'}; | ||
| 86 | } | ||
| 87 | |||
| 88 | 1; | ||
| 89 | |||
| 90 | __END__ |