public void registerToSal(final Broker domRegistryDependency) { domRegistryDependency.registerProvider(salProvider); }
@Override public Broker addingService(ServiceReference<Broker> reference) { Broker broker = bundleContext.getService(reference); session = broker.registerProvider(this, bundleContext); return broker; }
protected void registerToSal(BindingAwareProvider baProvider, Provider provider) { domBroker.registerProvider(provider); bindingAwareBroker.registerProvider(baProvider); }
@Override public void modifiedService(ServiceReference<Broker> reference, Broker service) { if (session != null) { session.close(); } Broker broker = bundleContext.getService(reference); session = broker.registerProvider(this, bundleContext); }
public void registerToSal(final Broker domRegistryDependency, final BindingAwareBroker bindingBroker, final BundleContext bundleContext) { domRegistryDependency.registerProvider(salProvider, bundleContext); bindingBroker.registerProvider(salProvider, bundleContext); }
@Override public java.lang.AutoCloseable createInstance() { //YangpushProvider provider = new YangpushProvider(); //getBrokerDependency().registerProvider(provider); final YangpushDomProvider provider = new YangpushDomProvider(); getDomBrokerDependency().registerProvider(provider); return provider; }
@Override public ProviderSession registerProvider(Provider provider) { ProviderSession realSession = broker.registerProvider(new ProviderWrapper(provider)); AuthzProviderContextImpl authzProviderContext = new AuthzProviderContextImpl(realSession, this); provider.onSessionInitiated(authzProviderContext); return authzProviderContext; }
@Override public ProviderSession registerProvider(Provider provider, BundleContext bundleContext) { // Allow the real broker to do its thing, while providing a wrapped // callback ProviderSession realSession = broker.registerProvider(new ProviderWrapper(provider), bundleContext); // Create Authz ProviderContext AuthzProviderContextImpl authzProviderContext = new AuthzProviderContextImpl(realSession, this); // Run onsessionInitiated on injected provider with the AuthZ provider // context. provider.onSessionInitiated(authzProviderContext); return authzProviderContext; }
@Override public java.lang.AutoCloseable createInstance() { final BindingToNormalizedNodeCodec codec = getBindingMappingServiceDependency(); final Broker.ProviderSession session = getDomAsyncBrokerDependency().registerProvider(new DummyDOMProvider()); final DOMNotificationPublishService publishService = session.getService(DOMNotificationPublishService.class); return new BindingDOMNotificationPublishServiceAdapter(codec, publishService); }
@Override public java.lang.AutoCloseable createInstance() { // Get new AuthZ Broker final AuthzBrokerImpl authzBrokerImpl = new AuthzBrokerImpl(); // Provide real broker to the new Authz broker authzBrokerImpl.setBroker(getDomBrokerDependency()); // Get AuthN service reference and register it with the authzBroker ServiceReference<AuthenticationService> authServiceReference = bundleContext .getServiceReference(AuthenticationService.class); AuthenticationService as = bundleContext.getService(authServiceReference); authzBrokerImpl.setAuthenticationService(as); // Set the policies list to authz serviceimpl AuthzServiceImpl.setPolicies(getPolicies()); // Register AuthZ broker with the real Broker as a provider; triggers // "onSessionInitiated" in AuthzBrokerImpl getDomBrokerDependency().registerProvider(authzBrokerImpl); // TODO ActionType is of type string, not ENUM due to improper // serialization of ENUMs by config/netconf subsystem. This needs to be // fixed as soon as config/netconf fixes the problem. getAction(); LOG.info("AuthZ Service Initialized from Config subsystem"); return authzBrokerImpl; }
@Override public java.lang.AutoCloseable createInstance() { final BindingToNormalizedNodeCodec codec = getBindingMappingServiceDependency(); final Broker.ProviderSession session = getDomAsyncBrokerDependency().registerProvider(new DummyDOMProvider()); final DOMNotificationService notifService = session.getService(DOMNotificationService.class); return new BindingDOMNotificationServiceAdapter(codec.getCodecRegistry(), notifService); }
@Override public java.lang.AutoCloseable createInstance() { // Create an instance of our provider RestconfProviderImpl instance = new RestconfProviderImpl(); // Set its port instance.setWebsocketPort(getWebsocketPort()); // Register it with the Broker getDomBrokerDependency().registerProvider(instance); if(runtimeRegistration != null){ runtimeRegistration.close(); } runtimeRegistration = getRootRuntimeBeanRegistratorWrapper().register(instance); return instance; } }
@Override public java.lang.AutoCloseable createInstance() { DataProviderService dataBrokerService = getDataBrokerDependency(); //Holds references to service retrieve via the data broker. //DEMOSTRATES: How to get services via the config sub system (data broker). final MountingServiceDependencyManager dependencyManager = new MountingServiceDependencyManager(); getDomRegistryDependency().registerProvider(dependencyManager, bundleContext); closeMgr.add( dependencyManager ); //Holds references to service retrieve via the bundle context (pure OSGi) //DEMOSTRATES: How to get services from OSGi's bundle context when you can't get to them //via the BrokerService (config sub system). final BundleContextDependencyManager bundleContextMgr = new BundleContextDependencyManager(); bundleContextMgr.setBundleContext( bundleContext ); bundleContextMgr.init(); closeMgr.add( bundleContextMgr ); return null; }
@Override public java.lang.AutoCloseable createInstance() { final BindingAwareBroker.ProviderContext bindingCtx = getBindingBrokerDependency().registerProvider(new Providers.BindingAware()); final Broker.ProviderSession domCtx = getDomBrokerDependency().registerProvider(new Providers.BindingIndependent()); final MountPointService mountPointService = bindingCtx.getSALService(MountPointService.class); final DataBroker dataBroker = bindingCtx.getSALService(DataBroker.class); final DOMNotificationPublishService domPublish = domCtx.getService(DOMNotificationPublishService.class); final DOMMountPointService domMount = domCtx.getService(DOMMountPointService.class); return NetconfEventSourceManager.create(dataBroker, domPublish, domMount, mountPointService, getEventSourceRegistryDependency(), getNamespaceToStream()); }
@Override public RootBindingAwareBroker createInstance() { final Broker domBroker = getDomAsyncBrokerDependency(); final BindingToNormalizedNodeCodec codec = getBindingMappingServiceDependency(); final ProviderSession session = domBroker.registerProvider(new DummyDOMProvider()); final MountPointService mount = createMountPointAdapter(codec,session); final BindingDOMRpcServiceAdapter rpcConsumer = createRpcConsumer(codec,session); final BindingDOMRpcProviderServiceAdapter rpcProvider = createRpcProvider(codec,session); final RootBindingAwareBroker broker = new RootBindingAwareBroker(getIdentifier().getInstanceName()); final RpcProviderRegistry heliumRpcBroker = new HeliumRpcProviderRegistry(rpcConsumer, rpcProvider); final MountProviderService legacyMount = createLegacyMountPointService(mount); broker.setLegacyDataBroker(getDataBrokerDependency()); broker.setNotificationBroker(getNotificationServiceDependency()); if (getNotificationPublishServiceDependency() != null) { broker.setNotificationPublishService(getNotificationPublishServiceDependency()); } broker.setRpcBroker(heliumRpcBroker); broker.setDataBroker(getRootDataBrokerDependency()); broker.setMountService(mount); broker.setLegacyMountManager(legacyMount); broker.start(); return broker; }