/** * Returns the reference to the implementation of the specified service. * * @param serviceClass service class * @param <T> type of service * @return service implementation * @throws org.onlab.osgi.ServiceNotFoundException if service is unavailable */ public static <T> T get(Class<T> serviceClass) { return DefaultServiceDirectory.getService(serviceClass); }
/** * Returns reference to the specified service implementation. * * @param service service class * @param <T> type of service * @return service implementation */ public <T> T get(Class<T> service) { return services.get(service); }
/** * Constructor. * * @param appId the application id of vtn */ public L2ForwardServiceImpl(ApplicationId appId) { this.appId = checkNotNull(appId, "ApplicationId can not be null"); ServiceDirectory serviceDirectory = new DefaultServiceDirectory(); this.flowObjectiveService = serviceDirectory.get(FlowObjectiveService.class); this.driverService = serviceDirectory.get(DriverService.class); }
@Override public final Object execute() throws Exception { try { auditCommand(); doExecute(); } catch (ServiceNotFoundException e) { error(e.getMessage()); } return null; }
/** * Construct a ArpServiceImpl object. * * @param appId the application id of vtn */ public ArpServiceImpl(ApplicationId appId) { this.appId = checkNotNull(appId, "ApplicationId can not be null"); ServiceDirectory serviceDirectory = new DefaultServiceDirectory(); this.flowObjectiveService = serviceDirectory.get(FlowObjectiveService.class); }
@Override public void init(UiConnection connection, ServiceDirectory directory) { super.init(connection, directory); hostService = directory.get(HostService.class); linkService = directory.get(LinkService.class); portChainService = directory.get(PortChainService.class); portPairService = directory.get(PortPairService.class); portPairGroupService = directory.get(PortPairGroupService.class); }
@Override public boolean isValid() { this.ospfController = DefaultServiceDirectory.getService(OspfController.class); return true; } }
/** * Constructor. * * @param appId the application id of vtn */ public ClassifierServiceImpl(ApplicationId appId) { this.appId = checkNotNull(appId, "ApplicationId can not be null"); ServiceDirectory serviceDirectory = new DefaultServiceDirectory(); this.flowObjectiveService = serviceDirectory.get(FlowObjectiveService.class); }
@Override public boolean isValid() { this.isisController = DefaultServiceDirectory.getService(IsisController.class); return true; } }
/** * Construct a DnatServiceImpl object. * * @param appId the application id of vtn */ public DnatServiceImpl(ApplicationId appId) { this.appId = checkNotNull(appId, "ApplicationId can not be null"); ServiceDirectory serviceDirectory = new DefaultServiceDirectory(); this.flowObjectiveService = serviceDirectory.get(FlowObjectiveService.class); }
@Override public void init(UiConnection connection, ServiceDirectory directory) { super.init(connection, directory); topologyService = directory.get(TopologyService.class); tunnelService = directory.get(TunnelService.class); pceService = directory.get(PceService.class); deviceService = directory.get(DeviceService.class); topologyService.addListener(topologyListener); tunnelService.addListener(tunnelListener); }
@Override public <T> T get(Class<T> serviceClass) { return getService(serviceClass); }
/** * Construct a SnatServiceImpl object. * * @param appId the application id of vtn */ public SnatServiceImpl(ApplicationId appId) { this.appId = checkNotNull(appId, "ApplicationId can not be null"); ServiceDirectory serviceDirectory = new DefaultServiceDirectory(); this.flowObjectiveService = serviceDirectory.get(FlowObjectiveService.class); }
@Override public void init(DeviceId deviceId, PipelinerContext context) { log.debug("Initiate HP pipeline"); this.serviceDirectory = context.directory(); this.deviceId = deviceId; flowRuleService = serviceDirectory.get(FlowRuleService.class); coreService = serviceDirectory.get(CoreService.class); flowObjectiveStore = context.store(); appId = coreService.registerApplication( "org.onosproject.driver.HpPipeline"); }
/** * Construct a L3ForwardServiceImpl object. * * @param appId the application id of vtn */ public L3ForwardServiceImpl(ApplicationId appId) { this.appId = checkNotNull(appId, "ApplicationId can not be null"); ServiceDirectory serviceDirectory = new DefaultServiceDirectory(); this.flowObjectiveService = serviceDirectory.get(FlowObjectiveService.class); }
public AbstractVirtualListenerManager(VirtualNetworkService manager, NetworkId networkId, Class<? extends Event> eventClass) { this.manager = manager; this.networkId = networkId; this.serviceDirectory = manager.getServiceDirectory(); //Set default event delivery service by default this.eventDispatcher = serviceDirectory.get(EventDeliveryService.class); //Initialize and reference to the listener registry this.listenerRegistry = listenerManager.getRegistry(networkId, eventClass); }
/** * Explicit constructor. * * @param appId application id. */ public SfcFlowRuleInstallerImpl(ApplicationId appId) { this.appId = checkNotNull(appId, "ApplicationId can not be null"); ServiceDirectory serviceDirectory = new DefaultServiceDirectory(); this.flowObjectiveService = serviceDirectory.get(FlowObjectiveService.class); this.driverService = serviceDirectory.get(DriverService.class); this.deviceService = serviceDirectory.get(DeviceService.class); this.hostService = serviceDirectory.get(HostService.class); this.virtualPortService = serviceDirectory.get(VirtualPortService.class); this.vtnRscService = serviceDirectory.get(VtnRscService.class); this.portPairService = serviceDirectory.get(PortPairService.class); this.portPairGroupService = serviceDirectory.get(PortPairGroupService.class); this.flowClassifierService = serviceDirectory.get(FlowClassifierService.class); this.tenantNetworkService = serviceDirectory.get(TenantNetworkService.class); nshSi = 0xff; }
@Override public void init(DeviceId deviceId, PipelinerContext context) { this.serviceDirectory = context.directory(); this.deviceId = deviceId; coreService = serviceDirectory.get(CoreService.class); flowRuleService = serviceDirectory.get(FlowRuleService.class); flowObjectiveStore = context.store(); driverId = coreService.registerApplication( "org.onosproject.driver.SoftRouterPipeline"); initializePipeline(); }
protected void activate() { ServiceDirectory services = new DefaultServiceDirectory(); coreService = services.get(CoreService.class); mastershipService = services.get(MastershipService.class); hostService = services.get(HostService.class); hostService.addListener(hostListener); log.info("Started"); }