diff --git a/java/github-proxy/pom.xml b/java/github-proxy/pom.xml
index 6a1810066..2a704ed7f 100644
--- a/java/github-proxy/pom.xml
+++ b/java/github-proxy/pom.xml
@@ -7,7 +7,7 @@
com.softwareag
lora
- 1.0.1
+ 1.1.0-SNAPSHOT
github-proxy
diff --git a/java/lora-codec-acs-switch/pom.xml b/java/lora-codec-acs-switch/pom.xml
index 8348c74c1..8ed7176ae 100644
--- a/java/lora-codec-acs-switch/pom.xml
+++ b/java/lora-codec-acs-switch/pom.xml
@@ -7,7 +7,7 @@
com.softwareag
lora
- 1.0.1
+ 1.1.0-SNAPSHOT
lora-codec-acs-switch
diff --git a/java/lora-codec-atim-th/pom.xml b/java/lora-codec-atim-th/pom.xml
index 45c08201a..317f52623 100644
--- a/java/lora-codec-atim-th/pom.xml
+++ b/java/lora-codec-atim-th/pom.xml
@@ -7,7 +7,7 @@
com.softwareag
lora
- 1.0.1
+ 1.1.0-SNAPSHOT
lora-codec-atim-th
diff --git a/java/lora-codec-atim-tm2d/pom.xml b/java/lora-codec-atim-tm2d/pom.xml
index e7ae519e9..03f205173 100644
--- a/java/lora-codec-atim-tm2d/pom.xml
+++ b/java/lora-codec-atim-tm2d/pom.xml
@@ -7,7 +7,7 @@
com.softwareag
lora
- 1.0.1
+ 1.1.0-SNAPSHOT
lora-codec-atim-tm2d
diff --git a/java/lora-codec-atim-tmxd/pom.xml b/java/lora-codec-atim-tmxd/pom.xml
index 48ec0ee05..726ed17be 100644
--- a/java/lora-codec-atim-tmxd/pom.xml
+++ b/java/lora-codec-atim-tmxd/pom.xml
@@ -7,7 +7,7 @@
com.softwareag
lora
- 1.0.1
+ 1.1.0-SNAPSHOT
lora-codec-atim-tmxd
diff --git a/java/lora-codec-axioma/pom.xml b/java/lora-codec-axioma/pom.xml
index 51ff49336..6dc88fdf9 100644
--- a/java/lora-codec-axioma/pom.xml
+++ b/java/lora-codec-axioma/pom.xml
@@ -7,7 +7,7 @@
com.softwareag
lora
- 1.0.1
+ 1.1.0-SNAPSHOT
lora-codec-axioma
diff --git a/java/lora-codec-c8y/pom.xml b/java/lora-codec-c8y/pom.xml
index 96f42fd96..b477456e5 100644
--- a/java/lora-codec-c8y/pom.xml
+++ b/java/lora-codec-c8y/pom.xml
@@ -8,7 +8,7 @@
com.softwareag
lora
- 1.0.1
+ 1.1.0-SNAPSHOT
lora-codec-c8y
diff --git a/java/lora-codec-cayennelpp/pom.xml b/java/lora-codec-cayennelpp/pom.xml
index cfaac63a7..4d20b4940 100644
--- a/java/lora-codec-cayennelpp/pom.xml
+++ b/java/lora-codec-cayennelpp/pom.xml
@@ -7,7 +7,7 @@
com.softwareag
lora
- 1.0.1
+ 1.1.0-SNAPSHOT
lora-codec-cayennelpp
diff --git a/java/lora-codec-elsys/pom.xml b/java/lora-codec-elsys/pom.xml
index 259329608..ed8badef8 100644
--- a/java/lora-codec-elsys/pom.xml
+++ b/java/lora-codec-elsys/pom.xml
@@ -7,7 +7,7 @@
com.softwareag
lora
- 1.0.1
+ 1.1.0-SNAPSHOT
lora-codec-elsys
diff --git a/java/lora-codec-example/pom.xml b/java/lora-codec-example/pom.xml
index 130ebfbb6..30f14db0c 100644
--- a/java/lora-codec-example/pom.xml
+++ b/java/lora-codec-example/pom.xml
@@ -7,7 +7,7 @@
com.softwareag
lora
- 1.0.1
+ 1.1.0-SNAPSHOT
lora-codec-example
diff --git a/java/lora-codec-lansitec/pom.xml b/java/lora-codec-lansitec/pom.xml
index 3d2af9a20..1f506919c 100644
--- a/java/lora-codec-lansitec/pom.xml
+++ b/java/lora-codec-lansitec/pom.xml
@@ -7,7 +7,7 @@
com.softwareag
lora
- 1.0.1
+ 1.1.0-SNAPSHOT
lora-codec-lansitec
diff --git a/java/lora-codec-ms/pom.xml b/java/lora-codec-ms/pom.xml
index 1ae2d4942..c81219446 100644
--- a/java/lora-codec-ms/pom.xml
+++ b/java/lora-codec-ms/pom.xml
@@ -7,7 +7,7 @@
com.softwareag
lora
- 1.0.1
+ 1.1.0-SNAPSHOT
lora-codec-ms
diff --git a/java/lora-codec-nke/pom.xml b/java/lora-codec-nke/pom.xml
index ec1ed63ce..2e798e053 100644
--- a/java/lora-codec-nke/pom.xml
+++ b/java/lora-codec-nke/pom.xml
@@ -7,7 +7,7 @@
com.softwareag
lora
- 1.0.1
+ 1.1.0-SNAPSHOT
lora-codec-nke
diff --git a/java/lora-codec-pyrescom-classair/pom.xml b/java/lora-codec-pyrescom-classair/pom.xml
index c97685dfb..7806e2228 100644
--- a/java/lora-codec-pyrescom-classair/pom.xml
+++ b/java/lora-codec-pyrescom-classair/pom.xml
@@ -7,7 +7,7 @@
com.softwareag
lora
- 1.0.1
+ 1.1.0-SNAPSHOT
lora-codec-pyrescom
diff --git a/java/lora-codec-semtech/pom.xml b/java/lora-codec-semtech/pom.xml
index 20123f2c1..009b50fc6 100644
--- a/java/lora-codec-semtech/pom.xml
+++ b/java/lora-codec-semtech/pom.xml
@@ -7,7 +7,7 @@
com.softwareag
lora
- 1.0.1
+ 1.1.0-SNAPSHOT
lora-codec-semtech
diff --git a/java/lora-codec-senlab/pom.xml b/java/lora-codec-senlab/pom.xml
index 77ce0c366..663298688 100644
--- a/java/lora-codec-senlab/pom.xml
+++ b/java/lora-codec-senlab/pom.xml
@@ -7,7 +7,7 @@
com.softwareag
lora
- 1.0.1
+ 1.1.0-SNAPSHOT
lora-codec-senlab
diff --git a/java/lora-interface/pom.xml b/java/lora-interface/pom.xml
index af69d9308..f4be1c8e4 100644
--- a/java/lora-interface/pom.xml
+++ b/java/lora-interface/pom.xml
@@ -7,7 +7,7 @@
com.softwareag
lora
- 1.0.1
+ 1.1.0-SNAPSHOT
lora-interface
diff --git a/java/lora-ns-actility/pom.xml b/java/lora-ns-actility/pom.xml
index 50f8ebef1..19c0877dc 100644
--- a/java/lora-ns-actility/pom.xml
+++ b/java/lora-ns-actility/pom.xml
@@ -6,7 +6,7 @@
com.softwareag
lora
- 1.0.1
+ 1.1.0-SNAPSHOT
lora-ns-actility
diff --git a/java/lora-ns-actility/src/main/java/lora/ns/actility/ActilityConnector.java b/java/lora-ns-actility/src/main/java/lora/ns/actility/ActilityConnector.java
index 34d352a65..9279781c7 100644
--- a/java/lora-ns-actility/src/main/java/lora/ns/actility/ActilityConnector.java
+++ b/java/lora-ns-actility/src/main/java/lora/ns/actility/ActilityConnector.java
@@ -46,6 +46,7 @@
import lora.ns.actility.api.model.appserver.AppServerCustomHttpHeadersInner;
import lora.ns.actility.api.model.appserver.AppServerHttpLorawanDestination;
import lora.ns.actility.api.model.appserver.AppServerStrategy;
+import lora.ns.actility.api.model.appserver.AppServerUpdate;
import lora.ns.actility.api.model.appserver.DownlinkSecurity;
import lora.ns.actility.api.model.basestation.Bs;
import lora.ns.actility.api.model.basestation.BsAppServersInner;
@@ -65,7 +66,6 @@
import lora.ns.actility.api.model.device.DeviceProfiles;
import lora.ns.actility.api.model.device.DeviceProfilesBriefsInner;
import lora.ns.actility.common.RandomUtils;
-import lora.ns.actility.rest.ActilityAdminService;
import lora.ns.actility.rest.ActilityServiceAccountService;
import lora.ns.actility.rest.JwtInterceptor;
import lora.ns.connector.LNSAbstractConnector;
@@ -78,13 +78,13 @@
@Slf4j
public class ActilityConnector extends LNSAbstractConnector {
+ private static final String THINGPARK_WIRELESS_REST = "/thingpark/wireless/rest";
private static final String AS_ID_PROPERTY = "asId";
private static final String AS_KEY_PROPERTY = "asKey";
private static final String AS_ID_PREFIX = "cumulocity-";
private static final String DEFAULT_AS_ID = "cumulocity";
private static final String DEFAULT_AS_KEY = "4e0ff46472fa1840f25368c066e94769";
- private ActilityAdminService actilityAdminService;
private ActilityServiceAccountService actilityServiceAccountService;
private DeviceApi deviceApi;
@@ -108,12 +108,7 @@ public DXAdminJWTInterceptor(String clientId, String clientSecret) {
protected String getToken() {
Token token = null;
try {
- if (this.clientId.contains("/")) {
- token = actilityServiceAccountService.getToken("client_credentials", this.clientId,
- this.clientSecret);
- } else {
- token = actilityAdminService.getToken("client_credentials", this.clientId, this.clientSecret);
- }
+ token = actilityServiceAccountService.getToken("client_credentials", this.clientId, this.clientSecret);
} catch (Exception e) {
throw new LoraException("Couldn't get JWT", e);
}
@@ -176,14 +171,8 @@ protected void init() {
final ch.qos.logback.classic.Logger serviceLogger = (ch.qos.logback.classic.Logger) LoggerFactory
.getLogger("lora.ns.actility");
serviceLogger.setLevel(ch.qos.logback.classic.Level.DEBUG);
- var feignBuilder = Feign.builder().client(new Client.Default(getSSLSocketFactory(), getHostnameVerifier()))
- .decoder(new JacksonDecoder(objectMapper)).encoder(new FormEncoder())
- .logger(new Slf4jLogger("lora.ns.actility")).logLevel(Level.FULL)
- .requestInterceptor(template -> template.header("Content-Type",
- "application/x-www-form-urlencoded"));
String url = properties.getProperty("url");
- actilityAdminService = feignBuilder.target(ActilityAdminService.class, url + "/thingpark/dx/admin/latest/api/");
- feignBuilder = Feign.builder().client(new Client.Default(getSSLSocketFactory(), getHostnameVerifier()))
+ var feignBuilder = Feign.builder().client(new Client.Default(getSSLSocketFactory(), getHostnameVerifier()))
.decoder(new JacksonDecoder(objectMapper)).encoder(new FormEncoder())
.logger(new Slf4jLogger("lora.ns.actility")).logLevel(Level.FULL)
.requestInterceptor(template -> template.header("Content-Type",
@@ -199,9 +188,9 @@ protected void init() {
feignBuilder = feignBuilder.requestInterceptor(new DXAdminJWTInterceptor(properties.getProperty("username"),
properties.getProperty("password")));
- deviceApi = feignBuilder.target(DeviceApi.class, url + "/thingpark/wireless/rest");
- appServerApi = feignBuilder.target(AppServerApi.class, url + "/thingpark/wireless/rest");
- baseStationApi = feignBuilder.target(BaseStationApi.class, url + "/thingpark/wireless/rest");
+ deviceApi = feignBuilder.target(DeviceApi.class, url + THINGPARK_WIRELESS_REST);
+ appServerApi = feignBuilder.target(AppServerApi.class, url + THINGPARK_WIRELESS_REST);
+ baseStationApi = feignBuilder.target(BaseStationApi.class, url + THINGPARK_WIRELESS_REST);
downlinkV2Api = feignBuilder.target(DownlinkApi.class, url + "/thingpark/lrc/rest");
}
@@ -244,16 +233,18 @@ public void provisionDevice(DeviceProvisioning deviceProvisioning) {
@Override
public void configureRoutings(String url, String tenant, String login, String password) {
- log.info("Configuring routings to: {} with credentials: {}:{}", url, login, password);
+ String domain = properties.getProperty("domain");
+ String group = properties.getProperty("group");
+ log.info("Configuring routings to: {} with credentials: {}:{} and domain {}:{}", url, login, password, domain,
+ group);
var appServers = appServerApi.getAppServersByName(tenant + "-" + getId());
if (!appServers.getBriefs().isEmpty()) {
// Update appserver
- this.appServerId = appServers.getBriefs().iterator().next().getID();
- String uid = appServers.getBriefs().iterator().next().getID().split("\\.")[1];
- var appServer = new AppServer();
- appServer.setType(null);
- appServer.setContentType(ContentTypeEnum.JSON);
+ var currentAppServer = appServers.getBriefs().iterator().next();
+ this.appServerId = currentAppServer.getID();
+ String uid = currentAppServer.getID().split("\\.")[1];
+ var appServer = new AppServerUpdate();
appServer.setCustomHttpHeaders(new ArrayList<>());
appServer.addCustomHttpHeadersItem(new AppServerCustomHttpHeadersInner().name("Authentication")
.value("Basic " + Base64.getEncoder()
@@ -261,8 +252,11 @@ public void configureRoutings(String url, String tenant, String login, String pa
appServer.setDestinations(new ArrayList<>());
appServer.addDestinationsItem(new AppServerHttpLorawanDestination().addAddressesItem(url + "/uplink")
.strategy(AppServerStrategy.SEQUENTIAL).ports("*"));
- appServer.downlinkSecurity(new DownlinkSecurity(getAsId(), getAsKey()));
- // appServerApi.updateAppServer(uid, appServer); <- doesn't work, 403
+ if (properties.containsKey("domain")) {
+ appServer.addDomainsItem(new Domain().name(properties.getProperty("domain"))
+ .group(new DomainGroup().name(properties.getProperty("group"))));
+ }
+ appServerApi.updateAppServer(uid, appServer);
} else {
// Create appserver
var appServer = new AppServer().contentType(ContentTypeEnum.JSON)
@@ -287,7 +281,7 @@ public void removeRoutings() {
@Override
public void deprovisionDevice(String deveui) {
- deviceApi.deleteDevice("e" + deveui);
+ deviceApi.deleteDevice("e" + deveui.toUpperCase());
}
@Override
diff --git a/java/lora-ns-actility/src/main/java/lora/ns/actility/api/AppServerApi.java b/java/lora-ns-actility/src/main/java/lora/ns/actility/api/AppServerApi.java
index ef2824ec8..e04eb7879 100644
--- a/java/lora-ns-actility/src/main/java/lora/ns/actility/api/AppServerApi.java
+++ b/java/lora-ns-actility/src/main/java/lora/ns/actility/api/AppServerApi.java
@@ -3,6 +3,7 @@
import feign.Param;
import feign.RequestLine;
import lora.ns.actility.api.model.appserver.AppServer;
+import lora.ns.actility.api.model.appserver.AppServerUpdate;
import lora.ns.actility.api.model.appserver.AppServers;
public interface AppServerApi {
@@ -16,5 +17,5 @@ public interface AppServerApi {
AppServer createAppServer(AppServer appServer);
@RequestLine("PUT /subscriptions/mine/appServers/{appServerUID}")
- AppServer updateAppServer(@Param("appServerUID") String appServerUID, AppServer appServer);
+ AppServer updateAppServer(@Param("appServerUID") String appServerUID, AppServerUpdate appServer);
}
diff --git a/java/lora-ns-actility/src/main/java/lora/ns/actility/api/model/appserver/AppServerUpdate.java b/java/lora-ns-actility/src/main/java/lora/ns/actility/api/model/appserver/AppServerUpdate.java
new file mode 100644
index 000000000..6eeab21c9
--- /dev/null
+++ b/java/lora-ns-actility/src/main/java/lora/ns/actility/api/model/appserver/AppServerUpdate.java
@@ -0,0 +1,111 @@
+package lora.ns.actility.api.model.appserver;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import com.fasterxml.jackson.annotation.JsonInclude;
+
+import lora.ns.actility.api.model.common.Domain;
+
+public class AppServerUpdate {
+ private List customHttpHeaders = new ArrayList<>();
+
+ private List destinations = new ArrayList<>();
+
+ private List domains = new ArrayList<>();
+
+ public AppServerUpdate customHttpHeaders(List customHttpHeaders) {
+
+ this.customHttpHeaders = customHttpHeaders;
+ return this;
+ }
+
+ public AppServerUpdate addCustomHttpHeadersItem(AppServerCustomHttpHeadersInner customHttpHeadersItem) {
+ if (this.customHttpHeaders == null) {
+ this.customHttpHeaders = new ArrayList<>();
+ }
+ this.customHttpHeaders.add(customHttpHeadersItem);
+ return this;
+ }
+
+ /**
+ * A list of HTTP headers to be added in HTTP requests sent to the application.
+ * Accept, Host, User-Agent, Content-Length and Content-Type headers cannot be
+ * customized. A given HTTP header name can be configured only once (case
+ * insensitive). This field is not returned if the authenticated user has domain
+ * restrictions but does not have `<Subscription>/a` access
+ * right.
+ *
+ * @return customHttpHeaders
+ **/
+ @javax.annotation.Nullable
+ @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
+
+ public List getCustomHttpHeaders() {
+ return customHttpHeaders;
+ }
+
+ @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
+ public void setCustomHttpHeaders(List customHttpHeaders) {
+ this.customHttpHeaders = customHttpHeaders;
+ }
+
+ public AppServerUpdate destinations(List destinations) {
+
+ this.destinations = destinations;
+ return this;
+ }
+
+ public AppServerUpdate addDestinationsItem(AppServerHttpLorawanDestination destinationsItem) {
+ if (this.destinations == null) {
+ this.destinations = new ArrayList<>();
+ }
+ this.destinations.add(destinationsItem);
+ return this;
+ }
+
+ /**
+ * Application Server destination
+ *
+ * @return destinations
+ **/
+ @javax.annotation.Nullable
+ @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
+
+ public List getDestinations() {
+ return destinations;
+ }
+
+ @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
+ public void setDestinations(List destinations) {
+ this.destinations = destinations;
+ }
+
+ public AppServerUpdate domains(List domains) {
+
+ this.domains = domains;
+ return this;
+ }
+
+ public AppServerUpdate addDomainsItem(Domain domainsItem) {
+ if (this.domains == null) {
+ this.domains = new ArrayList<>();
+ }
+ this.domains.add(domainsItem);
+ return this;
+ }
+
+ /**
+ * List of associated domains. The list cannot contain more than one domain for
+ * a given group.
+ *
+ * @return domains
+ **/
+ @javax.annotation.Nullable
+ @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
+
+ public List getDomains() {
+ return domains;
+ }
+
+}
diff --git a/java/lora-ns-actility/src/main/java/lora/ns/actility/rest/ActilityAdminService.java b/java/lora-ns-actility/src/main/java/lora/ns/actility/rest/ActilityAdminService.java
deleted file mode 100644
index 3353609b2..000000000
--- a/java/lora-ns-actility/src/main/java/lora/ns/actility/rest/ActilityAdminService.java
+++ /dev/null
@@ -1,13 +0,0 @@
-package lora.ns.actility.rest;
-
-import feign.Headers;
-import feign.Param;
-import feign.RequestLine;
-import lora.ns.actility.api.model.common.Token;
-
-public interface ActilityAdminService {
- @Headers("Content-Type: application/x-www-form-urlencoded")
- @RequestLine("POST oauth/token")
- Token getToken(@Param("grant_type") String grantType, @Param("client_id") String clientId,
- @Param("client_secret") String clientSecret);
-}
diff --git a/java/lora-ns-chirpstack/pom.xml b/java/lora-ns-chirpstack/pom.xml
index 9e2a8195d..e7be45cfb 100644
--- a/java/lora-ns-chirpstack/pom.xml
+++ b/java/lora-ns-chirpstack/pom.xml
@@ -9,7 +9,7 @@
com.softwareag
lora
- 1.0.1
+ 1.1.0-SNAPSHOT
lora-ns-chirpstack
diff --git a/java/lora-ns-generic/pom.xml b/java/lora-ns-generic/pom.xml
index 75d3df880..d18acaa8a 100644
--- a/java/lora-ns-generic/pom.xml
+++ b/java/lora-ns-generic/pom.xml
@@ -9,7 +9,7 @@
com.softwareag
lora
- 1.0.1
+ 1.1.0-SNAPSHOT
lora-ns-generic
diff --git a/java/lora-ns-kerlink/pom.xml b/java/lora-ns-kerlink/pom.xml
index 51ee61704..f30c799a3 100644
--- a/java/lora-ns-kerlink/pom.xml
+++ b/java/lora-ns-kerlink/pom.xml
@@ -6,7 +6,7 @@
com.softwareag
lora
- 1.0.1
+ 1.1.0-SNAPSHOT
lora-ns-kerlink
diff --git a/java/lora-ns-liveobjects/pom.xml b/java/lora-ns-liveobjects/pom.xml
index dc19e9494..bc181b034 100644
--- a/java/lora-ns-liveobjects/pom.xml
+++ b/java/lora-ns-liveobjects/pom.xml
@@ -9,7 +9,7 @@
com.softwareag
lora
- 1.0.1
+ 1.1.0-SNAPSHOT
lora-ns-liveobjects
diff --git a/java/lora-ns-loriot/pom.xml b/java/lora-ns-loriot/pom.xml
index bf10ad9d4..245429d76 100644
--- a/java/lora-ns-loriot/pom.xml
+++ b/java/lora-ns-loriot/pom.xml
@@ -6,7 +6,7 @@
com.softwareag
lora
- 1.0.1
+ 1.1.0-SNAPSHOT
lora-ns-loriot
diff --git a/java/lora-ns-ms/pom.xml b/java/lora-ns-ms/pom.xml
index 2377675e4..c5d1f213a 100644
--- a/java/lora-ns-ms/pom.xml
+++ b/java/lora-ns-ms/pom.xml
@@ -7,7 +7,7 @@
com.softwareag
lora
- 1.0.1
+ 1.1.0-SNAPSHOT
lora-ns-ms
diff --git a/java/lora-ns-objenious/pom.xml b/java/lora-ns-objenious/pom.xml
index 167e20d92..d6aa4224d 100644
--- a/java/lora-ns-objenious/pom.xml
+++ b/java/lora-ns-objenious/pom.xml
@@ -6,7 +6,7 @@
com.softwareag
lora
- 1.0.1
+ 1.1.0-SNAPSHOT
lora-ns-objenious
diff --git a/java/lora-ns-orbiwise/pom.xml b/java/lora-ns-orbiwise/pom.xml
index e0e49b508..db62670f1 100644
--- a/java/lora-ns-orbiwise/pom.xml
+++ b/java/lora-ns-orbiwise/pom.xml
@@ -6,7 +6,7 @@
com.softwareag
lora
- 1.0.1
+ 1.1.0-SNAPSHOT
lora-ns-orbiwise
diff --git a/java/lora-ns-ttn/pom.xml b/java/lora-ns-ttn/pom.xml
index 4a408ca49..aaefe30a1 100644
--- a/java/lora-ns-ttn/pom.xml
+++ b/java/lora-ns-ttn/pom.xml
@@ -6,7 +6,7 @@
com.softwareag
lora
- 1.0.1
+ 1.1.0-SNAPSHOT
lora-ns-ttn
diff --git a/java/pom.xml b/java/pom.xml
index 85108d68a..a0eb93394 100644
--- a/java/pom.xml
+++ b/java/pom.xml
@@ -5,7 +5,7 @@
4.0.0
com.softwareag
lora
- 1.0.1
+ 1.1.0-SNAPSHOT
pom
github-proxy