org.snmp4j
Class CommunityTarget

java.lang.Object
  extended by org.snmp4j.AbstractTarget
      extended by org.snmp4j.CommunityTarget
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable, Target

public class CommunityTarget
extends AbstractTarget

A CommunityTarget represents SNMP target properties for community based message processing models (SNMPv1 and SNMPv2c).

Version:
1.1
Author:
Frank Fock
See Also:
Serialized Form

Field Summary
 
Fields inherited from class org.snmp4j.AbstractTarget
securityLevel, securityModel, securityName
 
Constructor Summary
CommunityTarget()
          Default constructor.
CommunityTarget(Address address, OctetString community)
          Creates a fully specified community target.
 
Method Summary
 OctetString getCommunity()
          Gets the community octet string.
 int getSecurityModel()
          Gets the security model associated with this target.
 void setCommunity(OctetString community)
          Sets the community octet sting.
 void setSecurityLevel(int securityLevel)
          Sets the security level for this target.
 void setSecurityModel(int securityModel)
          Sets the security model for this target.
 java.lang.String toString()
           
 
Methods inherited from class org.snmp4j.AbstractTarget
clone, getAddress, getMaxSizeRequestPDU, getPreferredTransports, getRetries, getSecurityLevel, getSecurityName, getTimeout, getVersion, setAddress, setMaxSizeRequestPDU, setPreferredTransports, setRetries, setSecurityName, setTimeout, setVersion, toStringAbstractTarget
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

CommunityTarget

public CommunityTarget()
Default constructor.


CommunityTarget

public CommunityTarget(Address address,
                       OctetString community)
Creates a fully specified community target.

Parameters:
address - the transport Address of the target.
community - the community to be used for the target.
Method Detail

getCommunity

public OctetString getCommunity()
Gets the community octet string.

Returns:
an OctetString instance, never null.

setCommunity

public void setCommunity(OctetString community)
Sets the community octet sting.

Parameters:
community - an OctetString instance which must not be null.

getSecurityModel

public int getSecurityModel()
Description copied from interface: Target
Gets the security model associated with this target.

Specified by:
getSecurityModel in interface Target
Overrides:
getSecurityModel in class AbstractTarget
Returns:
an int value as defined in the SecurityModel interface or any third party subclass thereof.

setSecurityLevel

public void setSecurityLevel(int securityLevel)
Description copied from class: AbstractTarget
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.

Overrides:
setSecurityLevel in class AbstractTarget
Parameters:
securityLevel - one of


setSecurityModel

public void setSecurityModel(int securityModel)
Description copied from class: AbstractTarget
Sets the security model for this target.

Overrides:
setSecurityModel in class AbstractTarget
Parameters:
securityModel - an int value as defined in the SecurityModel interface or any third party subclass thereof.

toString

public java.lang.String toString()
Overrides:
toString in class AbstractTarget

Copyright 2005-2011 Frank Fock (SNMP4J.org)

Copyright © 2011 SNMP4J.org. All Rights Reserved.