aboutsummaryrefslogtreecommitdiffstats
path: root/sdc-distribution-client/src/main/java/org/onap/sdc/api
diff options
context:
space:
mode:
Diffstat (limited to 'sdc-distribution-client/src/main/java/org/onap/sdc/api')
-rw-r--r--sdc-distribution-client/src/main/java/org/onap/sdc/api/IDistributionClient.java21
-rw-r--r--sdc-distribution-client/src/main/java/org/onap/sdc/api/asdc/RegistrationRequest.java56
-rw-r--r--sdc-distribution-client/src/main/java/org/onap/sdc/api/asdc/ServerListResponse.java35
-rw-r--r--sdc-distribution-client/src/main/java/org/onap/sdc/api/consumer/IConfiguration.java50
-rw-r--r--sdc-distribution-client/src/main/java/org/onap/sdc/api/notification/INotificationData.java4
-rw-r--r--sdc-distribution-client/src/main/java/org/onap/sdc/api/notification/IVfModuleMetadata.java2
6 files changed, 49 insertions, 119 deletions
diff --git a/sdc-distribution-client/src/main/java/org/onap/sdc/api/IDistributionClient.java b/sdc-distribution-client/src/main/java/org/onap/sdc/api/IDistributionClient.java
index fe37dc1..ac48419 100644
--- a/sdc-distribution-client/src/main/java/org/onap/sdc/api/IDistributionClient.java
+++ b/sdc-distribution-client/src/main/java/org/onap/sdc/api/IDistributionClient.java
@@ -33,6 +33,11 @@ import org.onap.sdc.api.results.IDistributionClientResult;
import org.onap.sdc.api.notification.IArtifactInfo;
import org.onap.sdc.api.notification.IVfModuleMetadata;
+/**
+ Client for sending/receiving notifications/status related to distributions from SDC.
+ This client uses Kafka for communication with the topics.
+ For communication using DMAAP MR use latest version with major version = 1 (e.g. 1.4.5)
+ **/
public interface IDistributionClient {
/**
@@ -63,15 +68,13 @@ public interface IDistributionClient {
/**
* Stop distribution client <br>
* - stop polling notification topic <br>
- * - unregister topics (via ASDC) <br>
- * - delete keys from UEB
*
* @return IDistributionClientResult
*/
IDistributionClientResult stop();
/**
- * Downloads an artifact from ASDC Catalog <br>
+ * Downloads an artifact from SDC Catalog <br>
*
* @param artifactInfo
* @return IDistributionClientDownloadResult
@@ -80,10 +83,10 @@ public interface IDistributionClient {
/**
* Initialize the distribution client <br>
- * - fetch the UEB server list from ASDC <br>
- * - create keys in UEB <br>
- * - register for topics (via ASDC) <br>
+ * - get MessageBus server list from configuration <br>
+ * - validate artifact types against sdc server <br>
* - set the notification callback <br>
+ * - set up notification sender <br>
* <p>
* Note: all configuration fields are mandatory. <br>
* Password must be in clear text and not encrypted <br>
@@ -98,10 +101,10 @@ public interface IDistributionClient {
/**
* Initialize the distribution client <br>
- * - fetch the UEB server list from ASDC <br>
- * - create keys in UEB <br>
- * - register for topics (via ASDC) <br>
+ * - get MessageBus server list from configuration <br>
+ * - validate artifact types against sdc server <br>
* - set the notification callback <br>
+ * - set up notification sender <br>
* <p>
* Note: all configuration fields are mandatory. <br>
* Password must be in clear text and not encrypted <br>
diff --git a/sdc-distribution-client/src/main/java/org/onap/sdc/api/asdc/RegistrationRequest.java b/sdc-distribution-client/src/main/java/org/onap/sdc/api/asdc/RegistrationRequest.java
deleted file mode 100644
index 765da4c..0000000
--- a/sdc-distribution-client/src/main/java/org/onap/sdc/api/asdc/RegistrationRequest.java
+++ /dev/null
@@ -1,56 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * sdc-distribution-client
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.onap.sdc.api.asdc;
-
-import java.util.List;
-
-public class RegistrationRequest {
-
- private String apiPublicKey;
- private String distrEnvName;
- private Boolean isConsumerToSdcDistrStatusTopic;
- private List<String> distEnvEndPoints;
-
- public RegistrationRequest(String apiPublicKey, String distrEnvName, boolean isConsumerToSdcDistrStatusTopic, List<String> distEnvEndPoints) {
- this.apiPublicKey = apiPublicKey;
- this.distrEnvName = distrEnvName;
- this.isConsumerToSdcDistrStatusTopic = isConsumerToSdcDistrStatusTopic;
- this.distEnvEndPoints = distEnvEndPoints;
- }
-
- public String getApiPublicKey() {
- return apiPublicKey;
- }
-
- public String getDistrEnvName() {
- return distrEnvName;
- }
-
- public Boolean getIsConsumerToSdcDistrStatusTopic() {
- return isConsumerToSdcDistrStatusTopic;
- }
-
- public List<String> getDistEnvEndPoints() {
- return distEnvEndPoints;
- }
-
-
-}
diff --git a/sdc-distribution-client/src/main/java/org/onap/sdc/api/asdc/ServerListResponse.java b/sdc-distribution-client/src/main/java/org/onap/sdc/api/asdc/ServerListResponse.java
deleted file mode 100644
index b0cfb1e..0000000
--- a/sdc-distribution-client/src/main/java/org/onap/sdc/api/asdc/ServerListResponse.java
+++ /dev/null
@@ -1,35 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * sdc-distribution-client
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.onap.sdc.api.asdc;
-
-import java.util.List;
-import lombok.Getter;
-import lombok.NoArgsConstructor;
-import lombok.Setter;
-
-@Getter
-@Setter
-@NoArgsConstructor
-public class ServerListResponse {
-
- private List<String> uebServerList;
-
-}
diff --git a/sdc-distribution-client/src/main/java/org/onap/sdc/api/consumer/IConfiguration.java b/sdc-distribution-client/src/main/java/org/onap/sdc/api/consumer/IConfiguration.java
index e3013e2..84eb42b 100644
--- a/sdc-distribution-client/src/main/java/org/onap/sdc/api/consumer/IConfiguration.java
+++ b/sdc-distribution-client/src/main/java/org/onap/sdc/api/consumer/IConfiguration.java
@@ -22,6 +22,7 @@ package org.onap.sdc.api.consumer;
import java.util.List;
+import org.apache.kafka.common.KafkaException;
import org.onap.sdc.api.notification.INotificationData;
public interface IConfiguration {
@@ -30,7 +31,7 @@ public interface IConfiguration {
* without port), IP:port or FQDN (Fully Qualified Domain Name). * @return SDC
* Distribution Engine address.
*/
- String getAsdcAddress();
+ String getSdcAddress();
/**
* SDC Distribution Addresses from ONAP Component Values need to be set from
@@ -39,6 +40,32 @@ public interface IConfiguration {
List<String> getMsgBusAddress();
/**
+ * Kafka security.protocol
+ */
+ default String getKafkaSecurityProtocolConfig() {
+ return System.getenv().getOrDefault("SECURITY_PROTOCOL", "SASL_PLAINTEXT");
+ }
+
+ /**
+ * Kafka sasl.mechanism
+ */
+ default String getKafkaSaslMechanism() {
+ return System.getenv().getOrDefault("SASL_MECHANISM", "SCRAM-SHA-512");
+ }
+
+ /**
+ * Kafka sasl.jaas.config
+ */
+ default String getKafkaSaslJaasConfig() {
+ String saslJaasConfFromEnv = System.getenv("SASL_JAAS_CONFIG");
+ if(saslJaasConfFromEnv != null) {
+ return saslJaasConfFromEnv;
+ } else {
+ throw new KafkaException("sasl.jaas.config not set for Kafka Consumer");
+ }
+ }
+
+ /**
* User Name for SDC distribution consumer authentication.
*
* @return User Name.
@@ -64,7 +91,7 @@ public interface IConfiguration {
String getPassword();
/**
- * Distribution Client Polling Interval towards UEB in seconds. Can Be
+ * Distribution Client Polling Interval towards messaging bus in seconds. Can Be
* reconfigured in runtime.
*
* @return Distribution Client Polling Interval.
@@ -72,7 +99,7 @@ public interface IConfiguration {
int getPollingInterval();
/**
- * Distribution Client Timeout in seconds waiting to UEB server response in each
+ * Distribution Client Timeout in seconds waiting for messaging bus server response in each
* fetch interval. Can Be reconfigured in runtime.
*
* @return Distribution Client Timeout in seconds.
@@ -89,10 +116,10 @@ public interface IConfiguration {
List<String> getRelevantArtifactTypes();
/**
- * Returns the consumer group defined for this ECOMP component, if no consumer
+ * Returns the consumer group defined for this component, if no consumer
* group is defined return null.
*
- * @return Consumer group.
+ * @return SdcKafkaConsumer group.
*/
String getConsumerGroup();
@@ -105,7 +132,7 @@ public interface IConfiguration {
String getEnvironmentName();
/**
- * Unique ID of ECOMP component instance (e.x INSTAR name).
+ * Unique ID of component instance (e.x INSTAR name).
*
* @return
*/
@@ -113,7 +140,7 @@ public interface IConfiguration {
/**
* Return full path to Client's Key Store that contains either CA certificate or
- * the ASDC's public key (e.g /etc/keystore/asdc-client.jks) file will be
+ * the SDC's public key (e.g /etc/keystore/sdc-client.jks) file will be
* deployed with sdc-distribution jar.
*
* @return
@@ -147,15 +174,6 @@ public interface IConfiguration {
boolean isFilterInEmptyResources();
/**
- * By default, Distribution Client will use HTTPS (TLS 1.2) when connecting to
- * DMAAP. This param can be null, then default (HTTPS) behavior will be applied.
- * If set to false, distribution client will use HTTP when connecting to DMAAP.
- *
- * @return
- */
- Boolean isUseHttpsWithDmaap();
-
- /**
* By default, (false value) Distribution Client will trigger the regular
* registration towards SDC (register component as consumer to the
* SDC-DISTR-NOTIF-TOPIC-[ENV] topic and register component as producer to the
diff --git a/sdc-distribution-client/src/main/java/org/onap/sdc/api/notification/INotificationData.java b/sdc-distribution-client/src/main/java/org/onap/sdc/api/notification/INotificationData.java
index 5df130a..8c24ed4 100644
--- a/sdc-distribution-client/src/main/java/org/onap/sdc/api/notification/INotificationData.java
+++ b/sdc-distribution-client/src/main/java/org/onap/sdc/api/notification/INotificationData.java
@@ -25,7 +25,7 @@ import java.util.List;
public interface INotificationData {
/**
- * Global Distribution Identifier: UUID generated by ASDC per each distribution activation.<br>
+ * Global Distribution Identifier: UUID generated by SDC per each distribution activation.<br>
* Generated UUID is compliant with RFC 4122.<br>
* It is a 128-bit value formatted into blocks of hexadecimal digits separated by a hyphen ("-").<br>
* Ex.: AA97B177-9383-4934-8543-0F91A7A02836
@@ -45,7 +45,7 @@ public interface INotificationData {
String getServiceVersion();
/**
- * Global UUID generated by ASDC per each service version. Generated UUID is compliant with RFC 4122.<br>
+ * Global UUID generated by SDC per each service version. Generated UUID is compliant with RFC 4122.<br>
* It is a 128-bit value formatted into blocks of hexadecimal digits separated by a hyphen ("-").<br>
* Ex. : AA97B177-9383-4934-8543-0F91A7A02836
*/
diff --git a/sdc-distribution-client/src/main/java/org/onap/sdc/api/notification/IVfModuleMetadata.java b/sdc-distribution-client/src/main/java/org/onap/sdc/api/notification/IVfModuleMetadata.java
index 5347189..91415ce 100644
--- a/sdc-distribution-client/src/main/java/org/onap/sdc/api/notification/IVfModuleMetadata.java
+++ b/sdc-distribution-client/src/main/java/org/onap/sdc/api/notification/IVfModuleMetadata.java
@@ -45,7 +45,7 @@ public interface IVfModuleMetadata {
/**
* Global UUID of the VF Module.<br>
- * It is generated by ASDC per each new VF module version. Generated UUID is compliant with RFC 4122. It is a 128-bit value formatted into blocks of hexadecimal digits separated by a hyphen ("-").<br>
+ * It is generated by SDC per each new VF module version. Generated UUID is compliant with RFC 4122. It is a 128-bit value formatted into blocks of hexadecimal digits separated by a hyphen ("-").<br>
* Ex.: AA97B177-9383-4934-8543-0F91A7A02836
*/
String getVfModuleModelUUID();