NAME
TL1ng - A simple, flexible, OO way to work with TL1.
SYNOPSIS
To get started, if you want *basic* no-frills TL1 functionality over Telnet:
use TL1ng;
my $tl1_obj = TL1ng->new();
Which, currently, is the same as:
use TL1ng;
my $tl1_obj = TL1ng->new({
Source => 'Telnet'
Type => 'Base',
});
And that produces an object of the type TL1ng::Base, configured to communicate with the NE/GNE via Telnet by use of the TL1ng::Source::Telnet module.
But that's just the default right now. This is even better, and may become the default in later versions:
use TL1ng;
my $tl1_obj = TL1ng->new({
Type => 'Generic',
});
That produces an object of the type TL1ng::Generic, (which is a subclass of TL1ng::Base,) also configured to communicate with the NE/GNE via Telnet (again, by use of the TL1ng::Source::Telnet module.)
TL1ng::Generic has methods for login, logout, and managing multiple sessions through a single 'source' conection, and once I've vetted it's functionality against a wider variety of equipment it will probably be merged with TL1ng::Base.
Coming soon will also be sub-classes to provide device or vendor-specicic TL1 functionality.
BTW, I see nothing wrong with simply use
-ing and instantiating your desired sub-class module directly...
use TL1ng::Generic;
my $tl1_obj = TL1ng::Generic->new({ Various => Params, Go => Here });
Perhaps the factory idea behind this module is bird-brained and the example above is better. I'm not sure, but welcome suggestions! As always, TMTOWTDI.
DESCRIPTION
The module TL1ng is just a factory for getting instances of TL1ng::Base and it's sub-classes. The best way to learn about how this all works right now is to read the perldoc for TL1ng::Base, then read the perldoc for any specific sub-class(es) you may be using.
METHODS
new
Returns an object of the type TL1ng::Base, or some sub-class. The only parameter this method truly cares about is Type
, and it's value is used to determine which class to instantiate.
All additional parameters are passed through to the new
method of the instantiated class.
For example, Type => Foo
will cause the module to load and create an object from TL1ng::Foo. All additional parameters are passed to TL1ng::Foo->new()
. It's simplistic, and I already see the limitations, but it works for my needs and I simply don't have the time to do it a better way right now.
EXPORT
None by default.
SEE ALSO
AUTHOR
Steve Scaffidi, <mailto:sscaffidi@cpan.net|sscaffidi@cpan.net>
COPYRIGHT AND LICENSE
Copyright (C) 2007 by Steve Scaffidi
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.8.8 or, at your option, any later version of Perl 5 you may have available.