#################### main pod documentation begin ################### =head1 NAME Zymonic::Decryptor::Message::Decrypt - Zymonic Decryptor Message. =head1 SYNOPSIS Returns a value unencrypted =head1 DESCRIPTION Returns a value unencrypted =head1 USAGE =head1 BUGS None we're aware of... =head1 SUPPORT As in the license, Zymonic is provided without warranty or support unless purchased separately, however... If you email zymonic-support@zednax.com your issue will be noted and may receive a response. For security issues, please contact zymonic-security@zednax.com and someone will respond within 8 working hours. =head1 AUTHOR Alex Masidlover et al. CPAN ID: MODAUTHOR Zednax Limited alex.masidlover@zednax.com http://www.zednax.com =head1 COPYRIGHT This program is free software licensed under the... Zymonic Public License 1.0 The full text of the license can be found in the LICENSE file included with this module. Other licenses may be acceptable if including parts of Zymonic in larger projects, please contact Zednax for details. =head1 SEE ALSO perl(1). =cut #################### main pod documentation end ################### package Zymonic::Decryptor::Message::Decrypt; use strict; use warnings; BEGIN { use Exporter (); use vars qw($VERSION @ISA @EXPORT @EXPORT_OK %EXPORT_TAGS); $VERSION = '0.01'; @ISA = qw(Exporter); #Give a hoot don't pollute, do not export more than needed by default @EXPORT = qw(); @EXPORT_OK = qw(); %EXPORT_TAGS = (); } use base 'Zymonic::Decryptor::Message'; use Zymonic::Utils qw(death_handler); #################### subroutine header begin #################### =head2 respond Usage : my $response = $mh->repsond($in) Purpose : messages. Returns : Argument : Throws : Comment : See Also : =cut #################### subroutine header end #################### sub respond { my $self = shift; my $in = shift; my $returned_data = ''; my @messages = (); $self->{decryptor_server}->connection_log( 'Finding unencrypted data for: ' . $in->{id} ); eval { $returned_data = $self->{decryptor_server}->decrypt( $in->{id}, $in->{system} ); 1; } or do { my $err = death_handler( $@, '', 'return' ); eval { push( @messages, $err->{message}->{content} ); }; }; my $response = {}; if (@messages) { $response = { error => join( ",", map { "System Load Failed: " . $_ } @messages ) }; } else { $response = { data => $returned_data }; } return $response; } 1;