use of org.onosproject.core.Application in project onos by opennetworkinglab.
the class ReviewCommand method doExecute.
@Override
protected void doExecute() {
ApplicationAdminService applicationAdminService = get(ApplicationAdminService.class);
ApplicationId appId = applicationAdminService.getId(name);
if (appId == null) {
print("No such application: %s", name);
return;
}
Application app = applicationAdminService.getApplication(appId);
SecurityAdminService smService = SecurityUtil.getSecurityService();
if (smService == null) {
print("Security Mode is disabled");
return;
}
if (accept == null) {
smService.review(appId);
printPolicy(smService, app);
} else if ("accept".equals(accept.trim())) {
smService.acceptPolicy(appId);
printPolicy(smService, app);
} else {
print("Unknown command");
}
}
use of org.onosproject.core.Application in project onos by opennetworkinglab.
the class ApplicationEventTest method withTime.
@Test
public void withTime() {
Application app = createApp();
long before = System.currentTimeMillis();
ApplicationEvent event = new ApplicationEvent(APP_ACTIVATED, app);
long after = System.currentTimeMillis();
validateEvent(event, APP_ACTIVATED, app, before, after);
}
use of org.onosproject.core.Application in project onos by opennetworkinglab.
the class SimpleApplicationStore method remove.
@Override
public void remove(ApplicationId appId) {
Application app = apps.remove(appId);
if (app != null) {
states.remove(appId);
delegate.notify(new ApplicationEvent(APP_UNINSTALLED, app));
purgeApplication(app.id().name());
}
}
use of org.onosproject.core.Application in project onos by opennetworkinglab.
the class SimpleApplicationStoreTest method deactivate.
@Test
public void deactivate() {
Application app = createTestApp();
store.deactivate(app.id());
assertEquals("incorrect app count", 1, store.getApplications().size());
assertEquals("incorrect app state", INSTALLED, store.getState(app.id()));
assertEquals("incorrect event type", APP_DEACTIVATED, delegate.event.type());
assertEquals("incorrect event app", app, delegate.event.subject());
}
use of org.onosproject.core.Application in project onos by opennetworkinglab.
the class ApplicationManager method install.
@Override
public Application install(InputStream appDescStream) {
checkNotNull(appDescStream, "Application archive stream cannot be null");
Application app = store.create(appDescStream);
SecurityUtil.register(app.id());
return app;
}
Aggregations