public class ConfigTransactionJMXClient extends Object implements ConfigTransactionClient
Constructor and Description |
---|
ConfigTransactionJMXClient(ConfigRegistryMXBean configRegistryMXBeanProxy,
ObjectName configTransactionControllerON,
MBeanServer configMBeanServer) |
Modifier and Type | Method and Description |
---|---|
void |
abortConfig()
Destroy current transaction.
|
void |
assertVersion(int expectedParentVersion,
int expectedCurrentVersion) |
void |
checkConfigBeanExists(ObjectName objectName)
Check that object name corresponds with existing module.
|
void |
checkServiceReferenceExists(ObjectName objectName) |
CommitStatus |
commit() |
ObjectName |
createModule(String moduleName,
String instanceName)
Create new configuration bean.
|
void |
destroyConfigBean(String moduleName,
String instanceName)
Deprecated.
|
void |
destroyModule(ObjectName objectName)
Destroy existing module.
|
void |
destroyModule(String moduleName,
String instanceName) |
Attribute |
getAttribute(ObjectName on,
String attrName) |
Object |
getAttributeCurrentValue(ObjectName on,
String attrName) |
Set<String> |
getAvailableModuleFactoryQNames()
Get the qNames of all ModuleFactory instances in the system.
|
Set<String> |
getAvailableModuleNames()
Get the names of all available modules.
|
ObjectName |
getObjectName() |
long |
getParentVersion() |
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.
|
String |
getTransactionName()
Get the name of the transaction.
|
long |
getVersion() |
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.
|
<T> T |
newMBeanProxy(ObjectName on,
Class<T> clazz)
Deprecated.
|
<T> T |
newMXBeanProxy(ObjectName on,
Class<T> clazz) |
void |
reCreateModule(ObjectName objectName)
Re-creates an existing module configuration bean.
|
void |
removeAllServiceReferences()
Remove all service references.
|
void |
removeServiceReference(String serviceInterfaceName,
String refName)
Remove service reference.
|
boolean |
removeServiceReferences(ObjectName objectName)
Remove all service references attached to given module.
|
ObjectName |
saveServiceReference(String serviceInterfaceName,
String refName,
ObjectName moduleON)
Create or update reference name to objectName.
|
void |
setAttribute(ObjectName on,
String attrName,
Attribute attribute) |
void |
validateBean(ObjectName configBeanON) |
void |
validateConfig()
This method can be called multiple times, has no side effects.
|
public ConfigTransactionJMXClient(ConfigRegistryMXBean configRegistryMXBeanProxy, ObjectName configTransactionControllerON, MBeanServer configMBeanServer)
public <T> T newMXBeanProxy(ObjectName on, Class<T> clazz)
@Deprecated public <T> T newMBeanProxy(ObjectName on, Class<T> clazz)
newMXBeanProxy(javax.management.ObjectName, Class)
or JMX.newMBeanProxy(javax.management.MBeanServerConnection, javax.management.ObjectName, Class)
This method will be removed soon.public CommitStatus commit() throws ConflictingVersionException, ValidationException
commit
in interface ConfigTransactionClient
ConflictingVersionException
ValidationException
public void assertVersion(int expectedParentVersion, int expectedCurrentVersion)
assertVersion
in interface ConfigTransactionClient
public ObjectName createModule(String moduleName, String instanceName) throws InstanceAlreadyExistsException
ConfigTransactionController
createModule
in interface ConfigTransactionController
moduleName
- name of the moduleinstanceName
- name of the instanceInstanceAlreadyExistsException
- if given ifcName and instanceName is already registeredpublic void reCreateModule(ObjectName objectName) throws InstanceNotFoundException
ConfigTransactionController
reCreateModule
in interface ConfigTransactionController
objectName
- can be either read-only module name that can be obtained using
LookupRegistry.lookupConfigBean(String, String)
or
writable module name that must contain current transaction name.InstanceNotFoundException
- if module is not foundpublic void destroyModule(ObjectName objectName) throws InstanceNotFoundException
ConfigTransactionController
destroyModule
in interface ConfigTransactionController
objectName
- can be either read-only module name that can be obtained using
LookupRegistry.lookupConfigBean(String, String)
or
writable module name that must contain current transaction name.InstanceNotFoundException
- if module is not found@Deprecated public void destroyConfigBean(String moduleName, String instanceName) throws InstanceNotFoundException
destroyConfigBean
in interface ConfigTransactionClient
InstanceNotFoundException
public void destroyModule(String moduleName, String instanceName) throws InstanceNotFoundException
destroyModule
in interface ConfigTransactionClient
InstanceNotFoundException
public void abortConfig()
ConfigTransactionController
abortConfig
in interface ConfigTransactionController
public void validateConfig() throws ValidationException
ConfigTransactionController
validateConfig
in interface ConfigTransactionController
ValidationException
- if validation failspublic long getParentVersion()
getParentVersion
in interface ConfigTransactionClient
public long getVersion()
getVersion
in interface ConfigTransactionClient
public String getTransactionName()
ConfigTransactionController
getTransactionName
in interface ConfigTransactionController
public Set<String> getAvailableModuleNames()
ConfigTransactionController
getAvailableModuleNames
in interface ConfigTransactionController
ModuleFactory.getImplementationName()
public ObjectName getObjectName()
getObjectName
in interface ConfigTransactionClient
public Set<ObjectName> lookupConfigBeans()
LookupRegistry
lookupConfigBeans
in interface LookupRegistry
public Set<ObjectName> lookupConfigBeans(String moduleName)
LookupRegistry
lookupConfigBeans
in interface LookupRegistry
moduleName
- name of modulepublic ObjectName lookupConfigBean(String moduleName, String instanceName) throws InstanceNotFoundException
LookupRegistry
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> lookupConfigBeans(String moduleName, String instanceName)
LookupRegistry
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 void checkConfigBeanExists(ObjectName objectName) throws InstanceNotFoundException
LookupRegistry
checkConfigBeanExists
in interface LookupRegistry
InstanceNotFoundException
- if search did not find exactly one instancepublic ObjectName saveServiceReference(String serviceInterfaceName, String refName, ObjectName moduleON) throws InstanceNotFoundException
ServiceReferenceWritableRegistry
saveServiceReference
in interface ServiceReferenceWritableRegistry
InstanceNotFoundException
- if search did not find exactly one instancepublic void removeServiceReference(String serviceInterfaceName, String refName) throws InstanceNotFoundException
ServiceReferenceWritableRegistry
removeServiceReference
in interface ServiceReferenceWritableRegistry
InstanceNotFoundException
public void removeAllServiceReferences()
ServiceReferenceWritableRegistry
removeAllServiceReferences
in interface ServiceReferenceWritableRegistry
public 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 boolean removeServiceReferences(ObjectName objectName) throws InstanceNotFoundException
ServiceReferenceWritableRegistry
removeServiceReferences
in interface ServiceReferenceWritableRegistry
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 void checkServiceReferenceExists(ObjectName objectName) throws InstanceNotFoundException
checkServiceReferenceExists
in interface ServiceReferenceReadableRegistry
InstanceNotFoundException
public Attribute getAttribute(ObjectName on, String attrName)
getAttribute
in interface ConfigTransactionClient
public Object getAttributeCurrentValue(ObjectName on, String attrName)
getAttributeCurrentValue
in interface BeanReader
public void validateBean(ObjectName configBeanON) throws ValidationException
validateBean
in interface ConfigTransactionClient
ValidationException
public void setAttribute(ObjectName on, String attrName, Attribute attribute)
setAttribute
in interface ConfigTransactionClient
public Set<String> getAvailableModuleFactoryQNames()
LookupRegistry
getAvailableModuleFactoryQNames
in interface LookupRegistry
public Set<ObjectName> lookupRuntimeBeans()
LookupRegistry
lookupRuntimeBeans
in interface LookupRegistry
public Set<ObjectName> lookupRuntimeBeans(String moduleName, String instanceName)
LookupRegistry
lookupRuntimeBeans
in interface LookupRegistry
moduleName
- of beaninstanceName
- of beanCopyright © 2019 OpenDaylight. All rights reserved.