2 * ============LICENSE_START=======================================================
4 * ================================================================================
5 * Copyright © 2017-2018 AT&T Intellectual Property. All rights reserved.
6 * ================================================================================
7 * Licensed under the Apache License, Version 2.0 (the "License");
8 * you may not use this file except in compliance with the License.
9 * You may obtain a copy of the License at
11 * http://www.apache.org/licenses/LICENSE-2.0
13 * Unless required by applicable law or agreed to in writing, software
14 * distributed under the License is distributed on an "AS IS" BASIS,
15 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 * See the License for the specific language governing permissions and
17 * limitations under the License.
18 * ============LICENSE_END=========================================================
21 package org.onap.aai.schemaservice.versions;
23 import java.util.List;
25 import org.springframework.beans.factory.annotation.Value;
26 import org.springframework.stereotype.Service;
29 public class VersionService {
31 @Value("#{'${schema.version.list}'.split(',')}")
32 private List<String> schemaVersionList;
34 @Value("${schema.version.depth.start}")
35 private String depthStart;
37 @Value("${schema.version.related.link.start}")
38 private String relatedLinkStart;
40 @Value("${schema.version.app.root.start}")
41 private String appRootStart;
43 @Value("${schema.version.namespace.change.start}")
44 private String namespaceChangeStart;
46 @Value("${schema.version.edge.label.start}")
47 private String edgeLabelStart;
49 @Value("${schema.version.api.default}")
50 private String defaultApi;
52 public Version getVersionInfo() {
54 Version schemaVersion = new Version();
55 schemaVersion.setVersions(schemaVersionList);
56 schemaVersion.setDepthVersion(depthStart);
57 schemaVersion.setRelatedLinkVersion(relatedLinkStart);
58 schemaVersion.setAppRootVersion(appRootStart);
59 schemaVersion.setNamespaceChangeVersion(namespaceChangeStart);
60 schemaVersion.setEdgeVersion(edgeLabelStart);
61 schemaVersion.setDefaultVersion(defaultApi);