arangoDB = new ArangoDB.Builder().host(ip).port(port).useProtocol(protocol).build(); } catch (Exception e) { logger.error("Failed to initialize ArangoDB", e);
properties.store(os, null); InputStream targetStream = new ByteArrayInputStream(os.toByteArray()); driver = new ArangoDB.Builder().loadProperties(targetStream) .build(); } catch (IOException e) { throw new ArangoDBGraphException("Unable to read properties", e);
connectionTtl); final Collection<Host> hostList = createHostList(max, connectionFactory); final HostResolver hostResolver = createHostResolver(hostList, max, connectionFactory); final HostHandler hostHandler = createHostHandler(hostResolver); return new ArangoDBImpl( new VstCommunicationSync.Builder(hostHandler).timeout(timeout).user(user).password(password)
@Bean default ArangoOperations arangoTemplate() throws Exception { return new ArangoTemplate(arango().build(), database(), arangoConverter()); }
public ArangoDB build() { return arangoDB.build(); } }
@Override public void useProtocol(Protocol protocol) { arangoDB.useProtocol(protocol); }
@Override public void acquireHostList(boolean acquireHostList) { arangoDB.acquireHostList(acquireHostList); }
@Override public ArangoDBDocumentCollectionManagerFactory getAsync() throws UnsupportedOperationException { return new ArangoDBDocumentCollectionManagerFactory(builder.build(), builderAsync.build()); }
@Override public ArangoDBDocumentCollectionManagerFactory get() throws UnsupportedOperationException { return new ArangoDBDocumentCollectionManagerFactory(builder.build(), builderAsync.build()); }
@Bean default ArangoOperations arangoTemplate() throws Exception { return new ArangoTemplate(arango().build(), database(), arangoConverter()); }
@Override public ArangoDBBucketManagerFactory get() { return new ArangoDBBucketManagerFactory(builder.build()); }
@Override public void host(String host, int port) { arangoDB.host(host, port); }
@Override public void chunksize(int chunksize) { arangoDB.chunksize(chunksize); }
/** * Adds a host in the arangodb builder * * @param host the host * @param port the port * @throws NullPointerException when host is null */ public void addHost(String host, int port) throws NullPointerException { requireNonNull(host, "host is required"); builder.host(host, port); builderAsync.host(host, port); }
/** * set the chucksize * * @param chuckSize the cucksize */ public void setChuckSize(int chuckSize) { builder.chunksize(chuckSize); builderAsync.chunksize(chuckSize); }