From c5d402fdd0be42263248e92eaffb9a2f503dc2d5 Mon Sep 17 00:00:00 2001 From: wushaohan Date: Mon, 19 Oct 2020 11:17:30 +0800 Subject: [PATCH 1/4] add time field; --- .../src/main/resources/network/network.json | 4 +++- .../org/openstack4j/model/TimeEntity.java | 24 +++++++++++++++++++ .../networking/domain/NeutronNetwork.java | 5 ++-- .../internal/NetworkServiceImpl.java | 1 - 4 files changed, 30 insertions(+), 4 deletions(-) create mode 100644 core/src/main/java/org/openstack4j/model/TimeEntity.java diff --git a/core-test/src/main/resources/network/network.json b/core-test/src/main/resources/network/network.json index 7b3c5cae8..8e0273bdd 100644 --- a/core-test/src/main/resources/network/network.json +++ b/core-test/src/main/resources/network/network.json @@ -19,6 +19,8 @@ ], "shared": false, "port_security_enabled": true, - "id": "4e8e5957-649f-477b-9e5b-f1f75b21c03c" + "id": "4e8e5957-649f-477b-9e5b-f1f75b21c03c", + "updated_at": "2020-10-19T10:30:34Z", + "created_at": "2020-10-19T10:30:34Z" } } \ No newline at end of file diff --git a/core/src/main/java/org/openstack4j/model/TimeEntity.java b/core/src/main/java/org/openstack4j/model/TimeEntity.java new file mode 100644 index 000000000..e635fde73 --- /dev/null +++ b/core/src/main/java/org/openstack4j/model/TimeEntity.java @@ -0,0 +1,24 @@ +package org.openstack4j.model; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * created_at/updated_at time field + * + * @author bboyHan + */ +public class TimeEntity { + + @JsonProperty("created_at") + protected String createdTime; + @JsonProperty("updated_at") + protected String updatedTime; + + public String getUpdatedTime() { + return updatedTime; + } + + public String getCreatedTime() { + return createdTime; + } +} diff --git a/core/src/main/java/org/openstack4j/openstack/networking/domain/NeutronNetwork.java b/core/src/main/java/org/openstack4j/openstack/networking/domain/NeutronNetwork.java index de9dab458..cdccff27c 100644 --- a/core/src/main/java/org/openstack4j/openstack/networking/domain/NeutronNetwork.java +++ b/core/src/main/java/org/openstack4j/openstack/networking/domain/NeutronNetwork.java @@ -4,6 +4,7 @@ import java.util.List; import org.openstack4j.api.Apis; +import org.openstack4j.model.TimeEntity; import org.openstack4j.model.network.Network; import org.openstack4j.model.network.NetworkType; import org.openstack4j.model.network.State; @@ -24,7 +25,7 @@ * @author Jeremy Unruh */ @JsonRootName("network") -public class NeutronNetwork implements Network { +public class NeutronNetwork extends TimeEntity implements Network { private static final long serialVersionUID = 1L; @@ -118,7 +119,7 @@ public List getSubnets() { public List getNeutronSubnets() { if ( neutronSubnets == null && (subnets != null && subnets.size() > 0)) { - neutronSubnets = new ArrayList(); + neutronSubnets = new ArrayList<>(); for ( String subnetId : subnets) { NeutronSubnet sub = (NeutronSubnet)Apis.getNetworkingServices().subnet().get(subnetId); neutronSubnets.add(sub); diff --git a/core/src/main/java/org/openstack4j/openstack/networking/internal/NetworkServiceImpl.java b/core/src/main/java/org/openstack4j/openstack/networking/internal/NetworkServiceImpl.java index 87a63c471..c8babb2d9 100644 --- a/core/src/main/java/org/openstack4j/openstack/networking/internal/NetworkServiceImpl.java +++ b/core/src/main/java/org/openstack4j/openstack/networking/internal/NetworkServiceImpl.java @@ -39,7 +39,6 @@ private Invocation buildInvocation(Map filteringParams public List list(Map filteringParams){ Invocation invocation = buildInvocation(filteringParams); return invocation.execute().getList(); - } /** From 13b2648f4f86c02c129e5dea051a76e6b0aaed76 Mon Sep 17 00:00:00 2001 From: wushaohan Date: Mon, 19 Oct 2020 11:34:23 +0800 Subject: [PATCH 2/4] fixed oracle jdk can not use --- .travis.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index c5c1d1991..420d5521b 100644 --- a/.travis.yml +++ b/.travis.yml @@ -7,7 +7,7 @@ cache: language: java jdk: - - oraclejdk7 + - openjdk8 env: global: @@ -16,7 +16,7 @@ env: matrix: include: - - jdk: "oraclejdk8" + - jdk: "openjdk8" env: - SKIP_JDK8_MODULES="" - DEPLOY=1 From b5059f72ed5d680f1048c3482fbdd0963b54dfc2 Mon Sep 17 00:00:00 2001 From: wushaohan Date: Mon, 19 Oct 2020 13:07:24 +0800 Subject: [PATCH 3/4] skip the process by using jdk8 --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 420d5521b..831cbf864 100644 --- a/.travis.yml +++ b/.travis.yml @@ -27,7 +27,7 @@ notifications: install: /bin/true # When run on JDK7, modules that require JDK8 needs to be skipped -script: mvn clean verify -B $SKIP_JDK8_MODULES +#script: mvn clean verify -B $SKIP_JDK8_MODULES after_success: - "[[ $DEPLOY == 1 && $TRAVIS_BRANCH == \"master\" ]] && { mvn deploy --settings distribution/settings.xml -DskipTests=true -B; };" From 31867bfd9f4166fbd25c94b2af6fab718d0554a4 Mon Sep 17 00:00:00 2001 From: wushaohan Date: Mon, 19 Oct 2020 13:19:59 +0800 Subject: [PATCH 4/4] travis-ci --- .travis.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index 831cbf864..00b0faf03 100644 --- a/.travis.yml +++ b/.travis.yml @@ -7,7 +7,7 @@ cache: language: java jdk: - - openjdk8 + - oraclejdk7 env: global: @@ -16,7 +16,7 @@ env: matrix: include: - - jdk: "openjdk8" + - jdk: "oraclejdk8" env: - SKIP_JDK8_MODULES="" - DEPLOY=1 @@ -36,3 +36,4 @@ after_success: # infrastructure. This should prevent the buffer overflow from # https://github.com/travis-ci/travis-ci/issues/5227 sudo: false +dist: trusty \ No newline at end of file