2 * ============LICENSE_START=======================================================
3 * Copyright (C) 2019 Nordix Foundation
4 * ================================================================================
5 * Licensed under the Apache License, Version 2.0 (the "License");
6 * you may not use this file except in compliance with the License.
7 * You may obtain a copy of the License at
9 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
16 * SPDX-License-Identifier: Apache-2.0
17 * ============LICENSE_END=========================================================
20 package org.openecomp.sdc.tosca.csar;
22 import java.util.Arrays;
23 import java.util.Optional;
25 public enum ManifestTokenType {
26 ALGORITHM("Algorithm"),
27 ATTRIBUTE_VALUE_SEPARATOR(":"),
28 CMS_BEGIN("-----BEGIN CMS-----"),
29 CMS_END("-----END CMS-----"),
32 NON_MANO_ARTIFACT_SETS("non_mano_artifact_sets"),
34 VNF_PRODUCT_NAME("vnf_product_name"),
35 VNF_PROVIDER_ID("vnf_provider_id"),
36 VNF_PACKAGE_VERSION("vnf_package_version"),
37 VNF_RELEASE_DATE_TIME("vnf_release_date_time"),
38 PNFD_NAME("pnfd_name"),
39 PNFD_PROVIDER("pnfd_provider"),
40 PNFD_ARCHIVE_VERSION("pnfd_archive_version"),
41 PNFD_RELEASE_DATE_TIME("pnfd_release_date_time");
43 private final String token;
45 ManifestTokenType(final String token) {
49 public String getToken() {
53 public static Optional<ManifestTokenType> parse(final String token) {
54 return Arrays.stream(values()).filter(it -> it.getToken() != null && it.getToken().equals(token)).findFirst();
57 public boolean isMetadataEntry() {
58 return isMetadataVnfEntry() || isMetadataPnfEntry();
61 public boolean isMetadataVnfEntry() {
63 case VNF_PRODUCT_NAME:
65 case VNF_PACKAGE_VERSION:
66 case VNF_RELEASE_DATE_TIME:
73 public boolean isMetadataPnfEntry() {
77 case PNFD_ARCHIVE_VERSION:
78 case PNFD_RELEASE_DATE_TIME: