com.orientechnologies.orient.core.hook.ORecordHook Java Examples

The following examples show how to use com.orientechnologies.orient.core.hook.ORecordHook. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: OrienteerUsersModule.java    From Orienteer with Apache License 2.0 6 votes vote down vote up
@Override
public void onInitialize(OrienteerWebApplication app, ODatabaseDocument db) {
    List<Class<? extends ORecordHook>> hooks = app.getOrientDbSettings().getORecordHooks();
    hooks.add(OrienteerUserHook.class);
    hooks.add(OrienteerUserRoleHook.class);

    RegistrationResource.mount(app);
    RestorePasswordResource.mount(app);

    app.mountPackage("org.orienteer.users.web");
    app.registerWidgets("org.orienteer.users.widget");
    app.getUIVisualizersRegistry().registerUIComponentFactory(new OAuth2ProviderVisualizer());
    initMethods();

    OScheduler scheduler = db.getMetadata().getScheduler();
    Collection<OScheduledEvent> events = scheduler.getEvents().values(); // TODO: remove after fix issue https://github.com/orientechnologies/orientdb/issues/8368
    for (OScheduledEvent event : events) {
        scheduler.updateEvent(event);
    }
}
 
Example #2
Source File: ONotificationModule.java    From Orienteer with Apache License 2.0 5 votes vote down vote up
@Override
public void onInitialize(OrienteerWebApplication app, ODatabaseDocument db, ODocument moduleDoc) {
  super.onInitialize(app, db, moduleDoc);

  List<Class<? extends ORecordHook>> hooks = app.getOrientDbSettings().getORecordHooks();
  hooks.add(ONotificationHook.class);

  long period = new Module(moduleDoc).getSendPeriod();

  ONotificationScheduler.scheduleTask(new ONotificationSendTask(), period);
}
 
Example #3
Source File: ONotificationModule.java    From Orienteer with Apache License 2.0 5 votes vote down vote up
@Override
public void onDestroy(OrienteerWebApplication app, ODatabaseDocument db, ODocument moduleDoc) {
  super.onDestroy(app, db, moduleDoc);

  List<Class<? extends ORecordHook>> hooks = app.getOrientDbSettings().getORecordHooks();
  hooks.remove(ONotificationHook.class);

  ONotificationScheduler.stopAll();
}
 
Example #4
Source File: OrienteerUsersModule.java    From Orienteer with Apache License 2.0 5 votes vote down vote up
@Override
public void onDestroy(OrienteerWebApplication app, ODatabaseDocument db) {
    List<Class<? extends ORecordHook>> hooks = app.getOrientDbSettings().getORecordHooks();
    hooks.remove(OrienteerUserHook.class);
    hooks.remove(OrienteerUserRoleHook.class);

    RegistrationResource.unmount(app);
    RestorePasswordResource.unmount(app);

    app.unmountPackage("org.orienteer.users.web");
    app.unregisterWidgets("org.orienteer.users.widget");
    app.getUIVisualizersRegistry().unregisterUIComponentFactory(Collections.singletonList(OType.STRING), OAuth2ProviderVisualizer.NAME);
}
 
Example #5
Source File: OrientDbSettings.java    From wicket-orientdb with Apache License 2.0 4 votes vote down vote up
@Override
public List<Class<? extends ORecordHook>> getORecordHooks() {
	return oRecordHooks;
}
 
Example #6
Source File: IOrientDbSettings.java    From wicket-orientdb with Apache License 2.0 2 votes vote down vote up
/**
 * @return {@link List} of {@link ORecordHook} which should be registered for every DB instance created
 */
public List<Class<? extends ORecordHook>> getORecordHooks();