]> git.evergreen-ils.org Git - working/NCIPServer.git/blob - lib/NCIP/Response.pm
Add some the Header and Response objects.
[working/NCIPServer.git] / lib / NCIP / Response.pm
1 # ---------------------------------------------------------------
2 # Copyright © 2014 Jason J.A. Stephenson <jason@sigio.com>
3 #
4 # This file is part of NCIPServer.
5 #
6 # NCIPServer is free software; you can redistribute it and/or modify
7 # it under the terms of the GNU General Public License as published by
8 # the Free Software Foundation; either version 2 of the License, or
9 # (at your option) any later version.
10 #
11 # NCIPServer is distributed in the hope that it will be useful, but
12 # WITHOUT ANY WARRANTY; without even the implied warranty of
13 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
14 # General Public License for more details.
15 #
16 # You should have received a copy of the GNU General Public License
17 # along with NCIPServer.  If not, see <http://www.gnu.org/licenses/>.
18 # ---------------------------------------------------------------
19 package NCIP::Response;
20 use parent qw(Class::Accessor);
21
22 # This is the Response object to be returned by the ILS' handlers.
23 # The fields are:
24 #
25 # type: A string representing the name of the response this is usually
26 # the initiation message name with Response tacked on, i.e.
27 # LookupUserResponse, etc.  This value is used to lookup the
28 # appropriate template include for formatting the response message to
29 # the initiator.
30 #
31 # data: This is an object or struct with the response data for a
32 # successful result.  It's value and needs vary by message type.
33 #
34 # problem: If the response is reporting a problem, this should point
35 # to a NCIP::Problem object to be used in the problem template.
36 #
37 # header: A NCIP::Header object for the optional ResponseHeader in the
38 # response template.
39
40 # Presently, only one data or problem object is supported.  If one is
41 # supplied the other must be left undefined/unset.  Only 1 header is
42 # supported, but it is entirely optional according to the standard.
43
44 NCIP::Problem->mk_accessors(qw(type data problem header));
45
46 1;