2 * ===============LICENSE_START=======================================================
4 * ===================================================================================
5 * Copyright (C) 2017 AT&T Intellectual Property & Tech Mahindra. All rights reserved.
6 * ===================================================================================
7 * This Acumos software file is distributed by AT&T and Tech Mahindra
8 * under the Apache License, Version 2.0 (the "License");
9 * you may not use this file except in compliance with the License.
10 * You may obtain a copy of the License at
12 * http://www.apache.org/licenses/LICENSE-2.0
14 * This file 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=========================================================
20 package org.acumos.federation.gateway.cds;
22 import java.util.List;
24 import org.acumos.cds.domain.MLPSolution;
25 import org.acumos.cds.domain.MLPSolutionRevision;
28 * Supplements the CDS representation of a solution with related information: revisions.
29 * Allows federation to pack information passed between peers.
31 public class Solution extends MLPSolution {
34 * For the purpose of defining constants for search criteria.
35 * This exposes CDS maintained information so it has to be kept in sync.
36 * We only define those of interest for searching.
38 public static interface Fields {
39 public static final String solutionId = "solutionId";
40 public static final String name = "name";
41 public static final String active = "active";
42 public static final String modelTypeCode = "modelTypeCode";
43 public static final String toolkitTypeCode = "toolkitTypeCode";
44 public static final String accessTypeCode = "accessTypeCode";
45 public static final String validationStatusCode = "validationStatusCode";
46 public static final String modified = "modified";
47 public static final String sourceId = "sourceId";
50 private List<MLPSolutionRevision> revisions;
55 public Solution(MLPSolution theCDSSolution) {
56 super(theCDSSolution);
59 public void setRevisions(List<MLPSolutionRevision> theRevisions) {
60 this.revisions = theRevisions;
63 public List<MLPSolutionRevision> getRevisions() {
64 return this.revisions;
67 public static SolutionBuilder build() {
68 return new SolutionBuilder(new Solution());
71 public static SolutionBuilder buildFrom(MLPSolution theSolution) {
72 return new SolutionBuilder(new Solution(theSolution));
76 public String toString() {
77 return super.toString() + (this.revisions == null ? "[]" : this.revisions.toString()) ;