KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > lenya > ac > IPRange


1 /*
2  * Copyright 1999-2004 The Apache Software Foundation
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  *
16  */

17
18 /* $Id: IPRange.java 42616 2004-03-03 12:56:33Z gregor $ */
19
20 package org.apache.lenya.ac;
21
22 import java.net.InetAddress JavaDoc;
23
24
25 /**
26  * An IP range.
27  */

28 public interface IPRange extends Accreditable, Item, Groupable {
29     
30     /**
31      * Sets the network address.
32      *
33      * @param address A string, e.g. 192.168.0.32
34      *
35      * @throws AccessControlException when the conversion of the String to an
36      * InetAddress failed.
37      */

38     void setNetworkAddress(String JavaDoc address) throws AccessControlException;
39     
40     /**
41      * Sets the network address.
42      *
43      * @param address A byte array of the length 4.
44      *
45      * @throws AccessControlException when the conversion of the byte array to an
46      * InetAddress failed.
47      */

48     void setNetworkAddress(byte[] address) throws AccessControlException;
49     
50     /**
51      * Returns the network address.
52      * @return An InetAddress value.
53      */

54     InetAddress JavaDoc getNetworkAddress();
55     
56     /**
57      * Sets the subnet mask.
58      *
59      * @param mask A string, e.g. 192.168.0.32
60      *
61      * @throws AccessControlException when the conversion of the String to an
62      * InetAddress failed.
63      */

64     void setSubnetMask(String JavaDoc mask) throws AccessControlException;
65     
66     /**
67      * Sets the subnet mask.
68      *
69      * @param mask A byte array of the length 4.
70      *
71      * @throws AccessControlException when the conversion of the byte array to an
72      * InetAddress failed.
73      */

74     void setSubnetMask(byte[] mask) throws AccessControlException;
75     
76     /**
77      * Returns the subnet mask.
78      * @return An InetAddress value.
79      */

80     InetAddress JavaDoc getSubnetMask();
81     
82     /**
83      * Checks if this IP range contains a certain machine.
84      * @param machine The machine to check for.
85      * @return A boolean value.
86      */

87     boolean contains(Machine machine);
88 }
Popular Tags