Java Doc for MPv3.java in  » Net » snmp4j » org » snmp4j » mp » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » Net » snmp4j » org.snmp4j.mp 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   org.snmp4j.mp.MPv3

MPv3
public class MPv3 implements MessageProcessingModel(Code)
The MPv3 is the message processing model for SNMPv3.
author:
   Frank Fock
version:
   1.9.1

Inner Class :protected static class CacheEntry extends StateReference
Inner Class :protected static class Cache
Inner Class :protected static class HeaderData implements BERSerializable

Field Summary
final public static  intID
    
final public static  intMAXLEN_ENGINE_ID
    
final public static  intMAX_MESSAGE_ID
    
final public static  intMINLEN_ENGINE_ID
    
final public static  intMPv3_REPORTABLE_FLAG
    
protected  PDUFactoryincomingPDUFactory
    
transient  VectorsnmpEngineListeners
    

Constructor Summary
public  MPv3()
     Creates a MPv3 with a default local engine ID.
public  MPv3(byte[] localEngineID)
     Creates a MPv3 with a supplied local engine ID.
Parameters:
  localEngineID - the local engine ID.
public  MPv3(byte[] localEngineID, PDUFactory incomingPDUFactory)
     Creates a MPv3 with a supplied local engine ID and PDUFactory for incoming messages.
Parameters:
  localEngineID - the local engine ID.

Method Summary
public  booleanaddEngineID(Address address, OctetString engineID)
     Adds an engine ID (other than the local engine ID) to the internal storage.
public synchronized  voidaddSnmpEngineListener(SnmpEngineListener l)
     Adds a SNMP engine listener that needs to be informed about changes to the engine ID cache.
public static  byte[]createLocalEngineID()
     Creates a local engine ID based on the local IP address.
public static  byte[]createLocalEngineID(OctetString id)
    
public  PDUcreatePDU(Target target)
     Creates a PDU class that is used to parse incoming SNMP messages.
protected  voidfireEngineChanged(SnmpEngineEvent engineEvent)
     Fires a SNMP engine event the registered listeners.
protected  voidfireIncrementCounter(CounterEvent e)
     Fire a counter incrementation event.
public  AuthenticationProtocolgetAuthProtocol(OID id)
     Gets an authentication protocol for the supplied ID.
public  CounterSupportgetCounterSupport()
     Gets the counter support instance that can be used to register for counter incremnetation events.
protected  intgetDefaultSecurityModel()
     Gets the default security model to be used for engine ID discovery.
public  OctetStringgetEngineID(Address address)
     Gets the engine ID associated with the supplied address from the local storage and fires the corresponding SnmpEngineEvent .
public static  intgetEnterpriseID()
     Gets the enterprise ID used for creating the local engine ID.
public  intgetID()
    
public  byte[]getLocalEngineID()
     Gets a copy of the local engine ID.
public synchronized  intgetNextMessageID()
     Gets unique message ID.
public  PrivacyProtocolgetPrivProtocol(OID id)
     Gets an privacy protocol for the supplied ID.
public  SecurityModelgetSecurityModel(int id)
     Gets the security model for the supplied ID.
public  SecurityModelsgetSecurityModels()
     Gets the security models supported by this MPv3.
public  SecurityProtocolsgetSecurityProtocols()
     Gets the security protocols supported by this MPv3.
public  voidinitDefaults()
     Creates and initializes the default security protocols.
public  booleanisProtocolVersionSupported(int version)
    
public  intprepareDataElements(MessageDispatcher messageDispatcher, Address transportAddress, BERInputStream wholeMsg, Integer32 messageProcessingModel, Integer32 securityModel, OctetString securityName, Integer32 securityLevel, MutablePDU pdu, PduHandle sendPduHandle, Integer32 maxSizeResponseScopedPDU, StatusInformation statusInformation, MutableStateReference mutableStateReference)
    
public  intprepareOutgoingMessage(Address transportAddress, int maxMessageSize, int messageProcessingModel, int securityModel, byte[] securityName, int securityLevel, PDU pdu, boolean expectResponse, PduHandle sendPduHandle, Address destTransportAddress, BEROutputStream outgoingMessage)
    
public  intprepareResponseMessage(int messageProcessingModel, int maxMessageSize, int securityModel, byte[] securityName, int securityLevel, PDU pdu, int maxSizeResponseScopedPDU, StateReference stateReference, StatusInformation statusInformation, BEROutputStream outgoingMessage)
    
public  voidreleaseStateReference(PduHandle pduHandle)
    
public  OctetStringremoveEngineID(Address address)
     Removes an engine ID association from the local storage and fires the corresponding SnmpEngineEvent .
public synchronized  voidremoveSnmpEngineListener(SnmpEngineListener l)
     Removes a SNMP engine listener.
public  intsendReport(MessageDispatcher messageDispatcher, ScopedPDU pdu, int securityLevel, int securityModel, OctetString securityName, int maxSizeResponseScopedPDU, StateReference stateReference, VariableBinding payload)
     Sends a report message.
public  voidsetCounterSupport(CounterSupport counterSupport)
     Sets the counter support instance.
public static  voidsetEnterpriseID(int newEnterpriseID)
     Sets the IANA enterprise ID to be used for creating local engine ID by MPv3.createLocalEngineID() .
public  voidsetLocalEngineID(byte[] engineID)
     Sets the local engine ID.
public  voidsetSecurityModels(SecurityModels securityModels)
     Sets the security models supported by this MPv3.
public  voidsetSecurityProtocols(SecurityProtocols securityProtocols)
     Sets the security protocols for this MPv3.

Field Detail
ID
final public static int ID(Code)



MAXLEN_ENGINE_ID
final public static int MAXLEN_ENGINE_ID(Code)



MAX_MESSAGE_ID
final public static int MAX_MESSAGE_ID(Code)



MINLEN_ENGINE_ID
final public static int MINLEN_ENGINE_ID(Code)



MPv3_REPORTABLE_FLAG
final public static int MPv3_REPORTABLE_FLAG(Code)



incomingPDUFactory
protected PDUFactory incomingPDUFactory(Code)



snmpEngineListeners
transient Vector snmpEngineListeners(Code)




Constructor Detail
MPv3
public MPv3()(Code)
Creates a MPv3 with a default local engine ID.



MPv3
public MPv3(byte[] localEngineID)(Code)
Creates a MPv3 with a supplied local engine ID.
Parameters:
  localEngineID - the local engine ID. Its length must be >= 5 and <= 32.



MPv3
public MPv3(byte[] localEngineID, PDUFactory incomingPDUFactory)(Code)
Creates a MPv3 with a supplied local engine ID and PDUFactory for incoming messages.
Parameters:
  localEngineID - the local engine ID. Its length must be >= 5 and <= 32.
Parameters:
  incomingPDUFactory - a PDUFactory. If null the default factory will beused which creates ScopedPDU instances.
since:
   1.9.1




Method Detail
addEngineID
public boolean addEngineID(Address address, OctetString engineID)(Code)
Adds an engine ID (other than the local engine ID) to the internal storage.
Parameters:
  address - the Address of the remote SNMP engine.
Parameters:
  engineID - the engine ID of the remote SNMP engine.true if the engine ID has been added, falseotherwise (if the supplied engineID equals the local one).



addSnmpEngineListener
public synchronized void addSnmpEngineListener(SnmpEngineListener l)(Code)
Adds a SNMP engine listener that needs to be informed about changes to the engine ID cache.
Parameters:
  l - a SnmpEngineListener instance.
since:
   1.6



createLocalEngineID
public static byte[] createLocalEngineID()(Code)
Creates a local engine ID based on the local IP address. a new local engine ID.



createLocalEngineID
public static byte[] createLocalEngineID(OctetString id)(Code)
Creates a local engine ID based on the ID string supplied
Parameters:
  id - an ID string.a new local engine ID.



createPDU
public PDU createPDU(Target target)(Code)
Creates a PDU class that is used to parse incoming SNMP messages.
Parameters:
  target - the target parameter must be ignored.a ScopedPDU instance by default.
since:
   1.9.1



fireEngineChanged
protected void fireEngineChanged(SnmpEngineEvent engineEvent)(Code)
Fires a SNMP engine event the registered listeners.
Parameters:
  engineEvent - the SnmpEngineEvent instance to fire.
since:
   1.6



fireIncrementCounter
protected void fireIncrementCounter(CounterEvent e)(Code)
Fire a counter incrementation event.
Parameters:
  e - CounterEvent



getAuthProtocol
public AuthenticationProtocol getAuthProtocol(OID id)(Code)
Gets an authentication protocol for the supplied ID.
Parameters:
  id - an authentication protocol OID.an AuthenticationProtocol instance if the supplied IDis supported, otherwise null is returned.



getCounterSupport
public CounterSupport getCounterSupport()(Code)
Gets the counter support instance that can be used to register for counter incremnetation events. a CounterSupport instance that is used to fireCounterEvent.



getDefaultSecurityModel
protected int getDefaultSecurityModel()(Code)
Gets the default security model to be used for engine ID discovery. a security model ID.
See Also:   USM.getID



getEngineID
public OctetString getEngineID(Address address)(Code)
Gets the engine ID associated with the supplied address from the local storage and fires the corresponding SnmpEngineEvent .
Parameters:
  address - the Address of the remote SNMP engine.the engine ID of the remote SNMP engine or null if thereis no entry for address in the local storage.



getEnterpriseID
public static int getEnterpriseID()(Code)
Gets the enterprise ID used for creating the local engine ID. an enterprise ID as registered by the IANA (see http://www.iana.org).



getID
public int getID()(Code)



getLocalEngineID
public byte[] getLocalEngineID()(Code)
Gets a copy of the local engine ID. a byte array containing the local engine ID.



getNextMessageID
public synchronized int getNextMessageID()(Code)
Gets unique message ID. a message ID >= 1 and <= MPv3.MAX_MESSAGE_ID.



getPrivProtocol
public PrivacyProtocol getPrivProtocol(OID id)(Code)
Gets an privacy protocol for the supplied ID.
Parameters:
  id - an privacy protocol OID.an PrivacyProtocol instance if the supplied IDis supported, otherwise null is returned.



getSecurityModel
public SecurityModel getSecurityModel(int id)(Code)
Gets the security model for the supplied ID.
Parameters:
  id - a security model ID.a SecurityModel instance if the supplied IDis supported, otherwise null is returned.



getSecurityModels
public SecurityModels getSecurityModels()(Code)
Gets the security models supported by this MPv3. a SecurityModels instance.



getSecurityProtocols
public SecurityProtocols getSecurityProtocols()(Code)
Gets the security protocols supported by this MPv3. return a SecurityProtocols.



initDefaults
public void initDefaults()(Code)
Creates and initializes the default security protocols.
See Also:   SecurityProtocols.addDefaultProtocols



isProtocolVersionSupported
public boolean isProtocolVersionSupported(int version)(Code)



prepareDataElements
public int prepareDataElements(MessageDispatcher messageDispatcher, Address transportAddress, BERInputStream wholeMsg, Integer32 messageProcessingModel, Integer32 securityModel, OctetString securityName, Integer32 securityLevel, MutablePDU pdu, PduHandle sendPduHandle, Integer32 maxSizeResponseScopedPDU, StatusInformation statusInformation, MutableStateReference mutableStateReference)(Code)



prepareOutgoingMessage
public int prepareOutgoingMessage(Address transportAddress, int maxMessageSize, int messageProcessingModel, int securityModel, byte[] securityName, int securityLevel, PDU pdu, boolean expectResponse, PduHandle sendPduHandle, Address destTransportAddress, BEROutputStream outgoingMessage) throws IOException(Code)



prepareResponseMessage
public int prepareResponseMessage(int messageProcessingModel, int maxMessageSize, int securityModel, byte[] securityName, int securityLevel, PDU pdu, int maxSizeResponseScopedPDU, StateReference stateReference, StatusInformation statusInformation, BEROutputStream outgoingMessage) throws IOException(Code)



releaseStateReference
public void releaseStateReference(PduHandle pduHandle)(Code)



removeEngineID
public OctetString removeEngineID(Address address)(Code)
Removes an engine ID association from the local storage and fires the corresponding SnmpEngineEvent .
Parameters:
  address - the Address of the remote SNMP engine for whose engine IDis to be removed.the removed engine ID of the remote SNMP engine or null ifthere is no entry for address in the local storage.



removeSnmpEngineListener
public synchronized void removeSnmpEngineListener(SnmpEngineListener l)(Code)
Removes a SNMP engine listener.
Parameters:
  l - a SnmpEngineListener instance.
since:
   1.6



sendReport
public int sendReport(MessageDispatcher messageDispatcher, ScopedPDU pdu, int securityLevel, int securityModel, OctetString securityName, int maxSizeResponseScopedPDU, StateReference stateReference, VariableBinding payload)(Code)
Sends a report message.
Parameters:
  messageDispatcher - Send the message on behalf the supplied MessageDispatcher instance.
Parameters:
  pdu - ScopedPDUIf null, then contextEngineID, contextName, and requestIDof the report generated will be zero length and zero respective.Otherwise these values are extracted from the PDU.
Parameters:
  securityLevel - The security level to use when sending this report.
Parameters:
  securityModel - The security model to use when sending this report.
Parameters:
  securityName - The security name to use when sending this report.
Parameters:
  maxSizeResponseScopedPDU - the maximum size of of the report message (will be most likely ignoredbecause a report should always fit in 484 bytes).
Parameters:
  payload - the variable binding to include in the report message.
Parameters:
  stateReference - the state reference associated with the original message.an SNMP MPv3 error code or 0 if the report has been send successfully.



setCounterSupport
public void setCounterSupport(CounterSupport counterSupport)(Code)
Sets the counter support instance. By default, the singleton instance provided by the CounterSupport instance is used.
Parameters:
  counterSupport - a CounterSupport subclass instance.



setEnterpriseID
public static void setEnterpriseID(int newEnterpriseID)(Code)
Sets the IANA enterprise ID to be used for creating local engine ID by MPv3.createLocalEngineID() .
Parameters:
  newEnterpriseID - an enterprise ID as registered by the IANA (see http://www.iana.org).



setLocalEngineID
public void setLocalEngineID(byte[] engineID)(Code)
Sets the local engine ID. This value must not be changed after message processing has been started.
Parameters:
  engineID - the local engine ID. Its length must be >= 5 and <= 32.



setSecurityModels
public void setSecurityModels(SecurityModels securityModels)(Code)
Sets the security models supported by this MPv3.
Parameters:
  securityModels - a SecurityModels instance.



setSecurityProtocols
public void setSecurityProtocols(SecurityProtocols securityProtocols)(Code)
Sets the security protocols for this MPv3.
Parameters:
  securityProtocols - SecurityProtocols



Methods inherited from java.lang.Object
native protected Object clone() throws CloneNotSupportedException(Code)(Java Doc)
public boolean equals(Object obj)(Code)(Java Doc)
protected void finalize() throws Throwable(Code)(Java Doc)
final native public Class getClass()(Code)(Java Doc)
native public int hashCode()(Code)(Java Doc)
final native public void notify()(Code)(Java Doc)
final native public void notifyAll()(Code)(Java Doc)
public String toString()(Code)(Java Doc)
final native public void wait(long timeout) throws InterruptedException(Code)(Java Doc)
final public void wait(long timeout, int nanos) throws InterruptedException(Code)(Java Doc)
final public void wait() throws InterruptedException(Code)(Java Doc)

www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.