2 * ============LICENSE_START=======================================================
4 * ================================================================================
5 * Copyright (C) 2019 AT&T Intellectual Property. All rights
7 * ================================================================================
8 * Licensed 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 * Unless required by applicable law or agreed to in writing, software
15 * distributed under the License is distributed on an "AS IS" BASIS,
16 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17 * See the License for the specific language governing permissions and
18 * limitations under the License.
19 * ============LICENSE_END=========================================================
22 package org.onap.ccsdk.sli.plugins.grtoolkit.data;
24 import java.util.ArrayList;
25 import java.util.Collections;
26 import java.util.List;
30 * A data container for Site health.
32 * @author Anthony Haddox
33 * @see org.onap.ccsdk.sli.plugins.grtoolkit.resolver.HealthResolver
35 public class SiteHealth {
36 private List<AdminHealth> adminHealth;
37 private List<DatabaseHealth> databaseHealth;
38 private List<ClusterHealth> clusterHealth;
40 private Health health;
45 adminHealth = new ArrayList<>();
46 databaseHealth = new ArrayList<>();
47 clusterHealth = new ArrayList<>();
49 // Faulty by default, it's up to the health check to affirm the health
50 health = Health.FAULTY;
53 public SiteHealth withAdminHealth(AdminHealth... health) {
54 Collections.addAll(adminHealth, health);
58 public SiteHealth withDatabaseHealth(DatabaseHealth... health) {
59 Collections.addAll(databaseHealth, health);
63 public SiteHealth withClusterHealth(ClusterHealth... health) {
64 Collections.addAll(clusterHealth, health);
68 public SiteHealth withId(String id) {
73 public SiteHealth withRole(String role) {
78 public Health getHealth() {
82 public void setHealth(Health health) {
86 public List<AdminHealth> getAdminHealth() {
90 public void setAdminHealth(List<AdminHealth> adminHealth) {
91 this.adminHealth = adminHealth;
94 public List<DatabaseHealth> getDatabaseHealth() {
95 return databaseHealth;
98 public void setDatabaseHealth(List<DatabaseHealth> databaseHealth) {
99 this.databaseHealth = databaseHealth;
102 public List<ClusterHealth> getClusterHealth() {
103 return clusterHealth;
106 public void setClusterHealth(List<ClusterHealth> clusterHealth) {
107 this.clusterHealth = clusterHealth;
110 public String getId() {
114 public void setId(String id) {
118 public String getRole() {
122 public void setRole(String role) {