* limitations under the License.
* ============LICENSE_END=========================================================
*/
+
package org.onap.aai.web;
import com.att.eelf.configuration.EELFLogger;
import com.att.eelf.configuration.EELFManager;
+
+import java.io.UnsupportedEncodingException;
+import java.util.Base64;
+
import org.apache.commons.lang.StringUtils;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
import org.springframework.http.MediaType;
import org.springframework.web.client.RestTemplate;
-import java.io.UnsupportedEncodingException;
-import java.util.Base64;
-
@Configuration
public class EventClientPublisher {
@Value("${dmaap.ribbon.contentType:application/json}")
private String contentType;
- @Bean(name="dmaapRestTemplate")
- public RestTemplate dmaapRestTemplate(){
+ @Bean(name = "dmaapRestTemplate")
+ public RestTemplate dmaapRestTemplate() {
return new RestTemplate();
}
- @Bean(name="dmaapHeaders")
- public HttpHeaders dmaapHeaders() throws UnsupportedEncodingException
- {
+ @Bean(name = "dmaapHeaders")
+ public HttpHeaders dmaapHeaders() throws UnsupportedEncodingException {
HttpHeaders httpHeaders = new HttpHeaders();
httpHeaders.setContentType(MediaType.APPLICATION_JSON);
- if(username != null && password != null){
+ if (username != null && password != null) {
- if(!StringUtils.EMPTY.equals(username) && !StringUtils.EMPTY.equals(password)){
+ if (!StringUtils.EMPTY.equals(username) && !StringUtils.EMPTY.equals(password)) {
byte[] userPass = (username + ":" + password).getBytes("UTF-8");