diff options
25 files changed, 66 insertions, 79 deletions
diff --git a/adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/adapters/json/MapDeserializer.java b/adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/adapters/json/MapDeserializer.java index 6d3f8f7b1c..f51cb0dd64 100644 --- a/adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/adapters/json/MapDeserializer.java +++ b/adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/adapters/json/MapDeserializer.java @@ -55,7 +55,7 @@ public class MapDeserializer extends JsonDeserializer<Map<String, String>> { ObjectMapper mapper = new ObjectMapper(); JsonNode tree = mapper.readTree(parser); - Map<String, String> map = new LinkedHashMap<String, String>(); + Map<String, String> map = new LinkedHashMap<>(); Iterator<JsonNode> iterator = tree.iterator(); while (iterator.hasNext()) { @@ -71,4 +71,4 @@ public class MapDeserializer extends JsonDeserializer<Map<String, String>> { return map; } -}
\ No newline at end of file +} diff --git a/adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/adapters/json/MapSerializer.java b/adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/adapters/json/MapSerializer.java index 1db69f41ab..c2ea8242c3 100644 --- a/adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/adapters/json/MapSerializer.java +++ b/adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/adapters/json/MapSerializer.java @@ -53,8 +53,9 @@ public class MapSerializer extends JsonSerializer<Map<String, String>> { jsonGenerator.writeStartObject(); jsonGenerator.writeArrayFieldStart("entry"); - for (String key : map.keySet()) { - String value = map.get(key); + for (Map.Entry<String,String> entry : map.entrySet()) { + String key = entry.getKey(); + String value = entry.getValue(); jsonGenerator.writeStartObject(); jsonGenerator.writeStringField("key", key); jsonGenerator.writeStringField("value", value); @@ -64,4 +65,4 @@ public class MapSerializer extends JsonSerializer<Map<String, String>> { jsonGenerator.writeEndArray(); jsonGenerator.writeEndObject(); } -}
\ No newline at end of file +} diff --git a/adapters/mso-catalog-db-adapter/src/main/java/org/openecomp/mso/adapters/catalogdb/catalogrest/CatalogQueryExceptionCommon.java b/adapters/mso-catalog-db-adapter/src/main/java/org/openecomp/mso/adapters/catalogdb/catalogrest/CatalogQueryExceptionCommon.java index 9f709140ec..a1bc08599b 100644 --- a/adapters/mso-catalog-db-adapter/src/main/java/org/openecomp/mso/adapters/catalogdb/catalogrest/CatalogQueryExceptionCommon.java +++ b/adapters/mso-catalog-db-adapter/src/main/java/org/openecomp/mso/adapters/catalogdb/catalogrest/CatalogQueryExceptionCommon.java @@ -40,7 +40,7 @@ public abstract class CatalogQueryExceptionCommon { public String toJsonString() { try { - String jsonString = null; + String jsonString; ObjectMapper mapper = new ObjectMapper(); mapper.enable(SerializationConfig.Feature.WRAP_ROOT_VALUE); jsonString = mapper.writeValueAsString(this); diff --git a/adapters/mso-catalog-db-adapter/src/main/java/org/openecomp/mso/adapters/catalogdb/catalogrest/QueryAllottedResourceCustomization.java b/adapters/mso-catalog-db-adapter/src/main/java/org/openecomp/mso/adapters/catalogdb/catalogrest/QueryAllottedResourceCustomization.java index 75262e3597..9a82ed2c6e 100644 --- a/adapters/mso-catalog-db-adapter/src/main/java/org/openecomp/mso/adapters/catalogdb/catalogrest/QueryAllottedResourceCustomization.java +++ b/adapters/mso-catalog-db-adapter/src/main/java/org/openecomp/mso/adapters/catalogdb/catalogrest/QueryAllottedResourceCustomization.java @@ -54,7 +54,7 @@ public class QueryAllottedResourceCustomization extends CatalogQuery { "\t}"; // "\t}}"; - public QueryAllottedResourceCustomization() { super(); allottedResourceCustomization = new ArrayList<AllottedResourceCustomization>(); } + public QueryAllottedResourceCustomization() { super(); allottedResourceCustomization = new ArrayList<>(); } public QueryAllottedResourceCustomization(List<AllottedResourceCustomization> vlist) { allottedResourceCustomization = vlist; } public List<AllottedResourceCustomization> getServiceAllottedResources(){ return this.allottedResourceCustomization; } @@ -62,7 +62,7 @@ public class QueryAllottedResourceCustomization extends CatalogQuery { @Override public String toString () { - StringBuffer buf = new StringBuffer(); + StringBuilder buf = new StringBuilder(); boolean first = true; int i = 1; @@ -76,10 +76,10 @@ public class QueryAllottedResourceCustomization extends CatalogQuery { @Override public String JSON2(boolean isArray, boolean isEmbed) { - StringBuffer buf = new StringBuffer(); + StringBuilder buf = new StringBuilder(); if (!isEmbed && isArray) buf.append("{ "); if (isArray) buf.append("\"serviceAllottedResources\": ["); - Map<String, String> valueMap = new HashMap<String, String>(); + Map<String, String> valueMap = new HashMap<>(); String sep = ""; boolean first = true; @@ -114,4 +114,4 @@ public class QueryAllottedResourceCustomization extends CatalogQuery { return buf.toString(); } -}
\ No newline at end of file +} diff --git a/adapters/mso-catalog-db-adapter/src/main/java/org/openecomp/mso/adapters/catalogdb/catalogrest/QueryServiceMacroHolder.java b/adapters/mso-catalog-db-adapter/src/main/java/org/openecomp/mso/adapters/catalogdb/catalogrest/QueryServiceMacroHolder.java index 0e2aa714f6..e5147671f3 100644 --- a/adapters/mso-catalog-db-adapter/src/main/java/org/openecomp/mso/adapters/catalogdb/catalogrest/QueryServiceMacroHolder.java +++ b/adapters/mso-catalog-db-adapter/src/main/java/org/openecomp/mso/adapters/catalogdb/catalogrest/QueryServiceMacroHolder.java @@ -60,8 +60,8 @@ public class QueryServiceMacroHolder extends CatalogQuery { Service service = serviceMacroHolder.getService(); if (service == null) return "\"serviceResources\": null"; - StringBuffer buf = new StringBuffer(); - Map<String, String> valueMap = new HashMap<String, String>(); + StringBuilder buf = new StringBuilder(); + Map<String, String> valueMap = new HashMap<>(); put(valueMap, "SERVICE_MODEL_NAME", service.getModelName()); //getServiceModelName()); put(valueMap, "SERVICE_MODEL_UUID", service.getModelUUID()); //getServiceModelUuid()); @@ -84,4 +84,4 @@ public class QueryServiceMacroHolder extends CatalogQuery { return buf.toString(); } -}
\ No newline at end of file +} diff --git a/adapters/mso-catalog-db-adapter/src/main/java/org/openecomp/mso/adapters/catalogdb/catalogrest/QueryServiceNetworks.java b/adapters/mso-catalog-db-adapter/src/main/java/org/openecomp/mso/adapters/catalogdb/catalogrest/QueryServiceNetworks.java index 42b6b651ef..59c601ef19 100644 --- a/adapters/mso-catalog-db-adapter/src/main/java/org/openecomp/mso/adapters/catalogdb/catalogrest/QueryServiceNetworks.java +++ b/adapters/mso-catalog-db-adapter/src/main/java/org/openecomp/mso/adapters/catalogdb/catalogrest/QueryServiceNetworks.java @@ -51,10 +51,10 @@ public class QueryServiceNetworks extends CatalogQuery { "\t}"; // "\t}}"; - public QueryServiceNetworks() { super(); serviceNetworks = new ArrayList<NetworkResourceCustomization>(); } + public QueryServiceNetworks() { super(); serviceNetworks = new ArrayList<>(); } public QueryServiceNetworks(List<NetworkResourceCustomization> vlist) { LOGGER.debug ("QueryServiceNetworks:"); - serviceNetworks = new ArrayList<NetworkResourceCustomization>(); + serviceNetworks = new ArrayList<>(); for (NetworkResourceCustomization o : vlist) { LOGGER.debug (o.toString()); serviceNetworks.add(o); @@ -67,7 +67,7 @@ public class QueryServiceNetworks extends CatalogQuery { @Override public String toString () { - StringBuffer buf = new StringBuffer(); + StringBuilder buf = new StringBuilder(); boolean first = true; int i = 1; @@ -81,11 +81,11 @@ public class QueryServiceNetworks extends CatalogQuery { @Override public String JSON2(boolean isArray, boolean isEmbed) { - StringBuffer buf = new StringBuffer(); + StringBuilder buf = new StringBuilder(); if (!isEmbed && isArray) buf.append("{ "); if (isArray) buf.append("\"serviceNetworks\": ["); //if (isArray) buf.append("["); - Map<String, String> valueMap = new HashMap<String, String>(); + Map<String, String> valueMap = new HashMap<>(); String sep = ""; boolean first = true; @@ -112,4 +112,4 @@ public class QueryServiceNetworks extends CatalogQuery { if (!isEmbed && isArray) buf.append("}"); return buf.toString(); } -}
\ No newline at end of file +} diff --git a/adapters/mso-catalog-db-adapter/src/main/java/org/openecomp/mso/adapters/catalogdb/catalogrest/QueryServiceVnfs.java b/adapters/mso-catalog-db-adapter/src/main/java/org/openecomp/mso/adapters/catalogdb/catalogrest/QueryServiceVnfs.java index ee3c86ab94..cfbb781ae8 100644 --- a/adapters/mso-catalog-db-adapter/src/main/java/org/openecomp/mso/adapters/catalogdb/catalogrest/QueryServiceVnfs.java +++ b/adapters/mso-catalog-db-adapter/src/main/java/org/openecomp/mso/adapters/catalogdb/catalogrest/QueryServiceVnfs.java @@ -55,10 +55,10 @@ public class QueryServiceVnfs extends CatalogQuery { "\t}"; // "\t}}"; - public QueryServiceVnfs() { super(); serviceVnfs = new ArrayList<VnfResourceCustomization>(); } + public QueryServiceVnfs() { super(); serviceVnfs = new ArrayList<>(); } public QueryServiceVnfs(List<VnfResourceCustomization> vlist) { LOGGER.debug ("QueryServiceVnfs:"); - serviceVnfs = new ArrayList<VnfResourceCustomization>(); + serviceVnfs = new ArrayList<>(); for (VnfResourceCustomization o : vlist) { LOGGER.debug ("-- o is a serviceVnfs ----"); LOGGER.debug (o.toString()); @@ -72,7 +72,7 @@ public class QueryServiceVnfs extends CatalogQuery { @Override public String toString () { - StringBuffer buf = new StringBuffer(); + StringBuilder buf = new StringBuilder(); boolean first = true; int i = 1; @@ -86,10 +86,10 @@ public class QueryServiceVnfs extends CatalogQuery { @Override public String JSON2(boolean isArray, boolean isEmbed) { - StringBuffer buf = new StringBuffer(); + StringBuilder buf = new StringBuilder(); if (!isEmbed && isArray) buf.append("{ "); if (isArray) buf.append("\"serviceVnfs\": ["); - Map<String, String> valueMap = new HashMap<String, String>(); + Map<String, String> valueMap = new HashMap<>(); String sep = ""; boolean first = true; @@ -121,4 +121,4 @@ public class QueryServiceVnfs extends CatalogQuery { if (!isEmbed && isArray) buf.append("}"); return buf.toString(); } -}
\ No newline at end of file +} diff --git a/adapters/mso-catalog-db-adapter/src/main/java/org/openecomp/mso/adapters/catalogdb/catalogrest/QueryVfModule.java b/adapters/mso-catalog-db-adapter/src/main/java/org/openecomp/mso/adapters/catalogdb/catalogrest/QueryVfModule.java index 4675858936..309aa0641a 100644 --- a/adapters/mso-catalog-db-adapter/src/main/java/org/openecomp/mso/adapters/catalogdb/catalogrest/QueryVfModule.java +++ b/adapters/mso-catalog-db-adapter/src/main/java/org/openecomp/mso/adapters/catalogdb/catalogrest/QueryVfModule.java @@ -50,10 +50,10 @@ public class QueryVfModule extends CatalogQuery { "\t}"; // "\t}}"; - public QueryVfModule() { super(); vfModules = new ArrayList<VfModuleCustomization>(); } + public QueryVfModule() { super(); vfModules = new ArrayList<>(); } public QueryVfModule(List<VfModuleCustomization> vlist) { LOGGER.debug ("QueryVfModule:"); - vfModules = new ArrayList<VfModuleCustomization>(); + vfModules = new ArrayList<>(); if (vlist != null) { for (VfModuleCustomization o : vlist) { LOGGER.debug ("-- o is a vfModules ----"); @@ -69,7 +69,7 @@ public class QueryVfModule extends CatalogQuery { @Override public String toString () { - StringBuffer buf = new StringBuffer(); + StringBuilder buf = new StringBuilder(); boolean first = true; int i = 1; @@ -83,9 +83,9 @@ public class QueryVfModule extends CatalogQuery { @Override public String JSON2(boolean isArray, boolean x) { - StringBuffer buf = new StringBuffer(); + StringBuilder buf = new StringBuilder(); if (isArray) buf.append("\"vfModules\": ["); - Map<String, String> valueMap = new HashMap<String, String>(); + Map<String, String> valueMap = new HashMap<>(); String sep = ""; boolean first = true; @@ -95,7 +95,7 @@ public class QueryVfModule extends CatalogQuery { boolean vfNull = o.getVfModule() == null ? true : false; boolean hasVolumeGroup = false; String envt = o.getHeatEnvironmentArtifactUuid(); - if (envt != null && !envt.equals("")) { + if (envt != null && !"".equals(envt)) { hasVolumeGroup = true; } @@ -116,4 +116,4 @@ public class QueryVfModule extends CatalogQuery { if (isArray) buf.append("]"); return buf.toString(); } -}
\ No newline at end of file +} diff --git a/adapters/mso-requests-db-adapter/src/main/java/org/openecomp/mso/adapters/requestsdb/MsoRequestsDbAdapter.java b/adapters/mso-requests-db-adapter/src/main/java/org/openecomp/mso/adapters/requestsdb/MsoRequestsDbAdapter.java index 15f74c4d94..9648922d41 100644 --- a/adapters/mso-requests-db-adapter/src/main/java/org/openecomp/mso/adapters/requestsdb/MsoRequestsDbAdapter.java +++ b/adapters/mso-requests-db-adapter/src/main/java/org/openecomp/mso/adapters/requestsdb/MsoRequestsDbAdapter.java @@ -27,7 +27,6 @@ import javax.xml.bind.annotation.XmlElement; import org.openecomp.mso.adapters.requestsdb.exceptions.MsoRequestsDbException; import org.openecomp.mso.requestsdb.InfraActiveRequests; -import org.openecomp.mso.requestsdb.SiteStatus; /** * MSO Request DB Adapter Web Service diff --git a/adapters/mso-sdnc-adapter/src/main/java/org/openecomp/mso/adapters/sdnc/client/SDNCCallbackAdapterPortType.java b/adapters/mso-sdnc-adapter/src/main/java/org/openecomp/mso/adapters/sdnc/client/SDNCCallbackAdapterPortType.java index 0e72861f39..1b717b483a 100644 --- a/adapters/mso-sdnc-adapter/src/main/java/org/openecomp/mso/adapters/sdnc/client/SDNCCallbackAdapterPortType.java +++ b/adapters/mso-sdnc-adapter/src/main/java/org/openecomp/mso/adapters/sdnc/client/SDNCCallbackAdapterPortType.java @@ -40,6 +40,7 @@ import org.openecomp.mso.adapters.sdnc.SDNCAdapterResponse; @WebService(targetNamespace = "http://org.openecomp/workflow/sdnc/adapter/callback/wsdl/v1", name = "SDNCCallbackAdapterPortType") @XmlSeeAlso({ObjectFactory.class}) @SOAPBinding(parameterStyle = SOAPBinding.ParameterStyle.BARE) +@FunctionalInterface public interface SDNCCallbackAdapterPortType { @WebResult(name = "SDNCAdapterResponse", targetNamespace = "http://org.openecomp/workflow/sdnc/adapter/schema/v1", partName = "SDNCAdapterCallbackResponse") diff --git a/asdc-controller/src/main/java/org/openecomp/mso/asdc/client/ASDCController.java b/asdc-controller/src/main/java/org/openecomp/mso/asdc/client/ASDCController.java index 3ca8527b05..22c4b04ff4 100644 --- a/asdc-controller/src/main/java/org/openecomp/mso/asdc/client/ASDCController.java +++ b/asdc-controller/src/main/java/org/openecomp/mso/asdc/client/ASDCController.java @@ -442,7 +442,7 @@ public class ASDCController { try {
String resourceType = resourceStructure.getResourceInstance().getResourceType();
String category = resourceStructure.getResourceInstance().getCategory();
- if(resourceType.equals("VF") && !category.equalsIgnoreCase("Allotted Resource")){
+ if("VF".equals(resourceType) && !"Allotted Resource".equalsIgnoreCase(category)){
resourceStructure.createVfModuleStructures();
}
//resourceInstaller.installTheResource (resourceStructure);
diff --git a/asdc-controller/src/main/java/org/openecomp/mso/asdc/installer/heat/ToscaResourceInstaller.java b/asdc-controller/src/main/java/org/openecomp/mso/asdc/installer/heat/ToscaResourceInstaller.java index 11199dc04b..24950db916 100644 --- a/asdc-controller/src/main/java/org/openecomp/mso/asdc/installer/heat/ToscaResourceInstaller.java +++ b/asdc-controller/src/main/java/org/openecomp/mso/asdc/installer/heat/ToscaResourceInstaller.java @@ -786,7 +786,7 @@ public class ToscaResourceInstaller {// implements IVfResourceInstaller { String providerNetwork = toscaResourceStructure.getSdcCsarHelper().getNodeTemplatePropertyLeafValue(networkNodeTemplate, SdcPropertyNames.PROPERTY_NAME_PROVIDERNETWORK_ISPROVIDERNETWORK);
- if(providerNetwork != null && providerNetwork.equalsIgnoreCase("true")){
+ if("true".equalsIgnoreCase(providerNetwork)){
networkResource.setNeutronNetworkType("PROVIDER");
} else {
networkResource.setNeutronNetworkType("BASIC");
diff --git a/bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/client/aai/AAIRestClientImpl.java b/bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/client/aai/AAIRestClientImpl.java index c58f22f949..ae8638f0b7 100644 --- a/bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/client/aai/AAIRestClientImpl.java +++ b/bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/client/aai/AAIRestClientImpl.java @@ -42,8 +42,6 @@ import org.onap.aai.domain.yang.Pservers; import org.openecomp.mso.bpmn.core.PropertyConfiguration; import org.openecomp.mso.client.aai.entities.CustomQuery; import org.openecomp.mso.client.aai.entities.Results; -import org.openecomp.mso.logger.MsoLogger; -import org.openecomp.mso.properties.MsoPropertiesFactory; import org.springframework.stereotype.Service; import com.fasterxml.jackson.core.JsonParseException; @@ -56,15 +54,10 @@ public class AAIRestClientImpl implements AAIRestClient { private final WebTarget webTarget; - private static MsoPropertiesFactory msoPropertiesFactory = new MsoPropertiesFactory(); - - private static MsoLogger msoLogger = MsoLogger.getMsoLogger(MsoLogger.Catalog.GENERAL); - private static final String ENDPOINT_VERSION = "v10"; private static final String ENDPOINT_GET_ALL = ENDPOINT_VERSION + "/cloud-infrastructure/pservers"; private static final String ENDPOINT_GET_ALL_VNFS = ENDPOINT_VERSION + "/network/generic-vnfs"; private static final String ENDPOINT_CUSTOM_QUERY = ENDPOINT_VERSION + "/query"; - private static final String PSERVER_BY_VNF_QUERY = "g.V().has('aai-node-type', 'generic-vnf').has('vnf-name','USAUTOUFTIL2001UJDM02').out('runsOnPserver').has('aai-node-type', 'pserver')"; private static final String PSERVER_VNF_QUERY = "pservers-fromVnf"; private static final String GENERIC_VNF_PATH = ENDPOINT_VERSION + "/network/generic-vnfs/generic-vnf"; private static final String SERVICE_TOPOLOGY_BY_SERVICE_INSTANCE_ID = "store(‘x’).union(__.in(‘subscribesTo’).has(‘aai-node-type’,’customer’).store(‘x’),__.out(‘uses’).has(‘aai-node-type’,’allotted-resource’).store(‘x’),__.in(‘hasInstance’).has(‘aai-node-type’,’generic-vnf’).store(‘x’).union(" @@ -92,7 +85,6 @@ public class AAIRestClientImpl implements AAIRestClient { public AAIRestClientImpl(final String host) throws NoSuchAlgorithmException { Logger logger = Logger.getLogger(getClass().getName()); Client client = this.getSSLClient(); - Map<String, String> properties = PropertyConfiguration.getInstance().getProperties("mso.bpmn.urn.properties"); webTarget = client.register(logger).register(new AAIClientResponseExceptionMapper()).target(host + "/aai"); } @@ -107,7 +99,7 @@ public class AAIRestClientImpl implements AAIRestClient { @Override public List<Pserver> getPhysicalServerByVnfId(String vnfId, String transactionLoggingUuid) throws JsonParseException, JsonMappingException, IOException { - List<String> startNodes = new ArrayList<String>(); + List<String> startNodes = new ArrayList<>(); startNodes.add("network/generic-vnfs/generic-vnf/" + vnfId); String jsonInput = webTarget.register(AAIQueryObjectMapperProvider.class).path(ENDPOINT_CUSTOM_QUERY) .queryParam("format", "resource").request().header("X-FromAppId", "MSO") diff --git a/bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/client/aai/entities/Results.java b/bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/client/aai/entities/Results.java index c9c12c4afb..aea223da56 100644 --- a/bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/client/aai/entities/Results.java +++ b/bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/client/aai/entities/Results.java @@ -42,7 +42,7 @@ public class Results<T> { public List<T> getResult() { if (result == null) { - result = new ArrayList<T>(); + result = new ArrayList<>(); } return this.result; } diff --git a/bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/client/appc/ApplicationControllerClient.java b/bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/client/appc/ApplicationControllerClient.java index b164682bc7..26c1c4acd2 100644 --- a/bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/client/appc/ApplicationControllerClient.java +++ b/bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/client/appc/ApplicationControllerClient.java @@ -63,15 +63,7 @@ public class ApplicationControllerClient { private static final MsoLogger LOGGER = MsoLogger.getMsoLogger (MsoLogger.Catalog.RA); - private static final int ACCEPT_SERIES = 100; - private static final int ERROR_SERIES = 200; - private static final int REJECT_SERIES = 300; - private static final int SUCCESS_SERIES = 400; - private static final int SUCCESS_STATUS = SUCCESS_SERIES + 0; private static final int PARTIAL_SERIES = 500; - private static final int PARTIAL_SUCCESS_STATUS = PARTIAL_SERIES + 0; - - private final boolean useLCMBypass = false; private final String apiVer = "2.00"; private final String originatorId = "MSO"; diff --git a/bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/client/policy/LoggingFilter.java b/bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/client/policy/LoggingFilter.java index abd8543f84..665b9052eb 100644 --- a/bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/client/policy/LoggingFilter.java +++ b/bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/client/policy/LoggingFilter.java @@ -53,19 +53,20 @@ public class LoggingFilter implements ClientRequestFilter, ClientResponseFilter, private InputStream logInboundEntity(final StringBuilder b, InputStream stream, final Charset charset)
throws IOException {
- if (!stream.markSupported()) {
- stream = new BufferedInputStream(stream);
+ InputStream inputStream = stream;
+ if (!inputStream.markSupported()) {
+ inputStream = new BufferedInputStream(inputStream);
}
- stream.mark(maxEntitySize + 1);
+ inputStream.mark(maxEntitySize + 1);
final byte[] entity = new byte[maxEntitySize + 1];
- final int entitySize = stream.read(entity);
+ final int entitySize = inputStream.read(entity);
b.append(new String(entity, 0, Math.min(entitySize, maxEntitySize), charset));
if (entitySize > maxEntitySize) {
b.append("...more...");
}
b.append('\n');
- stream.reset();
- return stream;
+ inputStream.reset();
+ return inputStream;
}
@Override
@@ -126,4 +127,4 @@ public class LoggingFilter implements ClientRequestFilter, ClientResponseFilter, out.write(i);
}
}
-}
\ No newline at end of file +}
diff --git a/bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/client/sdno/Body.java b/bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/client/sdno/Body.java index 3138349fd2..2db4dea069 100644 --- a/bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/client/sdno/Body.java +++ b/bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/client/sdno/Body.java @@ -41,7 +41,7 @@ public class Body implements Serializable @JsonProperty("input") private Input input; @JsonIgnore - private Map<String, Object> additionalProperties = new HashMap<String, Object>(); + private Map<String, Object> additionalProperties = new HashMap<>(); private final static long serialVersionUID = 9101706044452851559L; @JsonProperty("input") diff --git a/bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/client/sdno/Input.java b/bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/client/sdno/Input.java index 27efe03243..25eb2ed270 100644 --- a/bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/client/sdno/Input.java +++ b/bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/client/sdno/Input.java @@ -41,7 +41,7 @@ public class Input implements Serializable @JsonProperty("request-healthdiagnostic") private RequestHealthDiagnostic RequestHealthDiagnostic; @JsonIgnore - private Map<String, Object> additionalProperties = new HashMap<String, Object>(); + private Map<String, Object> additionalProperties = new HashMap<>(); private final static long serialVersionUID = 7155546785389227528L; @JsonProperty("request-healthdiagnostic") diff --git a/bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/client/sdno/RequestHealthDiagnostic.java b/bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/client/sdno/RequestHealthDiagnostic.java index 20bd735ae2..b1ed77b513 100644 --- a/bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/client/sdno/RequestHealthDiagnostic.java +++ b/bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/client/sdno/RequestHealthDiagnostic.java @@ -59,7 +59,7 @@ public class RequestHealthDiagnostic implements Serializable @JsonProperty("health-diagnostic-code") private String healthDiagnosticCode; @JsonIgnore - private Map<String, Object> additionalProperties = new HashMap<String, Object>(); + private Map<String, Object> additionalProperties = new HashMap<>(); private final static long serialVersionUID = 1166788526178388021L; @JsonProperty("request-client-name") diff --git a/bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/client/sdno/ResultInfo.java b/bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/client/sdno/ResultInfo.java index 63894b9c16..0997b2df90 100644 --- a/bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/client/sdno/ResultInfo.java +++ b/bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/client/sdno/ResultInfo.java @@ -51,7 +51,7 @@ private String requestId; @JsonProperty("status") private String status; @JsonIgnore -private Map<String, Object> additionalProperties = new HashMap<String, Object>(); +private Map<String, Object> additionalProperties = new HashMap<>(); @JsonProperty("client-name") public String getClientName() { diff --git a/bpmn/MSOCoreBPMN/src/main/java/org/openecomp/mso/bpmn/core/XQueryScriptTask.java b/bpmn/MSOCoreBPMN/src/main/java/org/openecomp/mso/bpmn/core/XQueryScriptTask.java index 6080768cee..419f4aacf5 100644 --- a/bpmn/MSOCoreBPMN/src/main/java/org/openecomp/mso/bpmn/core/XQueryScriptTask.java +++ b/bpmn/MSOCoreBPMN/src/main/java/org/openecomp/mso/bpmn/core/XQueryScriptTask.java @@ -71,6 +71,7 @@ public class XQueryScriptTask extends BaseTask { private Expression atomicInputVariables; private Expression outputVariable; + @Override public void execute(DelegateExecution execution) throws Exception { if (msoLogger.isDebugEnabled()) { msoLogger.debug("Started Executing " + getTaskName()); @@ -222,12 +223,11 @@ public class XQueryScriptTask extends BaseTask { */ private XQueryExecutable compile(XQueryCompiler compiler, String resource) throws Exception { - try (InputStream xqStream = getClass().getResourceAsStream(resource)) { - XQueryExecutable executable = compiler.compile(xqStream); - return executable; - } catch (Exception e) { - msoLogger.debug ("Exception at resourceFile stream:", e); - return null; - } + try (InputStream xqStream = getClass().getResourceAsStream(resource)) { + return compiler.compile(xqStream); + } catch (Exception e) { + msoLogger.debug ("Exception at resourceFile stream:", e); + return null; + } } }
\ No newline at end of file diff --git a/bpmn/MSOCoreBPMN/src/main/java/org/openecomp/mso/bpmn/core/domain/ServiceDecomposition.java b/bpmn/MSOCoreBPMN/src/main/java/org/openecomp/mso/bpmn/core/domain/ServiceDecomposition.java index da340a02f7..1e68c84878 100644 --- a/bpmn/MSOCoreBPMN/src/main/java/org/openecomp/mso/bpmn/core/domain/ServiceDecomposition.java +++ b/bpmn/MSOCoreBPMN/src/main/java/org/openecomp/mso/bpmn/core/domain/ServiceDecomposition.java @@ -235,7 +235,7 @@ public class ServiceDecomposition extends JsonWrapper implements Serializable { Resource resource = iter.next();
//resource.getModelInfo().getModelInvariantId();
- if (resourceObjectId.equals("extracted information")){
+ if ("extracted information".equals(resourceObjectId)){
return resource.toJsonString();
}
}
diff --git a/bpmn/MSOInfrastructureBPMN/src/main/java/org/openecomp/mso/bpmn/vcpe/workflow/WorkflowAsyncVcpeResource.java b/bpmn/MSOInfrastructureBPMN/src/main/java/org/openecomp/mso/bpmn/vcpe/workflow/WorkflowAsyncVcpeResource.java index dbddbee928..b11a1d022d 100644 --- a/bpmn/MSOInfrastructureBPMN/src/main/java/org/openecomp/mso/bpmn/vcpe/workflow/WorkflowAsyncVcpeResource.java +++ b/bpmn/MSOInfrastructureBPMN/src/main/java/org/openecomp/mso/bpmn/vcpe/workflow/WorkflowAsyncVcpeResource.java @@ -39,7 +39,8 @@ import org.openecomp.mso.bpmn.common.workflow.service.WorkflowAsyncResource; */
@Path("/async")
public class WorkflowAsyncVcpeResource extends WorkflowAsyncResource {
-
+
+ @Override
protected ProcessEngineServices getProcessEngineServices() {
return pes4junit.orElse(ProcessEngines.getProcessEngine("vcpe"));
}
diff --git a/bpmn/MSOURN-plugin/src/main/java/org/openecomp/camunda/bpmn/plugin/urnmap/db/MyBatisExtendedSessionFactory.java b/bpmn/MSOURN-plugin/src/main/java/org/openecomp/camunda/bpmn/plugin/urnmap/db/MyBatisExtendedSessionFactory.java index 9e43ee3512..60d65665fe 100644 --- a/bpmn/MSOURN-plugin/src/main/java/org/openecomp/camunda/bpmn/plugin/urnmap/db/MyBatisExtendedSessionFactory.java +++ b/bpmn/MSOURN-plugin/src/main/java/org/openecomp/camunda/bpmn/plugin/urnmap/db/MyBatisExtendedSessionFactory.java @@ -37,6 +37,7 @@ public class MyBatisExtendedSessionFactory extends StandaloneProcessEngineConfig private String resourceName;
+ @Override
protected void init() {
throw new IllegalArgumentException(
"Normal 'init' on process engine only used for extended MyBatis mappings is not allowed, please use 'initFromProcessEngineConfiguration'. You cannot construct a process engine with this configuration.");
@@ -55,7 +56,6 @@ public class MyBatisExtendedSessionFactory extends StandaloneProcessEngineConfig setDatabaseTablePrefix(processEngineConfiguration.getDatabaseTablePrefix());
initDataSource();
- //initVariableTypes();
initCommandContextFactory();
initTransactionFactory();
initTransactionContextFactory();
@@ -75,7 +75,7 @@ public class MyBatisExtendedSessionFactory extends StandaloneProcessEngineConfig */
@Override
protected Collection<? extends CommandInterceptor> getDefaultCommandInterceptorsTxRequired() {
- List<CommandInterceptor> defaultCommandInterceptorsTxRequired = new ArrayList<CommandInterceptor>();
+ List<CommandInterceptor> defaultCommandInterceptorsTxRequired = new ArrayList<>();
defaultCommandInterceptorsTxRequired.add(new LogInterceptor());
defaultCommandInterceptorsTxRequired.add(new CommandContextInterceptor(commandContextFactory, this, true));
return defaultCommandInterceptorsTxRequired;
diff --git a/mso-api-handlers/mso-requests-db/src/main/java/org/openecomp/mso/requestsdb/MockRequestsDatabase.java b/mso-api-handlers/mso-requests-db/src/main/java/org/openecomp/mso/requestsdb/MockRequestsDatabase.java index c4ded174ba..e3c7cda3bd 100644 --- a/mso-api-handlers/mso-requests-db/src/main/java/org/openecomp/mso/requestsdb/MockRequestsDatabase.java +++ b/mso-api-handlers/mso-requests-db/src/main/java/org/openecomp/mso/requestsdb/MockRequestsDatabase.java @@ -60,10 +60,10 @@ public class MockRequestsDatabase { InfraActiveRequests returnRecord = null; if (record != null) { String requestAction = record.getRequestAction(); - if (requestAction == null || !requestAction.equals("GetLayer3ServiceDetailsRequest")) { + if (!"GetLayer3ServiceDetailsRequest".equals(requestAction)) { String status = record.getRequestStatus(); - if (status != null && status.equals("COMPLETED")) { - return returnRecord = record; + if ("COMPLETED".equals(status)) { + returnRecord = record; } } } |