本文整理汇总了Java中org.opendaylight.controller.sal.binding.api.BindingAwareBroker类的典型用法代码示例。如果您正苦于以下问题:Java BindingAwareBroker类的具体用法?Java BindingAwareBroker怎么用?Java BindingAwareBroker使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
BindingAwareBroker类属于org.opendaylight.controller.sal.binding.api包,在下文中一共展示了BindingAwareBroker类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: registerEventSourceTest
import org.opendaylight.controller.sal.binding.api.BindingAwareBroker; //导入依赖的package包/类
@Test
public void registerEventSourceTest() throws Exception {
topicTestHelper();
Node nodeMock = mock(Node.class);
EventSource eventSourceMock = mock(EventSource.class);
NodeId nodeId = new NodeId("nodeIdValue1");
nodeKey = new NodeKey(nodeId);
doReturn(nodeKey).when(nodeMock).getKey();
doReturn(nodeKey).when(eventSourceMock).getSourceNodeKey();
BindingAwareBroker.RoutedRpcRegistration routedRpcRegistrationMock = mock(BindingAwareBroker.RoutedRpcRegistration.class);
doReturn(routedRpcRegistrationMock).when(rpcProviderRegistryMock).addRoutedRpcImplementation(EventSourceService.class, eventSourceMock);
doNothing().when(routedRpcRegistrationMock).registerPath(eq(NodeContext.class), any(KeyedInstanceIdentifier.class));
assertNotNull("Return value has not been created correctly.", eventSourceTopology.registerEventSource(eventSourceMock));
}
示例2: testCreateInstance
import org.opendaylight.controller.sal.binding.api.BindingAwareBroker; //导入依赖的package包/类
@Test
public void testCreateInstance() throws Exception {
// configure mocks
DependencyResolver dependencyResolver = mock(DependencyResolver.class);
BindingAwareBroker broker = mock(BindingAwareBroker.class);
when(dependencyResolver.resolveInstance(eq(BindingAwareBroker.class), any(ObjectName.class), any(JmxAttribute.class))).thenReturn(broker);
// create instance of module with injected mocks
HelloModule module = new HelloModule(mock(ModuleIdentifier.class), dependencyResolver);
// getInstance calls resolveInstance to get the broker dependency and then calls createInstance
AutoCloseable closeable = module.getInstance();
// verify that the module registered the returned provider with the broker
verify(broker).registerProvider((HelloProvider)closeable);
// ensure no exceptions on close
closeable.close();
}
示例3: testCreateInstance
import org.opendaylight.controller.sal.binding.api.BindingAwareBroker; //导入依赖的package包/类
@Test
public void testCreateInstance() throws Exception {
// configure mocks
DependencyResolver dependencyResolver = mock(DependencyResolver.class);
BindingAwareBroker broker = mock(BindingAwareBroker.class);
when(dependencyResolver.resolveInstance(eq(BindingAwareBroker.class), any(ObjectName.class), any(JmxAttribute.class))).thenReturn(broker);
// create instance of module with injected mocks
SdnaModule module = new SdnaModule(mock(ModuleIdentifier.class), dependencyResolver);
// getInstance calls resolveInstance to get the broker dependency and then calls createInstance
AutoCloseable closeable = module.getInstance();
// verify that the module registered the returned provider with the broker
verify(broker).registerProvider((SdnaProvider)closeable);
// ensure no exceptions on close
closeable.close();
}
示例4: testCreateInstance
import org.opendaylight.controller.sal.binding.api.BindingAwareBroker; //导入依赖的package包/类
@Test
public void testCreateInstance() throws Exception {
// configure mocks
DependencyResolver dependencyResolver = mock(DependencyResolver.class);
BindingAwareBroker broker = mock(BindingAwareBroker.class);
when(dependencyResolver.resolveInstance(eq(BindingAwareBroker.class), any(ObjectName.class), any(JmxAttribute.class))).thenReturn(broker);
// create instance of module with injected mocks
ExampleModule module = new ExampleModule(mock(ModuleIdentifier.class), dependencyResolver);
// getInstance calls resolveInstance to get the broker dependency and then calls createInstance
AutoCloseable closeable = module.getInstance();
// verify that the module registered the returned provider with the broker
verify(broker).registerProvider((ExampleProvider)closeable);
// ensure no exceptions on close
closeable.close();
}
示例5: createInstance
import org.opendaylight.controller.sal.binding.api.BindingAwareBroker; //导入依赖的package包/类
@Override
public java.lang.AutoCloseable createInstance() {
BindingAwareBroker bindingAwareBroker = getBindingAwareBrokerDependency();
DataBroker dataBrokerService = getDataBrokerDependency();
RpcProviderRegistry rpcProviderRegistry = getRpcRegistryDependency();
NotificationProviderService notificationService = getNotificationServiceDependency();
Preconditions.checkNotNull(bindingAwareBroker);
Preconditions.checkNotNull(dataBrokerService);
Preconditions.checkNotNull(rpcProviderRegistry);
Preconditions.checkNotNull(notificationService);
MyRouterOrchestrator orchestrator = new MyRouterOrchestrator(bindingAwareBroker, dataBrokerService, notificationService, rpcProviderRegistry);
LOG.info("Tutorial NetconfExercise (instance {}) initialized.", orchestrator);
return orchestrator;
}
示例6: configureInstance
import org.opendaylight.controller.sal.binding.api.BindingAwareBroker; //导入依赖的package包/类
/**
* Function that is called when configuration of the dependencies is
* required.
*
* @param c
* dependency manager Component object, used for configuring the
* dependencies exported and imported
* @param imp
* Implementation class that is being configured, needed as long
* as the same routine can configure multiple implementations
* @param containerName
* The containerName being configured, this allow also optional
* per-container different behavior if needed, usually should not
* be the case though.
*/
@Override
public void configureInstance(Component c, Object imp, String containerName) {
if (imp.equals(NetworkHandler.class)) {
c.setInterface(INeutronNetworkAware.class.getName(), null);
}
if (imp.equals(SubnetHandler.class)) {
c.setInterface(INeutronSubnetAware.class.getName(), null);
}
if (imp.equals(PortHandler.class)) {
c.setInterface(INeutronPortAware.class.getName(), null);
}
// Create service dependencies.
c.add(createServiceDependency().setService(BindingAwareBroker.class).setCallbacks("setBindingAwareBroker", "unsetBindingAwareBroker")
.setRequired(true));
}
示例7: registerTest
import org.opendaylight.controller.sal.binding.api.BindingAwareBroker; //导入依赖的package包/类
@Test
public void registerTest() throws Exception {
topicTestHelper();
Node nodeMock = mock(Node.class);
EventSource eventSourceMock = mock(EventSource.class);
NodeId nodeId = new NodeId("nodeIdValue1");
nodeKey = new NodeKey(nodeId);
doReturn(nodeKey).when(nodeMock).getKey();
doReturn(nodeKey).when(eventSourceMock).getSourceNodeKey();
BindingAwareBroker.RoutedRpcRegistration routedRpcRegistrationMock = mock(BindingAwareBroker.RoutedRpcRegistration.class);
doReturn(routedRpcRegistrationMock).when(rpcProviderRegistryMock).addRoutedRpcImplementation(EventSourceService.class, eventSourceMock);
doNothing().when(routedRpcRegistrationMock).registerPath(eq(NodeContext.class), any(KeyedInstanceIdentifier.class));
eventSourceTopology.register(eventSourceMock);
verify(routedRpcRegistrationMock, times(1)).registerPath(eq(NodeContext.class), any(KeyedInstanceIdentifier.class));
}
示例8: unregisterTest
import org.opendaylight.controller.sal.binding.api.BindingAwareBroker; //导入依赖的package包/类
@Test
public void unregisterTest() throws Exception {
topicTestHelper();
EventSource eventSourceMock = mock(EventSource.class);
NodeId nodeId = new NodeId("nodeIdValue1");
nodeKey = new NodeKey(nodeId);
Map<NodeKey, BindingAwareBroker.RoutedRpcRegistration<EventSourceService>> localMap = getRoutedRpcRegistrations();
NodeKey nodeKeyMock = mock(NodeKey.class);
doReturn(nodeKeyMock).when(eventSourceMock).getSourceNodeKey();
BindingAwareBroker.RoutedRpcRegistration<EventSourceService> routedRpcRegistrationMock = mock(BindingAwareBroker.RoutedRpcRegistration.class);
localMap.put(nodeKeyMock, routedRpcRegistrationMock);
eventSourceTopology.unRegister(eventSourceMock);
verify(routedRpcRegistrationMock, times(1)).close();
}
示例9: MyRouterOrchestrator
import org.opendaylight.controller.sal.binding.api.BindingAwareBroker; //导入依赖的package包/类
public MyRouterOrchestrator(BindingAwareBroker bindingAwareBroker, DataBroker dataBroker, NotificationProviderService notificationService, RpcProviderRegistry rpcProviderRegistry) {
//Register this object as a provider for receiving session context
bindingAwareBroker.registerProvider(this);
//Register this object as listener for changes in netconf topology
InstanceIdentifier<Topology> netconfTopoIID = InstanceIdentifier.builder(NetworkTopology.class)
.child(Topology.class, new TopologyKey(new TopologyId(TopologyNetconf.QNAME.getLocalName())))
.build();
registrations.add(dataBroker.registerDataChangeListener(LogicalDatastoreType.OPERATIONAL, netconfTopoIID.child(Node.class), this, DataChangeScope.SUBTREE));
}
示例10: onSessionInitiated
import org.opendaylight.controller.sal.binding.api.BindingAwareBroker; //导入依赖的package包/类
@Override
public void onSessionInitiated(final BindingAwareBroker.ProviderContext session) {
LOG.info("BindingAwareBroker.ProviderContext initialized");
}
示例11: setRpcRegistration
import org.opendaylight.controller.sal.binding.api.BindingAwareBroker; //导入依赖的package包/类
public void setRpcRegistration(final BindingAwareBroker.RoutedRpcRegistration<CarPurchaseService> rpcRegistration) {
this.rpcRegistration = rpcRegistration;
}
示例12: configureInstance
import org.opendaylight.controller.sal.binding.api.BindingAwareBroker; //导入依赖的package包/类
/**
* Function that is called when configuration of the dependencies is
* required.
*
*@param c
* dependency manager Component object, used for configuring the
* dependencies exported and imported
*@param imp
* Implementation class that is being configured, needed as long
* as the same routine can configure multiple implementations
* @param containerName
* The containerName being configured, this allow also optional
* per-container different behavior if needed, usually should not
* be the case though.
*/
@Override
public void configureInstance(Component c, Object imp, String containerName) {
if (imp.equals(NetworkHandler.class)) {
c.setInterface(INeutronNetworkAware.class.getName(), null);
}
if (imp.equals(SubnetHandler.class)) {
c.setInterface(INeutronSubnetAware.class.getName(), null);
}
if (imp.equals(PortHandler.class)) {
c.setInterface(INeutronPortAware.class.getName(), null);
}
if (imp.equals(RouterHandler.class)) {
c.setInterface(INeutronRouterAware.class.getName(), null);
}
if (imp.equals(FloatingIpHandler.class)) {
c.setInterface(INeutronFloatingIPAware.class.getName(), null);
}
if (imp.equals(SecurityGroupHandler.class)) {
c.setInterface(INeutronSecurityGroupAware.class.getName(), null);
}
if (imp.equals(SecurityGroupRulesHandler.class)) {
c.setInterface(INeutronSecurityRuleAware.class.getName(), null);
}
if (imp.equals(LoadBalancerHandler.class)) {
c.setInterface(INeutronSecurityRuleAware.class.getName(), null);
}
if (imp.equals(LoadBalancerHealthMonitorHandler.class)) {
c.setInterface(INeutronSecurityRuleAware.class.getName(), null);
}
if (imp.equals(LoadBalancerListenerHandler.class)) {
c.setInterface(INeutronSecurityRuleAware.class.getName(), null);
}
if (imp.equals(LoadBalancerPoolHandler.class)) {
c.setInterface(INeutronSecurityRuleAware.class.getName(), null);
}
if (imp.equals(LoadBalancerPoolMemberHandler.class)) {
c.setInterface(INeutronSecurityRuleAware.class.getName(), null);
}
// Create service dependencies.
c.add(createServiceDependency().setService(BindingAwareBroker.class).setCallbacks("setBindingAwareBroker", "unsetBindingAwareBroker")
.setRequired(true));
}
示例13: getDatabroker
import org.opendaylight.controller.sal.binding.api.BindingAwareBroker; //导入依赖的package包/类
/**
* Get a DataBroker and assert that it is not null.
* @param providerContext ProviderContext from which to retrieve the DataBroker
* @return the Databroker
*/
public static DataBroker getDatabroker(BindingAwareBroker.ProviderContext providerContext) {
DataBroker dataBroker = providerContext.getSALService(DataBroker.class);
assertNotNull("dataBroker should not be null", dataBroker);
return dataBroker;
}
示例14: setBroker
import org.opendaylight.controller.sal.binding.api.BindingAwareBroker; //导入依赖的package包/类
@Override
public void setBroker(BindingAwareBroker broker) {
this.broker = broker;
}
示例15: setBroker
import org.opendaylight.controller.sal.binding.api.BindingAwareBroker; //导入依赖的package包/类
void setBroker(BindingAwareBroker broker);