softwarecontainer
0.18.0-739e8d7 2017-05-04
|
Public Types | |
enum | GatewayState : unsigned int { CREATED, CONFIGURED, ACTIVATED } |
Public Member Functions | |
WaylandGateway (std::shared_ptr< ContainerAbstractInterface > container) | |
bool | readConfigElement (const json_t *element) |
Gateway specific parsing of config elements. More... | |
virtual bool | activateGateway () |
virtual bool | teardownGateway () |
virtual std::string | id () const |
Returns the ID of the gateway. More... | |
virtual bool | setConfig (const json_t *config) |
Configure this gateway according to the supplied JSON configuration string. More... | |
virtual bool | activate () |
Applies any configuration set by setConfig() More... | |
virtual bool | teardown () |
Restore system to the state prior to launching of gateway. More... | |
virtual bool | isConfigured () |
Is the gateway configured or not? More... | |
virtual bool | isActivated () |
Is the gateway activated or not? More... | |
Protected Member Functions | |
std::shared_ptr< ContainerAbstractInterface > | getContainer () |
Get a handle to the associated container. More... | |
bool | setEnvironmentVariable (const std::string &variable, const std::string &value) |
Set an environment variable in the associated container. More... | |
Definition at line 26 of file waylandgateway.h.
|
virtual |
Gateway specific parsing of config elements.
All gateways implement this method in order to provide gateway specific parsing of the configuration content.
element | A JSON configuration item. |
Implements softwarecontainer::Gateway.
Definition at line 43 of file waylandgateway.cpp.
References softwarecontainer::Gateway::getContainer(), and softwarecontainer::JSONParser::read().
|
virtualinherited |
Returns the ID of the gateway.
Definition at line 36 of file gateway.cpp.
Referenced by softwarecontainer::Gateway::activate(), softwarecontainer::DBusGatewayInstance::DBusGatewayInstance(), softwarecontainer::Gateway::setConfig(), and softwarecontainer::Gateway::teardown().
|
virtualinherited |
Configure this gateway according to the supplied JSON configuration string.
config | JSON string containing gateway-specific JSON configuration |
config
was successfully parsed, false otherwiseGatewayError | If called on an already activated gateway. |
Reimplemented in softwarecontainer::DBusGateway.
Definition at line 41 of file gateway.cpp.
References softwarecontainer::Gateway::id(), and softwarecontainer::Gateway::readConfigElement().
|
virtualinherited |
Applies any configuration set by setConfig()
GatewayError | If called on an already activated gateway, or if the gateway has not been previously configured, or if there is not container instance set. |
Reimplemented in softwarecontainer::DBusGateway.
Definition at line 78 of file gateway.cpp.
References softwarecontainer::Gateway::id().
|
virtualinherited |
Restore system to the state prior to launching of gateway.
Any cleanup code (removal of files, virtual interfaces, etc) should be placed here.
GatewayError | If called on a non activated gateway. |
Reimplemented in softwarecontainer::DBusGateway.
Definition at line 103 of file gateway.cpp.
References softwarecontainer::Gateway::id().
Referenced by softwarecontainer::DBusGatewayInstance::DBusGatewayInstance().
|
virtualinherited |
Is the gateway configured or not?
Reimplemented in softwarecontainer::DBusGateway.
Definition at line 134 of file gateway.cpp.
|
virtualinherited |
Is the gateway activated or not?
Dynamic gateways will return true if they have been activated at least once. Non-dynamic gateways will return true if they are in state ACTIVATED
Reimplemented in softwarecontainer::DBusGateway.
Definition at line 139 of file gateway.cpp.
Referenced by softwarecontainer::DBusGatewayInstance::DBusGatewayInstance().
|
protectedinherited |
Get a handle to the associated container.
GatewayError | If called before setContainer() has been called. |
Definition at line 128 of file gateway.cpp.
Referenced by softwarecontainer::NetworkGateway::activateGateway(), softwarecontainer::DBusGatewayInstance::activateGateway(), readConfigElement(), and softwarecontainer::NetworkGateway::teardownGateway().
|
protectedinherited |
Set an environment variable in the associated container.