Java Doc for USM.java in  » Net » snmp4j » org » snmp4j » security » 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.security 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   org.snmp4j.security.USM

USM
public class USM implements SecurityModel(Code)
The USM class implements the User Based Security Model (USM) as defined in RFC3414.

When a user is added or removed from the USM, a UsmUserEvent is fired and forwarded to registered listeners.
author:
   Frank Fock
version:
   1.2




Constructor Summary
public  USM(SecurityProtocols securityProtocols, OctetString localEngineID, int engineBoots)
     Creates a USM with the support for the supplied security protocols.

Method Summary
public  UsmUserEntryaddLocalizedUser(byte[] engineID, OctetString userName, OID authProtocol, byte[] authKey, OID privProtocol, byte[] privKey)
     Adds a localized user to the USM.
public  voidaddUser(OctetString userName, UsmUser user)
     Adds an USM user to the internal user name table.
public  voidaddUser(OctetString userName, OctetString engineID, UsmUser user)
     Adds an USM user to the internal user name table and associates it with an authoritative engine ID.
public synchronized  voidaddUsmUserListener(UsmUserListener l)
     Adds a UsmUserListener that should be informed whenever the internal USM user table is changed.
protected  voidfireIncrementCounter(CounterEvent e)
    
protected  voidfireUsmUserChange(UsmUserEvent e)
     Fires a UsmUserEvent.
public  intgenerateRequestMessage(int snmpVersion, byte[] globalData, int maxMessageSize, int securityModel, byte[] securityEngineID, byte[] securityName, int securityLevel, BERInputStream scopedPDU, SecurityParameters securityParameters, BEROutputStream wholeMsg)
    
public  intgenerateResponseMessage(int snmpVersion, byte[] globalData, int maxMessageSize, int securityModel, byte[] securityEngineID, byte[] securityName, int securityLevel, BERInputStream scopedPDU, SecurityStateReference securityStateReference, SecurityParameters securityParameters, BEROutputStream wholeMsg)
    
public  CounterSupportgetCounterSupport()
     Gets the counter support instance that can be used to register for counter incremnetation events.
public  intgetEngineBoots()
     Returns the number of engine boots counted for the local engine ID.
public  intgetEngineTime()
     Returns the number of seconds since the value of the engineBoots object last changed.
public  intgetID()
    
public  OctetStringgetLocalEngineID()
     Returns the local engine ID.
public  SecurityProtocolsgetSecurityProtocols()
     Returns the security protocol collection used by this USM.
public  UsmTimeTablegetTimeTable()
     Returns the UsmTimeTable instance used by this USM for holding timing information about the local and remote SNMP entities.
public  UsmUserEntrygetUser(OctetString engineID, OctetString securityName)
    
public  UsmUserTablegetUserTable()
     Returns the UsmUserTable instance used by the USM for local storage of USM user information.
public  booleanisEngineDiscoveryEnabled()
     Checks whether engine ID discovery is enabled or not.
public  SecurityParametersnewSecurityParametersInstance()
    
public  SecurityStateReferencenewSecurityStateReference()
    
public  intprocessIncomingMsg(int snmpVersion, int maxMessageSize, SecurityParameters securityParameters, SecurityModel securityModel, int securityLevel, BERInputStream wholeMsg, OctetString securityEngineID, OctetString securityName, BEROutputStream scopedPDU, Integer32 maxSizeResponseScopedPDU, SecurityStateReference securityStateReference, StatusInformation statusInfo)
    
public  voidremoveAllUsers()
     Removes all users from the USM.
public  voidremoveEngineTime(OctetString engineID)
     Removes the specified engine ID from the internal time cache and thus forces an engine time rediscovery the next time the SNMP engine with the supplied ID is contacted.
public  UsmUserremoveUser(OctetString engineID, OctetString userName)
     Removes an USM user from the internal user name table.
public synchronized  voidremoveUsmUserListener(UsmUserListener l)
     Removes a UsmUserListener.
public  voidsetCounterSupport(CounterSupport counterSupport)
     Sets the counter support instance.
public  voidsetEngineBoots(int engineBoots)
     Sets the number of engine boots.
public  voidsetEngineDiscoveryEnabled(boolean engineDiscoveryEnabled)
     Enables or disables automatic engine ID discovery.
public  voidsetLocalEngine(OctetString localEngineID, int engineBoots, int engineTime)
     Sets the local engine ID, number of boots, and time after boot.
public  voidsetUsers(UsmUser[] users)
     Sets the users of this USM.
public  voidupdateUser(UsmUserEntry entry)
     Updates the USM user entry with the same engine ID and user name as the supplied instance and fires an appropriate UsmUserEvent.


Constructor Detail
USM
public USM(SecurityProtocols securityProtocols, OctetString localEngineID, int engineBoots)(Code)
Creates a USM with the support for the supplied security protocols.
Parameters:
  securityProtocols - the security protocols to support.
Parameters:
  localEngineID - the local engine ID.
Parameters:
  engineBoots - the number of engine boots.
since:
   1.2




Method Detail
addLocalizedUser
public UsmUserEntry addLocalizedUser(byte[] engineID, OctetString userName, OID authProtocol, byte[] authKey, OID privProtocol, byte[] privKey)(Code)
Adds a localized user to the USM.
Parameters:
  engineID - the engine ID for which the user has been localized.
Parameters:
  userName - the user's name.
Parameters:
  authProtocol - the authentication protocol ID.
Parameters:
  authKey - the authentication key.
Parameters:
  privProtocol - the privacy protocol ID.
Parameters:
  privKey - the privacy key.the added UsmUserEntry.



addUser
public void addUser(OctetString userName, UsmUser user)(Code)
Adds an USM user to the internal user name table.
Parameters:
  userName - a user name.
Parameters:
  user - the UsmUser to add.



addUser
public void addUser(OctetString userName, OctetString engineID, UsmUser user)(Code)
Adds an USM user to the internal user name table and associates it with an authoritative engine ID. This user can only be used with the specified engine ID - other engine IDs cannot be discovered on behalf of this entry.
Parameters:
  userName - a user name.
Parameters:
  engineID - the authoritative engine ID to be associated with this entry. IfengineID is null this method behaves exactlylike USM.addUser(OctetString userName,UsmUser user).
Parameters:
  user - the UsmUser to add.



addUsmUserListener
public synchronized void addUsmUserListener(UsmUserListener l)(Code)
Adds a UsmUserListener that should be informed whenever the internal USM user table is changed.
Parameters:
  l - a UsmUserListener that should be informed aboutUsmUserEvent events.



fireIncrementCounter
protected void fireIncrementCounter(CounterEvent e)(Code)



fireUsmUserChange
protected void fireUsmUserChange(UsmUserEvent e)(Code)
Fires a UsmUserEvent.
Parameters:
  e - the UsmUserEvent to fire.



generateRequestMessage
public int generateRequestMessage(int snmpVersion, byte[] globalData, int maxMessageSize, int securityModel, byte[] securityEngineID, byte[] securityName, int securityLevel, BERInputStream scopedPDU, SecurityParameters securityParameters, BEROutputStream wholeMsg) throws IOException(Code)



generateResponseMessage
public int generateResponseMessage(int snmpVersion, byte[] globalData, int maxMessageSize, int securityModel, byte[] securityEngineID, byte[] securityName, int securityLevel, BERInputStream scopedPDU, SecurityStateReference securityStateReference, SecurityParameters securityParameters, BEROutputStream wholeMsg) throws IOException(Code)



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.



getEngineBoots
public int getEngineBoots()(Code)
Returns the number of engine boots counted for the local engine ID. the number of engine boots (zero based).



getEngineTime
public int getEngineTime()(Code)
Returns the number of seconds since the value of the engineBoots object last changed. When incrementing this object's value would cause it to exceed its maximum, engineBoots is incremented as if a re-initialization had occurred, and this object's value consequently reverts to zero. a positive integer value denoting the number of seconds sincethe engineBoots value has been changed.
since:
   1.2



getID
public int getID()(Code)



getLocalEngineID
public OctetString getLocalEngineID()(Code)
Returns the local engine ID. the local engine ID.
since:
   1.2



getSecurityProtocols
public SecurityProtocols getSecurityProtocols()(Code)
Returns the security protocol collection used by this USM. a SecurityProtocols instance which is by default thesame instance as returned by SecurityProtocols.getInstance.
since:
   1.2



getTimeTable
public UsmTimeTable getTimeTable()(Code)
Returns the UsmTimeTable instance used by this USM for holding timing information about the local and remote SNMP entities. UsmTimeTable
since:
   1.6



getUser
public UsmUserEntry getUser(OctetString engineID, OctetString securityName)(Code)



getUserTable
public UsmUserTable getUserTable()(Code)
Returns the UsmUserTable instance used by the USM for local storage of USM user information. The returned table should not be modified, because modifications will not be reported to registered UsmUserListeners. the UsmUserTable instance containing the users known bythis USM.



isEngineDiscoveryEnabled
public boolean isEngineDiscoveryEnabled()(Code)
Checks whether engine ID discovery is enabled or not. If enabled, the USM will try to discover unknown engine IDs "on-the-fly" while processing the message. true if discovery is enabled, false otherwise.



newSecurityParametersInstance
public SecurityParameters newSecurityParametersInstance()(Code)



newSecurityStateReference
public SecurityStateReference newSecurityStateReference()(Code)



processIncomingMsg
public int processIncomingMsg(int snmpVersion, int maxMessageSize, SecurityParameters securityParameters, SecurityModel securityModel, int securityLevel, BERInputStream wholeMsg, OctetString securityEngineID, OctetString securityName, BEROutputStream scopedPDU, Integer32 maxSizeResponseScopedPDU, SecurityStateReference securityStateReference, StatusInformation statusInfo) throws IOException(Code)



removeAllUsers
public void removeAllUsers()(Code)
Removes all users from the USM.



removeEngineTime
public void removeEngineTime(OctetString engineID)(Code)
Removes the specified engine ID from the internal time cache and thus forces an engine time rediscovery the next time the SNMP engine with the supplied ID is contacted.
Parameters:
  engineID - the SNMP engine ID whose engine time to remove.
since:
   1.6



removeUser
public UsmUser removeUser(OctetString engineID, OctetString userName)(Code)
Removes an USM user from the internal user name table.
Parameters:
  engineID - the authoritative engine ID associated with the user, ornull
Parameters:
  userName - a user name.the removed UsmUser instance associate with the givenuserName or null if such a user could notbe found.



removeUsmUserListener
public synchronized void removeUsmUserListener(UsmUserListener l)(Code)
Removes a UsmUserListener.
Parameters:
  l - a proeviously added UsmUserListener.



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.



setEngineBoots
public void setEngineBoots(int engineBoots)(Code)
Sets the number of engine boots.
Parameters:
  engineBoots - the number of engine boots.



setEngineDiscoveryEnabled
public void setEngineDiscoveryEnabled(boolean engineDiscoveryEnabled)(Code)
Enables or disables automatic engine ID discovery.
Parameters:
  engineDiscoveryEnabled - true if discovery should be enabled,false otherwise.



setLocalEngine
public void setLocalEngine(OctetString localEngineID, int engineBoots, int engineTime)(Code)
Sets the local engine ID, number of boots, and time after boot.
Parameters:
  localEngineID - the local engine ID.
Parameters:
  engineBoots - the number of engine boots.
Parameters:
  engineTime - the number sendonds since the last boot.



setUsers
public void setUsers(UsmUser[] users)(Code)
Sets the users of this USM. All previously added users and all localized user information will be discarded and replaced by the supplied users.
Parameters:
  users - a possibly empty UsmUser array of users.
since:
   1.1



updateUser
public void updateUser(UsmUserEntry entry)(Code)
Updates the USM user entry with the same engine ID and user name as the supplied instance and fires an appropriate UsmUserEvent. If the corresponding user entry does not yet exist then it will be added.
Parameters:
  entry - an UsmUserEntry instance not necessarily the same as analready existing entry.
since:
   1.2



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.