View Javadoc
1   /*
2    * This file is part of Waarp Project (named also Waarp or GG).
3    *
4    *  Copyright (c) 2019, Waarp SAS, and individual contributors by the @author
5    *  tags. See the COPYRIGHT.txt in the distribution for a full listing of
6    * individual contributors.
7    *
8    *  All Waarp Project is free software: you can redistribute it and/or
9    * modify it under the terms of the GNU General Public License as published by
10   * the Free Software Foundation, either version 3 of the License, or (at your
11   * option) any later version.
12   *
13   * Waarp is distributed in the hope that it will be useful, but WITHOUT ANY
14   * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
15   * A PARTICULAR PURPOSE. See the GNU General Public License for more details.
16   *
17   *  You should have received a copy of the GNU General Public License along with
18   * Waarp . If not, see <http://www.gnu.org/licenses/>.
19   */
20  
21  package org.waarp.openr66.pojo;
22  
23  import com.fasterxml.jackson.annotation.JsonIgnore;
24  import org.waarp.common.database.exception.WaarpDatabaseSqlException;
25  
26  import java.sql.Types;
27  
28  import static org.waarp.common.database.data.AbstractDbData.*;
29  
30  /**
31   * MultipleMonitor data object
32   */
33  public class MultipleMonitor {
34  
35    private String hostid;
36  
37    private int countConfig;
38  
39    private int countHost;
40  
41    private int countRule;
42  
43    /**
44     * Empty constructor
45     */
46    public MultipleMonitor() {
47      // Nothing
48    }
49  
50    public MultipleMonitor(final String hostid, final int countConfig,
51                           final int countHost, final int countRule)
52        throws WaarpDatabaseSqlException {
53      this.hostid = hostid;
54      this.countConfig = countConfig;
55      this.countHost = countHost;
56      this.countRule = countRule;
57      checkValues();
58    }
59  
60    @JsonIgnore
61    public final void checkValues() throws WaarpDatabaseSqlException {
62      validateLength(Types.NVARCHAR, hostid);
63    }
64  
65    public final String getHostid() {
66      return hostid;
67    }
68  
69    public final void setHostid(final String hostid) {
70      this.hostid = hostid;
71    }
72  
73    public final int getCountConfig() {
74      return countConfig;
75    }
76  
77    public final void setCountConfig(final int countConfig) {
78      this.countConfig = countConfig;
79    }
80  
81    public final int getCountHost() {
82      return countHost;
83    }
84  
85    public final void setCountHost(final int countHost) {
86      this.countHost = countHost;
87    }
88  
89    public final int getCountRule() {
90      return countRule;
91    }
92  
93    public final void setCountRule(final int countRule) {
94      this.countRule = countRule;
95    }
96  }