KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > snmp4j > Target


1 /*_############################################################################
2   _##
3   _## SNMP4J - Target.java
4   _##
5   _## Copyright 2003-2007 Frank Fock and Jochen Katz (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
23
24
25 package org.snmp4j;
26
27 import java.io.Serializable JavaDoc;
28 import org.snmp4j.smi.Address;
29 // for JavaDoc
30
import org.snmp4j.mp.SnmpConstants;
31
32 /**
33  * A <code>Target</code> interface defines an abstract representation of a
34  * remote SNMP entity. It represents a target with an Address object, as well
35  * protocol parameters such as retransmission and timeout policy.
36  *
37  * @author Frank Fock
38  * @version 1.6
39  */

40 public interface Target extends Serializable JavaDoc, Cloneable JavaDoc {
41
42   /**
43    * Gets the address of this target.
44    * @return
45    * an Address instance.
46    */

47   Address getAddress();
48
49   /**
50    * Sets the address of the target.
51    * @param address
52    * an Address instance.
53    */

54   void setAddress(Address address);
55
56   /**
57    * Sets the SNMP version (thus the SNMP messagen processing model) of the
58    * target.
59    * @param version
60    * the message processing model ID.
61    * @see org.snmp4j.mp.SnmpConstants#version1
62    * @see org.snmp4j.mp.SnmpConstants#version2c
63    * @see org.snmp4j.mp.SnmpConstants#version3
64    */

65   void setVersion(int version);
66
67   /**
68    * Gets the SNMP version (NMP messagen processing model) of the target.
69    * @return
70    * the message processing model ID.
71    * @see org.snmp4j.mp.SnmpConstants#version1
72    * @see org.snmp4j.mp.SnmpConstants#version2c
73    * @see org.snmp4j.mp.SnmpConstants#version3
74    */

75   int getVersion();
76
77   /**
78    * Sets the number of retries to be performed before a request is timed out.
79    * @param retries
80    * the number of retries. <em>Note: If the number of retries is set to
81    * 0, then the request will be sent out exactly once.</em>
82    */

83   void setRetries(int retries);
84
85   /**
86    * Gets the number of retries.
87    * @return
88    * an integer >= 0.
89    */

90   int getRetries();
91
92   /**
93    * Sets the timeout for a target.
94    * @param timeout
95    * timeout in milliseconds before a confirmed request is resent or
96    * timed out.
97    */

98   void setTimeout(long timeout);
99
100   /**
101    * Gets the timeout for a target.
102    * @return
103    * the timeout in milliseconds.
104    */

105   long getTimeout();
106
107   /**
108    * Gets the maxmim size of request PDUs that this target is able to respond
109    * to. The default is 65535.
110    * @return
111    * the maximum PDU size of request PDUs for this target. Which is always
112    * greater than 484.
113    */

114   int getMaxSizeRequestPDU();
115
116   /**
117    * Sets the maximum size of request PDUs that this target is able to receive.
118    * @param maxSizeRequestPDU
119    * the maximum PDU (SNMP message) size this session will be able to
120    * process.
121    */

122   void setMaxSizeRequestPDU(int maxSizeRequestPDU);
123
124   Object JavaDoc clone();
125 }
126
127
Popular Tags