IGlobalConfiguration
public
interface
IGlobalConfiguration
com.android.tradefed.config.IGlobalConfiguration |
A class to encompass global configuration information for a single Trade Federation instance (encompassing any number of invocations of actual configurations).
Summary
Public methods | |
---|---|
abstract
void
|
cleanup()
Proper cleanup when tradefed shutdown. |
abstract
File
|
cloneConfigWithFilter(
Filter the GlobalConfiguration based on a white list and output to an XML file. |
abstract
File
|
cloneConfigWithFilter(
Filter the GlobalConfiguration based on a white list while allowing for manipulation of option values and output to an XML file. |
abstract
File
|
cloneConfigWithFilter(String... allowlistConfigs)
Filter the GlobalConfiguration based on a allowed list and output to an XML file. |
abstract
ICommandScheduler
|
getCommandScheduler()
Gets the |
abstract
Object
|
getConfigurationObject(String typeName)
Gets the custom configuration object with given name. |
abstract
ICredentialFactory
|
getCredentialFactory()
Gets the |
abstract
DeviceManagementGrpcServer
|
getDeviceManagementServer()
Returns the |
abstract
IDeviceManager
|
getDeviceManager()
Gets the |
abstract
|
getDeviceMonitors()
Gets the list of |
abstract
IDeviceSelection
|
getDeviceRequirements()
Gets the |
abstract
TradefedFeatureServer
|
getFeatureServer()
Returns the |
abstract
IConfigurationServer
|
getGlobalConfigServer()
Gets global config server. |
abstract
|
getHostMonitors()
Gets the list of |
abstract
IHostOptions
|
getHostOptions()
Gets the |
abstract
IHostResourceManager
|
getHostResourceManager()
Gets the |
abstract
IKeyStoreFactory
|
getKeyStoreFactory()
Gets the |
abstract
|
getMultiDeviceRecoveryHandlers()
Gets the list of |
abstract
|
getOptionValues(String optionName)
Get a list of option's values. |
abstract
|
getResourceMetricCollectors()
Gets the list of |
abstract
ISandboxFactory
|
getSandboxFactory()
Get a sandbox factory that can be used to run an invocation |
abstract
IShardHelper
|
getShardingStrategy()
Returns the |
abstract
TestInvocationManagementServer
|
getTestInvocationManagementSever()
Returns the |
abstract
ITerribleFailureHandler
|
getWtfHandler()
Gets the |
abstract
void
|
injectOptionValue(String optionName, String optionValue)
Inject a option value into the set of configuration objects. |
abstract
void
|
injectOptionValue(String optionName, String optionKey, String optionValue)
Inject a option value into the set of configuration objects. |
abstract
void
|
setCommandScheduler(ICommandScheduler scheduler)
Set the |
abstract
void
|
setConfigurationFactory(IConfigurationFactory configFactory)
Set the |
abstract
void
|
setConfigurationObject(String name, Object configObject)
Generic method to set the config object with the given name, replacing any existing value. |
abstract
void
|
setConfigurationObjectList(String typeName,
Generic method to set the config object list for the given name, replacing any existing value. |
abstract
void
|
setDeviceManagementServer(DeviceManagementGrpcServer server)
Sets the |
abstract
void
|
setDeviceManager(IDeviceManager deviceManager)
Set the |
abstract
void
|
setDeviceMonitor(IDeviceMonitor deviceMonitor)
Set the |
abstract
void
|
setDeviceRequirements(IDeviceSelection deviceSelection)
Set the |
abstract
void
|
setHostMonitors(
Set the |
abstract
void
|
setHostOptions(IHostOptions hostOptions)
Set the |
abstract
void
|
setHostResourceManager(IHostResourceManager hostResourceManager)
Set the |
abstract
void
|
setInvocationServer(TestInvocationManagementServer server)
Sets the |
abstract
void
|
setKeyStoreFactory(IKeyStoreFactory factory)
Set the |
abstract
|
setOptionsFromCommandLineArgs(
Set the global config ArgsOptionParser for expected format
|
abstract
void
|
setOriginalConfig(String config)
Sets the original config used to create the global configuration. |
abstract
void
|
setResourceMetricCollector(IResourceMetricCollector collector)
Sets the |
abstract
void
|
setSandboxFactory(ISandboxFactory factory)
Set the |
abstract
void
|
setShardingStrategy(IShardHelper sharding)
Sets the |
abstract
void
|
setTradefedFeatureServer(TradefedFeatureServer server)
Sets the |
abstract
void
|
setWtfHandler(ITerribleFailureHandler wtfHandler)
Set the |
abstract
void
|
setup()
Proper setup at the start of tradefed. |
abstract
void
|
validateOptions()
Validate option values. |
Public methods
cleanup
public abstract void cleanup ()
Proper cleanup when tradefed shutdown.
cloneConfigWithFilter
public abstract File cloneConfigWithFilter (exclusionPatterns, String... allowlistConfigs)
Filter the GlobalConfiguration based on a white list and output to an XML file.
Parameters | |
---|---|
exclusionPatterns |
: The pattern of class name to exclude from the dump. |
allowlistConfigs |
String : a String array of configs to be included in the new XML file.
If it's set to null |
Returns | |
---|---|
File |
the File containing the new filtered global config. |
Throws | |
---|---|
|
IOException |
See also:
cloneConfigWithFilter
public abstract File cloneConfigWithFilter (exclusionPatterns, IConfigOptionValueTransformer transformer, boolean deepCopy, String... allowlistConfigs)
Filter the GlobalConfiguration based on a white list while allowing for manipulation of option values and output to an XML file.
Parameters | |
---|---|
exclusionPatterns |
: The pattern of class name to exclude from the dump. |
transformer |
IConfigOptionValueTransformer |
deepCopy |
boolean |
allowlistConfigs |
String : a String array of configs to be included in the new XML
file.
If it's set to null |
Returns | |
---|---|
File |
the File containing the new filtered global config. |
See also:
cloneConfigWithFilter
public abstract File cloneConfigWithFilter (String... allowlistConfigs)
Filter the GlobalConfiguration based on a allowed list and output to an XML file.
For example, for following configuration:
<xml>
<configuration>
<device_monitor class="com.android.tradefed.device.DeviceMonitorMultiplexer" />
<wtf_handler class="com.android.tradefed.log.TerribleFailureEmailHandler" />
<key_store class="com.android.tradefed.util.keystore.JSONFileKeyStoreFactory" />
</configuration>
</xml>
all config except "key_store" will be filtered out, and result a config file with
following content:
<xml>
<configuration>
<key_store class="com.android.tradefed.util.keystore.JSONFileKeyStoreFactory" />
</configuration>
</xml>
Parameters | |
---|---|
allowlistConfigs |
String : a String array of configs to be included in the new XML file.
If it's set to null |
Returns | |
---|---|
File |
the File containing the new filtered global config. |
Throws | |
---|---|
|
IOException |
getCommandScheduler
public abstract ICommandScheduler getCommandScheduler ()
Gets the ICommandScheduler
to use from the configuration.
Returns | |
---|---|
ICommandScheduler |
the ICommandScheduler . Will never return null. |
getConfigurationObject
public abstract Object getConfigurationObject (String typeName)
Gets the custom configuration object with given name.
Parameters | |
---|---|
typeName |
String : the unique type of the configuration object |
Returns | |
---|---|
Object |
the object or null if object with that name is not found |
getCredentialFactory
public abstract ICredentialFactory getCredentialFactory ()
Gets the ICredentialFactory
for creating credentials.
Returns | |
---|---|
ICredentialFactory |
ICredentialFactory or null if none was specified. |
getDeviceManagementServer
public abstract DeviceManagementGrpcServer getDeviceManagementServer ()
Returns the DeviceManagementGrpcServer
or null if undefined.
Returns | |
---|---|
DeviceManagementGrpcServer |
getDeviceManager
public abstract IDeviceManager getDeviceManager ()
Gets the IDeviceManager
to use from the configuration. Manages the set of available
devices for testing
Returns | |
---|---|
IDeviceManager |
the IDeviceManager provided in the configuration. |
getDeviceMonitors
public abstractgetDeviceMonitors ()
Gets the list of IDeviceMonitor
from the global config.
Returns | |
---|---|
|
the list of IDeviceMonitor from the global config, or null if
none was specified. |
getDeviceRequirements
public abstract IDeviceSelection getDeviceRequirements ()
Gets the IDeviceSelection
to use from the configuration. Represents a global filter
on which devices the DeviceManager
can see.
Returns | |
---|---|
IDeviceSelection |
the IDeviceSelection provided in the configuration. |
getFeatureServer
public abstract TradefedFeatureServer getFeatureServer ()
Returns the TradefedFeatureServer
or null if undefined.
Returns | |
---|---|
TradefedFeatureServer |
getGlobalConfigServer
public abstract IConfigurationServer getGlobalConfigServer ()
Gets global config server. Global config server is used to get host configs from a server instead of getting it from local files.
Returns | |
---|---|
IConfigurationServer |
getHostMonitors
public abstractgetHostMonitors ()
Gets the list of IHostMonitor
from the global config.
Returns | |
---|---|
|
the list of IHostMonitor from the global config, or null if none
was specified. |
getHostOptions
public abstract IHostOptions getHostOptions ()
Gets the IHostOptions
to use from the configuration.
Returns | |
---|---|
IHostOptions |
the IDeviceManager provided in the configuration. |
getHostResourceManager
public abstract IHostResourceManager getHostResourceManager ()
Gets the IHostResourceManager
from the global config.
Returns | |
---|---|
IHostResourceManager |
the IHostResourceManager from the global config, or default implementation
LocalHostResourceManager if none is specified in host config. |
getKeyStoreFactory
public abstract IKeyStoreFactory getKeyStoreFactory ()
Gets the IKeyStoreFactory
to use from the configuration.
Returns | |
---|---|
IKeyStoreFactory |
the IKeyStoreFactory or null if no key store factory is set. |
getMultiDeviceRecoveryHandlers
public abstractgetMultiDeviceRecoveryHandlers ()
Gets the list of IMultiDeviceRecovery
to use from the configuration.
Returns | |
---|---|
|
the list of IMultiDeviceRecovery , or null if not set. |
getOptionValues
public abstractgetOptionValues (String optionName)
Get a list of option's values.
Parameters | |
---|---|
optionName |
String : the map option name |
Returns | |
---|---|
|
a list of the given option's values. null if the option name does not
exist. |
getResourceMetricCollectors
public abstractgetResourceMetricCollectors ()
Gets the list of IResourceMetricCollector
from the global config.
Returns | |
---|---|
|
the list of IResourceMetricCollector from the global config or null
if none was specified. |
getSandboxFactory
public abstract ISandboxFactory getSandboxFactory ()
Get a sandbox factory that can be used to run an invocation
Returns | |
---|---|
ISandboxFactory |
getShardingStrategy
public abstract IShardHelper getShardingStrategy ()
Returns the IShardHelper
that defines the way to shard a configuration.
Returns | |
---|---|
IShardHelper |
getTestInvocationManagementSever
public abstract TestInvocationManagementServer getTestInvocationManagementSever ()
Returns the TestInvocationManagementServer
or null if undefined.
Returns | |
---|---|
TestInvocationManagementServer |
getWtfHandler
public abstract ITerribleFailureHandler getWtfHandler ()
Gets the ITerribleFailureHandler
to use from the configuration.
Handles what to do in the event that a WTF (What a Terrible Failure)
occurs.
Returns | |
---|---|
ITerribleFailureHandler |
the ITerribleFailureHandler provided in the
configuration, or null if no handler is set |
injectOptionValue
public abstract void injectOptionValue (String optionName, String optionValue)
Inject a option value into the set of configuration objects.
Useful to provide values for options that are generated dynamically.Parameters | |
---|---|
optionName |
String : the option name |
optionValue |
String : the option value(s) |
Throws | |
---|---|
ConfigurationException |
if failed to set the option's value |
injectOptionValue
public abstract void injectOptionValue (String optionName, String optionKey, String optionValue)
Inject a option value into the set of configuration objects.
Useful to provide values for options that are generated dynamically.Parameters | |
---|---|
optionName |
String : the map option name |
optionKey |
String : the map option key |
optionValue |
String : the map option value |
Throws | |
---|---|
ConfigurationException |
if failed to set the option's value |
setCommandScheduler
public abstract void setCommandScheduler (ICommandScheduler scheduler)
Set the ICommandScheduler
, replacing any existing values.
setConfigurationFactory
public abstract void setConfigurationFactory (IConfigurationFactory configFactory)
Set the IConfigurationFactory
for this configuration.
Parameters | |
---|---|
configFactory |
IConfigurationFactory |
setConfigurationObject
public abstract void setConfigurationObject (String name, Object configObject)
Generic method to set the config object with the given name, replacing any existing value.
Parameters | |
---|---|
name |
String : the unique name of the config object type. |
configObject |
Object : the config object |
Throws | |
---|---|
ConfigurationException |
if the configObject was not the correct type |
setConfigurationObjectList
public abstract void setConfigurationObjectList (String typeName,configList)
Generic method to set the config object list for the given name, replacing any existing value.
Parameters | |
---|---|
typeName |
String : the unique name of the config object type. |
configList |
: the config object list |
Throws | |
---|---|
ConfigurationException |
if any objects in the list are not the correct type |
setDeviceManagementServer
public abstract void setDeviceManagementServer (DeviceManagementGrpcServer server)
Sets the DeviceManagementGrpcServer
.
Parameters | |
---|---|
server |
DeviceManagementGrpcServer |
setDeviceManager
public abstract void setDeviceManager (IDeviceManager deviceManager)
Set the IDeviceManager
, replacing any existing values. This sets the manager for the
test devices
setDeviceMonitor
public abstract void setDeviceMonitor (IDeviceMonitor deviceMonitor)
Set the IDeviceMonitor
.
Parameters | |
---|---|
deviceMonitor |
IDeviceMonitor : The monitor |
Throws | |
---|---|
ConfigurationException |
if an IDeviceMonitor has already been set. |
setDeviceRequirements
public abstract void setDeviceRequirements (IDeviceSelection deviceSelection)
Set the IDeviceSelection
, replacing any existing values. This sets a global device
filter on which devices the DeviceManager
can see.
setHostMonitors
public abstract void setHostMonitors (hostMonitors)
Set the IHostMonitor
list.
Parameters | |
---|---|
hostMonitors |
: The list of monitors |
Throws | |
---|---|
ConfigurationException |
if an IHostMonitor has already been set. |
setHostOptions
public abstract void setHostOptions (IHostOptions hostOptions)
Set the IHostOptions
, replacing any existing values.
setHostResourceManager
public abstract void setHostResourceManager (IHostResourceManager hostResourceManager)
Set the IHostResourceManager
, replacing any existing values.
setInvocationServer
public abstract void setInvocationServer (TestInvocationManagementServer server)
Sets the TestInvocationManagementServer
.
Parameters | |
---|---|
server |
TestInvocationManagementServer |
setKeyStoreFactory
public abstract void setKeyStoreFactory (IKeyStoreFactory factory)
Set the IKeyStoreFactory
, replacing any existing values.
setOptionsFromCommandLineArgs
public abstractsetOptionsFromCommandLineArgs ( listArgs)
Set the global config Option
fields with given set of command line arguments
ArgsOptionParser
for expected format
Parameters | |
---|---|
listArgs |
: the command line arguments |
Returns | |
---|---|
|
the unconsumed arguments |
Throws | |
---|---|
ConfigurationException |
setOriginalConfig
public abstract void setOriginalConfig (String config)
Sets the original config used to create the global configuration.
Parameters | |
---|---|
config |
String |
setResourceMetricCollector
public abstract void setResourceMetricCollector (IResourceMetricCollector collector)
Sets the IResourceMetricCollector
.
Parameters | |
---|---|
collector |
IResourceMetricCollector |
setSandboxFactory
public abstract void setSandboxFactory (ISandboxFactory factory)
Set the ISandboxFactory
, replacing any existing values.
setShardingStrategy
public abstract void setShardingStrategy (IShardHelper sharding)
Sets the IShardHelper
to be used when sharding a configuration.
Parameters | |
---|---|
sharding |
IShardHelper |
setTradefedFeatureServer
public abstract void setTradefedFeatureServer (TradefedFeatureServer server)
Sets the TradefedFeatureServer
.
Parameters | |
---|---|
server |
TradefedFeatureServer |
setWtfHandler
public abstract void setWtfHandler (ITerribleFailureHandler wtfHandler)
Set the ITerribleFailureHandler
.
Parameters | |
---|---|
wtfHandler |
ITerribleFailureHandler : the WTF handler |
Throws | |
---|---|
ConfigurationException |
if an ITerribleFailureHandler has
already been set. |
setup
public abstract void setup ()
Proper setup at the start of tradefed.
Throws | |
---|---|
|
com.android.tradefed.config.ConfigurationException |
ConfigurationException |
validateOptions
public abstract void validateOptions ()
Validate option values.
Currently this will just validate that all mandatory options have been set
Throws | |
---|---|
ConfigurationException |
if configuration is missing mandatory fields |