Package com.santaba.agent.groovyapi.snmp
Class Session.Builder
- java.lang.Object
-
- com.santaba.agent.groovyapi.snmp.Session.Builder
-
- Enclosing class:
- Session
public static class Session.Builder extends java.lang.Object
A helper class to help to build the Session for snmpimport com.santaba.agent.groovyapi.snmp.Session Session.Builder builder = Session.Builder.newBuilder() Session session = builder.withHost("XXXYourHost").withVersion("v2c") // ... withYYY other methods to set more properties .build() // use it println session.get("1.3.4.5")
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description Session
build()
static Session.Builder
newBuilder()
Session.Builder
withAuthProtocol(java.lang.String authProtocol)
Session.Builder
withAuthToken(java.lang.String authToken)
Session.Builder
withCommunity(java.lang.String community)
Session.Builder
withContextEngineId(java.lang.String contextEngineId)
Session.Builder
withContextName(java.lang.String contextName)
Session.Builder
withHost(java.lang.String host)
Session.Builder
withPort(int port)
Session.Builder
withPrivProtocol(java.lang.String privProtocol)
Session.Builder
withPrivToken(java.lang.String privToken)
Session.Builder
withProps(java.util.Map<java.lang.String,java.lang.String> otherProps)
inject more propertiesSession.Builder
withSecurity(java.lang.String security)
Session.Builder
withTimeoutMills(int timeoutMills)
Session.Builder
withVersion(java.lang.String version)
-
-
-
Method Detail
-
newBuilder
public static Session.Builder newBuilder()
-
withProps
public Session.Builder withProps(java.util.Map<java.lang.String,java.lang.String> otherProps)
inject more properties- Parameters:
otherProps
- a map with key and value like snmp.authToken ....- Returns:
-
withHost
public Session.Builder withHost(java.lang.String host)
-
withVersion
public Session.Builder withVersion(java.lang.String version)
-
withCommunity
public Session.Builder withCommunity(java.lang.String community)
-
withSecurity
public Session.Builder withSecurity(java.lang.String security)
-
withAuthProtocol
public Session.Builder withAuthProtocol(java.lang.String authProtocol)
-
withAuthToken
public Session.Builder withAuthToken(java.lang.String authToken)
-
withPrivProtocol
public Session.Builder withPrivProtocol(java.lang.String privProtocol)
-
withPrivToken
public Session.Builder withPrivToken(java.lang.String privToken)
-
withContextName
public Session.Builder withContextName(java.lang.String contextName)
-
withContextEngineId
public Session.Builder withContextEngineId(java.lang.String contextEngineId)
-
withTimeoutMills
public Session.Builder withTimeoutMills(int timeoutMills)
-
withPort
public Session.Builder withPort(int port)
-
build
public Session build() throws java.io.IOException
- Throws:
java.io.IOException
-
-