log.info("Blueprint Processor GRPC server started and ready to serve on port({})...", server.getPort());
server.awaitTermination();
} catch (Exception e) {
- e.printStackTrace();
+ log.error("*** Error ***", e);
}
}
}
header.add(BluePrintConstants.RESPONSE_HEADER_PATCH_VERSION, tokens[2]);
header.add(BluePrintConstants.RESPONSE_HEADER_LATEST_VERSION, appVersion);
} catch (Exception e) {
- e.printStackTrace();
+ log.error("*** Error ***", e);
}
return webFilterChain.filter(serverWebExchange);
defProperty = new StringProperty();
}
} else if (BluePrintTypes.validCollectionTypes().contains(propertyDefinition.getType())) {
- ArrayProperty arrayProperty = new ArrayProperty();
+ Optional<Property> innerType = Optional.empty();
if (propertyDefinition.getEntrySchema() != null) {
String entrySchema = propertyDefinition.getEntrySchema().getType();
if (!BluePrintTypes.validPrimitiveTypes().contains(entrySchema)) {
- Property innerType = new RefProperty("#/definitions/" + entrySchema);
- arrayProperty.setItems(innerType);
- } else {
- Property innerType = new StringProperty();
- arrayProperty.setItems(innerType);
+ innerType = Optional.of(new RefProperty("#/definitions/" + entrySchema));
}
- defProperty = arrayProperty;
}
-
+ ArrayProperty arrayProperty = new ArrayProperty();
+ arrayProperty.setItems(innerType.orElseGet(StringProperty::new));
+ defProperty = arrayProperty;
} else {
defProperty = new RefProperty("#/definitions/" + propertyDefinition.getType());
}
File targetZipFile = new File(targetLocation.toString());
try {
- targetZipFile.createNewFile();
+ if (! targetZipFile.createNewFile()) {
+ LOGGER.warn("Overwriting zip file {}", targetLocation);
+ }
} catch (IOException e) {
LOGGER.error("Could not able to create file {}", targetZipFile, e);
}
public class ComponentStatusMessage implements IComponentDoneStatusMessage, IDistributionStatusMessage {
- public String componentName;
+ private String componentName;
- public String consumerID;
+ private String consumerID;
- public String distributionID;
+ private String distributionID;
- public DistributionStatusEnum status;
+ private DistributionStatusEnum status;
- public long timeStamp;
+ private long timeStamp;
- public String artifactUrl;
+ private String artifactUrl;
@Override
public String getDistributionID() {
@Override
public String getArtifactURL() {
- return artifactUrl;
+ return getArtifactUrl();
}
@Override
public long getTimestamp() {
+ return getTimeStamp();
+ }
+
+ public void setComponentName(String componentName) {
+ this.componentName = componentName;
+ }
+
+ public void setConsumerID(String consumerID) {
+ this.consumerID = consumerID;
+ }
+
+ public void setDistributionID(String distributionID) {
+ this.distributionID = distributionID;
+ }
+
+ public void setStatus(DistributionStatusEnum status) {
+ this.status = status;
+ }
+
+ public long getTimeStamp() {
return timeStamp;
}
+
+ public void setTimeStamp(long timeStamp) {
+ this.timeStamp = timeStamp;
+ }
+
+ public String getArtifactUrl() {
+ return artifactUrl;
+ }
+
+ public void setArtifactUrl(String artifactUrl) {
+ this.artifactUrl = artifactUrl;
+ }
}
private ComponentStatusMessage buildStatusMessage(String distributionId, DistributionStatusEnum status, String url,
String componentName) {
return new BuilderUtil<>(new ComponentStatusMessage()).build(builder -> {
- builder.distributionID = distributionId;
- builder.status = status;
- builder.consumerID = consumerId;
- builder.componentName = componentName;
- builder.timeStamp = System.currentTimeMillis();
- builder.artifactUrl = url;
+ builder.setDistributionID(distributionId);
+ builder.setStatus(status);
+ builder.setConsumerID(consumerId);
+ builder.setComponentName(componentName);
+ builder.setTimeStamp(System.currentTimeMillis());
+ builder.setArtifactUrl(url);
}).create();
}