-
- All Superinterfaces:
java.lang.Cloneable,java.io.Serializable
- All Known Implementing Classes:
AbstractTarget,CertifiedTarget,CommunityTarget,DirectUserTarget,SecureTarget,TlsX509CertifiedTarget,UserTarget
public interface Target<A extends Address> extends java.io.Serializable, java.lang.CloneableATargetinterface defines an abstract representation of a remote SNMP entity. It represents a target with an Address object, as well protocol parameters such as retransmission and timeout policy.- Version:
- 3.1.0
- Author:
- Frank Fock
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description java.lang.Objectclone()Target<A>duplicate()Creates a new copy of this target with the same address type.AgetAddress()Gets the address of this target.intgetMaxSizeRequestPDU()Gets the maximum size of request PDUs that this target is able to respond to.java.util.List<TransportMapping<? super A>>getPreferredTransports()Gets the prioritised list of transport mappings to be used for this target.intgetRetries()Gets the number of retries.intgetSecurityLevel()Gets the security level associated with this target.intgetSecurityModel()Gets the security model associated with this target.OctetStringgetSecurityName()Gets the security name associated with this target.longgetTimeout()Gets the timeout for a target.intgetVersion()Gets the SNMP version (NMP messagen processing model) of the target.voidsetAddress(A address)Sets the address of the target.voidsetMaxSizeRequestPDU(int maxSizeRequestPDU)Sets the maximum size of request PDUs that this target is able to receive.voidsetRetries(int retries)Sets the number of retries to be performed before a request is timed out.voidsetSecurityLevel(int securityLevel)Sets the security level for this target.voidsetSecurityModel(int securityModel)Sets the security model for this target.voidsetSecurityName(OctetString securityName)Sets the security name to be used with this target.voidsetTimeout(long timeout)Sets the timeout for a target.voidsetVersion(int version)Sets the SNMP version (thus the SNMP message processing model) of the target.
-
-
-
Method Detail
-
getAddress
A getAddress()
Gets the address of this target.- Returns:
- an Address instance.
-
setAddress
void setAddress(A address)
Sets the address of the target.- Parameters:
address- an Address instance.
-
setVersion
void setVersion(int version)
Sets the SNMP version (thus the SNMP message processing model) of the target.- Parameters:
version- the message processing model ID.- See Also:
SnmpConstants.version1,SnmpConstants.version2c,SnmpConstants.version3
-
getVersion
int getVersion()
Gets the SNMP version (NMP messagen processing model) of the target.- Returns:
- the message processing model ID.
- See Also:
SnmpConstants.version1,SnmpConstants.version2c,SnmpConstants.version3
-
setRetries
void setRetries(int retries)
Sets the number of retries to be performed before a request is timed out.- Parameters:
retries- the number of retries. Note: If the number of retries is set to 0, then the request will be sent out exactly once.
-
getRetries
int getRetries()
Gets the number of retries.- Returns:
- an integer >= 0.
-
setTimeout
void setTimeout(long timeout)
Sets the timeout for a target.- Parameters:
timeout- timeout in milliseconds before a confirmed request is resent or timed out.
-
getTimeout
long getTimeout()
Gets the timeout for a target.- Returns:
- the timeout in milliseconds.
-
getMaxSizeRequestPDU
int getMaxSizeRequestPDU()
Gets the maximum size of request PDUs that this target is able to respond to. The default is 65535.- Returns:
- the maximum PDU size of request PDUs for this target. Which is always greater than 484.
-
setMaxSizeRequestPDU
void setMaxSizeRequestPDU(int maxSizeRequestPDU)
Sets the maximum size of request PDUs that this target is able to receive.- Parameters:
maxSizeRequestPDU- the maximum PDU (SNMP message) size this session will be able to process.
-
getPreferredTransports
java.util.List<TransportMapping<? super A>> getPreferredTransports()
Gets the prioritised list of transport mappings to be used for this target. The first mapping in the list that matches the target address is chosen for sending new requests.- Returns:
- an ordered list of
TransportMappinginstances. - Since:
- 2.0
-
clone
java.lang.Object clone()
-
duplicate
Target<A> duplicate()
Creates a new copy of this target with the same address type.- Returns:
- a copy of this target with the same address type.
- Since:
- 3.2.0
-
getSecurityModel
int getSecurityModel()
Gets the security model associated with this target.- Returns:
- an
intvalue as defined in theSecurityModelinterface or any third party subclass thereof.
-
getSecurityName
OctetString getSecurityName()
Gets the security name associated with this target. The security name is used by the security model to lookup further parameters like authentication and privacy protocol settings from the security model dependent internal storage.- Returns:
- an
OctetStringinstance (nevernull).
-
getSecurityLevel
int getSecurityLevel()
Gets the security level associated with this target.
-
setSecurityLevel
void setSecurityLevel(int securityLevel)
Sets the security level for this target. The supplied security level must be supported by the security model dependent information associated with the security name set for this target.- Parameters:
securityLevel- one of
-
setSecurityModel
void setSecurityModel(int securityModel)
Sets the security model for this target.- Parameters:
securityModel- anintvalue as defined in theSecurityModelinterface or any third party subclass thereof.
-
setSecurityName
void setSecurityName(OctetString securityName)
Sets the security name to be used with this target.- Parameters:
securityName- anOctetStringinstance (must not benull).- See Also:
getSecurityName()
-
-