*/
package org.onap.so.adapters.network;
-
+
import java.net.MalformedURLException;
import java.net.URL;
copyCreateSubnetIdMap (subnetIdMap),
copyNrb (networkRollback));
} catch (Exception e) {
- error = "Error sending createNetwork notification " + e.getMessage ();
- LOGGER.error (MessageEnum.RA_CREATE_NETWORK_NOTIF_EXC, "", "", MsoLogger.ErrorCode.DataError, "Exception sending createNetwork notification", e);
- alarmLogger.sendAlarm ("MsoInternalError", MsoAlarmLogger.CRITICAL, error);
+ error = CREATE_NETWORK_ERROR_MSG + e.getMessage ();
+ LOGGER.error (MessageEnum.RA_CREATE_NETWORK_NOTIF_EXC, "", "", MsoLogger.ErrorCode.DataError, CREATE_NETWORK_EXCEPTON_MSG, e);
+ alarmLogger.sendAlarm (MSO_INTERNAL_ERROR_MSG, MsoAlarmLogger.CRITICAL, error);
}
return;
}
* ================================================================================
* Copyright (C) 2017 - 2018 AT&T Intellectual Property. All rights reserved.
* ================================================================================
+ * Modifications Copyright (C) 2018 IBM.
+ * ================================================================================
* 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
* limitations under the License.
* ============LICENSE_END=========================================================
*/
-
+
package org.onap.so.adapters.openstack;
import org.onap.so.security.MSOSpringFirewall;
http.csrf().disable()
.authorizeRequests()
.antMatchers("/manage/health","/manage/info").permitAll()
- .antMatchers("/**").hasAnyRole(StringUtils.collectionToDelimitedString(getRoles(),",").toString())
+ .antMatchers("/**").hasAnyRole(StringUtils.collectionToDelimitedString(getRoles(),","))
.and()
.httpBasic();
}
private String errorMessage;
private T returnObject;
- @Override
- public String toString() {
- return new ToStringBuilder(this).append("statusCode", statusCode).append("errorMessage", errorMessage)
- .append("returnObject", returnObject).toString();
- }
+
public GenericValetResponse(int statusCode, String errorMessage, T obj) {
super();
this.statusCode = statusCode;
public GenericValetResponse() {
this(-1, "not set", null);
}
+ @Override
+ public String toString() {
+ return new ToStringBuilder(this).append("statusCode", statusCode).append("errorMessage", errorMessage)
+ .append("returnObject", returnObject).toString();
+ }
public void setErrorMessage(String errorMessage) {
this.errorMessage = errorMessage;
}
* limitations under the License.
* ============LICENSE_END=========================================================
*/
-
+
package org.onap.so.adapters.valet.beans;
import java.io.Serializable;
@JsonProperty("environment")
private String environment;
@JsonProperty("files")
- private Map<String, Object> files = new HashMap<String, Object>();
+ private Map<String, Object> files = new HashMap<>();
@JsonProperty("parameters")
- private Map<String, Object> parameters = new HashMap<String, Object>();
+ private Map<String, Object> parameters = new HashMap<>();
public HeatRequest(String stackName, boolean disableRollback, int timeoutMins, String template, String environment, Map<String, Object> files, Map<String, Object> parameters) {
super();
* Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
* Copyright (C) 2017 Huawei Technologies Co., Ltd. All rights reserved.
* ================================================================================
+ * Modifications Copyright (C) 2018 IBM.
+ * ================================================================================
* 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
public class VolumeAdapterRest {
private static final MsoLogger LOGGER = MsoLogger.getMsoLogger(MsoLogger.Catalog.RA, VolumeAdapterRest.class);
private static final String TESTING_KEYWORD = "___TESTING___";
-
+ private static final String EXCEPTION="Exception :";
+ private static final String RESP=", resp=";
+ private static final String VOLUME_GROUPID_IN_URL_DOESNT_MATCH_CONTENT="VolumeGroupId in URL does not match content";
@Autowired
private MsoVnfAdapterImpl vnfAdapter;
rb,
req.getMessageId());
} catch (VnfException e) {
- LOGGER.debug("Exception :",e);
+ LOGGER.debug(EXCEPTION,e);
eresp = new VolumeGroupExceptionResponse(
e.getMessage(), MsoExceptionCategory.INTERNAL, true, req.getMessageId());
}
BpelRestClient bpelClient = bpelRestClientProvider.get();
bpelClient.bpelPost(getResponse(), req.getNotificationUrl(), sendxml);
}
- LOGGER.debug ("CreateVFModule VolumesTask exit: code=" + getStatusCode() + ", resp="+ getResponse());
+ LOGGER.debug ("CreateVFModule VolumesTask exit: code=" + getStatusCode() + RESP+ getResponse());
}
}
return Response
.status(HttpStatus.SC_BAD_REQUEST)
.type(MediaType.TEXT_PLAIN)
- .entity("VolumeGroupId in URL does not match content")
+ .entity(VOLUME_GROUPID_IN_URL_DOESNT_MATCH_CONTENT)
.build();
}
DeleteVNFVolumesTask task = new DeleteVNFVolumesTask(req);
}
response = new DeleteVolumeGroupResponse(true, req.getMessageId());
} catch (VnfException e) {
- LOGGER.debug("Exception :",e);
+ LOGGER.debug(EXCEPTION,e);
eresp = new VolumeGroupExceptionResponse(e.getMessage(), MsoExceptionCategory.INTERNAL, true, req.getMessageId());
}
if (!req.isSynchronous()) {
BpelRestClient bpelClient = bpelRestClientProvider.get();
bpelClient.bpelPost(getResponse(), req.getNotificationUrl(), sendxml);
}
- LOGGER.debug("DeleteVNFVolumesTask exit: code=" + getStatusCode() + ", resp="+ getResponse());
+ LOGGER.debug("DeleteVNFVolumesTask exit: code=" + getStatusCode() + RESP+ getResponse());
}
}
return Response
.status(HttpStatus.SC_BAD_REQUEST)
.type(MediaType.TEXT_PLAIN)
- .entity("VolumeGroupId in URL does not match content")
+ .entity(VOLUME_GROUPID_IN_URL_DOESNT_MATCH_CONTENT)
.build();
}
RollbackVNFVolumesTask task = new RollbackVNFVolumesTask(req);
vnfAdapter.rollbackVnf(vrb);
response = new RollbackVolumeGroupResponse(true, req.getMessageId());
} catch (VnfException e) {
- LOGGER.debug("Exception :",e);
+ LOGGER.debug(EXCEPTION,e);
eresp = new VolumeGroupExceptionResponse(e.getMessage(), MsoExceptionCategory.INTERNAL, true, req.getMessageId());
}
if (!req.isSynchronous()) {
BpelRestClient bpelClient = bpelRestClientProvider.get();
bpelClient.bpelPost(getResponse(), req.getNotificationUrl(), sendxml);
}
- LOGGER.debug("DeleteVNFVolumesTask exit: code=" + getStatusCode() + ", resp="+ getResponse());
+ LOGGER.debug("DeleteVNFVolumesTask exit: code=" + getStatusCode() + RESP+ getResponse());
}
}
return Response
.status(HttpStatus.SC_BAD_REQUEST)
.type(MediaType.TEXT_PLAIN)
- .entity("VolumeGroupId in URL does not match content")
+ .entity(VOLUME_GROUPID_IN_URL_DOESNT_MATCH_CONTENT)
.build();
}
UpdateVNFVolumesTask task = new UpdateVNFVolumesTask(req);
req.getVolumeGroupId(), req.getVolumeGroupStackId(),
outputs.value, req.getMessageId());
} catch (VnfException e) {
- LOGGER.debug("Exception :",e);
+ LOGGER.debug(EXCEPTION,e);
eresp = new VolumeGroupExceptionResponse(e.getMessage(), MsoExceptionCategory.INTERNAL, true, req.getMessageId());
}
if (!req.isSynchronous()) {
BpelRestClient bpelClient = bpelRestClientProvider.get();
bpelClient.bpelPost(getResponse(), req.getNotificationUrl(), sendxml);
}
- LOGGER.debug("UpdateVNFVolumesTask exit: code=" + getStatusCode() + ", resp="+ getResponse());
+ LOGGER.debug("UpdateVNFVolumesTask exit: code=" + getStatusCode() + RESP+ getResponse());
}
}
@Configuration("CXFConfiguration")
public class CXFConfiguration {
-
- private static final MsoLogger msoLogger = MsoLogger.getMsoLogger(MsoLogger.Catalog.BPEL,CXFConfiguration.class);
JAXRSServerFactoryBean endpoint;
* ================================================================================
* Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
* ================================================================================
+ * Modifications Copyright (C) 2018 IBM.
+ * ================================================================================
* 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
* ============LICENSE_END=========================================================
*/
-package org.onap.so.adapters.vfc;
+package org.onap.so.adapters.vfc;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
-import org.springframework.boot.autoconfigure.domain.EntityScan;
-import org.springframework.context.annotation.ComponentScan;
-import org.springframework.data.jpa.repository.config.EnableJpaRepositories;
private static final MsoLogger LOGGER = MsoLogger.getMsoLogger(MsoLogger.Catalog.RA, VfcAdapterRest.class);
private static final String REQUEST_DEBUG_MSG="body from request is {}";
+ private static final String APPLICATION_EXCEPTION="ApplicationException: ";
@Autowired
private VfcManager driverMgr ;
RestfulResponse rsp = driverMgr.createNs(nsInput);
return buildResponse(rsp);
} catch(ApplicationException e) {
- LOGGER.debug("ApplicationException: ", e);
+ LOGGER.debug(APPLICATION_EXCEPTION, e);
return e.buildErrorResponse();
}
}
RestfulResponse rsp = driverMgr.deleteNs(nsOperationKey, nsInstanceId);
return buildResponse(rsp);
} catch(ApplicationException e) {
- LOGGER.debug("ApplicationException: ", e);
+ LOGGER.debug(APPLICATION_EXCEPTION, e);
return e.buildErrorResponse();
}
}
RestfulResponse rsp = driverMgr.getNsProgress(nsOperationKey, jobId);
return buildResponse(rsp);
} catch(ApplicationException e) {
- LOGGER.debug("ApplicationException: ", e);
+ LOGGER.debug(APPLICATION_EXCEPTION, e);
return e.buildErrorResponse();
}
}
RestfulResponse rsp = driverMgr.instantiateNs(nsInstanceId, nsInput);
return buildResponse(rsp);
} catch(ApplicationException e) {
- LOGGER.debug("ApplicationException: ", e);
+ LOGGER.debug(APPLICATION_EXCEPTION, e);
return e.buildErrorResponse();
}
}
RestfulResponse rsp = driverMgr.terminateNs(nsOperationKey, nsInstanceId);
return buildResponse(rsp);
} catch(ApplicationException e) {
- LOGGER.debug("ApplicationException: ", e);
+ LOGGER.debug(APPLICATION_EXCEPTION, e);
return e.buildErrorResponse();
}
}
RestfulResponse rsp = driverMgr.scaleNs(nsInstanceId, nsInput);
return buildResponse(rsp);
} catch(ApplicationException e) {
- LOGGER.debug("ApplicationException: ", e);
+ LOGGER.debug(APPLICATION_EXCEPTION, e);
return e.buildErrorResponse();
}
}
* ================================================================================
* Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
* ================================================================================
+ * Modifications Copyright (C) 2018 IBM.
+ * ================================================================================
* 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
public HttpResponse post(RequestClientParameter parameterObject)
throws ClientProtocolException, IOException{
HttpPost post = new HttpPost(url);
- msoLogger.debug("Camunda url is: "+ url);
+ msoLogger.debug(CAMUNDA_URL_MESAGE+ url);
String jsonReq = wrapVIDRequest(parameterObject.getRequestId(), parameterObject.isBaseVfModule(), parameterObject.getRecipeTimeout(), parameterObject.getRequestAction(),
parameterObject.getServiceInstanceId(), parameterObject.getCorrelationId(), parameterObject.getVnfId(), parameterObject.getVfModuleId(), parameterObject.getVolumeGroupId(), parameterObject.getNetworkId(), parameterObject.getConfigurationId(),
parameterObject.getServiceType(), parameterObject.getVnfType(), parameterObject.getVfModuleType(), parameterObject.getNetworkType(), parameterObject.getRequestDetails(), parameterObject.getApiVersion(), parameterObject.isaLaCarte(), parameterObject.getRequestUri(), parameterObject.getRecipeParamXsd());