// Create USM parameters for the principal defaultuser (user used when
// requests are sent: the defaultUser is a template and for this
// reason we cannot find it under the user mib (not created as a user)
//
final SnmpUsmParameters paramsV3 = new SnmpUsmParameters(
engine,
user);
// Set the security level authentication but without privacy
//
paramsV3.setSecurityLevel(securityLevel);
// Set the context name
//
if (community.compareTo("null") != 0) {
paramsV3.setContextName(community.getBytes());
}
// Set the contextEngineId discovered by the peer upon
// its creation
//
paramsV3.setContextEngineId(agentV3.getEngineId().getBytes());
// Associate the parameters with the agent
//
agentV3.setTimeout(timeOut);
agentV3.setMaxTries(maxRetries);