package org.onap.holmes.engine.resources;
-import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import javax.servlet.http.HttpServletRequest;
import org.onap.holmes.common.dcae.entity.SecurityInfo;
import org.onap.holmes.common.dropwizard.ioc.utils.ServiceLocatorHolder;
import org.onap.holmes.dsa.dmaappolling.Subscriber;
-import org.onap.holmes.engine.dmaappolling.SubscriberAction;
+import org.onap.holmes.engine.dmaap.SubscriberAction;
import org.onap.holmes.engine.request.DmaapConfigRequest;
@Service
+ " and <b>url</b>. Both fields are required.") DmaapConfigRequest config,
@Context HttpServletRequest request){
String url = config.getUrl();
- if (url.startsWith("http://")) {
+ if (url.startsWith("http://") || url.startsWith("https://")) {
Subscriber subscriber = new Subscriber();
subscriber.setTopic(config.getName());
subscriber.setUrl(url);
return "{\"message\": \"Succeeded!\", \"topic\": \"" + config.getName() + "\"}";
}
- return "{\"message\": \"Only the HTTP protocol is supported!\"}";
+ return "{\"message\": \"Only the HTTP or HTTPS protocol is supported!\"}";
}
@DELETE
+ " and <b>url</b>. Both fields are required.") DmaapConfigRequest config,
@Context HttpServletRequest request){
String url = config.getUrl();
- if (url.startsWith("http://")) {
+ if (url.startsWith("http://") || url.startsWith("https://")) {
SecurityInfo securityInfo = new SecurityInfo();
SecurityInfo.DmaapInfo dmaapInfo = new SecurityInfo().new DmaapInfo();
dmaapInfo.setTopicUrl(config.getUrl());
DcaeConfigurationsCache.addPubSecInfo(config.getName(), securityInfo);
return "{\"message\": \"Succeeded!\", \"topic\": \"" + config.getName() + "\"}";
}
- return "{\"message\": \"Only the HTTP protocol is supported!\"}";
+ return "{\"message\": \"Only the HTTP or HTTPS protocol is supported!\"}";
}
}