use of org.onosproject.core.ApplicationId in project onos by opennetworkinglab.
the class DistributedKubevirtNodeStore method activate.
@Activate
protected void activate() {
ApplicationId appId = coreService.registerApplication(APP_ID);
nodeStore = storageService.<String, KubevirtNode>consistentMapBuilder().withSerializer(Serializer.using(SERIALIZER_KUBEVIRT_NODE)).withName("kubevirt-nodestore").withApplicationId(appId).build();
nodeStore.addListener(nodeMapEventListener);
log.info("Started");
}
use of org.onosproject.core.ApplicationId in project onos by opennetworkinglab.
the class OpenstackManagementWebResource method purgeRulesBase.
private boolean purgeRulesBase() {
ApplicationId appId = coreService.getAppId(Constants.OPENSTACK_NETWORKING_APP_ID);
if (appId == null) {
throw new ItemNotFoundException("application not found");
}
flowRuleService.removeFlowRulesById(appId);
boolean result = true;
long timeoutExpiredMs = System.currentTimeMillis() + TIMEOUT_MS;
// we make sure all flow rules are removed from the store
while (stream(flowRuleService.getFlowEntriesById(appId).spliterator(), false).count() > 0) {
long waitMs = timeoutExpiredMs - System.currentTimeMillis();
try {
sleep(SLEEP_MS);
} catch (InterruptedException e) {
log.error("Exception caused during rule purging...");
}
if (stream(flowRuleService.getFlowEntriesById(appId).spliterator(), false).count() == 0) {
break;
} else {
flowRuleService.removeFlowRulesById(appId);
log.info("Failed to purging flow rules, retrying rule purging...");
}
if (waitMs <= 0) {
result = false;
break;
}
}
if (result) {
log.info("Successfully purged flow rules!");
} else {
log.warn("Failed to purge flow rules.");
}
return result;
}
use of org.onosproject.core.ApplicationId in project onos by opennetworkinglab.
the class DistributedInstancePortStore method activate.
@Activate
protected void activate() {
ApplicationId appId = coreService.registerApplication(OPENSTACK_NETWORKING_APP_ID);
instancePortStore = storageService.<String, InstancePort>consistentMapBuilder().withSerializer(Serializer.using(SERIALIZER_INSTANCE_PORT)).withName("openstack-instanceport-store").withApplicationId(appId).build();
instancePortStore.addListener(instancePortMapListener);
log.info("Started");
}
use of org.onosproject.core.ApplicationId in project onos by opennetworkinglab.
the class DistributedOpenstackRouterStore method activate.
@Activate
protected void activate() {
ApplicationId appId = coreService.registerApplication(OPENSTACK_NETWORKING_APP_ID);
osRouterStore = storageService.<String, Router>consistentMapBuilder().withSerializer(Serializer.using(SERIALIZER_NEUTRON_L3)).withName("openstack-routerstore").withApplicationId(appId).build();
osRouterStore.addListener(routerMapListener);
osRouterInterfaceStore = storageService.<String, RouterInterface>consistentMapBuilder().withSerializer(Serializer.using(SERIALIZER_NEUTRON_L3)).withName("openstack-routerifacestore").withApplicationId(appId).build();
osRouterInterfaceStore.addListener(routerInterfaceMapListener);
osFloatingIpStore = storageService.<String, NetFloatingIP>consistentMapBuilder().withSerializer(Serializer.using(SERIALIZER_NEUTRON_L3)).withName("openstack-floatingipstore").withApplicationId(appId).build();
osFloatingIpStore.addListener(floatingIpMapListener);
log.info("Started");
}
use of org.onosproject.core.ApplicationId in project onos by opennetworkinglab.
the class SimpleApplicationStore method loadFromDisk.
private void loadFromDisk() {
for (String name : getApplicationNames()) {
ApplicationId appId = idStore.registerApplication(name);
ApplicationDescription appDesc = getApplicationDescription(name);
DefaultApplication app = DefaultApplication.builder(appDesc).withAppId(appId).build();
apps.put(appId, app);
states.put(appId, isActive(name) ? INSTALLED : ACTIVE);
// load app permissions
}
}
Aggregations