alma::acs::tmcdb::logic::ContainerStartupOptionHelper Class Reference

Collaboration diagram for alma::acs::tmcdb::logic::ContainerStartupOptionHelper:
Collaboration graph
[legend]

List of all members.

Public Types

enum  OptionType { ENV_VAR, EXEC_ARG, EXEC_ARG_LANG, CONT_ARG }

Public Member Functions

 ContainerStartupOptionHelper (Logger logger)
Collection
< ContainerStartupOption > 
convertFlagsString (Container container, String flags)
String convertContainerStartupOptions (Collection< ContainerStartupOption > options)

Static Public Attributes

static final String CONT_ARG_WRAPPER_OPTION = "--passthrough"
static final String EXEC_ARG_LANG_WRAPPER_OPTION = "--passthroughProcessStart"
static final String OPTION_NAME_LEGACY_CONCATENATED = "LegacyOptionsConcat"

Private Attributes

final Logger logger

Detailed Description

Encapsulates the translation of Container parameters between

  1. The one-string version used by the CDB and container daemon (where different levels of options are expressed via wrapper options like --passthroughProcessStart)
  2. and the more atomic storage in the TMCDB as a set of ContainerStartupOption objects.

In the future this class may also be used to provide lists of available options to the TMCDB Explorer.

Perhaps move this class to module acsstartup if we refactor this class's API to not use TMCDB pojos.

Author:
hsommer

Member Enumeration Documentation

These values correspond to the allowed content of attribute 'OptionType' in table ContainerStartupOption.

Enumerator:
ENV_VAR 
EXEC_ARG 
EXEC_ARG_LANG 
CONT_ARG 

Constructor & Destructor Documentation

alma::acs::tmcdb::logic::ContainerStartupOptionHelper::ContainerStartupOptionHelper ( Logger  logger  )  [inline]

Ctor that takes a logger.


Member Function Documentation

String alma::acs::tmcdb::logic::ContainerStartupOptionHelper::convertContainerStartupOptions ( Collection< ContainerStartupOption >  options  )  [inline]

Converts a list of ContainerStartupOption to a flat option string that can be passed to the container daemon or used to satisfy DAL calls.

Parameters:
options 
Returns:
Options in one string, wrapped as needed. Possibly empty string, never null.
Exceptions:
IllegalArgumentException if an option references a different container than the other options (all refs null is OK though)

References CONT_ARG_WRAPPER_OPTION, EXEC_ARG_LANG_WRAPPER_OPTION, and logger.

Referenced by alma::TMCDB::maci::DeployInfo::getFlags(), and alma::acs::tmcdb::logic::ContainerStartupOptionHelperTest::testToOptionsString().

Collection<ContainerStartupOption> alma::acs::tmcdb::logic::ContainerStartupOptionHelper::convertFlagsString ( Container  container,
String  flags 
) [inline]

Converts a string of options to one or more ContainerStartupOption objects.

TODO: Parse out at least the wrapper options and create separate ContainerStartupOption instances for them. Or even parse other options into separate ContainerStartupOptions.

Parameters:
container The container whose flags we convert (will be set on the created ContainerStartupOption.
flags The flags string, as it comes from the CDB (Container.DeployInfo.Flags) or from the WDAL interface. May be null.
Returns:

References OPTION_NAME_LEGACY_CONCATENATED.

Referenced by com::cosylab::cdb::jdal::HibernateWDALImpl::loadXMLCDB(), and alma::acs::tmcdb::logic::ContainerStartupOptionHelperTest::testFromOptionsString().


Member Data Documentation

Referenced by convertFlagsString().


The documentation for this class was generated from the following file:

Generated by  doxygen 1.6.2