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  package org.waarp.openr66.protocol.localhandler.packet.json;
21  
22  import org.waarp.openr66.protocol.localhandler.packet.LocalPacketFactory;
23  
24  /**
25   * Exporting Configuration JSON packet
26   */
27  public class ConfigExportJsonPacket extends JsonPacket {
28  
29    protected boolean host;
30    protected boolean rule;
31    protected boolean business;
32    protected boolean alias;
33    protected boolean roles;
34  
35    /**
36     * @return the host
37     */
38    public final boolean isHost() {
39      return host;
40    }
41  
42    /**
43     * @param host the host to set
44     */
45    public final void setHost(final boolean host) {
46      this.host = host;
47    }
48  
49    /**
50     * @return the rule
51     */
52    public final boolean isRule() {
53      return rule;
54    }
55  
56    /**
57     * @param rule the rule to set
58     */
59    public final void setRule(final boolean rule) {
60      this.rule = rule;
61    }
62  
63    /**
64     * @return the business
65     */
66    public final boolean isBusiness() {
67      return business;
68    }
69  
70    /**
71     * @param business the business to set
72     */
73    public final void setBusiness(final boolean business) {
74      this.business = business;
75    }
76  
77    /**
78     * @return the alias
79     */
80    public final boolean isAlias() {
81      return alias;
82    }
83  
84    /**
85     * @param alias the alias to set
86     */
87    public final void setAlias(final boolean alias) {
88      this.alias = alias;
89    }
90  
91    /**
92     * @return the roles
93     */
94    public final boolean isRoles() {
95      return roles;
96    }
97  
98    /**
99     * @param roles the roles to set
100    */
101   public final void setRoles(final boolean roles) {
102     this.roles = roles;
103   }
104 
105   @Override
106   public final void fromJson(final JsonPacket other) {
107     super.fromJson(other);
108     if (other instanceof ConfigExportJsonPacket) {
109       final ConfigExportJsonPacket other2 = (ConfigExportJsonPacket) other;
110       host = other2.host;
111       rule = other2.rule;
112       business = other2.business;
113       alias = other2.alias;
114       roles = other2.roles;
115     }
116   }
117 
118   @Override
119   public void setRequestUserPacket() {
120     setRequestUserPacket(LocalPacketFactory.CONFEXPORTPACKET);
121   }
122 }