GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages
Sympa::DataSource(3Sympa) sympa 6.2.62 Sympa::DataSource(3Sympa)

Sympa::DataSource - Base class of Sympa data source subclasses

  # To implemnt Sympa::DataSource::Foo:

  package Sympa::DataSource::Foo;

  use base qw(Sympa::DataSource);
  
  sub _open {
      my $self = shift;
      ...
      return $handle;
  }
  
  sub _next {
      my $self = shift;
      ...
      return [$email, $gecos];
  }
  
  1;
  
  # To use Sympa::DataSource::Foo:
  
  usr Sympa::DataSource;
  
  $ds = Sympa::DataSource->new('Foo', 'member', context => $list,
      key => val, ...);
  if ($ds and $ds->open) {
      while (my $member = $ds->next) {
          ...
      }
      $ds->close;
  }

TBD.

new ( $type, $role, context => $that, [ key => val, ... ] )
Constructor. Creates a new instance of Sympa::DataSource.

Parameters:

$type
Type of data source. This corresponds to impemented subclasses.
$role
Role of data source. 'member', 'owner', 'editor' or 'custom_attribute'.
context => $that
Context. Sympa::List instance and so on.
key => val, ...
Optional or mandatory parameters.

Returns:

A new instance, or "undef" on failure.

close ( )
Instance method. Closes backend and does cleanup.
next ( )
Instance method. Returns the next entry in data source. Data source should have been opened.
open ( )
Instance method. Opens backend and returns handle.
get_id ( )
Instance method. Gets unique ID of the instance.
get_short_id ( )
Instance method. Gets data source ID, a hexadecimal string with 8 columns.
name ( )
Instance method. Gets human-readable name of data source. Typically it is value of {name} attribute or result of get_short_id().
role ( )
Instance method. Returns $role set by new().
__dsh ( )
Instance method, protected. Returns native query handle which _open() returned. This may be used only at inside of each subclass.

required_modules
Class or instance method. TBD.
_open ( [ options... ] )
Instance mthod. TBD.
_next ( [ options... ] )
Instance method, mandatory. TBD.
_next_ca ( [ options... ] )
Instance method, mandatory if the data source supports custom attribute. TBD.
_close ( )
Instance method. TBD.

{context}
Context of the data source set by new().
Others
The other options set by new() may be accessed as attributes.

Sympa::DataSource appeared on Sympa 6.2.45b. See also "HISTORY" in Sympa::Request::Handler::include.
2021-04-27 6.2.62

Search for    or go to Top of page |  Section 3 |  Main Index

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with ManDoc.