1 # ---------------------------------------------------------------
2 # Copyright © 2014 Jason J.A. Stephenson <jason@sigio.com>
4 # This file is part of NCIPServer.
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.
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.
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 # ---------------------------------------------------------------
23 my $class = ref $invocant || $invocant;
24 my $self = bless {@_}, $class;
28 # Methods required for SHAREit:
33 sub cancelrequestitem {
51 # Other methods, just because.
56 # A few helper methods:
58 # All subclasses will possibly want to create a ResponseHeader and the
59 # code for that would be highly redundant. We supply a default
60 # implementation here that can retrieve the agency information from
61 # the InitiationHeader of the message, swap their values, and return a
65 my $initheader = shfit;
69 if ($initheader && $initheader->{FromAgencyId}
70 && $initheader->{ToAgencyId}) {
71 $header = NCIP::Header->new(
72 FromAgencyId => $initheader->{ToAgencyId},
73 ToAgencyId => $initheader->{FromAgencyId}