sub disconnect {
my $self = shift;
+ return unless $self;
unless( $self->state == DISCONNECTED ) {
$self->send('DISCONNECT', "") if ($self->endpoint == CLIENT);;
$self->state( DISCONNECTED );
sub request {
my $self = shift;
my $meth = shift;
+ return unless $self;
my $method;
if (!ref $meth) {
my @payload_list = @_; # this is a Domain Object
+ return unless ($self and $self->{peer_handle});
+
$logger->debug( "In send", INTERNAL );
my $tT;
my $self = shift;
$logger->debug( "Resending..." . @_RESEND_QUEUE, DEBUG );
while ( my $req = shift @OpenSRF::AppSession::_RESEND_QUEUE ) {
- $req->resend;
+ $req->resend unless $req->complete;
}
}
sub status {
my $self = shift;
+ return unless $self;
$self->send( 'STATUS', @_ );
}
}
sub send {
- shift()->session->send(@_);
+ my $self = shift;
+ return unless ($self and $self->session);
+ $self->session->send(@_);
}
sub finish {
sub resend {
my $self = shift;
+ return unless ($self and $self->session);
OpenSRF::Utils::Logger->debug(
"I'm resending the request for threadTrace ". $self->threadTrace, DEBUG);
if($self->payload) {
sub status {
my $self = shift;
my $msg = shift;
+ return unless ($self and $self->session);
$self->session->send( 'STATUS',$msg, $self->threadTrace );
}
sub respond {
my $self = shift;
my $msg = shift;
+ return unless ($self and $self->session);
my $response;
if (ref($msg) && UNIVERSAL::can($msg, 'getAttribute') && $msg->getAttribute('name') =~ /oilsResult/) {
statusCode => STATUS_COMPLETE(),
status => 'Request Complete' );
+ return unless ($self and $self->session);
$self->session->send( 'RESULT' => $response, 'STATUS' => $stat, $self->threadTrace);
}