Java Doc for AbstractIPRange.java in  » Content-Management-System » apache-lenya-2.0 » org » apache » lenya » ac » impl » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » Content Management System » apache lenya 2.0 » org.apache.lenya.ac.impl 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


org.apache.lenya.ac.impl.AbstractItem
   org.apache.lenya.ac.impl.AbstractGroupable
      org.apache.lenya.ac.impl.AbstractIPRange

All known Subclasses:   org.apache.lenya.ac.file.FileIPRange,
AbstractIPRange
abstract public class AbstractIPRange extends AbstractGroupable implements IPRange(Code)

A range of IP addresses, expressed by a network address and a subnet mask.

Note: this class does not enforce that the network address and the subnet mask have the same size (i.e. either both IPv4 or both IPv6 addresses). If the the network address and subnet mask have different sizes, the range does not contain any hosts, that is AbstractIPRange.contains(Machine) will always return false.




Constructor Summary
public  AbstractIPRange(ItemManager itemManager, Logger logger)
     Ctor.
public  AbstractIPRange(ItemManager itemManager, Logger logger, String id)
     Ctor.

Method Summary
public  booleancontains(Machine machine)
     Checks if this IP range contains a certain machine.

Note: if the network address and the subnet mask of this IP range have different sizes (i.e. one is IPv4 and one is IPv6), this method will always return false, no matter what machine has been specified!

Further, if the machine address and the IP range (i.e.

public  voiddelete()
    
public  FilegetConfigurationDirectory()
     Returns the configuration directory.
public  InetAddressgetNetworkAddress()
     Returns the network address.
public  InetAddressgetSubnetMask()
     Returns the subnet mask.
public static  booleanisValidSubnet(InetAddress networkAddress, InetAddress subnetMask)
     Checks if a network address / subnet mask combination describes a valid subnet.
Parameters:
  networkAddress - The network address.
Parameters:
  subnetMask - The subnet mask.
abstract public  voidsave()
    
protected  voidsetConfigurationDirectory(File _configurationDirectory)
    
public  voidsetNetworkAddress(String address)
     Sets the network address.
public  voidsetNetworkAddress(byte[] address)
     Sets the network address.
public  voidsetSubnetMask(String mask)
     Sets the subnet mask.
public  voidsetSubnetMask(byte[] mask)
     Sets the subnet mask.

Only valid subnet masks are accepted, for which the binary representation is a sequence of 1-bits followed by a sequence of 0-bits.



Constructor Detail
AbstractIPRange
public AbstractIPRange(ItemManager itemManager, Logger logger)(Code)
Ctor. Initializes the the IP range with the local host (127.0.0.1/24 for IPv4, ::1/128 for IPv6).
Parameters:
  itemManager - The item manager.
Parameters:
  logger - The logger.



AbstractIPRange
public AbstractIPRange(ItemManager itemManager, Logger logger, String id)(Code)
Ctor.
Parameters:
  itemManager - The item manager.
Parameters:
  logger - The logger.
Parameters:
  id - The IP range ID.




Method Detail
contains
public boolean contains(Machine machine)(Code)
Checks if this IP range contains a certain machine.

Note: if the network address and the subnet mask of this IP range have different sizes (i.e. one is IPv4 and one is IPv6), this method will always return false, no matter what machine has been specified!

Further, if the machine address and the IP range (i.e. network address and subnet mask) have different sizes, the method will return false. (In other words: an IPv4 range never contains an IPv6 address and the other way round.)

Note that the above can lead to confusion. For example the local subnet in IPv4 ( 127.0.0.0/8) will not contain the localhost in IPv6 ( ::1), and the localhost in IPv4 (127.0.0.1) will not be contained in the local subnet in IPv6 (::1/128).
Parameters:
  machine - the machine to check for a boolean value
See Also:   InetAddressUtil.contains




delete
public void delete() throws AccessControlException(Code)
Delete an IP range
throws:
  AccessControlException - if the delete failed



getConfigurationDirectory
public File getConfigurationDirectory()(Code)
Returns the configuration directory. A file object.



getNetworkAddress
public InetAddress getNetworkAddress()(Code)
Returns the network address. an InetAddress representing the network address



getSubnetMask
public InetAddress getSubnetMask()(Code)
Returns the subnet mask. An InetAddress value.



isValidSubnet
public static boolean isValidSubnet(InetAddress networkAddress, InetAddress subnetMask)(Code)
Checks if a network address / subnet mask combination describes a valid subnet.
Parameters:
  networkAddress - The network address.
Parameters:
  subnetMask - The subnet mask. A boolean value.



save
abstract public void save() throws AccessControlException(Code)
Save the IP range
throws:
  AccessControlException - if the save failed



setConfigurationDirectory
protected void setConfigurationDirectory(File _configurationDirectory)(Code)



setNetworkAddress
public void setNetworkAddress(String address) throws AccessControlException(Code)
Sets the network address. This method accepts numeric IPv4 addresses like "129.168.0.32", numeric IPv6 addresses like "1080::8:800:200C:417A" as well as hostnames (if DNS resolution is available) like "localhost" or "www.apache.com".
Parameters:
  address - a String like "192.168.0.32","::1", ...
throws:
  AccessControlException - when the conversion of the String to anInetAddress failed
See Also:   AbstractIPRange.setNetworkAddress(byte[])



setNetworkAddress
public void setNetworkAddress(byte[] address) throws AccessControlException(Code)
Sets the network address. The method accepts numeric IPv4 addresses (specified by byte arrays of length 4) or IPv6 addresses (specified by byte arrays of length 16).
Parameters:
  address - a byte array of the length 4 or 16
throws:
  AccessControlException - when the conversion of the byte array to an InetAddressfailed.
See Also:   AbstractIPRange.setNetworkAddress(String)



setSubnetMask
public void setSubnetMask(String mask) throws AccessControlException(Code)
Sets the subnet mask. See AbstractIPRange.setNetworkAddress(String) for the allowed formats of the mask string. (However, the hostname format will usually not be of much use for setting the mask.)

Only valid subnet masks are accepted, for which the binary representation is a sequence of 1-bits followed by a sequence of 0-bits. For example "255.128.0.0" is valid while "255.128.0.1" is not.
Parameters:
  mask - a String like "255.255.255.0"
throws:
  AccessControlException - when the conversion of the String to anInetAddress failed.
See Also:   AbstractIPRange.setSubnetMask(byte[])




setSubnetMask
public void setSubnetMask(byte[] mask) throws AccessControlException(Code)
Sets the subnet mask.

Only valid subnet masks are accepted, for which the binary representation is a sequence of 1-bits followed by a sequence of 0-bits. For example { 255, 128, 0, 0 } is valid while { 255, 128, 0, 1 } is not.
Parameters:
  mask - A byte array of the length 4.
throws:
  AccessControlException - when the conversion of the byte array to an InetAddressfailed.
See Also:   AbstractIPRange.setSubnetMask(String)




Methods inherited from org.apache.lenya.ac.impl.AbstractGroupable
public void addedToGroup(Group group)(Code)(Java Doc)
public Accreditable[] getAccreditables()(Code)(Java Doc)
public Group[] getGroups()(Code)(Java Doc)
public void removeFromAllGroups()(Code)(Java Doc)
public void removedFromGroup(Group group)(Code)(Java Doc)

Methods inherited from org.apache.lenya.ac.impl.AbstractItem
public int compareTo(Object obj)(Code)(Java Doc)
public boolean equals(Object otherObject)(Code)(Java Doc)
public AccreditableManager getAccreditableManager()(Code)(Java Doc)
public String getDescription()(Code)(Java Doc)
public String getId()(Code)(Java Doc)
public ItemManager getItemManager()(Code)(Java Doc)
public String getName()(Code)(Java Doc)
public int hashCode()(Code)(Java Doc)
public void setDescription(String _description)(Code)(Java Doc)
protected void setId(String string)(Code)(Java Doc)
public void setName(String _name)(Code)(Java Doc)
public String toString()(Code)(Java Doc)

www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.