KickJava   Java API By Example, From Geeks To Geeks.

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


1 /*_############################################################################
2   _##
3   _## SNMP4J-Agent - TDomainAddressFactory.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.OID;
25 import org.snmp4j.smi.OctetString;
26 import org.snmp4j.smi.Address;
27
28 /**
29  * The <code>TDomainAddressFactory</code> defines the interface for address
30  * factories that can create an address from a transport domain ID and a
31  * TDomainAddress textual convention conforming <code>OctetString</code> value
32  * and vice versa.
33  *
34  * @author Frank Fock
35  * @version 1.0
36  */

37 public interface TDomainAddressFactory {
38
39   /**
40    * Creates an <code>Address</code> from a transport domain ID and a
41    * TDomainAddress textual convention conforming <code>OctetString</code>
42    * value.
43    * @param transportDomain
44    * a transport domain ID as defined by {@link TransportDomains}.
45    * @param address
46    * a TDomainAddress TC conforming <code>OctetString</code>.
47    * @return
48    * an <code>Address</code> if <code>address</code> could be mapped or
49    * <code>null</code> if not.
50    */

51   Address createAddress(OID transportDomain, OctetString address);
52
53   /**
54    * Checks whether a transport domain ID and a <code>OctetString</code> value
55    * represent a valid and consistent address.
56    * @param transportDomain
57    * a transport domain ID as defined by {@link TransportDomains}.
58    * @param address
59    * an <code>OctetString</code>.
60    * @return
61    * <code>true</code> if <code>transportDomain</code> and
62    * <code>address</code> are consitent and valid.
63    */

64   boolean isValidAddress(OID transportDomain, OctetString address);
65
66   /**
67    * Gets the transport domain ID for the specified address.
68    * @param address
69    * an address.
70    * @return
71    * the corresponding transport domain ID as defined by
72    * {@link TransportDomains} or <code>null</code> if the address cannot be
73    * mapped.
74    */

75   OID getTransportDomain(Address address);
76
77   /**
78    * Gets the TDomainAddress textual convention conforming
79    * <code>OctetString</code> value for the specified address.
80    * @param address
81    * an address.
82    * @return
83    * a TDomainAddress <code>OctetString</code> value or <code>null</code>
84    * if the address cannot be mapped.
85    */

86   OctetString getAddress(Address address);
87
88 }
89
Popular Tags