Help-Site Computer Manuals
Software
Hardware
Programming
Networking
  Algorithms & Data Structures   Programming Languages   Revision Control
  Protocols
  Cameras   Computers   Displays   Keyboards & Mice   Motherboards   Networking   Printers & Scanners   Storage
  Windows   Linux & Unix   Mac

/var/sites/help-site.com/auto/tmp/CPAN/9677/Tuxedo-Admin-0.08/lib/Tuxedo/Admin/Group.pm

/var/sites/help-site.com/auto/tmp/CPAN/9677/Tuxedo-Admin-0.08/lib/Tuxedo/Admin/Group.pm


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();

  

=head2 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();

  

=head2 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'));

    

=head2 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'));

  

  

=head2 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'));

    

=head2 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()
Programminig
Wy
Wy
yW
Wy
Programming
Wy
Wy
Wy
Wy