The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

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

VERSION

version 1.14

SYNOPSIS

    $service = $multiservice->service("yandex.yandex-ppb-people-pt.meta-all");
    @services = $multiservice->services();

DESCRIPTION

Multiservice's interface consists of two fundamental methods: service($name) to get service by it's name, and services() to get list of all services.

Additionally, you can check whether multiservice contains service without instantiating it, using has_service($name) method.

Remember that althouth multiservice is currently a service too, it doesn'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 hard to code.

METHODS

service($name)

Get service by name.

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

simple_service()

This method should be implemented by subclass.

has_service($name)

Check whether service with specified name exists in this multiservice.

Like service, subclasses should usually implement has_simple_service instead.

has_simple_service($name)

This method should be implemented by subclass.

services()

Construct all subservices. Because they are top-level, we don't need simple_services().

By default, it uses service_names to get list of services.

service_names()

Get list with names of all subservices.

Subclasses should usually override this method, services uses it in default implementation.

multiop()

Get multiop operation mode of object. There are three possible values which this method can return:

allowed

start, stop, restart actions for this module start/stop/restart all subservices.

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.

SEE ALSO

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

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

AUTHOR

Vyacheslav Matjukhin <mmcleric@yandex-team.ru>

COPYRIGHT AND LICENSE

This software is copyright (c) 2010 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.