Skip to content
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

Spring migration - Spring Data Gremlin #12581

Merged
merged 32 commits into from
Jul 22, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
adae704
add spring-data-gremlin
saragluna Jun 22, 2020
2525e20
fix build errors
saragluna Jun 23, 2020
9370bba
add sample
saragluna Jun 28, 2020
7db842a
Merge branch 'master' into feature/spring-data-gremlin
saragluna Jun 28, 2020
c6387ee
fix README.md
saragluna Jun 28, 2020
b21028e
change spring-data-gremlin to current version in springboot
saragluna Jun 28, 2020
3dab02b
fix build
saragluna Jun 28, 2020
9b2e096
fix build
saragluna Jun 28, 2020
bb9e0b1
change version tag for spring-data-gremlin from current to dependency
saragluna Jun 29, 2020
fdc3ab4
change back package name
saragluna Jun 29, 2020
a3b1782
Merge branch 'master' into feature/spring-data-gremlin
saragluna Jun 29, 2020
05a5020
suppress checkstyles
saragluna Jun 29, 2020
9c2f6d7
add -X flag
saragluna Jun 29, 2020
08a1b0b
try to fix readme
saragluna Jun 29, 2020
c561f60
try to fix javadoc
saragluna Jun 29, 2020
fbee68e
try to suppress attach-javadoc warnings for now
saragluna Jun 29, 2020
75f9c3d
fix ci build
saragluna Jun 30, 2020
881cff2
change module directory
saragluna Jun 30, 2020
df6c682
add update version tag for spring-data-gremlin in samples
saragluna Jun 30, 2020
906a03c
empty readme.md for now
saragluna Jul 6, 2020
4a95ad4
Merge branch 'master' into feature/spring-data-gremlin
saragluna Jul 6, 2020
7029a39
revert readme file
saragluna Jul 9, 2020
d2f72e1
Merge branch 'master' into feature/spring-data-gremlin
saragluna Jul 9, 2020
4af3fe9
Merge branch 'master' into feature/spring-data-gremlin
saragluna Jul 10, 2020
e0ef3aa
Merge branch 'master' into feature/spring-data-gremlin
saragluna Jul 13, 2020
07404b4
fix ci group id
saragluna Jul 13, 2020
f286352
Merge branch 'master' into feature/spring-data-gremlin
saragluna Jul 21, 2020
07d93b0
change gremlin group id / artifact id
saragluna Jul 21, 2020
2252658
Merge branch 'master' into feature/spring-data-gremlin
saragluna Jul 21, 2020
052cf20
add changelog files
saragluna Jul 21, 2020
f5d27b6
fix ci.yml files
saragluna Jul 21, 2020
09136d8
correct azure-spring-data-gremlin artifact id / group id in README file
saragluna Jul 21, 2020
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -492,6 +492,10 @@
<suppress checks="ConstantName" files="com.azure.spring.data.cosmos.repository|common.*\.java" />
<suppress checks="ConstantName|MemberName" files="com.azure.cosmos.UserRepositoryConfiguration|AppConfiguration|MyDocument.java" />

<!-- Checkstyle suppressions for spring-data-gremlin package -->
<suppress checks="PackageName" files="com.microsoft.spring.data.gremlin.*" />
<suppress checks="MethodName" files="com.microsoft.spring.data.gremlin.common.GremlinConfig.java" />

<!-- These suppressions were added due to limitations in our custom Checkstyle rules and should be addressed in the future. -->
<!-- API naming is too restrictive -->
<suppress checks="com.azure.tools.checkstyle.checks.ServiceClientCheck" files="com.azure.search.documents.indexes.SearchIndexerAsyncClient.java"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2077,6 +2077,13 @@
RCN_REDUNDANT_NULLCHECK_OF_NULL_VALUE"/>
</Match>

<Match>
<Or>
<Class name="com.microsoft.azure.telemetry.TelemetryEventData$EventData$CustomData"/> <!-- false positive -->
</Or>
<Bug pattern="UPM_UNCALLED_PRIVATE_METHOD"/>
</Match>


<!-- These fields are designed to be not written. They are for deserializing. -->
<Match>
Expand Down
5 changes: 5 additions & 0 deletions eng/jacoco-test-coverage/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -282,6 +282,11 @@
<artifactId>azure-spring-data-cosmos</artifactId>
<version>3.0.0-beta.1</version> <!-- {x-version-update;com.azure:azure-spring-data-cosmos;current} -->
</dependency>
<dependency>
<groupId>com.azure</groupId>
<artifactId>azure-spring-data-gremlin</artifactId>
<version>2.3.1-beta.1</version> <!-- {x-version-update;com.azure:azure-spring-data-gremlin;current} -->
</dependency>
</dependencies>
<build>
<plugins>
Expand Down
13 changes: 7 additions & 6 deletions eng/versioning/external_dependencies.txt
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ com.microsoft.azure:azure-servicebus-jms;0.0.2
com.microsoft.azure:qpid-proton-j-extensions;1.2.3
com.microsoft.rest:client-runtime;1.7.4
com.microsoft.rest.v2:client-runtime;2.1.1
com.microsoft.spring.data.gremlin:spring-data-gremlin;2.2.3
com.microsoft.azure:spring-data-cosmosdb;2.3.0
com.microsoft.spring.data.gremlin:spring-data-gremlin;2.3.0
com.squareup.okhttp3:okhttp;4.2.2
commons-codec:commons-codec;1.13
io.micrometer:micrometer-core;1.2.0
Expand All @@ -52,11 +52,13 @@ net.minidev:json-smart;2.3
org.apache.ant:ant;1.9.4
org.apache.avro:avro;1.9.2
org.apache.avro:avro-maven-plugin;1.9.2
org.apache.commons:commons-lang3;3.8.1
org.apache.httpcomponents:httpclient;4.3.6
org.apache.logging.log4j:log4j-api;2.11.1
org.apache.logging.log4j:log4j-core;2.11.1
org.apache.logging.log4j:log4j-slf4j-impl;2.13.0
org.apache.qpid:proton-j;0.33.4
org.apache.tinkerpop:gremlin-driver;3.2.4
org.asynchttpclient:async-http-client;2.10.5
org.codehaus.groovy:groovy-eclipse-batch;2.5.8-01
org.codehaus.groovy:groovy-eclipse-compiler;3.4.0-01
Expand All @@ -82,19 +84,20 @@ org.springframework.boot:spring-boot-starter-web;2.3.0.RELEASE
org.springframework.boot:spring-boot-starter;2.3.0.RELEASE
org.springframework.boot:spring-boot;2.3.0.RELEASE
org.springframework.boot:spring-boot-starter-parent;2.3.0.RELEASE
org.springframework.data:spring-data-commons;2.3.0.RELEASE
org.springframework.security:spring-security-config;5.3.2.RELEASE
org.springframework.security:spring-security-core;5.3.2.RELEASE
org.springframework.security:spring-security-web;5.3.2.RELEASE
org.springframework.security:spring-security-oauth2-client;5.3.2.RELEASE
org.springframework.security:spring-security-oauth2-core;5.3.2.RELEASE
org.springframework.security:spring-security-oauth2-jose;5.3.2.RELEASE
org.springframework:spring-web;5.2.6.RELEASE
org.springframework:spring-jms;5.2.6.RELEASE
org.springframework.data:spring-data-commons;2.3.0.RELEASE
org.springframework:spring-beans;5.2.6.RELEASE
org.springframework:spring-context;5.2.6.RELEASE
org.springframework:spring-core;5.2.6.RELEASE
org.springframework:spring-expression;5.2.6.RELEASE
org.springframework:spring-jms;5.2.6.RELEASE
org.springframework:spring-tx;5.2.6.RELEASE
org.springframework:spring-web;5.2.6.RELEASE
pl.pragmatists:JUnitParams;1.1.1

## Test dependency versions
Expand Down Expand Up @@ -152,7 +155,6 @@ org.junit.platform:junit-platform-testkit;1.6.2
org.junit.vintage:junit-vintage-engine;5.6.2
org.openjdk.jmh:jmh-core;1.22
org.openjdk.jmh:jmh-generator-annprocess;1.22
org.springframework:spring-context;5.2.6.RELEASE
org.spockframework:spock-core;1.3-groovy-2.5
org.testng:testng;6.14.3
uk.org.lidalia:slf4j-test;1.2.0
Expand All @@ -174,7 +176,6 @@ net.java.dev.jna:jna-platform;5.4.0
net.jonathangiles.tools:dependencyChecker-maven-plugin;1.0.4
net.jonathangiles.tools:whitelistgenerator-maven-plugin;1.0.1
org.apache.commons:commons-collections4;4.2
org.apache.commons:commons-lang3;3.8.1
org.apache.commons:commons-text;1.6
org.apache.maven.plugins:maven-antrun-plugin;1.8
org.apache.maven.plugins:maven-assembly-plugin;3.2.0
Expand Down
2 changes: 1 addition & 1 deletion eng/versioning/version_client.txt
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ com.azure:azure-spring-boot-test-aad;1.0.0;1.0.0
com.azure:azure-spring-boot-test-core;1.0.0;1.0.0
com.azure:azure-spring-boot-test-cosmosdb;1.0.0;1.0.0
com.azure:azure-spring-boot-test-keyvault;1.0.0;1.0.0
com.azure:azure-spring-data-gremlin;2.3.1-beta.1;2.3.1-beta.1
com.microsoft.azure:azure-spring-boot;2.3.2;2.3.3-beta.1
com.microsoft.azure:azure-spring-boot-starter;2.3.2;2.3.3-beta.1
com.microsoft.azure:azure-active-directory-spring-boot-starter;2.3.2;2.3.3-beta.1
Expand All @@ -63,7 +64,6 @@ com.microsoft.azure:azure-data-gremlin-spring-boot-starter;2.3.2;2.3.3-beta.1
com.microsoft.azure:azure-keyvault-secrets-spring-boot-starter;2.3.2;2.3.3-beta.1
com.microsoft.azure:azure-servicebus-jms-spring-boot-starter;2.3.2;2.3.3-beta.1
com.microsoft.azure:azure-spring-boot-metrics-starter;2.3.2;2.3.3-beta.1
com.microsoft.azure:spring-data-cosmosdb;3.0.0-beta.1;3.0.0-beta.1

# Unreleased dependencies: Copy the entry from above, prepend "unreleased_" and remove the current
# version. Unreleased dependencies are only valid for dependency versions.
Expand Down
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.azure</groupId>
<artifactId>azure-spring-data-gremlin</artifactId>
<version>2.3.1-beta.1</version> <!-- {x-version-update;com.azure:azure-spring-data-gremlin;current} -->
</dependency>

</dependencies>

</project>
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);
}
}
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;
}
}
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();
}
}
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;
}
}

Loading