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
Ubic::Multiservice(3) User Contributed Perl Documentation Ubic::Multiservice(3)

Ubic::Multiservice - interface of multiservice representing several named services

version 1.58

    $service = $multiservice->service("multiservice-x.multiservice-y.service-z");
    @services = $multiservice->services();

Multiservices are objects with simple list/get API which is used to fill ubic service tree.

This is an abstract base class for all multiservices.

Actual multiservice classes should inherit from this class and implement methods from "ABSTRACT METHODS" section.

These methods have to be overloaded by subclasses:
simple_service($name)
Should return subservice by its short name (i.e. name without dot separators in it).
service_names()
Should return list with the names of all top-level subservices.

These methods can be overloaded for a performance boost or some non-trivial tasks, but their default implementation should be adequate in 99% of the cases.
service($name)
Get service by name.

This class provides a common implementation which can delegate searching of subservices to multiservices (don't panic!), so subclasses should implement "simple_service" instead.

All subservices are cached forever.

has_service($name)
Check whether service with specified name exists in this multiservice.

Like "service", subclasses should usually implement "has_simple_service" instead.

services()
Construct all top-level subservices.

By default, it uses "service_names" to get the list of names.

has_simple_service($name)
Returns true if $name is a subservice of this multiservice.

Default implementation calls "$self->service_names", so you might want to reimplement it in subclasses for a performance reasons.

multiop()
Get multiop operation mode of a multiservice. There are three possible values which this method can return:
allowed
"start", "stop", "restart" actions for this module start/stop/restart all subservices. This is the default.
protected
-f flag in ubic(1) binary is required to call any action.
forbidden
ubic(1) binary will refuse to start/stop/restart this multiservice.

Although multiservice class is inherited from "Ubic::Service" class, it doesn't and shouldn't implement start/stop/status methods. This is because user will usually want to see action's progress, and all output policy is defined in Ubic::Cmd class; interaction protocol between this class and "Ubic::Cmd" class would be too complex.

This may be fixed in future: either "Ubic::Multiservice" will no longer inherit from "Ubic::Service", or start/stop methods will be implemented with renderer object as an argument. Until then, please don't override these methods in subclasses.

"user", "group" and other metadata methods are not used for multiservices too.

Subservices are cached forever; this can cause troubles, but it is necessary to avoid memory leaks in persistent programs, for example, in "Ubic::Ping".

Ubic::Multiservice::Simple - class for defining simple multiservices.

Ubic::Multiservice::Dir - multiservice which loads service configs from files.

Vyacheslav Matyukhin <mmcleric@yandex-team.ru>

This software is copyright (c) 2015 by Yandex LLC.

This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.

2015-01-27 perl v5.32.1

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.