当前位置: 首页>>代码示例>>Java>>正文


Java ODatabaseInternal类代码示例

本文整理汇总了Java中com.orientechnologies.orient.core.db.ODatabaseInternal的典型用法代码示例。如果您正苦于以下问题:Java ODatabaseInternal类的具体用法?Java ODatabaseInternal怎么用?Java ODatabaseInternal使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


ODatabaseInternal类属于com.orientechnologies.orient.core.db包,在下文中一共展示了ODatabaseInternal类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: onOpen

import com.orientechnologies.orient.core.db.ODatabaseInternal; //导入依赖的package包/类
@Override
public void onOpen(final ODatabaseInternal iDatabase) {

  if (iDatabase.getName().equalsIgnoreCase("OSystem"))
    return;

  OLogManager.instance().info(this, "loading ES conf for database %s", iDatabase.getName());
  final OElasticSearchDatabaseSync db = new OElasticSearchDatabaseSync(iDatabase.getName(), getESClient(iDatabase.getName()));
  iDatabase.registerHook(db);
}
 
开发者ID:orientechnologies,项目名称:orientdb-elasticsearch,代码行数:11,代码来源:OElasticSearchPlugin.java

示例2: onOpen

import com.orientechnologies.orient.core.db.ODatabaseInternal; //导入依赖的package包/类
@Override
public void onOpen(final ODatabaseInternal db) {
  if (OSecurityNull.class.equals(db.getProperty(ODatabase.OPTIONS.SECURITY.toString()))) {
    return; // ignore maintenance operations which run without security, such as index repair
  }
  if (!startRecording(db)) {
    pendingDbs.add(db);
  }
}
 
开发者ID:sonatype,项目名称:nexus-public,代码行数:10,代码来源:EntityHook.java

示例3: onClose

import com.orientechnologies.orient.core.db.ODatabaseInternal; //导入依赖的package包/类
@Override
public void onClose(final ODatabaseInternal db) {
  if (!pendingDbs.remove(db)) {
    stopRecording(db);
    flushEvents(db);
  }
}
 
开发者ID:sonatype,项目名称:nexus-public,代码行数:8,代码来源:EntityHook.java

示例4: recordEvent

import com.orientechnologies.orient.core.db.ODatabaseInternal; //导入依赖的package包/类
private boolean recordEvent(final ODocument document, final EventKind eventKind) {
  final OClass schemaType = document.getSchemaClass();
  if (schemaType != null) {
    final EntityAdapter adapter = recordingAdapters.get(schemaType);
    if (adapter != null) {
      final ODatabaseInternal db = ODatabaseRecordThreadLocal.INSTANCE.get();
      if (db != null) {
        // workaround OrientDB 2.1 issue where in-TX dictionary updates are not replicated
        if (db.getStorage().isDistributed() && adapter instanceof SingletonEntityAdapter) {
          ((SingletonEntityAdapter) adapter).singleton.replicate(document, eventKind);
        }
        Map<ODocument, EventKind> events = dbEvents.get(db);
        if (events == null) {
          events = new LinkedHashMap<>();
          dbEvents.put(db, events);
        }
        // replace mapping after merge so key always points to the latest document instance
        // (avoids a risk that the original key became disconnected/detached at this point)
        EventKind updatedEventKind = updateEventKind(events.remove(document), eventKind);
        if (updatedEventKind != null) {
          events.put(document, updatedEventKind);
        }
        return true;
      }
    }
  }
  return false;
}
 
开发者ID:sonatype,项目名称:nexus-public,代码行数:29,代码来源:EntityHook.java

示例5: onCreate

import com.orientechnologies.orient.core.db.ODatabaseInternal; //导入依赖的package包/类
@Override
public void onCreate(final ODatabaseInternal odi) {
    appEventLogger.accept(AppEvent.info(ODATABASE_CREATE)
            .setData(new ODatabaseLifecycleEvent(odi.getName()))
            .build()
    );
}
 
开发者ID:runrightfast,项目名称:runrightfast-vertx,代码行数:8,代码来源:RunRightFastOrientDBLifeCycleListener.java

示例6: onOpen

import com.orientechnologies.orient.core.db.ODatabaseInternal; //导入依赖的package包/类
@Override
public void onOpen(final ODatabaseInternal odi) {
    appEventLogger.accept(AppEvent.info(ODATABASE_OPEN)
            .setData(new ODatabaseLifecycleEvent(odi.getName()))
            .build()
    );
}
 
开发者ID:runrightfast,项目名称:runrightfast-vertx,代码行数:8,代码来源:RunRightFastOrientDBLifeCycleListener.java

示例7: onClose

import com.orientechnologies.orient.core.db.ODatabaseInternal; //导入依赖的package包/类
@Override
public void onClose(final ODatabaseInternal odi) {
    appEventLogger.accept(AppEvent.info(ODATABASE_CLOSE)
            .setData(new ODatabaseLifecycleEvent(odi.getName()))
            .build()
    );
}
 
开发者ID:runrightfast,项目名称:runrightfast-vertx,代码行数:8,代码来源:RunRightFastOrientDBLifeCycleListener.java

示例8: onDrop

import com.orientechnologies.orient.core.db.ODatabaseInternal; //导入依赖的package包/类
@Override
public void onDrop(final ODatabaseInternal odi) {
    appEventLogger.accept(AppEvent.info(ODATABASE_DROP)
            .setData(new ODatabaseLifecycleEvent(odi.getName()))
            .build()
    );
}
 
开发者ID:runrightfast,项目名称:runrightfast-vertx,代码行数:8,代码来源:RunRightFastOrientDBLifeCycleListener.java

示例9: onCreateClass

import com.orientechnologies.orient.core.db.ODatabaseInternal; //导入依赖的package包/类
@Override
public void onCreateClass(final ODatabaseInternal odi, final OClass oclass) {
    appEventLogger.accept(AppEvent.info(ODATABASE_CREATE_CLASS)
            .setData(new ODatabaseLifecycleClassEvent(odi.getName(), oclass.getName()))
            .build()
    );
}
 
开发者ID:runrightfast,项目名称:runrightfast-vertx,代码行数:8,代码来源:RunRightFastOrientDBLifeCycleListener.java

示例10: onDropClass

import com.orientechnologies.orient.core.db.ODatabaseInternal; //导入依赖的package包/类
@Override
public void onDropClass(final ODatabaseInternal odi, final OClass oclass) {
    appEventLogger.accept(AppEvent.info(ODATABASE_DROP_CLASS)
            .setData(new ODatabaseLifecycleClassEvent(odi.getName(), oclass.getName()))
            .build()
    );
}
 
开发者ID:runrightfast,项目名称:runrightfast-vertx,代码行数:8,代码来源:RunRightFastOrientDBLifeCycleListener.java

示例11: onDrop

import com.orientechnologies.orient.core.db.ODatabaseInternal; //导入依赖的package包/类
@Override
public void onDrop(final ODatabaseInternal iDatabase) {
  try {
    OLogManager.instance().debug(this, "Dropping spatial indexes...");
    for (OIndex idx : iDatabase.getMetadata().getIndexManager().getIndexes()) {

      if (idx.getInternal() instanceof OLuceneSpatialIndex) {
        OLogManager.instance().debug(this, "- index '%s'", idx.getName());
        idx.delete();
      }
    }
  } catch (Exception e) {
    OLogManager.instance().warn(this, "Error on dropping spatial indexes", e);
  }
}
 
开发者ID:orientechnologies,项目名称:orientdb-spatial,代码行数:16,代码来源:OLuceneSpatialIndexFactory.java

示例12: onDrop

import com.orientechnologies.orient.core.db.ODatabaseInternal; //导入依赖的package包/类
@Override
public void onDrop(final ODatabaseInternal iDatabase) {
  OLogManager.instance().info(this, "Dropping spatial indexes...");
  for (OIndex idx : iDatabase.getMetadata().getIndexManager().getIndexes()) {
    if (idx.getInternal() instanceof OLuceneSpatialIndex) {
      OLogManager.instance().info(this, "- index '%s'", idx.getName());
      idx.delete();
    }
  }
}
 
开发者ID:orientechnologies,项目名称:orientdb-spatial,代码行数:11,代码来源:OLuceneSpatialIndexPlugin.java

示例13: castToODatabaseDocument

import com.orientechnologies.orient.core.db.ODatabaseInternal; //导入依赖的package包/类
/**
 * Utility method to obtain {@link ODatabaseDocument} from {@link ODatabase}
 * @param db {@link ODatabase} to cast from
 * @return {@link ODatabaseDocument} for a specified {@link ODatabase}
 */
public static ODatabaseDocument castToODatabaseDocument(ODatabase<?> db)
{
	while(db!=null && !(db instanceof ODatabaseDocument))
	{
		if(db instanceof ODatabaseInternal<?>)
		{
			db = ((ODatabaseInternal<?>)db).getUnderlying();
		}
	}
	return (ODatabaseDocument)db;
}
 
开发者ID:OrienteerBAP,项目名称:wicket-orientdb,代码行数:17,代码来源:DefaultODatabaseThreadLocalFactory.java

示例14: onDrop

import com.orientechnologies.orient.core.db.ODatabaseInternal; //导入依赖的package包/类
@Override
public void onDrop(final ODatabaseInternal iDatabase) {
  OLogManager.instance().info(this, "Dropping Lucene indexes...");
  for (OIndex idx : iDatabase.getMetadata().getIndexManager().getIndexes()) {
    if (idx.getInternal() instanceof OLuceneIndex) {
      OLogManager.instance().info(this, "- index '%s'", idx.getName());
      idx.delete();
    }
  }
}
 
开发者ID:orientechnologies,项目名称:orientdb-lucene,代码行数:11,代码来源:OLuceneIndexPlugin.java

示例15: onDrop

import com.orientechnologies.orient.core.db.ODatabaseInternal; //导入依赖的package包/类
@Override
public void onDrop(final ODatabaseInternal iDatabase) {
  try {
    OLogManager.instance().debug(this, "Dropping Lucene indexes...");
    for (OIndex idx : iDatabase.getMetadata().getIndexManager().getIndexes()) {
      if (idx.getInternal() instanceof OLuceneIndex) {
        OLogManager.instance().debug(this, "- index '%s'", idx.getName());
        idx.delete();
      }
    }
  } catch (Exception e) {
    OLogManager.instance().warn(this, "Error on dropping Lucene indexes", e);
  }
}
 
开发者ID:orientechnologies,项目名称:orientdb-lucene,代码行数:15,代码来源:OLuceneIndexFactory.java


注:本文中的com.orientechnologies.orient.core.db.ODatabaseInternal类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。