messageId: "SVC4669"
}
#---------SVC4670------------------------------
+ # %1 - artifactname
+ # %2 - validname
ARTIFACT_NAME_INVALID: {
code: 400,
- message: "Error: Artifact name is invalid.",
+ message: "Error: Artifact name '%1' is invalid. Only the following characters are allowed in the Artifact Name: '%2'.",
messageId: "SVC4670"
}
#---------SVC4671------------------------------
private static final String CREATE_RESOURCE_VALIDATE_CAPABILITY_TYPES = "Create Resource - validateCapabilityTypesCreate";
private static final String COMPONENT_INSTANCE_WITH_NAME = "component instance with name ";
private static final String COMPONENT_INSTANCE_WITH_NAME_IN_RESOURCE = "component instance with name {} in resource {} ";
+ private static final String VALID_CHARACTERS_ARTIFACT_NAME = "'A-Z', 'a-z', '0-9', '.', '_', '-', '@' and space";
private static final LoggerSupportability loggerSupportability = LoggerSupportability.getLogger(ResourceBusinessLogic.class.getName());
private final ComponentInstanceBusinessLogic componentInstanceBusinessLogic;
private final ResourceImportManager resourceImportManager;
Either<List<NonMetaArtifactInfo>, String> artifactPathAndNameList = getValidArtifactNames(csarInfo, collectedWarningMessages);
if (artifactPathAndNameList.isRight()) {
return Either.right(
- getComponentsUtils().getResponseFormatByArtifactId(ActionStatus.ARTIFACT_NAME_INVALID, artifactPathAndNameList.right().value()));
+ getComponentsUtils().getResponseFormatByArtifactId(ActionStatus.ARTIFACT_NAME_INVALID, artifactPathAndNameList.right().value(),
+ VALID_CHARACTERS_ARTIFACT_NAME));
}
EnumMap<ArtifactOperationEnum, List<NonMetaArtifactInfo>> vfCsarArtifactsToHandle = null;
if (artifactOperation.isCreateOrLink()) {
return responseFormat;
}
- public ResponseFormat getResponseFormatByArtifactId(ActionStatus actionStatus, String artifactId) {
+ public ResponseFormat getResponseFormatByArtifactId(ActionStatus actionStatus, String... params) {
ResponseFormat responseFormat;
switch (actionStatus) {
case RESOURCE_NOT_FOUND:
case ARTIFACT_NOT_FOUND:
- responseFormat = getResponseFormat(ActionStatus.ARTIFACT_NOT_FOUND, artifactId);
+ responseFormat = getResponseFormat(ActionStatus.ARTIFACT_NOT_FOUND, params);
+ break;
+ case ARTIFACT_NAME_INVALID:
+ responseFormat = getResponseFormat(ActionStatus.ARTIFACT_NAME_INVALID, params);
break;
default:
responseFormat = getResponseFormat(actionStatus);