e4f9a518ed8a169b3597985ce883cbfad7853fcb
[public/netxms.git] / src / java / netxms-client / src / main / java / org / netxms / client / objects / Subnet.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 java.net.InetAddress;
22 import org.netxms.base.*;
23 import org.netxms.client.NXCSession;
24
25
26 /**
27 * Subnet object
28 */
29 public class Subnet extends GenericObject
30 {
31 private InetAddress subnetMask;
32 private long zoneId;
33
34 /**
35 * @param msg
36 */
37 public Subnet(NXCPMessage msg, NXCSession session)
38 {
39 super(msg, session);
40
41 subnetMask = msg.getVariableAsInetAddress(NXCPCodes.VID_IP_NETMASK);
42 zoneId = msg.getVariableAsInt64(NXCPCodes.VID_ZONE_ID);
43 }
44
45
46 /**
47 * @return Subnet mask
48 */
49 public InetAddress getSubnetMask()
50 {
51 return subnetMask;
52 }
53
54
55 /* (non-Javadoc)
56 * @see org.netxms.client.NXCObject#getObjectClassName()
57 */
58 @Override
59 public String getObjectClassName()
60 {
61 return "Subnet";
62 }
63
64
65 /**
66 * @return the zoneId
67 */
68 public long getZoneId()
69 {
70 return zoneId;
71 }
72 }