com.arangodb.entity.ArangoDBVersion Java Examples

The following examples show how to use com.arangodb.entity.ArangoDBVersion. 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: SslExample.java    From arangodb-java-driver-async with Apache License 2.0 6 votes vote down vote up
@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 ArangoDBAsync arangoDB = new ArangoDBAsync.Builder()
			.loadProperties(SslExample.class.getResourceAsStream("/arangodb-ssl.properties")).useSsl(true)
			.sslContext(sc).build();
	final ArangoDBVersion version = arangoDB.getVersion().get();
	assertThat(version, is(notNullValue()));
}
 
Example #2
Source File: ArangoSslTest.java    From arangodb-java-driver-async with Apache License 2.0 6 votes vote down vote up
@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 ArangoDBAsync arangoDB = new ArangoDBAsync.Builder()
			.loadProperties(ArangoSslTest.class.getResourceAsStream("/arangodb-ssl.properties")).useSsl(true)
			.sslContext(sc).build();
	final ArangoDBVersion version = arangoDB.getVersion().get();
	assertThat(version, is(notNullValue()));
}
 
Example #3
Source File: ArangoSslTest.java    From arangodb-java-driver with Apache License 2.0 6 votes vote down vote up
@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(ArangoSslTest.class.getResourceAsStream("/arangodb-ssl.properties")).useSsl(true)
            .sslContext(sc).build();
    final ArangoDBVersion version = arangoDB.getVersion();
    assertThat(version, is(notNullValue()));
}
 
Example #4
Source File: SslExample.java    From arangodb-java-driver with Apache License 2.0 6 votes vote down vote up
@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 ArangoDBAsync arangoDB = new ArangoDBAsync.Builder()
            .loadProperties(SslExample.class.getResourceAsStream("/arangodb-ssl.properties")).useSsl(true)
            .sslContext(sc).build();
    final ArangoDBVersion version = arangoDB.getVersion().get();
    assertThat(version, is(notNullValue()));
}
 
Example #5
Source File: ArangoSslTest.java    From arangodb-java-driver with Apache License 2.0 6 votes vote down vote up
@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 ArangoDBAsync arangoDB = new ArangoDBAsync.Builder()
            .loadProperties(ArangoSslTest.class.getResourceAsStream("/arangodb-ssl.properties")).useSsl(true)
            .sslContext(sc).build();
    final ArangoDBVersion version = arangoDB.getVersion().get();
    assertThat(version, is(notNullValue()));
}
 
Example #6
Source File: ArangoTemplate.java    From spring-data with Apache License 2.0 5 votes vote down vote up
@Override
public ArangoDBVersion getVersion() throws DataAccessException {
	try {
		if (version == null) {
			version = db().getVersion();
		}
		return version;
	} catch (final ArangoDBException e) {
		throw translateExceptionIfPossible(e);
	}
}
 
Example #7
Source File: ArangoTemplateTest.java    From spring-data with Apache License 2.0 5 votes vote down vote up
@Test
public void template() {
	final ArangoDBVersion version = template.getVersion();
	assertThat(version, is(notNullValue()));
	assertThat(version.getLicense(), is(notNullValue()));
	assertThat(version.getServer(), is(notNullValue()));
	assertThat(version.getVersion(), is(notNullValue()));
}
 
Example #8
Source File: SslExample.java    From arangodb-java-driver with Apache License 2.0 5 votes vote down vote up
@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()
			.host("127.0.0.1", 8529)
			.password("test")
			.useSsl(true)
			.sslContext(sc)
			.useProtocol(Protocol.HTTP_JSON)
			.build();
	final ArangoDBVersion version = arangoDB.getVersion();
	assertThat(version, is(notNullValue()));
	System.out.println(version.getVersion());
}
 
Example #9
Source File: ArangoDBAsyncImpl.java    From arangodb-java-driver-async with Apache License 2.0 4 votes vote down vote up
@Override
public CompletableFuture<ArangoDBVersion> getVersion() {
	return db().getVersion();
}
 
Example #10
Source File: CommunicationTest.java    From arangodb-java-driver with Apache License 2.0 4 votes vote down vote up
@Test
public void chunkSizeSmall() {
    final ArangoDB arangoDB = new ArangoDB.Builder().chunksize(20).build();
    final ArangoDBVersion version = arangoDB.getVersion();
    assertThat(version, is(notNullValue()));
}
 
Example #11
Source File: CommunicationTest.java    From arangodb-java-driver with Apache License 2.0 4 votes vote down vote up
@Test
public void minOneConnection() {
    final ArangoDB arangoDB = new ArangoDB.Builder().maxConnections(0).build();
    final ArangoDBVersion version = arangoDB.getVersion();
    assertThat(version, is(notNullValue()));
}
 
Example #12
Source File: CommunicationTest.java    From arangodb-java-driver with Apache License 2.0 4 votes vote down vote up
@Test
public void defaultMaxConnection() {
    final ArangoDB arangoDB = new ArangoDB.Builder().maxConnections(null).build();
    final ArangoDBVersion version = arangoDB.getVersion();
    assertThat(version, is(notNullValue()));
}
 
Example #13
Source File: ArangoOperations.java    From spring-data with Apache License 2.0 2 votes vote down vote up
/**
 * Returns the server name and version number.
 *
 * @return the server version, number
 * @throws DataAccessException
 */
ArangoDBVersion getVersion() throws DataAccessException;
 
Example #14
Source File: ArangoDBAsync.java    From arangodb-java-driver-async with Apache License 2.0 2 votes vote down vote up
/**
 * Returns the server name and version number.
 * 
 * @see <a href="https://docs.arangodb.com/current/HTTP/MiscellaneousFunctions/index.html#return-server-version">API
 *      Documentation</a>
 * @return the server version, number
 */
CompletableFuture<ArangoDBVersion> getVersion();