@ThreadSafe public class ConfigRegistryImpl extends Object implements AutoCloseable, ConfigRegistryImplMXBean
OBJECT_NAME, OBJECT_NAME_NO_NOTIFICATIONS
Constructor and Description |
---|
ConfigRegistryImpl(ModuleFactoriesResolver resolver,
MBeanServer configMBeanServer,
BaseJMXRegistrator baseJMXRegistrator,
BindingContextProvider bindingContextProvider) |
ConfigRegistryImpl(ModuleFactoriesResolver resolver,
MBeanServer configMBeanServer,
BindingContextProvider bindingContextProvider) |
Modifier and Type | Method and Description |
---|---|
ObjectName |
beginConfig()
Create new
ConfigTransactionControllerImpl . |
ObjectName |
beginConfig(boolean blankTransaction)
It returns true if this transaction is created automatically by
org.opendaylight.controller.config.manager.impl.osgi.BlankTransactionServiceTracker.
|
void |
checkConfigBeanExists(ObjectName objectName)
Check that object name corresponds with existing module.
|
void |
checkServiceReferenceExists(ObjectName objectName) |
void |
close()
Abort open transactions and unregister read only modules.
|
CommitStatus |
commitConfig(ObjectName transactionControllerON)
Verifies and commits transaction.
|
Set<String> |
getAvailableModuleFactoryQNames()
Get the qNames of all ModuleFactory instances in the system.
|
Set<String> |
getAvailableModuleNames()
Get the module names available in the system.
|
List<ObjectName> |
getOpenConfigs()
List of open configuration transactions.
|
String |
getServiceInterfaceName(String namespace,
String localName)
Get the name of the service interface.
|
Map<String,Map<String,ObjectName>> |
getServiceMapping()
Get mapping of services to reference names and module object names.
|
ObjectName |
getServiceReference(String serviceInterfaceQName,
String refName)
Get the reference to that service.
|
long |
getVersion()
Get the version of last committed transaction that is now used as base
version.
|
boolean |
isHealthy()
Will return true unless there was a transaction that succeeded during
validation but failed in second phase of commit.
|
ObjectName |
lookupConfigBean(String moduleName,
String instanceName)
Find read module.
|
ObjectName |
lookupConfigBeanByServiceInterfaceName(String serviceInterfaceQName,
String refName)
Lookup object name by fully qualified service interface name and service
reference name.
|
Set<ObjectName> |
lookupConfigBeans()
Find all modules.
|
Set<ObjectName> |
lookupConfigBeans(String moduleName)
Find modules with given module name.
|
Set<ObjectName> |
lookupConfigBeans(String moduleName,
String instanceName)
Find read modules.
|
Set<ObjectName> |
lookupRuntimeBeans()
Find all runtime beans.
|
Set<ObjectName> |
lookupRuntimeBeans(String moduleName,
String instanceName)
Find all runtime of specified module.
|
Set<String> |
lookupServiceInterfaceNames(ObjectName objectName)
Find all available service interface names of a module.
|
Map<String,ObjectName> |
lookupServiceReferencesByServiceInterfaceName(String serviceInterfaceQName)
Get current mapping between reference names and module object names for given
service interface name.
|
String |
toString() |
public ConfigRegistryImpl(ModuleFactoriesResolver resolver, MBeanServer configMBeanServer, BindingContextProvider bindingContextProvider)
public ConfigRegistryImpl(ModuleFactoriesResolver resolver, MBeanServer configMBeanServer, BaseJMXRegistrator baseJMXRegistrator, BindingContextProvider bindingContextProvider)
public ObjectName beginConfig()
ConfigTransactionControllerImpl
.beginConfig
in interface ConfigRegistry
ObjectName
of
ConfigTransactionControllerMXBean
public ObjectName beginConfig(boolean blankTransaction)
blankTransaction
- true if this transaction is created automatically by
org.opendaylight.controller.config.manager.impl.osgi.BlankTransactionServiceTrackerpublic CommitStatus commitConfig(ObjectName transactionControllerON) throws ValidationException, ConflictingVersionException
ConfigRegistry
commitConfig
in interface ConfigRegistry
transactionControllerON
- ObjectName
of
ConfigTransactionControllerMXBean
that was received in ConfigRegistry.beginConfig()
method call.ValidationException
- if validation failsConflictingVersionException
- if configuration state was changedpublic List<ObjectName> getOpenConfigs()
getOpenConfigs
in interface ConfigRegistry
public void close()
ConfigRegistry.OBJECT_NAME
, it
will not unregister itself here.close
in interface AutoCloseable
public long getVersion()
getVersion
in interface ConfigRegistryImplMXBean
public Set<String> getAvailableModuleNames()
getAvailableModuleNames
in interface ConfigRegistry
public boolean isHealthy()
isHealthy
in interface ConfigRegistry
public Set<ObjectName> lookupConfigBeans()
lookupConfigBeans
in interface LookupRegistry
public Set<ObjectName> lookupConfigBeans(String moduleName)
lookupConfigBeans
in interface LookupRegistry
moduleName
- name of modulepublic Set<ObjectName> lookupConfigBeans(String moduleName, String instanceName)
lookupConfigBeans
in interface LookupRegistry
moduleName
- exact match for searched module name, can contain '*' to match all
values.instanceName
- exact match for searched instance name, can contain '*' to match
all values.public ObjectName lookupConfigBean(String moduleName, String instanceName) throws InstanceNotFoundException
lookupConfigBean
in interface LookupRegistry
moduleName
- exact match for searched module name, can contain '*' to match all
values.instanceName
- exact match for searched instance name, can contain '*' to match
all values.InstanceNotFoundException
- if search did not find exactly one instancepublic Set<ObjectName> lookupRuntimeBeans()
lookupRuntimeBeans
in interface LookupRegistry
public Set<ObjectName> lookupRuntimeBeans(String moduleName, String instanceName)
lookupRuntimeBeans
in interface LookupRegistry
moduleName
- of beaninstanceName
- of beanpublic void checkConfigBeanExists(ObjectName objectName) throws InstanceNotFoundException
LookupRegistry
checkConfigBeanExists
in interface LookupRegistry
InstanceNotFoundException
- if search did not find exactly one instancepublic ObjectName lookupConfigBeanByServiceInterfaceName(String serviceInterfaceQName, String refName)
ServiceReferenceReadableRegistry
lookupConfigBeanByServiceInterfaceName
in interface ServiceReferenceReadableRegistry
serviceInterfaceQName
- service interface namerefName
- service reference name supplied in
.api .ConfigTransactionController#saveServiceReference(String, String, javax.management.ObjectName)
public Map<String,Map<String,ObjectName>> getServiceMapping()
ServiceReferenceReadableRegistry
getServiceMapping
in interface ServiceReferenceReadableRegistry
public Map<String,ObjectName> lookupServiceReferencesByServiceInterfaceName(String serviceInterfaceQName)
ServiceReferenceReadableRegistry
lookupServiceReferencesByServiceInterfaceName
in interface ServiceReferenceReadableRegistry
serviceInterfaceQName
- service interface namepublic Set<String> lookupServiceInterfaceNames(ObjectName objectName) throws InstanceNotFoundException
ServiceReferenceReadableRegistry
lookupServiceInterfaceNames
in interface ServiceReferenceReadableRegistry
objectName
- module object nameInstanceNotFoundException
- if search did not find exactly one instancepublic String getServiceInterfaceName(String namespace, String localName)
ServiceReferenceReadableRegistry
getServiceInterfaceName
in interface ServiceReferenceReadableRegistry
namespace
- service interface namespacelocalName
- service interface local namepublic void checkServiceReferenceExists(ObjectName objectName) throws InstanceNotFoundException
checkServiceReferenceExists
in interface ServiceReferenceReadableRegistry
InstanceNotFoundException
public ObjectName getServiceReference(String serviceInterfaceQName, String refName) throws InstanceNotFoundException
ServiceReferenceReadableRegistry
getServiceReference
in interface ServiceReferenceReadableRegistry
.config .api.ServiceReferenceWritableRegistry#saveServiceReference(String,
String, javax.management.ObjectName)
InstanceNotFoundException
public Set<String> getAvailableModuleFactoryQNames()
LookupRegistry
getAvailableModuleFactoryQNames
in interface LookupRegistry
Copyright © 2019 OpenDaylight. All rights reserved.