Search in sources :

Example 6 with ApplicationId

use of org.onosproject.core.ApplicationId in project onos by opennetworkinglab.

the class DistributedK8sApiConfigStore method activate.

@Activate
protected void activate() {
    ApplicationId appId = coreService.registerApplication(APP_ID);
    apiConfigStore = storageService.<String, K8sApiConfig>consistentMapBuilder().withSerializer(Serializer.using(SERIALIZER_K8S_API_CONFIG)).withName("k8s-apiconfig-store").withApplicationId(appId).build();
    apiConfigStore.addListener(apiConfigMapListener);
    log.info("Started");
}
Also used : ApplicationId(org.onosproject.core.ApplicationId) Activate(org.osgi.service.component.annotations.Activate)

Example 7 with ApplicationId

use of org.onosproject.core.ApplicationId in project onos by opennetworkinglab.

the class DistributedK8sHostStore method activate.

@Activate
protected void activate() {
    ApplicationId appId = coreService.registerApplication(APP_ID);
    hostStore = storageService.<String, K8sHost>consistentMapBuilder().withSerializer(Serializer.using(SERIALIZER_K8S_HOST)).withName("k8s-hoststore").withApplicationId(appId).build();
    hostStore.addListener(hostMapListener);
    log.info("Started");
}
Also used : ApplicationId(org.onosproject.core.ApplicationId) Activate(org.osgi.service.component.annotations.Activate)

Example 8 with ApplicationId

use of org.onosproject.core.ApplicationId in project onos by opennetworkinglab.

the class DistributedK8sNodeStore method activate.

@Activate
protected void activate() {
    ApplicationId appId = coreService.registerApplication(APP_ID);
    nodeStore = storageService.<String, K8sNode>consistentMapBuilder().withSerializer(Serializer.using(SERIALIZER_K8S_NODE)).withName("k8s-nodestore").withApplicationId(appId).build();
    nodeStore.addListener(nodeMapListener);
    log.info("Started");
}
Also used : ApplicationId(org.onosproject.core.ApplicationId) Activate(org.osgi.service.component.annotations.Activate)

Example 9 with ApplicationId

use of org.onosproject.core.ApplicationId in project onos by opennetworkinglab.

the class EventSubscriptionManager method unregisterListener.

@Override
public void unregisterListener(String appName) {
    ApplicationId externalAppId = checkNotNull(coreService.getAppId(appName));
    registeredApps.remove(externalAppId);
}
Also used : ApplicationId(org.onosproject.core.ApplicationId)

Example 10 with ApplicationId

use of org.onosproject.core.ApplicationId in project onos by opennetworkinglab.

the class EventSubscriptionManager method registeredApplication.

/**
 * Checks if the application has registered.
 *
 * @param appName application name
 * @return true if application has registered
 */
private boolean registeredApplication(String appName) {
    checkNotNull(appName);
    ApplicationId appId = checkNotNull(coreService.getAppId(appName));
    if (registeredApps.containsKey(appId)) {
        return true;
    }
    log.debug("{} is not registered", appName);
    return false;
}
Also used : ApplicationId(org.onosproject.core.ApplicationId)

Aggregations

ApplicationId (org.onosproject.core.ApplicationId)138 CoreService (org.onosproject.core.CoreService)36 Activate (org.osgi.service.component.annotations.Activate)36 DefaultApplicationId (org.onosproject.core.DefaultApplicationId)25 Path (javax.ws.rs.Path)21 Produces (javax.ws.rs.Produces)16 ObjectNode (com.fasterxml.jackson.databind.node.ObjectNode)15 GET (javax.ws.rs.GET)14 Test (org.junit.Test)13 ApplicationAdminService (org.onosproject.app.ApplicationAdminService)11 FlowRuleService (org.onosproject.net.flow.FlowRuleService)11 TrafficSelector (org.onosproject.net.flow.TrafficSelector)11 Intent (org.onosproject.net.intent.Intent)11 ArrayNode (com.fasterxml.jackson.databind.node.ArrayNode)10 JsonNode (com.fasterxml.jackson.databind.JsonNode)9 InputStream (java.io.InputStream)9 DeviceId (org.onosproject.net.DeviceId)9 DefaultTrafficSelector (org.onosproject.net.flow.DefaultTrafficSelector)9 IntentService (org.onosproject.net.intent.IntentService)9 TrafficTreatment (org.onosproject.net.flow.TrafficTreatment)8