The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

Tuxedo::Admin::Group

SYNOPSIS

  use Tuxedo::Admin;

  $admin = new Tuxedo::Admin;

  $group = $admin->group('GW_GRP_3');

  $group->grpno('50');
  $group->lmid('master');
  $group->update();
  
  ...

  unless ($group->exists())
  {
    $rc = $group->add($group);
    $admin->print_status();
  }  

  foreach $group ($admin->group_list())
  {
    print "Group name: ", $group->srvgrp();
    print "Group number: ", $group->grpno();
  }

DESCRIPTION

Provides methods to query, add, remove and update a Tuxedo group.

INITIALISATION

Tuxedo::Admin::Group objects are not instantiated directly. Instead they are created via the group() method of a Tuxedo::Admin object.

Example:

  $group = $admin->group('GW_GRP_1');

This applies both for existing groups and for new groups that are being created.

METHODS

exists()

Used to determine whether or not the group exists.

  if ($group->exists())
  {
    ...
  }

Returns true if the group exists.

add()

Adds the group to the current Tuxedo application.

  $rc = $group->add();

Croaks if the group already exists or if the required srvgrp, grpno and lmid parameters are not set. $rc is non-negative on success.

Example:

  $group = $admin->group('GW_GRP_1);
  die "group already exists\n" if $group->exists();
  
  $group->grpno('50');
  $group->lmid('yoda');
  
  $rc = $group->add($group);
  print "Welcome!" unless ($rc < 0);
  
  $admin->print_status();
  

remove()

Removes the group from the current Tuxedo application.

  $rc = $group->remove();

Croaks if the group is booted or if the required srvgrp parameter is not set. $rc is non-negative on success.

Example:

  $group = $admin->group('GW_GRP_1');
  
  warn "Can't remove a group while it is booted.\n"
    unless ($group->state() eq 'INACTIVE');
  
  $rc = $group->remove()
    if ($group->exists() and ($group->state() eq 'INACTIVE'));

  print "hasta la vista baby!" unless ($rc < 0);
  
  $admin->print_status();
  

update()

Updates the group configuration with the values of the current object.

  $ok = $group->update();

Croaks if the group does not exist or the required srvgrp parameter is not set. $rc is non-negative on success.

boot()

Starts all servers in this group.

  $rc = $group->boot();

Croaks if the group is already booted. $rc is non-negative on success.

Example:

  $group = $admin->group('GW_GRP_1');
  $rc = $group->boot()
    if ($group->exists() and ($group->state() ne 'ACTIVE'));

    

shutdown()

Stops all servers in this group.

  $rc = $group->shutdown();

Croaks if the group is not running. $rc is non-negative on success.

Example:

  $group = $admin->group('GW_GRP_1');
  $rc = $group->shutdown() 
    if ($group->exists() and ($group->state() ne 'INACTIVE'));
  
  

suspend()

Suspends all services advertised by servers in this group.

  $rc = $group->suspend();

Croaks if the group is not active. $rc is non-negative on success.

Example:

  $group = $admin->group('GW_GRP_1');
  $rc = $group->suspend()
    if ($group->exists() and ($group->state() eq 'ACTIVE'));

    

resume()

Unsuspends all services advertised by servers in this group.

  $rc = $group->resume();

Croaks if the group is not active. $rc is non-negative on success.

Example:

  $group = $admin->group('GW_GRP_1');
  $rc = $group->resume() 
    if ($group->exists() and ($group->state() eq 'ACTIVE'));
  

servers()

Returns the list of servers in this group.

  @servers = $group->servers();

where @servers is an array of references to Tuxedo::Admin::Server objects.

Example:

  foreach $server ($group->servers())
  {
    print $server->servername(), "\t", $server->srvid(), "\n";
  }

get/set methods

The following methods are available to get and set the group parameters. If an argument is provided then the parameter value is set to be the argument value. The value of the parameter is returned.

Example:

  # Get the group number
  print $group->grpno(), "\n";

  # Set the group number
  $group->grpno('50');
closeinfo()
curlmid()
encryption_required()
envfile()
grpno()
lmid()
openinfo()
sec_principal_location()
sec_principal_name()
sec_principal_passvar()
signature_required()
srvgrp()
state()
tmscount()
tmsname()