Skip to content

Commit

Permalink
fix jdoc
Browse files Browse the repository at this point in the history
  • Loading branch information
gkorland committed Dec 12, 2023
1 parent 4e4ab38 commit 6716b6e
Show file tree
Hide file tree
Showing 9 changed files with 54 additions and 15 deletions.
14 changes: 13 additions & 1 deletion src/main/java/com/falkordb/Driver.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,21 @@
import java.io.Closeable;

import redis.clients.jedis.Jedis;

/**
* An interface which aligned to FalkorDB Driver interface
*/
public interface Driver extends Closeable{

/**
* Returns a selected Graph
* @param graphId Graph name
* @return a selected Graph
*/
GraphContextGenerator graph(String graphId);

/**
* Returns a underline connection to the database
* @return a underline connection to the database
*/
Jedis getConnection();
}
13 changes: 13 additions & 0 deletions src/main/java/com/falkordb/FalkorDB.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,27 @@

import com.falkordb.impl.api.DriverImpl;

/**
* FalkorDB driver factory
*/
final public class FalkorDB {

private FalkorDB() {}

/**
* Creates a new driver instance
* @return a new driver instance
*/
public static Driver driver (){
return new DriverImpl();
}

/**
* Creates a new driver instance
* @param host host name
* @param port port number
* @return a new driver instance
*/
public static Driver driver (String host, int port){
return new DriverImpl(host, port);
}
Expand Down
5 changes: 5 additions & 0 deletions src/main/java/com/falkordb/graph_entities/Property.java
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,11 @@ public class Property <T> {
private String name;
private T value;

/**
* Default constructor
*/
public Property() {}

/**
* Parameterized constructor
*
Expand Down
8 changes: 4 additions & 4 deletions src/main/java/com/falkordb/impl/api/AbstractGraph.java
Original file line number Diff line number Diff line change
Expand Up @@ -28,15 +28,15 @@ public abstract class AbstractGraph implements Graph {
/**
* Sends a query to the redis graph.Implementation and context dependent
* @param preparedQuery prepared query
* @param timeout
* @param timeout timeout in milliseconds
* @return Result set
*/
protected abstract ResultSet sendQuery(String preparedQuery, long timeout);

/**
* Sends a read-query to the redis graph.Implementation and context dependent
* @param preparedQuery prepared query
* @param timeout
* @param timeout timeout in milliseconds
* @return Result set
*/
protected abstract ResultSet sendReadOnlyQuery(String preparedQuery, long timeout);
Expand Down Expand Up @@ -109,9 +109,9 @@ public ResultSet readOnlyQuery(String query, Map<String, Object> params) {

/**
* Executes a cypher query with parameters and timeout.
* @param timeout
* @param query Cypher query.
* @param params parameters map.
* @param timeout timeout in milliseconds
* @return a result set.
*/
@Override
Expand All @@ -122,9 +122,9 @@ public ResultSet query(String query, Map<String, Object> params, long timeout) {

/**
* Executes a cypher read-only query with parameters and timeout.
* @param timeout
* @param query Cypher query.
* @param params parameters map.
* @param timeout timeout in milliseconds
* @return a result set.
*/
@Override
Expand Down
9 changes: 8 additions & 1 deletion src/main/java/com/falkordb/impl/api/GraphCommand.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import redis.clients.jedis.commands.ProtocolCommand;

/**
*
* An enum which aligned to FalkorDB Graph commands
*/
public enum GraphCommand implements ProtocolCommand {
QUERY("graph.QUERY"),
Expand All @@ -12,10 +12,17 @@ public enum GraphCommand implements ProtocolCommand {

private final byte[] raw;

/**
* Generates a new instance with a specific command
* @param alt command
*/
GraphCommand(String alt) {
raw = SafeEncoder.encode(alt);
}

/**
* Returns the raw command
*/
public byte[] getRaw() {
return raw;
}
Expand Down
4 changes: 3 additions & 1 deletion src/main/java/com/falkordb/impl/api/GraphContextImpl.java
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,9 @@ public class GraphContextImpl extends AbstractGraph implements GraphContext {

/**
* Generates a new instance with a specific Jedis connection
* @param connectionContext
* @param connection Jedis connection
* @param cache GraphCache
* @param graphId graph id
*/
public GraphContextImpl(Jedis connection, GraphCache cache, String graphId) {
this.connection = connection;
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/com/falkordb/impl/api/GraphImpl.java
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
import redis.clients.jedis.util.SafeEncoder;

/**
*
* An implementation of GraphContextGenerator.
*/
public class GraphImpl extends AbstractGraph implements GraphContextGenerator {

Expand Down
8 changes: 4 additions & 4 deletions src/main/java/com/falkordb/impl/api/GraphPipelineImpl.java
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ public ResultSet build(Object o) {
*
* NOTE: timeout is simply sent to DB. Socket timeout will not be changed.
* @param query Cypher query
* @param timeout
* @param timeout timeout in milliseconds
* @return a response which builds the result set with the query answer.
*/
@Override
Expand All @@ -90,7 +90,7 @@ public ResultSet build(Object o) {
*
* NOTE: timeout is simply sent to DB. Socket timeout will not be changed.
* @param query Cypher query
* @param timeout
* @param timeout timeout in milliseconds
* @return a response which builds the result set with the query answer.
*/
@Override
Expand Down Expand Up @@ -151,7 +151,7 @@ public ResultSet build(Object o) {
* timeout.
* @param query Cypher query.
* @param params parameters map.
* @param timeout
* @param timeout timeout in milliseconds
* @return a response which builds the result set with the query answer.
*/
@Override
Expand All @@ -175,7 +175,7 @@ public ResultSet build(Object o) {
* timeout.
* @param query Cypher query.
* @param params parameters map.
* @param timeout
* @param timeout timeout in milliseconds
* @return a response which builds the result set with the query answer.
*/
@Override
Expand Down
6 changes: 3 additions & 3 deletions src/main/java/com/falkordb/impl/api/GraphTransaction.java
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ public ResultSet build(Object o) {
*
* NOTE: timeout is simply sent to DB. Socket timeout will not be changed.
* @param query Cypher query
* @param timeout
* @param timeout timeout in milliseconds
* @return a response which builds the result set with the query answer.
*/
@Override
Expand Down Expand Up @@ -152,7 +152,7 @@ public ResultSet build(Object o) {
* NOTE: timeout is simply sent to DB. Socket timeout will not be changed.
* @param query Cypher query.
* @param params parameters map.
* @param timeout
* @param timeout timeout in milliseconds
* @return a response which builds the result set with the query answer.
*/
@Override
Expand All @@ -175,7 +175,7 @@ public ResultSet build(Object o) {
* NOTE: timeout is simply sent to DB. Socket timeout will not be changed.
* @param query Cypher query.
* @param params parameters map.
* @param timeout
* @param timeout timeout in milliseconds
* @return a response which builds the result set with the query answer.
*/
@Override
Expand Down

0 comments on commit 6716b6e

Please sign in to comment.