org.snmp4j
Class SNMP4JSettings

java.lang.Object
  extended by org.snmp4j.SNMP4JSettings

public final class SNMP4JSettings
extends java.lang.Object

The SNMP4JSettings class implements a central configuration class of the SNMP4J framework. As a rule of thumb, changes to the default configuration should be made before any other classes of the SNMP4J API are instantiated or referenced by the application code.

Since:
1.5
Version:
1.10
Author:
Frank Fock

Constructor Summary
SNMP4JSettings()
           
 
Method Summary
static OIDTextFormat getOIDTextFormat()
          Gets the OID text format for textual representation of OIDs.
static ThreadFactory getThreadFactory()
          Gets the thread factory.
static long getThreadJoinTimeout()
          Gets the Thread join timeout used to join threads if no explicit timeout is set.
static TimerFactory getTimerFactory()
          Gets the timer factory.
static VariableTextFormat getVariableTextFormat()
          Gets the variable text format for textual representation of variable bindings.
static boolean isExtensibilityEnabled()
          Tests if the extensibility feature is enabled.
static boolean isFowardRuntimeExceptions()
          Indicates whether runtime exceptions should be thrown on thread boundaries controlled by SNMP4J and related APIs.
static void setExtensibilityEnabled(boolean enable)
          Enables (or disables) the extensibility feature of SNMP4J.
static void setForwardRuntimeExceptions(boolean forwardExceptions)
          Enables or disables runtime exception forwarding.
static void setOIDTextFormat(OIDTextFormat newOidTextFormat)
          Sets the OID text format to be used by SNMP4J.
static void setThreadFactory(ThreadFactory newThreadFactory)
          Sets the thread factory for creating new threads of execution.
static void setThreadJoinTimeout(long millis)
          Sets the Thread join timeout used to join threads if no explicit timeout is set.
static void setTimerFactory(TimerFactory newTimerFactory)
          Sets the timer factory for creating new timer instances.
static void setVariableTextFormat(VariableTextFormat newVariableTextFormat)
          Sets the variable text format to be used by SNMP4J.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SNMP4JSettings

public SNMP4JSettings()
Method Detail

setExtensibilityEnabled

public static void setExtensibilityEnabled(boolean enable)
Enables (or disables) the extensibility feature of SNMP4J. When enabled, SNMP4J checks certain properties files that describe which transport mappings, address types, SMI syntaxes, security protocols, etc. should be supported by SNMP4J.

By default, the extensibility feature is disabled which provides a faster startup and since no system properties are read, it ensures that SNMP4J can be used also in secure environments like applets.

Parameters:
enable - if true activates extensibility or if false disables it. In the latter case, SNMP4J's default configuration will be used with all available features.
Since:
1.2.2

isExtensibilityEnabled

public static final boolean isExtensibilityEnabled()
Tests if the extensibility feature is enabled.

Returns:
if true the extensibility is enabled otherwise it is disabled. In the latter case, SNMP4J's default configuration will be used with all available features.
Since:
1.2.2

setForwardRuntimeExceptions

public static void setForwardRuntimeExceptions(boolean forwardExceptions)
Enables or disables runtime exception forwarding.

Parameters:
forwardExceptions - true runtime exceptions are thrown on thread boundaries controlled by SNMP4J and related APIs. Default is false.
Since:
1.8.1
See Also:
forwardRuntimeExceptions

isFowardRuntimeExceptions

public static final boolean isFowardRuntimeExceptions()
Indicates whether runtime exceptions should be thrown on thread boundaries controlled by SNMP4J and related APIs.

Returns:
true runtime exceptions are thrown on thread boundaries controlled by SNMP4J and related APIs. Default is false.
Since:
1.8.1

getThreadFactory

public static final ThreadFactory getThreadFactory()
Gets the thread factory.

Returns:
a ThreadFactory.
Since:
1.9

setThreadFactory

public static final void setThreadFactory(ThreadFactory newThreadFactory)
Sets the thread factory for creating new threads of execution.

Parameters:
newThreadFactory - a ThreadFactory (must not be null).
Since:
1.9

getTimerFactory

public static final TimerFactory getTimerFactory()
Gets the timer factory.

Returns:
a TimerFactory.
Since:
1.9

setTimerFactory

public static final void setTimerFactory(TimerFactory newTimerFactory)
Sets the timer factory for creating new timer instances.

Parameters:
newTimerFactory - a TimerFactory (must not be null).
Since:
1.9

getOIDTextFormat

public static final OIDTextFormat getOIDTextFormat()
Gets the OID text format for textual representation of OIDs.

Returns:
an OIDTextFormat instance.
Since:
1.10

setOIDTextFormat

public static final void setOIDTextFormat(OIDTextFormat newOidTextFormat)
Sets the OID text format to be used by SNMP4J.

Parameters:
newOidTextFormat - the new OIDTextFormat (must not be null).
Since:
1.10

getVariableTextFormat

public static final VariableTextFormat getVariableTextFormat()
Gets the variable text format for textual representation of variable bindings.

Returns:
an VariableTextFormat instance.
Since:
1.10

setVariableTextFormat

public static final void setVariableTextFormat(VariableTextFormat newVariableTextFormat)
Sets the variable text format to be used by SNMP4J.

Parameters:
newVariableTextFormat - the new VariableTextFormat (must not be null).
Since:
1.10

getThreadJoinTimeout

public static long getThreadJoinTimeout()
Gets the Thread join timeout used to join threads if no explicit timeout is set.

Returns:
the timeout millis.
Since:
1.10.2

setThreadJoinTimeout

public static void setThreadJoinTimeout(long millis)
Sets the Thread join timeout used to join threads if no explicit timeout is set.

Parameters:
millis - the maximum time in milli-seconds to wait for a Thread to join if no explicit timeout has been set.
Since:
1.10.2

Copyright 2005-2010 Frank Fock (SNMP4J.org)

Copyright © 2011 SNMP4J.org. All Rights Reserved.