use of org.onosproject.core.ApplicationId in project onos by opennetworkinglab.
the class FlowsListCommand method removeFlowsInteractive.
/**
* Removes the flows passed as argument after confirmation is provided
* for each of them.
* If no explicit confirmation is provided, the flow is not removed.
*
* @param flows list of flows to remove
* @param flowService FlowRuleService object
* @param coreService CoreService object
*/
public void removeFlowsInteractive(Iterable<FlowEntry> flows, FlowRuleService flowService, CoreService coreService) {
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
flows.forEach(flow -> {
ApplicationId appId = coreService.getAppId(flow.appId());
System.out.print(String.format("Id=%s, AppId=%s. Remove? [y/N]: ", flow.id(), appId != null ? appId.name() : "<none>"));
String response;
try {
response = br.readLine();
response = response.trim().replace("\n", "");
if ("y".equals(response)) {
flowService.removeFlowRules(flow);
}
} catch (IOException e) {
response = "";
}
print(response);
});
}
use of org.onosproject.core.ApplicationId in project onos by opennetworkinglab.
the class DistributedKubevirtRouterStore method activate.
@Activate
protected void activate() {
ApplicationId appId = coreService.registerApplication(APP_ID);
routerStore = storageService.<String, KubevirtRouter>consistentMapBuilder().withSerializer(Serializer.using(SERIALIZER_KUBEVIRT_ROUTER)).withName("kubevirt-routerstore").withApplicationId(appId).build();
fipStore = storageService.<String, KubevirtFloatingIp>consistentMapBuilder().withSerializer(Serializer.using(SERIALIZER_KUBEVIRT_ROUTER)).withName("kubevirt-fipstore").withApplicationId(appId).build();
routerStore.addListener(routerMapListener);
fipStore.addListener(fipMapListener);
log.info("Started");
}
use of org.onosproject.core.ApplicationId in project onos by opennetworkinglab.
the class DistributedKubevirtSecurityGroupStore method activate.
@Activate
protected void activate() {
ApplicationId appId = coreService.registerApplication(APP_ID);
sgStore = storageService.<String, KubevirtSecurityGroup>consistentMapBuilder().withSerializer(Serializer.using(SERIALIZER_KUBEVIRT_SG)).withName("kubevirt-securitygroupstore").withApplicationId(appId).build();
sgStore.addListener(securityGroupListener);
log.info("Started");
}
use of org.onosproject.core.ApplicationId in project onos by opennetworkinglab.
the class DistributedKubevirtLoadBalancerStore method activate.
@Activate
protected void activate() {
ApplicationId appId = coreService.registerApplication(APP_ID);
loadBalancerStore = storageService.<String, KubevirtLoadBalancer>consistentMapBuilder().withSerializer(Serializer.using(SERIALIZER_KUBEVIRT_LOAD_BALANCER)).withName("kubevirt-loadbalancerstore").withApplicationId(appId).build();
loadBalancerStore.addListener(loadBalancerMapListener);
log.info("Started");
}
use of org.onosproject.core.ApplicationId in project onos by opennetworkinglab.
the class DistributedKubevirtNetworkStore method activate.
@Activate
protected void activate() {
ApplicationId appId = coreService.registerApplication(APP_ID);
networkStore = storageService.<String, KubevirtNetwork>consistentMapBuilder().withSerializer(Serializer.using(SERIALIZER_KUBEVIRT_NETWORK)).withName("kubevirt-networkstore").withApplicationId(appId).build();
networkStore.addListener(networkMapListener);
log.info("Started");
}
Aggregations