App-KGB
view release on metacpan or search on metacpan
lib/App/KGB/Client/ServerRef.pm view on Meta::CPAN
$s->send_changes( $client, $protocol_ver, $commit, $branch, $module, { extra => stuff } );
$s->relay_message( $client, $message, [ { opts } ] );
=head1 DESCRIPTION
B<App::KGB::Client::ServerRef> is used in L<App::KGB::Client> to refer to
remote KGB server instances. It encapsulates sending requests to the remote
server, maintaining protocol encapsulation and authentication.
=head1 CONSTRUCTOR
=over
=item new
The usual constructor. Accepts a hashref of initialiers.
=back
=head1 FIELDS
=over
=item B<uri> (B<mandatory>)
The URI of the remote KGB server. Something like C<http://some.host:port/>.
=item B<proxy>
This is the SOAP proxy used to communicate with the server. If omitted,
defaults to the value of B<uri> field, with C<?session=KGB> appended.
=item B<password> (B<mandatory>)
Password, to be used for authentication to the remote KGB server.
=item B<timeout>
Specifies the timeout for the SOAP transaction in seconds. Defaults to 15
seconds.
=item B<verbose>
Be verbose about communicating with KGB server.
=item B<dry_run>
Perform all processing, but do not communicate with the server.
=back
=head1 METHODS
=over
=item B<send_changes> (I<message parameters>)
Transmits the change set and all data about it along with the necessary
authentication hash. If an error occurs, an exception is thrown.
Message parameters are passed as arguments in the following order:
=over
=item Client instance (L<App::KGB::Client>)
=item Protocol version (or 'auto')
=item Commit (an instance of L<App::KGB::Commit>)
=item Branch
=item Module
=item Extra
This is a hash reference with additional parameters.
=back
=item B<relay_message>(I<client>, I<message> [, I<options hash> ])
Sends a message to the server for relaying.
=item send_changes_v2($info)
=item send_changes_v3($info)
=item send_changes_v4($info)
Methods implementing different protocol versions
=item send_changes_soap($message)
Helper method sending commit information via SOAP. Dies on any error or SOAP
FAULT.
=item send_changes_json($message)
Helper method sending commit information via JSON-RPC. Dies on errors.
=back
=cut
require v5.10.0;
use base 'Class::Accessor::Fast';
__PACKAGE__->mk_accessors( qw( uri proxy password timeout verbose dry_run ) );
use utf8;
use Carp qw(confess);
use Digest::SHA qw(sha1_hex);
use YAML ();
sub new {
my $self = shift->SUPER::new( @_ );
defined( $self->uri )
or confess "'uri' is mandatory";
defined( $self->proxy )
( run in 0.792 second using v1.01-cache-2.11-cpan-ceb78f64989 )