MOSES-MOBY

 view release on metacpan or  search on metacpan

lib/MOSES/MOBY/Cache/Central.pm  view on Meta::CPAN

Update the datatype cache. This will update any items that are 'old',
by relying on the LSID for the datatype.

Throw an exception if any of the following occur:
    * A cache to update doesn't exist
    * There is a SOAP error calling the registry
    * There were read/write errors on the cache directory or its contents

=cut

sub update_datatype_cache {
    my ($self) = @_;	
    
    my %old_datatypes = ();
    my %new_datatypes = ();
    my @changed_datatypes = ();
   
   if (!(-e File::Spec->catfile (
   					$self->cachedir,
				    $self->_clean ($self->_endpoint),
				    DATATYPES_CACHE))) {

lib/MOSES/MOBY/Cache/Central.pm  view on Meta::CPAN

Update the services cache. This will update any items that are 'old',
by relying on the LSID for the datatype.

Throw an exception if any of the following occur:
	* A cache to update doesn't exist
	* There is a SOAP error calling the registry
	* There were read/write errors on the cache directory or its contents

=cut

sub update_service_cache {
    my ($self) = @_;	
    
    my %old_services = ();
    my %new_services = ();
    my %changed_services = ();
   
   if (!(-e File::Spec->catfile (
   					$self->cachedir,
				    $self->_clean ($self->_endpoint),
				    SERVICES_CACHE))) {

lib/MOSES/MOBY/Generators/GenServices.pm  view on Meta::CPAN

		$LOG->info ("\tAsync service created at '$outfile'\n");
		 
	}
    }
}


#-----------------------------------------------------------------
# update_table
#-----------------------------------------------------------------
sub update_table {
    my ($self, @args) = @_;
    my %args =
	( # some default values
	  impl_outdir    => ( $MOBYCFG::GENERATORS_IMPL_OUTDIR ||
			      MOSES::MOBY::Generators::Utils->find_file ($Bin, 'services') ),
	  services_table => ($MOBYCFG::GENERATORS_IMPL_SERVICES_TABLE || 'SERVICES_TABLE'),
	  impl_prefix    => ($MOBYCFG::GENERATORS_IMPL_PACKAGE_PREFIX || 'Service'),
	  cachedir       => $self->cachedir,
	  registry       => $self->registry,
	  service_names  => [],

lib/MOSES/MOBY/Generators/GenServices.pm  view on Meta::CPAN

    print DISPATCH Data::Dumper->Dump ( [$DISPATCH_TABLE], ['DISPATCH_TABLE'] )
	or $self->throw ("cannot write to '$file_with_table': $!\n");
    close DISPATCH;
    $LOG->info ("Updated services table '$file_with_table'. New contents: " .
		$self->toString ($DISPATCH_TABLE));
}

#-----------------------------------------------------------------
# update_async_table
#-----------------------------------------------------------------
sub update_async_table {
    my ($self, @args) = @_;
    my %args =
	( # some default values
	  impl_outdir    => ( $MOBYCFG::GENERATORS_IMPL_OUTDIR ||
			      MOSES::MOBY::Generators::Utils->find_file ($Bin, 'services') ),
	  services_table => ($MOBYCFG::GENERATORS_IMPL_ASYNC_SERVICES_TABLE || 'ASYNC_SERVICES_TABLE'),
	  impl_prefix    => ($MOBYCFG::GENERATORS_IMPL_PACKAGE_PREFIX || 'Service'),
	  cachedir       => $self->cachedir,
	  registry       => $self->registry,
	  service_names  => [],

lib/MOSES/MOBY/Generators/templates/service.tt  view on Meta::CPAN

#-----------------------------------------------------------------
# update_state_event
#    This method is used to update the state of your 
#    LSAE_STATE_CHANGED_EVENT event.
#
#  Parameters:  
#    $request - $request from process_it()
#    $state - one of (created, running, completed, terminated_by_request, terminated_by_error) 
#    $msg   - a message to provide regarding the state of our event 
#-----------------------------------------------------------------
sub update_state_event {
    my ( $self, $request, $state, $msg ) = @_;

    my %valid_states = ('created'=>1,'running'=>1,'completed'=>1,'termintated_by_request'=>1,'terminated_by_error'=>1,);
    
    $msg = '' unless defined $msg;
    $state = 'running' unless defined $state;
    
    # validate the state of the event ...
    $state = 'running' unless $valid_states{$state};
    

lib/MOSES/MOBY/Generators/templates/service.tt  view on Meta::CPAN

#-----------------------------------------------------------------
# update_percentage_event
#    This method is used to update the state of your 
#    LSAE_PERCENT_PROGRESS_EVENT event.
#
#  Parameters:  
#    $request     - $request from process_it()
#    $percentrage - an integer between 0-100 
#    $msg         - a message to provide regarding the state of our event 
#-----------------------------------------------------------------
sub update_percentage_event {
    my ( $self, $request, $percentage, $msg ) = @_;
    
    $msg = '' unless defined $msg;
    $percentage = 1 unless defined $percentage;
    
    # validate the state of the event ...
    $percentage = 1 unless $percentage >= 0 and $percentage <=100;
    
    unless ( defined $ENV{ID} ) {
        # hmm, local testing of service?

lib/MOSES/MOBY/Generators/templates/service.tt  view on Meta::CPAN

# update_step_event
#    This method is used to update the state of your 
#    LSAE_STEP_PROGRESS_EVENT event.
#
#  Parameters:  
#    $request         - $request from process_it()
#    $total_steps     - integer representing total steps until completion
#    $steps_completed - integer representing steps completed 
#    $msg             - a message to provide regarding the state of our event 
#-----------------------------------------------------------------
sub update_step_event {
    my ( $self, $request, $total_steps, $steps_completed, $msg ) = @_;
   
    $msg = '' unless defined $msg;
    $total_steps = 1 unless defined $total_steps;
    $steps_completed = 0 unless defined $steps_completed;
    
    # validate the state of the event ...
    $steps_completed = $total_steps if $steps_completed > $total_steps;
    
    unless ( defined $ENV{ID} ) {

lib/MOSES/MOBY/Generators/templates/service.tt  view on Meta::CPAN

#-----------------------------------------------------------------
# update_time_event
#    This method is used to update the state of your 
#    LSAE_TIME_PROGRESS_EVENT event.
#
#  Parameters:  
#    $request   - $request from process_it()
#    $remaining - integer representing seconds until completion 
#    $msg       - a message to provide regarding the state of our event 
#-----------------------------------------------------------------
sub update_time_event {
    my ( $self, $request, $remaining, $msg ) = @_;
    
    $msg = '' unless defined $msg;
    $remaining = 0 unless defined $remaining;
    
    # validate the state of the event ...
    $remaining = 0 unless $remaining >= 0 ;
    
    unless ( defined $ENV{ID} ) {
        # hmm, local testing of service?



( run in 0.724 second using v1.01-cache-2.11-cpan-95122f20152 )