diff options
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.java | 46 | ||||
-rw-r--r-- | sdc-distribution-client/src/main/java/org/onap/sdc/api/consumer/IConfiguration.java | 54 |
2 files changed, 53 insertions, 47 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 ac48419..1115c91 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 @@ -76,16 +76,18 @@ public interface IDistributionClient { /** * Downloads an artifact from SDC Catalog <br> * - * @param artifactInfo + * @param artifactInfo - the info about the Artifact to be downloaded * @return IDistributionClientDownloadResult */ IDistributionClientDownloadResult download(IArtifactInfo artifactInfo); /** * Initialize the distribution client <br> - * - get MessageBus server list from configuration <br> + * - validate the config <br> + * - set up the SDC connector <br> * - validate artifact types against sdc server <br> * - set the notification callback <br> + * - get and set up the Kafka endpoint and topics <br> * - set up notification sender <br> * <p> * Note: all configuration fields are mandatory. <br> @@ -93,17 +95,19 @@ public interface IDistributionClient { * ONAP-Component MUST store password as SHA-2 (256) hashed with * dynamically generated salt value <br> * - * @param conf - * @param callback + * @param conf - contains configuration + * @param callback - the NotificationCallback logic * @return IDistributionClientResult */ IDistributionClientResult init(IConfiguration conf, INotificationCallback callback); /** * Initialize the distribution client <br> - * - get MessageBus server list from configuration <br> + * - validate the config <br> + * - set up the SDC connector <br> * - validate artifact types against sdc server <br> * - set the notification callback <br> + * - get and set up the Kafka endpoint and topics <br> * - set up notification sender <br> * <p> * Note: all configuration fields are mandatory. <br> @@ -111,9 +115,9 @@ public interface IDistributionClient { * ONAP-Component MUST store password as SHA-2 (256) hashed with * dynamically generated salt value <br> * - * @param conf - * @param notificationCallback - * @param statusCallback + * @param conf - contains configuration + * @param notificationCallback - the NotificationCallback logic + * @param statusCallback - the StatusCallback logic * @return IDistributionClientResult */ IDistributionClientResult init(IConfiguration conf, INotificationCallback notificationCallback, @@ -123,7 +127,7 @@ public interface IDistributionClient { * Build and publish Distribution Download Status event to Distribution * Status Topic * - * @param statusMessage + * @param statusMessage - the status message to be published * @return IDistributionClientResult */ IDistributionClientResult sendDownloadStatus(IDistributionStatusMessage statusMessage); @@ -132,8 +136,8 @@ public interface IDistributionClient { * Build and publish Distribution Download Status event to Distribution * Status Topic With Error Reason. * - * @param statusMessage - * @param errorReason + * @param statusMessage - the status message to be published + * @param errorReason - the error details * @return IDistributionClientResult */ IDistributionClientResult sendDownloadStatus(IDistributionStatusMessage statusMessage, String errorReason); @@ -142,7 +146,7 @@ public interface IDistributionClient { * Build and publish Distribution Deployment Status event to Distribution * Status Topic * - * @param statusMessage + * @param statusMessage - the status message to be published * @return IDistributionClientResult */ IDistributionClientResult sendDeploymentStatus(IDistributionStatusMessage statusMessage); @@ -151,8 +155,8 @@ public interface IDistributionClient { * Build and publish Distribution Deployment Status event to Distribution * Status Topic With Error Reason. * - * @param statusMessage - * @param errorReason + * @param statusMessage - the status message to be published + * @param errorReason - the error details * @return IDistributionClientResult */ IDistributionClientResult sendDeploymentStatus(IDistributionStatusMessage statusMessage, String errorReason); @@ -161,7 +165,7 @@ public interface IDistributionClient { * Build and publish Distribution Component Status event to Distribution * Status Topic * - * @param statusMessage + * @param statusMessage - the status message to be published * @return IDistributionClientResult */ IDistributionClientResult sendComponentDoneStatus(IComponentDoneStatusMessage statusMessage); @@ -170,8 +174,8 @@ public interface IDistributionClient { * Build and publish Distribution Component Status event to Distribution * Status Topic With Error Reason. * - * @param statusMessage - * @param errorReason + * @param statusMessage - the status message to be published + * @param errorReason - the error details * @return IDistributionClientResult */ IDistributionClientResult sendComponentDoneStatus(IComponentDoneStatusMessage statusMessage, String errorReason); @@ -181,7 +185,7 @@ public interface IDistributionClient { * Build and publish Distribution Final Status event to Distribution * Status Topic * - * @param statusMessage + * @param statusMessage - the status message to be published * @return IDistributionClientResult */ IDistributionClientResult sendFinalDistrStatus(IFinalDistrStatusMessage statusMessage); @@ -191,8 +195,8 @@ public interface IDistributionClient { * Build and publish Distribution Final Status event to Distribution * Status Topic With Error Reason. * - * @param statusMessage - * @param errorReason + * @param statusMessage - the status message to be published + * @param errorReason - the error details * @return IDistributionClientResult */ IDistributionClientResult sendFinalDistrStatus(IFinalDistrStatusMessage statusMessage, String errorReason); @@ -204,7 +208,7 @@ public interface IDistributionClient { * @deprecated Method is deprecated due to VF Module changes. Only backward * compatibility is supported.<br> * - * @param artifactPayload + * @param artifactPayload - the payload of artifact data * @return IVfModuleMetadata list */ @Deprecated 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 84eb42b..184dca4 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 @@ -34,27 +34,28 @@ public interface IConfiguration { String getSdcAddress(); /** - * SDC Distribution Addresses from ONAP Component Values need to be set from - * impl - */ - List<String> getMsgBusAddress(); - - /** - * Kafka security.protocol + * Kafka security protocol to be used by the client to Auth towards the kafka cluster + * + * @return Kafka security.protocol. Default is SASL_PLAINTEXT */ default String getKafkaSecurityProtocolConfig() { return System.getenv().getOrDefault("SECURITY_PROTOCOL", "SASL_PLAINTEXT"); } /** - * Kafka sasl.mechanism + * Kafka SASL mechanism to be used by the client to Auth towards the kafka cluster + * + * @return Kafka sasl.mechanism. Default is SCRAM-SHA-512 */ default String getKafkaSaslMechanism() { return System.getenv().getOrDefault("SASL_MECHANISM", "SCRAM-SHA-512"); } /** - * Kafka sasl.jaas.config + * Kafka JAAS config to be used by the client to Auth towards the kafka cluster. + * If overridden, must align with sasl.jaas.config convention set out by the sasl.mechanism being used + * otherwise, mandatory setting of the environment variable SASL_JAAS_CONFIG is required to provide default behaviour + * @return Kafka sasl.jaas.config */ default String getKafkaSaslJaasConfig() { String saslJaasConfFromEnv = System.getenv("SASL_JAAS_CONFIG"); @@ -77,7 +78,7 @@ public interface IConfiguration { * default (HTTPS) behavior will be applied. If set to false, distribution * client will use HTTP when connecting to SDC. * - * @return + * @return default is true */ default Boolean isUseHttpsWithSDC() { return true; @@ -116,8 +117,7 @@ public interface IConfiguration { List<String> getRelevantArtifactTypes(); /** - * Returns the consumer group defined for this component, if no consumer - * group is defined return null. + * Returns the kafka consumer group defined for this component. * * @return SdcKafkaConsumer group. */ @@ -127,14 +127,14 @@ public interface IConfiguration { * Returns the environment name (testing, production etc...). Can Be * reconfigured in runtime. * - * @return + * @return Environment name */ String getEnvironmentName(); /** - * Unique ID of component instance (e.x INSTAR name). + * Returns the kafka consumer id defined for this component. * - * @return + * @return SdcKafkaConsumer id. */ String getConsumerID(); @@ -143,12 +143,14 @@ public interface IConfiguration { * the SDC's public key (e.g /etc/keystore/sdc-client.jks) file will be * deployed with sdc-distribution jar. * - * @return + * @return Client's Key store path */ String getKeyStorePath(); /** - * @return Returns client's Key Store password + * Return the password for the Client's Key Store + * + * @return Client's Key Store password */ String getKeyStorePassword(); @@ -156,7 +158,7 @@ public interface IConfiguration { * Sets whether SDC server TLS authentication is activated. If set to false, Key * Store path and password are not needed to be set. * - * @return + * @return true by default */ boolean activateServerTLSAuth(); @@ -169,12 +171,12 @@ public interface IConfiguration { * Setting the method to false will activate the legacy behavior, in which empty * resources are not part of the notification.<br> * - * @return + * @return true or false */ boolean isFilterInEmptyResources(); /** - * By default, (false value) Distribution Client will trigger the regular + * By default: false. 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 * SDC-DISTR-STATUS-TOPIC-[ENV]).<br> @@ -182,7 +184,7 @@ public interface IConfiguration { * this component request to be consumer and producer of the * SDC-DISTR-STATUS-TOPIC-[ENV] topic.<br> * - * @return + * @return false by default */ default boolean isConsumeProduceStatusTopic() { return false; @@ -193,7 +195,7 @@ public interface IConfiguration { * available proxies from JVM arguments. If set to false, distribution client * will use proxy parameters configured through properties file. * - * @return + * @return false by default */ default Boolean isUseSystemProxy() { return false; @@ -205,7 +207,7 @@ public interface IConfiguration { * Client will register the proxy configuration with the HttpClient instance * using HTTP and route requests through the proxy. * - * @return + * @return Hostname of the http proxy */ String getHttpProxyHost(); @@ -216,7 +218,7 @@ public interface IConfiguration { * register the proxy configuration with the HttpClient instance using HTTP and * route requests through the proxy. * - * @return + * @return Port of the http proxy */ int getHttpProxyPort(); @@ -226,7 +228,7 @@ public interface IConfiguration { * Client will register the proxy configuration with the HttpClient instance * using HTTPS and route requests through the proxy. * - * @return + * @return Hostname of the https proxy */ String getHttpsProxyHost(); @@ -237,7 +239,7 @@ public interface IConfiguration { * register the proxy configuration with the HttpClient instance using HTTPS and * route requests through the proxy. * - * @return + * @return Port of the https proxy */ int getHttpsProxyPort(); } |