e43b2d0634e22cef43976c0c57e80f7736e14751
[public/netxms.git] / src / java / client / netxms-client / src / main / java / org / netxms / client / objects / Zone.java
1 /**
2 * NetXMS - open source network management system
3 * Copyright (C) 2003-2011 Victor Kirhenshtein
4 *
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 2 of the License, or
8 * (at your option) any later version.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software
17 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
18 */
19 package org.netxms.client.objects;
20
21 import org.netxms.base.NXCPCodes;
22 import org.netxms.base.NXCPMessage;
23 import org.netxms.client.NXCSession;
24
25 /**
26 * Zone object
27 */
28 public class Zone extends GenericObject
29 {
30 private long zoneId;
31 private long agentProxy;
32 private long snmpProxy;
33 private long icmpProxy;
34 private long sshProxy;
35
36 /**
37 * Create zone object from NXCP message
38 *
39 * @param msg NXCP message
40 * @param session owning session
41 */
42 public Zone(NXCPMessage msg, NXCSession session)
43 {
44 super(msg, session);
45 zoneId = msg.getFieldAsInt64(NXCPCodes.VID_ZONE_ID);
46 agentProxy = msg.getFieldAsInt64(NXCPCodes.VID_AGENT_PROXY);
47 snmpProxy = msg.getFieldAsInt64(NXCPCodes.VID_SNMP_PROXY);
48 icmpProxy = msg.getFieldAsInt64(NXCPCodes.VID_ICMP_PROXY);
49 sshProxy = msg.getFieldAsInt64(NXCPCodes.VID_SSH_PROXY);
50 }
51
52 /* (non-Javadoc)
53 * @see org.netxms.client.objects.AbstractObject#isAllowedOnMap()
54 */
55 @Override
56 public boolean isAllowedOnMap()
57 {
58 return true;
59 }
60
61 /* (non-Javadoc)
62 * @see org.netxms.client.objects.AbstractObject#isAlarmsVisible()
63 */
64 @Override
65 public boolean isAlarmsVisible()
66 {
67 return true;
68 }
69
70 /**
71 * @return the zoneId
72 */
73 public long getZoneId()
74 {
75 return zoneId;
76 }
77
78 /**
79 * @return the agentProxy
80 */
81 public long getAgentProxy()
82 {
83 return agentProxy;
84 }
85
86 /**
87 * @return the snmpProxy
88 */
89 public long getSnmpProxy()
90 {
91 return snmpProxy;
92 }
93
94 /**
95 * @return the icmpProxy
96 */
97 public long getIcmpProxy()
98 {
99 return icmpProxy;
100 }
101
102 /**
103 * @return the sshProxy
104 */
105 public long getSshProxy()
106 {
107 return sshProxy;
108 }
109
110 /* (non-Javadoc)
111 * @see org.netxms.client.objects.GenericObject#getObjectClassName()
112 */
113 @Override
114 public String getObjectClassName()
115 {
116 return "Zone";
117 }
118 }