Skip to content

Commit

Permalink
Cloud address translaton in Java cont'd
Browse files Browse the repository at this point in the history
  • Loading branch information
dmitrii-ubskii committed Apr 4, 2024
1 parent d3a2721 commit af35581
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions java/TypeDB.java
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
import com.vaticle.typedb.driver.api.TypeDBCredential;
import com.vaticle.typedb.driver.connection.TypeDBDriverImpl;

import java.util.Map;
import java.util.Set;

import static com.vaticle.typedb.common.collection.Collections.set;
Expand Down Expand Up @@ -75,4 +76,21 @@ public static TypeDBDriver cloudDriver(String address, TypeDBCredential credenti
public static TypeDBDriver cloudDriver(Set<String> addresses, TypeDBCredential credential) {
return new TypeDBDriverImpl(addresses, credential);
}

/**
* Open a TypeDB Driver to TypeDB Cloud server(s) available at the provided addresses, using
* the provided credential.
*
* <h3>Examples</h3>
* <pre>
* TypeDB.cloudDriver(addresses, credential);
* </pre>
*
* @param addresses Translation map from addresses received from the TypeDB server(s)
* to addresses to be used by the driver for connection
* @param credential The credential to connect with
*/
public static TypeDBDriver cloudDriver(Map<String, String> addressesTranslation, TypeDBCredential credential) {
return new TypeDBDriverImpl(addressesTranslation, credential);
}
}

0 comments on commit af35581

Please sign in to comment.