KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > snmp4j > agent > mo > snmp > CoexistenceInfoProvider


1 /*_############################################################################
2   _##
3   _## SNMP4J-Agent - CoexistenceInfoProvider.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
22 package org.snmp4j.agent.mo.snmp;
23
24 import org.snmp4j.smi.OctetString;
25 import org.snmp4j.smi.Address;
26
27 /**
28  * A <code>CoexistenceInfoProvider</code> provides access to coexistence
29  * information.
30  *
31  * @author Frank Fock
32  * @version 1.0
33  */

34 public interface CoexistenceInfoProvider {
35
36   /**
37    * Gets the information needed for community based security protocols to
38    * coexistence with the SNMPv3 security model.
39    *
40    * @param community
41    * a community OctetString that identifies the coexistence information
42    * required.
43    * @return
44    * the CoexistenceInfo with security name, context engine ID, context, and
45    * optionally a transport tag
46    */

47   CoexistenceInfo getCoexistenceInfo(OctetString community);
48
49   /**
50    * Returns the community associated with the supplied security name.
51    * @param securityName
52    * the security name.
53    * @param contextEngineID
54    * the context engine ID of the remote target (when proxying) otherwise
55    * the local engine ID.
56    * @param contextName
57    * the context name (default is an empty string).
58    * @return OctetString
59    * the associated community string or <code>null</code> if such an
60    * association does not exists.
61    */

62   OctetString getCommunity(OctetString securityName,
63                            OctetString contextEngineID,
64                            OctetString contextName);
65
66   /**
67    * Checks whether the supplied address passes the source address filtering
68    * provided for community based security models.
69    *
70    * @param address
71    * the source Address of a SNMP message.
72    * @param coexistenceInfo
73    * a set of coexistence information (returned by
74    * {@link #getCoexistenceInfo}) that provides the transport tag
75    * used to identify allowed source addresses. On return, the maximum
76    * message size attribute of the coexistence info set will be set
77    * according to the values defined for the matched source address in
78    * the snmpTargetAddrExtTable.
79    * @return
80    * <code>true</code> if the address passes the filter, <code>false</code>
81    * otherwise.
82    */

83   boolean passesFilter(Address address, CoexistenceInfo coexistenceInfo);
84
85 }
86
Popular Tags