logo
Free, unlimited AI code reviews that run on commit
git-lrc git-lrc GitHub Install Now We'd appreciate a star git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt

RoPkg::Simba::Mirror - a mirror class

Author

       Subredu Manuel <diablo@iasi.roedu.net>

Bugs And Limitations

       None known to the author

Configuration And Environment

       This module does not use any configuration files or environment variables

Dependencies

       RoPkg::DBObject and RoPkg::Exceptions

Description

       RoPkg::Simba::Mirror is a class used to hold all the information a mirror has. Also, the
       RoPkg::Simba::Mirror can be used to add/del/update a mirror to/from the database. Simba is derivated from
       RoPkg::DBObject.

Diagnostics

       Unpack the source, and use 'make test' command

Incompatibilities

       None known to the author

Name

       RoPkg::Simba::Mirror - a mirror class

Perl Critic

       This module is perl critic level 2 compliant (with 1 exception)

See Also

       RoPkg::Simba RoPkg::Simba::Mirrors RoPkg::DBObject RoPkg::Object

Subroutines/Methods

       All methods raise OutsideClass exception when called outside class instance. Besides this, each method,
       may raise other exceptions. Check each method section to find out more.

   new()
       The class constructor. At this moment, it just calls RoPkg::DBObject->new() . Please read the
       RoPkg::DBObject manual page for more information about the new() parameters.

   table()
       Returns the name of the mirrors database table.

   Add()
       Adds the mirror to the database. This method is a wrapper for RoPkg::DBObject::SQL_Insert . On success 0
       is returned. On error, DBI exception is raised.

   Delete()
       Deletes the current mirror from the database. Before calling this method, you should set the id of the
       mirror . If you don't set the id Param::Missing exception is raised. On database operation success, 0 is
       returned. On database error, DBI exception is raised.

   Update()
       Update the current mirror object with the database. Before calling this method, you should set the id of
       the mirror . If you don't set the id Param::Missing exception is raised. On database operation success, 0
       is returned. On database error, DBI exception is raised.

   Load()
       Load the mirror information from the database, into the current object. Before calling this method you
       should have set id or Name. If id or Name are not set, then Param::Missing is raised.  On database
       operation success 0 is returned. On database error, DBI exception is raised.

   GetMethods()
       Returns a array with the current object methods names. In scalar context returns the number of methods.

       The following methods are get/set methods for all fields of a mirror.

       *) id
       *) Name
       *) Description
       *) HomeSite
       *) LocalDir
       *) Size
       *) SyncMethod
       *) CommandID
       *) LastErrorCode
       *) Active
       *) InProgress
       *) SyncSource
       *) SyncSourceUser
       *) SyncSourcePass
       *) SyncSourceModule
       *) Contact
       *) LastUpdated
       *) LastUpdateDuration
       *) LastUpdateSpeed
       *) LastUpdateFilesNo
       *) LastUpdateBytes
       *) LocalURL
       *) StdOut
       *) StdErr

Synopsis

        !#/usr/bin/perl

        use RoPkg::DB;
        use RoPkg::Simba::Mirror;

        sub main {
          my $dbp = new RoPkg::DB();
          $dbp->Add('dbi:mysql:database=mysql;host=localhost',
                    'root',
                    '',
                    'local');

          my $m = new RoPkg::Simba::Mirror(dbo => $dbp, dbo_method => 'db_local');
          $m->Name('debian');
          $m->Load();
        }

        main();

Version

       0.1.3

See Also