KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > snmp4j > agent > mo > snmp > smi > Constraints


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

20
21 package org.snmp4j.agent.mo.snmp.smi;
22
23 /**
24  * The <code>Constraints</code> interface describes a collection of SNMP value
25  * range constraints.
26  *
27  * @author Frank Fock
28  * @version 1.0
29  */

30 public interface Constraints extends ValueConstraint {
31
32   /**
33    * Adds a range constraint to the constraints collection.
34    * @param constraint
35    * a SNMP integer/long value range constraint.
36    */

37   void add(Constraint constraint);
38
39   /**
40    * Removes a constraint.
41    * @param contraint
42    * a SNMP integer/long value range constraint.
43    */

44   void remove(Constraint contraint);
45
46   /**
47    * Gets an array with the constraints in this collection ordered by insertion
48    * time.
49    * @return
50    * an array of <code>Constraint</code> instances.
51    */

52   Constraint[] getConstraints();
53
54   /**
55    * Interpretes the value range constraints contained in this collection as
56    * size restrictions for OCTET STRING values and checks whether the given
57    * size matches these criteria.
58    * @param size
59    * a long value representing an OCTET STRING size.
60    * @return
61    * <code>true</code> if the size is valid.
62    */

63   boolean isValidSize(long size);
64 }
65
Popular Tags