Package org.snmp4j
Interface Target
- All Superinterfaces:
 Cloneable,Serializable
- All Known Implementing Classes:
 AbstractTarget,CertifiedTarget,CommunityTarget,SecureTarget,TlsX509CertifiedTarget,UserTarget
A 
Target interface 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:
 - 2.0
 - Author:
 - Frank Fock
 
- 
Method Summary
Modifier and TypeMethodDescriptionclone()Creates a new copy of this target with the same address type.Gets the address of this target.intGets the maximum size of request PDUs that this target is able to respond to.List<TransportMapping<? extends Address>>Gets the prioritised list of transport mappings to be used for this target.intGets the number of retries.intGets the security level associated with this target.intGets the security model associated with this target.Gets the security name associated with this target.longGets the timeout for a target.intGets the SNMP version (NMP messagen processing model) of the target.voidsetAddress(Address 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 Details
- 
getAddress
Address getAddress()Gets the address of this target.- Returns:
 - an Address instance.
 
 - 
setAddress
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:
 
 - 
getVersion
int getVersion()Gets the SNMP version (NMP messagen processing model) of the target.- Returns:
 - the message processing model ID.
 - See Also:
 
 - 
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
List<TransportMapping<? extends Address>> 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
Object clone() - 
duplicate
Target 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:
 - 2.8.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
Sets the security name to be used with this target.- Parameters:
 securityName- anOctetStringinstance (must not benull).- See Also:
 
 
 -