Search in sources :

Example 1 with DefaultApplication

use of org.onosproject.core.DefaultApplication 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
    }
}
Also used : DefaultApplication(org.onosproject.core.DefaultApplication) ApplicationId(org.onosproject.core.ApplicationId) ApplicationDescription(org.onosproject.app.ApplicationDescription)

Example 2 with DefaultApplication

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

the class SimpleApplicationStore method create.

@Override
public Application create(InputStream appDescStream) {
    ApplicationDescription appDesc = saveApplication(appDescStream);
    ApplicationId appId = idStore.registerApplication(appDesc.name());
    DefaultApplication app = DefaultApplication.builder(appDesc).withAppId(appId).build();
    apps.put(appId, app);
    states.put(appId, INSTALLED);
    delegate.notify(new ApplicationEvent(APP_INSTALLED, app));
    return app;
}
Also used : ApplicationEvent(org.onosproject.app.ApplicationEvent) DefaultApplication(org.onosproject.core.DefaultApplication) ApplicationId(org.onosproject.core.ApplicationId) ApplicationDescription(org.onosproject.app.ApplicationDescription)

Aggregations

ApplicationDescription (org.onosproject.app.ApplicationDescription)2 ApplicationId (org.onosproject.core.ApplicationId)2 DefaultApplication (org.onosproject.core.DefaultApplication)2 ApplicationEvent (org.onosproject.app.ApplicationEvent)1