diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md
index 2c8b2c6a9d..a0a2949743 100644
--- a/CONTRIBUTING.md
+++ b/CONTRIBUTING.md
@@ -36,6 +36,8 @@ Before submitting the code, we need to do some preparation:
git config user.email "{email-address-of-github}" # like "jermy@apache.org"
```
+5. Sign the HugeGraph CLA: [https://cla-assistant.io/hugegraph/hugegraph](https://cla-assistant.io/hugegraph/hugegraph)
+
Optional: You can use [GitHub desktop](https://desktop.github.com/) to greatly simplify the commit and update process.
## 2. Create an Issue on GitHub
@@ -108,13 +110,6 @@ Note that since GitHub requires submitting code through `username + token` (inst
Go to the web page of GitHub fork repo, there would be a chance to create a Pull Request after pushing to a new branch, just click button "Compare & pull request" to do it. Then edit the description for proposed changes, which can just be copied from the commit message.
-Please sign the HugeGraph CLA when contributing code for the first time. You can sign the CLA by just posting a Pull Request Comment same as the below format:
-
-`I have read the CLA Document and I hereby sign the CLA`
-
-Note: please make sure the email address you used to submit the code is bound to the GitHub account. For how to bind the email address, please refer to https://github.com/settings/emails:
-
-
## 5. Code review
Maintainers will start the code review after all the **automatic** checks are passed:
diff --git a/hugegraph-core/src/main/java/com/baidu/hugegraph/HugeFactory.java b/hugegraph-core/src/main/java/com/baidu/hugegraph/HugeFactory.java
index 56ee22e84b..503f901e8b 100644
--- a/hugegraph-core/src/main/java/com/baidu/hugegraph/HugeFactory.java
+++ b/hugegraph-core/src/main/java/com/baidu/hugegraph/HugeFactory.java
@@ -44,7 +44,7 @@ public class HugeFactory {
private static final Logger LOG = Log.logger(HugeGraph.class);
- private static final Thread shutdownHook = new Thread(() -> {
+ private static final Thread SHUTDOWN_HOOK = new Thread(() -> {
LOG.info("HugeGraph is shutting down");
HugeFactory.shutdown(30L);
}, "hugegraph-shutdown");
@@ -53,14 +53,14 @@ public class HugeFactory {
SerialEnum.registerInternalEnums();
HugeGraph.registerTraversalStrategies(StandardHugeGraph.class);
- Runtime.getRuntime().addShutdownHook(shutdownHook);
+ Runtime.getRuntime().addShutdownHook(SHUTDOWN_HOOK);
}
private static final String NAME_REGEX = "^[A-Za-z][A-Za-z0-9_]{0,47}$";
- private static final Map graphs = new HashMap<>();
+ private static final Map GRAPHS = new HashMap<>();
- private static final AtomicBoolean shutdown = new AtomicBoolean(false);
+ private static final AtomicBoolean SHUTDOWN = new AtomicBoolean(false);
public static synchronized HugeGraph open(Configuration config) {
HugeConfig conf = config instanceof HugeConfig ?
@@ -82,10 +82,10 @@ public static synchronized HugeGraph open(HugeConfig config) {
String name = config.get(CoreOptions.STORE);
checkGraphName(name, "graph config(like hugegraph.properties)");
name = name.toLowerCase();
- HugeGraph graph = graphs.get(name);
+ HugeGraph graph = GRAPHS.get(name);
if (graph == null || graph.closed()) {
graph = new StandardHugeGraph(config);
- graphs.put(name, graph);
+ GRAPHS.put(name, graph);
} else {
String backend = config.get(CoreOptions.BACKEND);
E.checkState(backend.equalsIgnoreCase(graph.backend()),
@@ -105,7 +105,7 @@ public static HugeGraph open(URL url) {
public static void remove(HugeGraph graph) {
String name = graph.option(CoreOptions.STORE);
- graphs.remove(name);
+ GRAPHS.remove(name);
}
public static void checkGraphName(String name, String configFile) {
@@ -143,7 +143,7 @@ public static PropertiesConfiguration getRemoteConfig(URL url) {
* @param timeout seconds
*/
public static void shutdown(long timeout) {
- if (!shutdown.compareAndSet(false, true)) {
+ if (!SHUTDOWN.compareAndSet(false, true)) {
return;
}
try {
@@ -154,7 +154,7 @@ public static void shutdown(long timeout) {
OltpTraverser.destroy();
} catch (Throwable e) {
LOG.error("Error while shutdown", e);
- shutdown.compareAndSet(true, false);
+ SHUTDOWN.compareAndSet(true, false);
throw new HugeException("Failed to shutdown", e);
}
@@ -162,6 +162,6 @@ public static void shutdown(long timeout) {
}
public static void removeShutdownHook() {
- Runtime.getRuntime().removeShutdownHook(shutdownHook);
+ Runtime.getRuntime().removeShutdownHook(SHUTDOWN_HOOK);
}
}
diff --git a/hugegraph-core/src/main/java/com/baidu/hugegraph/HugeGraph.java b/hugegraph-core/src/main/java/com/baidu/hugegraph/HugeGraph.java
index 69e495f56d..1e93542124 100644
--- a/hugegraph-core/src/main/java/com/baidu/hugegraph/HugeGraph.java
+++ b/hugegraph-core/src/main/java/com/baidu/hugegraph/HugeGraph.java
@@ -63,126 +63,183 @@
*/
public interface HugeGraph extends Graph {
- public HugeGraph hugegraph();
-
- public SchemaManager schema();
-
- public Id getNextId(HugeType type);
-
- public Id addPropertyKey(PropertyKey key);
- public Id removePropertyKey(Id key);
- public Id clearPropertyKey(PropertyKey propertyKey);
- public Collection propertyKeys();
- public PropertyKey propertyKey(String key);
- public PropertyKey propertyKey(Id key);
- public boolean existsPropertyKey(String key);
-
- public void addVertexLabel(VertexLabel vertexLabel);
- public Id removeVertexLabel(Id label);
- public Collection vertexLabels();
- public VertexLabel vertexLabel(String label);
- public VertexLabel vertexLabel(Id label);
- public VertexLabel vertexLabelOrNone(Id id);
- public boolean existsVertexLabel(String label);
- public boolean existsLinkLabel(Id vertexLabel);
-
- public void addEdgeLabel(EdgeLabel edgeLabel);
- public Id removeEdgeLabel(Id label);
- public Collection edgeLabels();
- public EdgeLabel edgeLabel(String label);
- public EdgeLabel edgeLabel(Id label);
- public EdgeLabel edgeLabelOrNone(Id label);
- public boolean existsEdgeLabel(String label);
-
- public void addIndexLabel(SchemaLabel schemaLabel, IndexLabel indexLabel);
- public Id removeIndexLabel(Id label);
- public Id rebuildIndex(SchemaElement schema);
- public Collection indexLabels();
- public IndexLabel indexLabel(String label);
- public IndexLabel indexLabel(Id id);
- public boolean existsIndexLabel(String label);
+ HugeGraph hugegraph();
+
+ SchemaManager schema();
+
+ Id getNextId(HugeType type);
+
+ Id addPropertyKey(PropertyKey key);
+
+ Id removePropertyKey(Id key);
+
+ Id clearPropertyKey(PropertyKey propertyKey);
+
+ Collection propertyKeys();
+
+ PropertyKey propertyKey(String key);
+
+ PropertyKey propertyKey(Id key);
+
+ boolean existsPropertyKey(String key);
+
+ void addVertexLabel(VertexLabel vertexLabel);
+
+ Id removeVertexLabel(Id label);
+
+ Collection vertexLabels();
+
+ VertexLabel vertexLabel(String label);
+
+ VertexLabel vertexLabel(Id label);
+
+ VertexLabel vertexLabelOrNone(Id id);
+
+ boolean existsVertexLabel(String label);
+
+ boolean existsLinkLabel(Id vertexLabel);
+
+ void addEdgeLabel(EdgeLabel edgeLabel);
+
+ Id removeEdgeLabel(Id label);
+
+ Collection edgeLabels();
+
+ EdgeLabel edgeLabel(String label);
+
+ EdgeLabel edgeLabel(Id label);
+
+ EdgeLabel edgeLabelOrNone(Id label);
+
+ boolean existsEdgeLabel(String label);
+
+ void addIndexLabel(SchemaLabel schemaLabel, IndexLabel indexLabel);
+
+ Id removeIndexLabel(Id label);
+
+ Id rebuildIndex(SchemaElement schema);
+
+ Collection indexLabels();
+
+ IndexLabel indexLabel(String label);
+
+ IndexLabel indexLabel(Id id);
+
+ boolean existsIndexLabel(String label);
@Override
- public Vertex addVertex(Object... keyValues);
- public void removeVertex(Vertex vertex);
- public void removeVertex(String label, Object id);
- public void addVertexProperty(VertexProperty property);
- public void removeVertexProperty(VertexProperty property);
-
- public Edge addEdge(Edge edge);
- public void canAddEdge(Edge edge);
- public void removeEdge(Edge edge);
- public void removeEdge(String label, Object id);
- public void addEdgeProperty(Property property);
- public void removeEdgeProperty(Property property);
-
- public Vertex vertex(Object object);
+ Vertex addVertex(Object... keyValues);
+
+ void removeVertex(Vertex vertex);
+
+ void removeVertex(String label, Object id);
+
+ void addVertexProperty(VertexProperty property);
+
+ void removeVertexProperty(VertexProperty property);
+
+ Edge addEdge(Edge edge);
+
+ void canAddEdge(Edge edge);
+
+ void removeEdge(Edge edge);
+
+ void removeEdge(String label, Object id);
+
+ void addEdgeProperty(Property property);
+
+ void removeEdgeProperty(Property property);
+
+ Vertex vertex(Object object);
+
@Override
- public Iterator vertices(Object... objects);
- public Iterator vertices(Query query);
- public Iterator adjacentVertex(Object id);
- public boolean checkAdjacentVertexExist();
+ Iterator vertices(Object... objects);
+
+ Iterator vertices(Query query);
+
+ Iterator adjacentVertex(Object id);
+
+ boolean checkAdjacentVertexExist();
+
+ Edge edge(Object object);
- public Edge edge(Object object);
@Override
- public Iterator edges(Object... objects);
- public Iterator edges(Query query);
- public Iterator adjacentVertices(Iterator edges) ;
- public Iterator adjacentEdges(Id vertexId);
+ Iterator edges(Object... objects);
+
+ Iterator edges(Query query);
+
+ Iterator adjacentVertices(Iterator edges);
+
+ Iterator adjacentEdges(Id vertexId);
- public Number queryNumber(Query query);
+ Number queryNumber(Query query);
- public String name();
- public String backend();
- public String backendVersion();
- public BackendStoreSystemInfo backendStoreSystemInfo();
- public BackendFeatures backendStoreFeatures();
+ String name();
- public GraphMode mode();
- public void mode(GraphMode mode);
+ String backend();
- public GraphReadMode readMode();
- public void readMode(GraphReadMode readMode);
+ String backendVersion();
- public void waitStarted();
- public void serverStarted(Id serverId, NodeRole serverRole);
- public boolean started();
- public boolean closed();
+ BackendStoreSystemInfo backendStoreSystemInfo();
- public T metadata(HugeType type, String meta, Object... args);
+ BackendFeatures backendStoreFeatures();
- public void initBackend();
- public void clearBackend();
- public void truncateBackend();
+ GraphMode mode();
- public void createSnapshot();
- public void resumeSnapshot();
+ void mode(GraphMode mode);
- public void create(String configPath, Id server, NodeRole role);
- public void drop();
+ GraphReadMode readMode();
- public HugeConfig cloneConfig(String newGraph);
+ void readMode(GraphReadMode readMode);
+
+ void waitStarted();
+
+ void serverStarted(Id serverId, NodeRole serverRole);
+
+ boolean started();
+
+ boolean closed();
+
+ T metadata(HugeType type, String meta, Object... args);
+
+ void initBackend();
+
+ void clearBackend();
+
+ void truncateBackend();
+
+ void createSnapshot();
+
+ void resumeSnapshot();
+
+ void create(String configPath, Id server, NodeRole role);
+
+ void drop();
+
+ HugeConfig cloneConfig(String newGraph);
@Override
- public HugeFeatures features();
+ HugeFeatures features();
+
+ AuthManager authManager();
+
+ void switchAuthManager(AuthManager authManager);
+
+ TaskScheduler taskScheduler();
- public AuthManager authManager();
- public void switchAuthManager(AuthManager authManager);
- public TaskScheduler taskScheduler();
- public RaftGroupManager raftGroupManager(String group);
+ RaftGroupManager raftGroupManager(String group);
- public void proxy(HugeGraph graph);
+ void proxy(HugeGraph graph);
- public boolean sameAs(HugeGraph graph);
+ boolean sameAs(HugeGraph graph);
- public long now();
+ long now();
- public V option(TypedOption option);
+ V option(TypedOption option);
- public void registerRpcServices(RpcServiceConfig4Server serverConfig,
- RpcServiceConfig4Client clientConfig);
+ void registerRpcServices(RpcServiceConfig4Server serverConfig,RpcServiceConfig4Client clientConfig);
- public default List mapPkId2Name(Collection ids) {
+ default List mapPkId2Name(Collection ids) {
List names = new ArrayList<>(ids.size());
for (Id id : ids) {
SchemaElement schema = this.propertyKey(id);
@@ -191,7 +248,7 @@ public default List mapPkId2Name(Collection ids) {
return names;
}
- public default List mapVlId2Name(Collection ids) {
+ default List mapVlId2Name(Collection ids) {
List names = new ArrayList<>(ids.size());
for (Id id : ids) {
SchemaElement schema = this.vertexLabel(id);
@@ -200,7 +257,7 @@ public default List mapVlId2Name(Collection ids) {
return names;
}
- public default List mapElId2Name(Collection ids) {
+ default List mapElId2Name(Collection ids) {
List names = new ArrayList<>(ids.size());
for (Id id : ids) {
SchemaElement schema = this.edgeLabel(id);
@@ -209,7 +266,7 @@ public default List mapElId2Name(Collection ids) {
return names;
}
- public default List mapIlId2Name(Collection ids) {
+ default List mapIlId2Name(Collection ids) {
List names = new ArrayList<>(ids.size());
for (Id id : ids) {
SchemaElement schema = this.indexLabel(id);
@@ -218,7 +275,7 @@ public default List mapIlId2Name(Collection ids) {
return names;
}
- public default List mapPkName2Id(Collection pkeys) {
+ default List mapPkName2Id(Collection pkeys) {
List ids = new ArrayList<>(pkeys.size());
for (String pkey : pkeys) {
PropertyKey propertyKey = this.propertyKey(pkey);
@@ -227,7 +284,7 @@ public default List mapPkName2Id(Collection pkeys) {
return ids;
}
- public default Id[] mapElName2Id(String[] edgeLabels) {
+ default Id[] mapElName2Id(String[] edgeLabels) {
Id[] ids = new Id[edgeLabels.length];
for (int i = 0; i < edgeLabels.length; i++) {
EdgeLabel edgeLabel = this.edgeLabel(edgeLabels[i]);
@@ -236,7 +293,7 @@ public default Id[] mapElName2Id(String[] edgeLabels) {
return ids;
}
- public default Id[] mapVlName2Id(String[] vertexLabels) {
+ default Id[] mapVlName2Id(String[] vertexLabels) {
Id[] ids = new Id[vertexLabels.length];
for (int i = 0; i < vertexLabels.length; i++) {
VertexLabel vertexLabel = this.vertexLabel(vertexLabels[i]);
@@ -245,7 +302,7 @@ public default Id[] mapVlName2Id(String[] vertexLabels) {
return ids;
}
- public static void registerTraversalStrategies(Class> clazz) {
+ static void registerTraversalStrategies(Class> clazz) {
TraversalStrategies strategies = null;
strategies = TraversalStrategies.GlobalCache
.getStrategies(Graph.class)
diff --git a/hugegraph-core/src/main/java/com/baidu/hugegraph/HugeGraphParams.java b/hugegraph-core/src/main/java/com/baidu/hugegraph/HugeGraphParams.java
index e307415635..c9853c90a0 100644
--- a/hugegraph-core/src/main/java/com/baidu/hugegraph/HugeGraphParams.java
+++ b/hugegraph-core/src/main/java/com/baidu/hugegraph/HugeGraphParams.java
@@ -38,38 +38,55 @@
*/
public interface HugeGraphParams {
- public HugeGraph graph();
- public String name();
- public GraphMode mode();
- public GraphReadMode readMode();
+ HugeGraph graph();
- public SchemaTransaction schemaTransaction();
- public GraphTransaction systemTransaction();
- public GraphTransaction graphTransaction();
+ String name();
- public GraphTransaction openTransaction();
- public void closeTx();
+ GraphMode mode();
- public boolean started();
- public boolean closed();
- public boolean initialized();
- public BackendFeatures backendStoreFeatures();
+ GraphReadMode readMode();
- public BackendStore loadSchemaStore();
- public BackendStore loadGraphStore();
- public BackendStore loadSystemStore();
+ SchemaTransaction schemaTransaction();
- public EventHub schemaEventHub();
- public EventHub graphEventHub();
- public EventHub indexEventHub();
+ GraphTransaction systemTransaction();
- public HugeConfig configuration();
+ GraphTransaction graphTransaction();
- public ServerInfoManager serverManager();
+ GraphTransaction openTransaction();
- public AbstractSerializer serializer();
- public Analyzer analyzer();
- public RateLimiter writeRateLimiter();
- public RateLimiter readRateLimiter();
- public RamTable ramtable();
+ void closeTx();
+
+ boolean started();
+
+ boolean closed();
+
+ boolean initialized();
+
+ BackendFeatures backendStoreFeatures();
+
+ BackendStore loadSchemaStore();
+
+ BackendStore loadGraphStore();
+
+ BackendStore loadSystemStore();
+
+ EventHub schemaEventHub();
+
+ EventHub graphEventHub();
+
+ EventHub indexEventHub();
+
+ HugeConfig configuration();
+
+ ServerInfoManager serverManager();
+
+ AbstractSerializer serializer();
+
+ Analyzer analyzer();
+
+ RateLimiter writeRateLimiter();
+
+ RateLimiter readRateLimiter();
+
+ RamTable ramtable();
}
diff --git a/hugegraph-core/src/main/java/com/baidu/hugegraph/StandardHugeGraph.java b/hugegraph-core/src/main/java/com/baidu/hugegraph/StandardHugeGraph.java
index 1336fd98d4..2b6d0f333d 100644
--- a/hugegraph-core/src/main/java/com/baidu/hugegraph/StandardHugeGraph.java
+++ b/hugegraph-core/src/main/java/com/baidu/hugegraph/StandardHugeGraph.java
@@ -112,26 +112,26 @@
public class StandardHugeGraph implements HugeGraph {
public static final Class>[] PROTECT_CLASSES = {
- StandardHugeGraph.class,
- StandardHugeGraph.StandardHugeGraphParams.class,
- TinkerPopTransaction.class,
- StandardHugeGraph.Txs.class,
- StandardHugeGraph.SysTransaction.class
+ StandardHugeGraph.class,
+ StandardHugeGraph.StandardHugeGraphParams.class,
+ TinkerPopTransaction.class,
+ StandardHugeGraph.Txs.class,
+ StandardHugeGraph.SysTransaction.class
};
public static final Set> ALLOWED_CONFIGS = ImmutableSet.of(
- CoreOptions.TASK_WAIT_TIMEOUT,
- CoreOptions.TASK_SYNC_DELETION,
- CoreOptions.TASK_TTL_DELETE_BATCH,
- CoreOptions.TASK_INPUT_SIZE_LIMIT,
- CoreOptions.TASK_RESULT_SIZE_LIMIT,
- CoreOptions.OLTP_CONCURRENT_THREADS,
- CoreOptions.OLTP_CONCURRENT_DEPTH,
- CoreOptions.OLTP_COLLECTION_TYPE,
- CoreOptions.VERTEX_DEFAULT_LABEL,
- CoreOptions.VERTEX_ENCODE_PK_NUMBER,
- CoreOptions.STORE_GRAPH,
- CoreOptions.STORE
+ CoreOptions.TASK_WAIT_TIMEOUT,
+ CoreOptions.TASK_SYNC_DELETION,
+ CoreOptions.TASK_TTL_DELETE_BATCH,
+ CoreOptions.TASK_INPUT_SIZE_LIMIT,
+ CoreOptions.TASK_RESULT_SIZE_LIMIT,
+ CoreOptions.OLTP_CONCURRENT_THREADS,
+ CoreOptions.OLTP_CONCURRENT_DEPTH,
+ CoreOptions.OLTP_COLLECTION_TYPE,
+ CoreOptions.VERTEX_DEFAULT_LABEL,
+ CoreOptions.VERTEX_ENCODE_PK_NUMBER,
+ CoreOptions.STORE_GRAPH,
+ CoreOptions.STORE
);
private static final Logger LOG = Log.logger(HugeGraph.class);
diff --git a/hugegraph-core/src/main/java/com/baidu/hugegraph/auth/AuthManager.java b/hugegraph-core/src/main/java/com/baidu/hugegraph/auth/AuthManager.java
index c10e11a099..7dddc8d58c 100644
--- a/hugegraph-core/src/main/java/com/baidu/hugegraph/auth/AuthManager.java
+++ b/hugegraph-core/src/main/java/com/baidu/hugegraph/auth/AuthManager.java
@@ -21,7 +21,6 @@
import java.util.List;
import java.util.Set;
-
import javax.security.sasl.AuthenticationException;
import com.baidu.hugegraph.auth.SchemaDefine.AuthElement;
@@ -29,63 +28,101 @@
public interface AuthManager {
- public boolean close();
-
- public Id createUser(HugeUser user);
- public Id updateUser(HugeUser user);
- public HugeUser deleteUser(Id id);
- public HugeUser findUser(String name);
- public HugeUser getUser(Id id);
- public List listUsers(List ids);
- public List listAllUsers(long limit);
-
- public Id createGroup(HugeGroup group);
- public Id updateGroup(HugeGroup group);
- public HugeGroup deleteGroup(Id id);
- public HugeGroup getGroup(Id id);
- public List listGroups(List ids);
- public List listAllGroups(long limit);
-
- public Id createTarget(HugeTarget target);
- public Id updateTarget(HugeTarget target);
- public HugeTarget deleteTarget(Id id);
- public HugeTarget getTarget(Id id);
- public List listTargets(List ids);
- public List listAllTargets(long limit);
-
- public Id createBelong(HugeBelong belong);
- public Id updateBelong(HugeBelong belong);
- public HugeBelong deleteBelong(Id id);
- public HugeBelong getBelong(Id id);
- public List listBelong(List ids);
- public List listAllBelong(long limit);
- public List listBelongByUser(Id user, long limit);
- public List listBelongByGroup(Id group, long limit);
-
- public Id createAccess(HugeAccess access);
- public Id updateAccess(HugeAccess access);
- public HugeAccess deleteAccess(Id id);
- public HugeAccess getAccess(Id id);
- public List listAccess(List ids);
- public List listAllAccess(long limit);
- public List listAccessByGroup(Id group, long limit);
- public List listAccessByTarget(Id target, long limit);
-
- public Id createProject(HugeProject project);
- public HugeProject deleteProject(Id id);
- public Id updateProject(HugeProject project);
- public Id projectAddGraphs(Id id, Set graphs);
- public Id projectRemoveGraphs(Id id, Set graphs);
- public HugeProject getProject(Id id);
- public List listAllProject(long limit);
-
- public HugeUser matchUser(String name, String password);
- public RolePermission rolePermission(AuthElement element);
-
- public String loginUser(String username, String password)
- throws AuthenticationException;
- public void logoutUser(String token);
-
- public UserWithRole validateUser(String username, String password);
- public UserWithRole validateUser(String token);
+ boolean close();
+
+ Id createUser(HugeUser user);
+
+ Id updateUser(HugeUser user);
+
+ HugeUser deleteUser(Id id);
+
+ HugeUser findUser(String name);
+
+ HugeUser getUser(Id id);
+
+ List listUsers(List ids);
+
+ List listAllUsers(long limit);
+
+ Id createGroup(HugeGroup group);
+
+ Id updateGroup(HugeGroup group);
+
+ HugeGroup deleteGroup(Id id);
+
+ HugeGroup getGroup(Id id);
+
+ List listGroups(List ids);
+
+ List listAllGroups(long limit);
+
+ Id createTarget(HugeTarget target);
+
+ Id updateTarget(HugeTarget target);
+
+ HugeTarget deleteTarget(Id id);
+
+ HugeTarget getTarget(Id id);
+
+ List listTargets(List ids);
+
+ List listAllTargets(long limit);
+
+ Id createBelong(HugeBelong belong);
+
+ Id updateBelong(HugeBelong belong);
+
+ HugeBelong deleteBelong(Id id);
+
+ HugeBelong getBelong(Id id);
+
+ List listBelong(List ids);
+
+ List listAllBelong(long limit);
+
+ List listBelongByUser(Id user, long limit);
+
+ List listBelongByGroup(Id group, long limit);
+
+ Id createAccess(HugeAccess access);
+
+ Id updateAccess(HugeAccess access);
+
+ HugeAccess deleteAccess(Id id);
+
+ HugeAccess getAccess(Id id);
+
+ List listAccess(List ids);
+
+ List listAllAccess(long limit);
+
+ List listAccessByGroup(Id group, long limit);
+
+ List listAccessByTarget(Id target, long limit);
+
+ Id createProject(HugeProject project);
+
+ HugeProject deleteProject(Id id);
+
+ Id updateProject(HugeProject project);
+
+ Id projectAddGraphs(Id id, Set graphs);
+
+ Id projectRemoveGraphs(Id id, Set graphs);
+
+ HugeProject getProject(Id id);
+
+ List listAllProject(long limit);
+
+ HugeUser matchUser(String name, String password);
+
+ RolePermission rolePermission(AuthElement element);
+
+ String loginUser(String username, String password) throws AuthenticationException;
+
+ void logoutUser(String token);
+
+ UserWithRole validateUser(String username, String password);
+
+ UserWithRole validateUser(String token);
}
diff --git a/hugegraph-core/src/main/java/com/baidu/hugegraph/auth/EntityManager.java b/hugegraph-core/src/main/java/com/baidu/hugegraph/auth/EntityManager.java
index c4b668e619..0ff8c0ca2c 100644
--- a/hugegraph-core/src/main/java/com/baidu/hugegraph/auth/EntityManager.java
+++ b/hugegraph-core/src/main/java/com/baidu/hugegraph/auth/EntityManager.java
@@ -73,7 +73,7 @@ private HugeGraph graph() {
}
private String unhideLabel() {
- return Hidden.unHide(this.label) ;
+ return Hidden.unHide(this.label);
}
public Id add(T entity) {
diff --git a/hugegraph-core/src/main/java/com/baidu/hugegraph/auth/RelationshipManager.java b/hugegraph-core/src/main/java/com/baidu/hugegraph/auth/RelationshipManager.java
index 1fb3232fd5..667927d026 100644
--- a/hugegraph-core/src/main/java/com/baidu/hugegraph/auth/RelationshipManager.java
+++ b/hugegraph-core/src/main/java/com/baidu/hugegraph/auth/RelationshipManager.java
@@ -77,7 +77,7 @@ private HugeGraph graph() {
}
private String unhideLabel() {
- return Hidden.unHide(this.label) ;
+ return Hidden.unHide(this.label);
}
public Id add(T relationship) {
diff --git a/hugegraph-core/src/main/java/com/baidu/hugegraph/auth/SchemaDefine.java b/hugegraph-core/src/main/java/com/baidu/hugegraph/auth/SchemaDefine.java
index 3ffc1d883a..dd3535021a 100644
--- a/hugegraph-core/src/main/java/com/baidu/hugegraph/auth/SchemaDefine.java
+++ b/hugegraph-core/src/main/java/com/baidu/hugegraph/auth/SchemaDefine.java
@@ -116,7 +116,7 @@ protected static String unhideField(String label, String key) {
return Hidden.unHide(label) + "_" + key;
}
- public static abstract class AuthElement implements Serializable {
+ public abstract static class AuthElement implements Serializable {
private static final long serialVersionUID = 8746691160192814973L;
@@ -241,7 +241,7 @@ protected Object[] asArray(List