* limitations under the License.
* ============LICENSE_END=========================================================
*/
-
+
package org.openecomp.mso.client.dmaap;
-import java.io.FileNotFoundException;
import java.io.IOException;
import java.util.Base64;
import java.util.Map;
+import java.util.Optional;
import java.util.Properties;
-import org.openecomp.mso.bpmn.core.PropertyConfiguration;
+import org.openecomp.mso.client.defaultproperties.DefaultDmaapPropertiesImpl;
import org.springframework.core.io.ClassPathResource;
import org.springframework.core.io.Resource;
protected final EELFLogger auditLogger = EELFManager.getInstance().getAuditLogger();
protected final Map<String, String> msoProperties;
protected final Properties properties;
- public DmaapClient(String filepath) throws FileNotFoundException, IOException {
+ public DmaapClient(String filepath) throws IOException {
Resource resource = new ClassPathResource(filepath);
- DmaapProperties dmaapProperties = DmaapPropertiesLoader.getInstance().getImpl();
+ DmaapProperties dmaapProperties = DmaapPropertiesLoader.getInstance().getNewImpl();
if (dmaapProperties == null) {
+ auditLogger.error("No RestProperty implementation found on classpath, loading default");
dmaapProperties = new DefaultDmaapPropertiesImpl();
}
this.msoProperties = dmaapProperties.getProperties();
this.properties.put("password", this.deobfuscatePassword(this.getPassword()));
this.properties.put("username", this.getUserName());
this.properties.put("topic", this.getTopic());
+ if (this.getHost().isPresent()) {
+ this.properties.put("host", this.getHost().get());
+ }
}
protected String deobfuscatePassword(String password) {
public abstract String getUserName();
public abstract String getPassword();
public abstract String getTopic();
+ public abstract Optional<String> getHost();
}