• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java ArangoDB类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: FormRepositoryArangoImpl

import com.arangodb.ArangoDB; //导入依赖的package包/类
public FormRepositoryArangoImpl() {
    arangoDB = new ArangoDB.Builder()
            .host(config.getHost(), config.getPort())
            .user(config.getUser())
            .password(config.getPassword())
            .registerModule(new VPackJdk8Module())
            .build();
    // if first time connect to the arango, create menu database.
    if(!arangoDB.getDatabases().contains(config.getFormDBName())) {
        arangoDB.createDatabase(config.getFormDBName());
        db = arangoDB.db(config.getFormDBName());
        // add form collection with unique indexes
        CollectionEntity formCollection = db.createCollection(FORM);
        final Collection<String> fields = new ArrayList<String>();
        fields.add(ID);
        HashIndexOptions options = new HashIndexOptions();
        options.unique(true);
        db.collection(FORM).createHashIndex(fields, options);
    }
    if(db == null) db = arangoDB.db(config.getFormDBName());
}
 
开发者ID:networknt,项目名称:light-portal,代码行数:22,代码来源:FormRepositoryArangoImpl.java


示例2: open

import com.arangodb.ArangoDB; //导入依赖的package包/类
@Override
public void open() {
    try {
        final ArangoDB.Builder builder = new ArangoDB.Builder()
                .host(getProperty(ARANGODB_HOST), Integer.parseInt(getProperty(ARANGODB_PORT)));

        if (!StringUtils.isEmpty(getProperty(ARANGODB_USER))) {
            builder.user(getProperty(ARANGODB_USER)).password(getProperty(ARANGODB_PWD));
        }

        arango = builder.build();
    }
    catch (final Exception e) {
        LOGGER.error("Open connection with ArangoDB", e);
    }
}
 
开发者ID:bbonnin,项目名称:zeppelin-arangodb-interpreter,代码行数:17,代码来源:ArangoDbInterpreter.java


示例3: init

import com.arangodb.ArangoDB; //导入依赖的package包/类
protected static void init(String dbName) {

        AbstractArangoDbInterpreterTest.dbName = dbName;

        arango = new ArangoDB.Builder()
                .host(HOST, PORT)
                .user(USERNAME).password(PASSWORD)
                .build();

        try {
            arango.db(dbName).drop();
        }
        catch (final ArangoDBException e) {}

        arango.createDatabase(dbName);

        final Properties props = new Properties();
        props.put(ArangoDbInterpreter.ARANGODB_HOST, HOST);
        props.put(ArangoDbInterpreter.ARANGODB_PORT, "" + PORT);
        props.put(ArangoDbInterpreter.ARANGODB_DATABASE, dbName);
        props.put(ArangoDbInterpreter.ARANGODB_USER, USERNAME);
        props.put(ArangoDbInterpreter.ARANGODB_PWD, PASSWORD);
        interpreter = new ArangoDbInterpreter(props);
        interpreter.open();
    }
 
开发者ID:bbonnin,项目名称:zeppelin-arangodb-interpreter,代码行数:26,代码来源:AbstractArangoDbInterpreterTest.java


示例4: connect

import com.arangodb.ArangoDB; //导入依赖的package包/类
@Test
@Ignore
public void connect() throws Exception {
	final KeyStore ks = KeyStore.getInstance(KeyStore.getDefaultType());
	ks.load(this.getClass().getResourceAsStream(SSL_TRUSTSTORE), SSL_TRUSTSTORE_PASSWORD.toCharArray());

	final KeyManagerFactory kmf = KeyManagerFactory.getInstance(KeyManagerFactory.getDefaultAlgorithm());
	kmf.init(ks, SSL_TRUSTSTORE_PASSWORD.toCharArray());

	final TrustManagerFactory tmf = TrustManagerFactory.getInstance(TrustManagerFactory.getDefaultAlgorithm());
	tmf.init(ks);

	final SSLContext sc = SSLContext.getInstance("TLS");
	sc.init(kmf.getKeyManagers(), tmf.getTrustManagers(), null);

	final ArangoDB arangoDB = new ArangoDB.Builder()
			.loadProperties(SslExample.class.getResourceAsStream("/arangodb-ssl.properties")).useSsl(true)
			.sslContext(sc).build();
	final ArangoDBVersion version = arangoDB.getVersion();
	assertThat(version, is(notNullValue()));
}
 
开发者ID:arangodb,项目名称:arangodb-java-driver,代码行数:22,代码来源:SslExample.java


示例5: init

import com.arangodb.ArangoDB; //导入依赖的package包/类
@BeforeClass
public static void init() {
	if (arangoDB == null) {
		arangoDB = new ArangoDB.Builder().build();
	}
	try {
		arangoDB.db(TEST_DB).drop();
	} catch (final ArangoDBException e) {
	}
	arangoDB.createDatabase(TEST_DB);
	BaseGraphTest.db = arangoDB.db(TEST_DB);

	final Collection<EdgeDefinition> edgeDefinitions = new ArrayList<EdgeDefinition>();
	final EdgeDefinition edgeDefinition = new EdgeDefinition().collection(EDGE_COLLECTION_NAME)
			.from(VERTEXT_COLLECTION_NAME).to(VERTEXT_COLLECTION_NAME);
	edgeDefinitions.add(edgeDefinition);
	try {
		db.createGraph(GRAPH_NAME, edgeDefinitions, null);
		addExampleElements();
	} catch (final ArangoDBException ex) {

	}
}
 
开发者ID:arangodb,项目名称:arangodb-java-driver,代码行数:24,代码来源:BaseGraphTest.java


示例6: createClient

import com.arangodb.ArangoDB; //导入依赖的package包/类
protected ArangoDB createClient() {
    ArangoDB.Builder builder;
    try {
        builder = createClientBuilder();
    } catch (Exception ex) {
        throw new RuntimeException("Failed create ArangoDB: " + ex.getMessage(), ex);
    }
    builder.registerModule(new VPackFebitModule());
    ArangoDB db = builder.build();
    return db;
}
 
开发者ID:febit,项目名称:febit,代码行数:12,代码来源:ArangoInitService.java


示例7: createArango

import com.arangodb.ArangoDB; //导入依赖的package包/类
@OnScheduled
public final void createArango(ProcessContext context) throws IOException {
    if (arangoDB != null) {
        closeArango();
    }

    final String host = context.getProperty(HOST).getValue();
    final int port = context.getProperty(PORT).asInteger();
    final String user = context.getProperty(USERNAME).getValue();
    final String password = context.getProperty(PASSWORD).getValue();

    arangoDB = new ArangoDB.Builder().host(host).port(port).user(user).password(password).build();
    getLogger().info("Creating ArangoDB Connection");
}
 
开发者ID:pinkdevelops,项目名称:nifi-arangodb-bundle,代码行数:15,代码来源:AbstractArangoProcessor.java


示例8: setUp

import com.arangodb.ArangoDB; //导入依赖的package包/类
@BeforeClass
public static void setUp() {
	arangoDB = new ArangoDB.Builder().build();
	try {
		arangoDB.db(DB_NAME).drop();
	} catch (final ArangoDBException e) {
	}
	arangoDB.createDatabase(DB_NAME);
	db = arangoDB.db(DB_NAME);
	db.createCollection(COLLECTION_NAME);
	collection = db.collection(COLLECTION_NAME);
}
 
开发者ID:arangodb,项目名称:arangodb-java-driver,代码行数:13,代码来源:ExampleBase.java


示例9: setUp

import com.arangodb.ArangoDB; //导入依赖的package包/类
@BeforeClass
public static void setUp() {
	arangoDB = new ArangoDB.Builder().build();
	try {
		arangoDB.db(TEST_DB).drop();
	} catch (final ArangoDBException e) {
	}
	arangoDB.createDatabase(TEST_DB);
	db = arangoDB.db(TEST_DB);
	createData();
}
 
开发者ID:arangodb,项目名称:arangodb-java-driver,代码行数:12,代码来源:AQLActorsAndMoviesExample.java


示例10: setup

import com.arangodb.ArangoDB; //导入依赖的package包/类
@BeforeClass
public static void setup() {
	final InternalArangoDB<ArangoExecutorSync, Response, ConnectionSync> arangoDB = new ArangoDB.Builder().build();
	util = arangoDB.util();
}
 
开发者ID:arangodb,项目名称:arangodb-java-driver,代码行数:6,代码来源:ArangoSerializationTest.java


示例11: client

import com.arangodb.ArangoDB; //导入依赖的package包/类
public ArangoDB client() {
    return LAZY_CLIENT.get();
}
 
开发者ID:febit,项目名称:febit,代码行数:4,代码来源:ArangoInitService.java


示例12: MenuRepositoryArangoImpl

import com.arangodb.ArangoDB; //导入依赖的package包/类
public MenuRepositoryArangoImpl() {
    arangoDB = new ArangoDB.Builder()
            .host(config.getHost(), config.getPort())
            .user(config.getUser())
            .password(config.getPassword())
            .registerModule(new VPackJdk8Module())
            .build();
    // if first time connect to the arango, create menu database.
    if(!arangoDB.getDatabases().contains(config.getMenuDBName())) {
        arangoDB.createDatabase(config.getMenuDBName());
        db = arangoDB.db(config.getMenuDBName());
        // add two collections with unique indexes
        CollectionEntity menuCollection = db.createCollection(MENU);
        final Collection<String> fields = new ArrayList<String>();
        fields.add(ENTITYID);
        HashIndexOptions options = new HashIndexOptions();
        options.unique(true);
        db.collection(MENU).createHashIndex(fields, options);

        CollectionEntity menuItemCollection = db.createCollection(MENUITEM);
        db.collection(MENUITEM).createHashIndex(fields, options);

        // add graph
        Collection<EdgeDefinition> edgeDefinitions = new ArrayList<>();
        EdgeDefinition edgeDefinition = new EdgeDefinition();
        edgeDefinition.collection(CONTAINS);
        edgeDefinition.from(MENU, MENUITEM);
        edgeDefinition.to(MENUITEM);
        edgeDefinitions.add(edgeDefinition);
        db.createGraph(CONTAINSGRAPH, edgeDefinitions);

        // create a function
        db.createAqlFunction("LIGHTAPI::COMMON::AGGREGATE_PATH",
                "function (flat) {\n" +
                        "        var result = flat[0][0];\n" +
                        "        if (flat) {\n" +
                        "            flat.forEach(function (path) {\n" +
                        "                for(var i = path.length -1; i > 0; i--) {\n" +
                        "                    path[i-1].contains = new Array();\n" +
                        "                    path[i-1].contains.push(path[i]);\n" +
                        "                }\n" +
                        "            });\n" +
                        "        }\n" +
                        "        function includes(a, o) {\n" +
                        "            var found;\n" +
                        "            a.forEach(function (e) {\n" +
                        "                if(e._key === o._key) {\n" +
                        "                    found = e;\n" +
                        "                }\n" +
                        "            });\n" +
                        "            return found;\n" +
                        "        }\n" +
                        "        function mergeObjects(target, source) {\n" +
                        "            if(target && target.contains) {\n" +
                        "                if(source.contains) {\n" +
                        "                    source.contains.forEach(function(v) {\n" +
                        "                        var e = includes(target.contains, v);\n" +
                        "                        if(!e) {\n" +
                        "                            target.contains.push(v);\n" +
                        "                        } else {\n" +
                        "                            mergeObjects(e, v);\n" +
                        "                        }\n" +
                        "                    });\n" +
                        "                }\n" +
                        "            } else {\n" +
                        "                if(target && source.contains) {\n" +
                        "                    target.contains = source.contains;\n" +
                        "                }\n" +
                        "            }\n" +
                        "        }\n" +
                        "        for(var j= flat.length -1; j >= 0; j--) {\n" +
                        "            mergeObjects(result, flat[j][0]);\n" +
                        "        }\n" +
                        "        return result;\n" +
                        "    }\n", null);
    }
    if(db == null) db = arangoDB.db(config.getMenuDBName());
}
 
开发者ID:networknt,项目名称:light-portal,代码行数:79,代码来源:MenuRepositoryArangoImpl.java


示例13: setDataSource

import com.arangodb.ArangoDB; //导入依赖的package包/类
@Override
public void setDataSource(Object object) {
    this.arangoDB = (ArangoDB)object;
}
 
开发者ID:networknt,项目名称:light-portal,代码行数:5,代码来源:MenuRepositoryArangoImpl.java


示例14: setUp

import com.arangodb.ArangoDB; //导入依赖的package包/类
@BeforeClass
public static void setUp() {
    arangoDB = (ArangoDB)menuQueryRepository.getDataSource();
    // add testing data
}
 
开发者ID:networknt,项目名称:light-portal,代码行数:6,代码来源:MenuQueryRepositoryArangoTest.java


示例15: setUp

import com.arangodb.ArangoDB; //导入依赖的package包/类
@BeforeClass
public static void setUp() {
    arangoDB = (ArangoDB)formQueryRepository.getDataSource();
    // add testing data
}
 
开发者ID:networknt,项目名称:light-portal,代码行数:6,代码来源:FormQueryRepositoryArangoTest.java


示例16: setUp

import com.arangodb.ArangoDB; //导入依赖的package包/类
@Before
public void setUp() {
	arangoDB = new ArangoDB.Builder().build();
	arangoDB.db("_system").createCollection("test");
}
 
开发者ID:arangodb,项目名称:simple-java-performance-test,代码行数:6,代码来源:ArangoDbTest.java


示例17: TaxEntWrapperDriver

import com.arangodb.ArangoDB; //导入依赖的package包/类
public TaxEntWrapperDriver(IFloraOn driver, INodeKey tev) throws FloraOnException {
	super(driver, tev);
	this.dbDriver = (ArangoDB) driver.getDatabaseDriver();
	this.database = (ArangoDatabase) driver.getDatabase();
}
 
开发者ID:miguel-porto,项目名称:flora-on-server,代码行数:6,代码来源:TaxEntWrapperDriver.java


示例18: NodeWorkerDriver

import com.arangodb.ArangoDB; //导入依赖的package包/类
public NodeWorkerDriver(IFloraOn driver) {
	super(driver);
	this.dbDriver = (ArangoDB) driver.getDatabaseDriver();
	this.database = (ArangoDatabase) driver.getDatabase();
}
 
开发者ID:miguel-porto,项目名称:flora-on-server,代码行数:6,代码来源:NodeWorkerDriver.java


示例19: QueryDriver

import com.arangodb.ArangoDB; //导入依赖的package包/类
public QueryDriver(IFloraOn driver) {
	super(driver);
	dbDriver = (ArangoDB) driver.getDatabaseDriver();
	database = (ArangoDatabase) driver.getDatabase();
}
 
开发者ID:miguel-porto,项目名称:flora-on-server,代码行数:6,代码来源:QueryDriver.java


示例20: chunkSizeSmall

import com.arangodb.ArangoDB; //导入依赖的package包/类
@Test
public void chunkSizeSmall() {
	final ArangoDB arangoDB = new ArangoDB.Builder().chunksize(20).build();
	final ArangoDBVersion version = arangoDB.getVersion();
	assertThat(version, is(notNullValue()));
}
 
开发者ID:arangodb,项目名称:arangodb-java-driver,代码行数:7,代码来源:CommunicationTest.java



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java EFormatString类代码示例发布时间:2022-05-22
下一篇:
Java EngineException类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap