-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Spring migration - Spring Data Gremlin #12581
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
saragluna
merged 32 commits into
Azure:master
from
saragluna:feature/spring-data-gremlin
Jul 22, 2020
Merged
Changes from 26 commits
Commits
Show all changes
32 commits
Select commit
Hold shift + click to select a range
adae704
add spring-data-gremlin
saragluna 2525e20
fix build errors
saragluna 9370bba
add sample
saragluna 7db842a
Merge branch 'master' into feature/spring-data-gremlin
saragluna c6387ee
fix README.md
saragluna b21028e
change spring-data-gremlin to current version in springboot
saragluna 3dab02b
fix build
saragluna 9b2e096
fix build
saragluna bb9e0b1
change version tag for spring-data-gremlin from current to dependency
saragluna fdc3ab4
change back package name
saragluna a3b1782
Merge branch 'master' into feature/spring-data-gremlin
saragluna 05a5020
suppress checkstyles
saragluna 9c2f6d7
add -X flag
saragluna 08a1b0b
try to fix readme
saragluna c561f60
try to fix javadoc
saragluna fbee68e
try to suppress attach-javadoc warnings for now
saragluna 75f9c3d
fix ci build
saragluna 881cff2
change module directory
saragluna df6c682
add update version tag for spring-data-gremlin in samples
saragluna 906a03c
empty readme.md for now
saragluna 4a95ad4
Merge branch 'master' into feature/spring-data-gremlin
saragluna 7029a39
revert readme file
saragluna d2f72e1
Merge branch 'master' into feature/spring-data-gremlin
saragluna 4af3fe9
Merge branch 'master' into feature/spring-data-gremlin
saragluna e0ef3aa
Merge branch 'master' into feature/spring-data-gremlin
saragluna 07404b4
fix ci group id
saragluna f286352
Merge branch 'master' into feature/spring-data-gremlin
saragluna 07d93b0
change gremlin group id / artifact id
saragluna 2252658
Merge branch 'master' into feature/spring-data-gremlin
saragluna 052cf20
add changelog files
saragluna f5d27b6
fix ci.yml files
saragluna 09136d8
correct azure-spring-data-gremlin artifact id / group id in README file
saragluna File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
46 changes: 46 additions & 0 deletions
46
sdk/spring/azure-spring-boot-samples/azure-spring-data-sample-gremlin-web-service/pom.xml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,46 @@ | ||
| <?xml version="1.0" encoding="UTF-8"?> | ||
| <project xmlns="http://maven.apache.org/POM/4.0.0" | ||
| xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
| xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> | ||
| <modelVersion>4.0.0</modelVersion> | ||
|
|
||
| <parent> | ||
| <groupId>org.springframework.boot</groupId> | ||
| <artifactId>spring-boot-starter-parent</artifactId> | ||
| <version>2.3.0.RELEASE</version> <!-- {x-version-update;org.springframework.boot:spring-boot-starter-parent;external_dependency} --> | ||
| </parent> | ||
|
|
||
| <groupId>com.azure</groupId> | ||
| <artifactId>azure-spring-data-sample-gremlin-web-service</artifactId> | ||
| <name>Spring Data gremlin - Web Service</name> | ||
|
|
||
| <dependencies> | ||
| <dependency> | ||
| <groupId>org.springframework.boot</groupId> | ||
| <artifactId>spring-boot</artifactId> | ||
| </dependency> | ||
|
|
||
| <dependency> | ||
| <groupId>org.springframework.boot</groupId> | ||
| <artifactId>spring-boot-autoconfigure</artifactId> | ||
| </dependency> | ||
|
|
||
| <dependency> | ||
| <groupId>org.springframework.boot</groupId> | ||
| <artifactId>spring-boot-starter-web</artifactId> | ||
| </dependency> | ||
|
|
||
| <dependency> | ||
| <groupId>com.jayway.jsonpath</groupId> | ||
| <artifactId>json-path</artifactId> | ||
| </dependency> | ||
|
|
||
| <dependency> | ||
| <groupId>com.microsoft.spring.data.gremlin</groupId> | ||
| <artifactId>spring-data-gremlin</artifactId> | ||
| <version>2.3.1-beta.1</version> <!-- {x-version-update;com.microsoft.spring.data.gremlin:spring-data-gremlin;current} --> | ||
| </dependency> | ||
|
|
||
| </dependencies> | ||
|
|
||
| </project> |
15 changes: 15 additions & 0 deletions
15
...-web-service/src/main/java/com/microsoft/spring/data/gremlin/web/service/Application.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,15 @@ | ||
| // Copyright (c) Microsoft Corporation. All rights reserved. | ||
| // Licensed under the MIT License. | ||
|
|
||
| package com.microsoft.spring.data.gremlin.web.service; | ||
|
|
||
| import org.springframework.boot.SpringApplication; | ||
| import org.springframework.boot.autoconfigure.SpringBootApplication; | ||
|
|
||
| @SpringBootApplication | ||
| public class Application { | ||
|
|
||
| public static void main(String[] args) { | ||
| SpringApplication.run(Application.class, args); | ||
| } | ||
| } |
105 changes: 105 additions & 0 deletions
105
...src/main/java/com/microsoft/spring/data/gremlin/web/service/config/GremlinProperties.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,105 @@ | ||
| // Copyright (c) Microsoft Corporation. All rights reserved. | ||
| // Licensed under the MIT License. | ||
|
|
||
| package com.microsoft.spring.data.gremlin.web.service.config; | ||
|
|
||
| import org.apache.tinkerpop.gremlin.driver.ser.Serializers; | ||
| import org.springframework.boot.context.properties.ConfigurationProperties; | ||
|
|
||
| @ConfigurationProperties("gremlin") | ||
| public class GremlinProperties { | ||
| private String endpoint; | ||
|
|
||
| private int port; | ||
|
|
||
| private String username; | ||
|
|
||
| private String password; | ||
|
|
||
| private boolean sslEnabled; | ||
|
|
||
| private boolean telemetryAllowed = true; | ||
|
|
||
| private String serializer = Serializers.GRAPHSON.toString(); | ||
|
|
||
| private int maxContentLength; | ||
|
|
||
| public GremlinProperties() { | ||
| } | ||
|
|
||
| public GremlinProperties(String endpoint, int port, String username, String password, boolean sslEnabled, | ||
| boolean telemetryAllowed, String serializer, int maxContentLength) { | ||
| this.endpoint = endpoint; | ||
| this.port = port; | ||
| this.username = username; | ||
| this.password = password; | ||
| this.sslEnabled = sslEnabled; | ||
| this.telemetryAllowed = telemetryAllowed; | ||
| this.serializer = serializer; | ||
| this.maxContentLength = maxContentLength; | ||
| } | ||
|
|
||
| public String getEndpoint() { | ||
| return endpoint; | ||
| } | ||
|
|
||
| public void setEndpoint(String endpoint) { | ||
| this.endpoint = endpoint; | ||
| } | ||
|
|
||
| public int getPort() { | ||
| return port; | ||
| } | ||
|
|
||
| public void setPort(int port) { | ||
| this.port = port; | ||
| } | ||
|
|
||
| public String getUsername() { | ||
| return username; | ||
| } | ||
|
|
||
| public void setUsername(String username) { | ||
| this.username = username; | ||
| } | ||
|
|
||
| public String getPassword() { | ||
| return password; | ||
| } | ||
|
|
||
| public void setPassword(String password) { | ||
| this.password = password; | ||
| } | ||
|
|
||
| public boolean isSslEnabled() { | ||
| return sslEnabled; | ||
| } | ||
|
|
||
| public void setSslEnabled(boolean sslEnabled) { | ||
| this.sslEnabled = sslEnabled; | ||
| } | ||
|
|
||
| public boolean isTelemetryAllowed() { | ||
| return telemetryAllowed; | ||
| } | ||
|
|
||
| public void setTelemetryAllowed(boolean telemetryAllowed) { | ||
| this.telemetryAllowed = telemetryAllowed; | ||
| } | ||
|
|
||
| public String getSerializer() { | ||
| return serializer; | ||
| } | ||
|
|
||
| public void setSerializer(String serializer) { | ||
| this.serializer = serializer; | ||
| } | ||
|
|
||
| public int getMaxContentLength() { | ||
| return maxContentLength; | ||
| } | ||
|
|
||
| public void setMaxContentLength(int maxContentLength) { | ||
| this.maxContentLength = maxContentLength; | ||
| } | ||
| } |
36 changes: 36 additions & 0 deletions
36
...ava/com/microsoft/spring/data/gremlin/web/service/config/UserRepositoryConfiguration.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,36 @@ | ||
| // Copyright (c) Microsoft Corporation. All rights reserved. | ||
| // Licensed under the MIT License. | ||
|
|
||
| package com.microsoft.spring.data.gremlin.web.service.config; | ||
|
|
||
| import com.microsoft.spring.data.gremlin.common.GremlinConfig; | ||
| import com.microsoft.spring.data.gremlin.config.AbstractGremlinConfiguration; | ||
| import com.microsoft.spring.data.gremlin.repository.config.EnableGremlinRepositories; | ||
| import org.springframework.beans.factory.annotation.Autowired; | ||
| import org.springframework.boot.context.properties.EnableConfigurationProperties; | ||
| import org.springframework.context.annotation.Configuration; | ||
| import org.springframework.context.annotation.PropertySource; | ||
|
|
||
| @Configuration | ||
| @EnableGremlinRepositories(basePackages = "com.microsoft.azure.spring.data.gremlin.web.service.repository") | ||
| @EnableConfigurationProperties(GremlinProperties.class) | ||
| @PropertySource("classpath:application.properties") | ||
| public class UserRepositoryConfiguration extends AbstractGremlinConfiguration { | ||
|
|
||
| @Autowired | ||
| private GremlinProperties gremlinProps; | ||
|
|
||
| @Override | ||
| public GremlinConfig getGremlinConfig() { | ||
| return GremlinConfig.defaultBuilder() | ||
| .endpoint(gremlinProps.getEndpoint()) | ||
| .port(gremlinProps.getPort()) | ||
| .username(gremlinProps.getUsername()) | ||
| .password(gremlinProps.getPassword()) | ||
| .sslEnabled(gremlinProps.isSslEnabled()) | ||
| .telemetryAllowed(gremlinProps.isTelemetryAllowed()) | ||
| .serializer(gremlinProps.getSerializer()) | ||
| .maxContentLength(gremlinProps.getMaxContentLength()) | ||
| .build(); | ||
| } | ||
| } |
44 changes: 44 additions & 0 deletions
44
...vice/src/main/java/com/microsoft/spring/data/gremlin/web/service/domain/MicroService.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,44 @@ | ||
| // Copyright (c) Microsoft Corporation. All rights reserved. | ||
| // Licensed under the MIT License. | ||
|
|
||
| package com.microsoft.spring.data.gremlin.web.service.domain; | ||
|
|
||
| import com.microsoft.spring.data.gremlin.annotation.Vertex; | ||
| import org.springframework.data.annotation.Id; | ||
|
|
||
| import java.util.HashMap; | ||
| import java.util.Map; | ||
|
|
||
| @Vertex | ||
| public class MicroService { | ||
|
|
||
| @Id | ||
| private String id; | ||
|
|
||
| private Map<String, String> properties = new HashMap<>(); | ||
|
|
||
| public MicroService() { | ||
| } | ||
|
|
||
| public MicroService(String id, Map<String, String> properties) { | ||
| this.id = id; | ||
| this.properties = properties; | ||
| } | ||
|
|
||
| public String getId() { | ||
| return id; | ||
| } | ||
|
|
||
| public void setId(String id) { | ||
| this.id = id; | ||
| } | ||
|
|
||
| public Map<String, String> getProperties() { | ||
| return properties; | ||
| } | ||
|
|
||
| public void setProperties(Map<String, String> properties) { | ||
| this.properties = properties; | ||
| } | ||
| } | ||
|
|
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.