Java Doc for Context.java in  » Content-Management-System » dspace » org » dspace » core » 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 » Content Management System » dspace » org.dspace.core 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   org.dspace.core.Context

Context
public class Context (Code)
Class representing the context of a particular DSpace operation. This stores information such as the current authenticated user and the database connection being used.

Typical use of the context object will involve constructing one, and setting the current user if one is authenticated. Several operations may be performed using the context object. If all goes well, complete is called to commit the changes and free up any resources used by the context. If anything has gone wrong, abort is called to roll back any changes and free up the resources.

The context object is also used as a cache for CM API objects.
version:
   $Revision: 2104 $




Constructor Summary
public  Context()
     Construct a new context object.

Method Summary
public  voidabort()
     Close the context, without committing any of the changes performed using this context.
public  voidaddEvent(Event event)
     Add an event to be dispatched when this context is committed.
public  voidcache(Object o, int id)
     Store an object in the object cache.
public  voidclearCache()
    
public  voidcommit()
     Commit any transaction that is currently in progress, but do not close the context.
public  voidcomplete()
     Close the context object after all of the operations performed in the context have completed succesfully.
protected  voidfinalize()
    
public  ObjectfromCache(Class objectClass, int id)
     Store an object in the object cache.
public  LocalegetCurrentLocale()
    
public  EPersongetCurrentUser()
    
public  ConnectiongetDBConnection()
    
public  List<Event>getEvents()
     Get the current event list.
public  StringgetExtraLogInfo()
     Get extra information to be logged with message logged in the scope of this context.
public  Group[]getSpecialGroups()
    
public  booleanignoreAuthorization()
     Find out if the authorisation system should be ignored for this context.
public  booleaninSpecialGroup(int groupID)
    
public  booleanisValid()
     Find out if this context is valid.
public  voidremoveCached(Object o, int id)
     Remove an object from the object cache.
public  voidsetCurrentLocale(Locale locale)
    
public  voidsetCurrentUser(EPerson user)
     Set the current user.
public  voidsetDispatcher(String dispatcher)
    
public  voidsetExtraLogInfo(String info)
     Set extra information that should be added to any message logged in the scope of this context.
public  voidsetIgnoreAuthorization(boolean b)
     Specify whether the authorisation system should be ignored for this context.
public  voidsetSpecialGroup(int groupID)
    


Constructor Detail
Context
public Context() throws SQLException(Code)
Construct a new context object. A database connection is opened. No user is authenticated.
exception:
  SQLException - if there was an error obtaining a database connection




Method Detail
abort
public void abort()(Code)
Close the context, without committing any of the changes performed using this context. The database connection is freed. No exception is thrown if there is an error freeing the database connection, since this method may be called as part of an error-handling routine where an SQLException has already been thrown.



addEvent
public void addEvent(Event event)(Code)
Add an event to be dispatched when this context is committed.
Parameters:
  event -



cache
public void cache(Object o, int id)(Code)
Store an object in the object cache.
Parameters:
  o - the object to store
Parameters:
  id - the object's ID



clearCache
public void clearCache()(Code)
Remove all the objects from the object cache



commit
public void commit() throws SQLException(Code)
Commit any transaction that is currently in progress, but do not close the context.
exception:
  SQLException - if there was an error completing the database transactionor closing the connection



complete
public void complete() throws SQLException(Code)
Close the context object after all of the operations performed in the context have completed succesfully. Any transaction with the database is committed.
exception:
  SQLException - if there was an error completing the database transactionor closing the connection



finalize
protected void finalize()(Code)



fromCache
public Object fromCache(Class objectClass, int id)(Code)
Store an object in the object cache.
Parameters:
  objectClass - Java Class of object to check for in cache
Parameters:
  id - ID of object in cache the object from the cache, or null if it's notcached.



getCurrentLocale
public Locale getCurrentLocale()(Code)
Gets the current Locale Localethe current Locale



getCurrentUser
public EPerson getCurrentUser()(Code)
Get the current (authenticated) user the current user, or null if no user isauthenticated



getDBConnection
public Connection getDBConnection()(Code)
Get the database connection associated with the context the database connection



getEvents
public List<Event> getEvents()(Code)
Get the current event list. If there is a separate list of events from already-committed operations combine that with current list. List of all available events.



getExtraLogInfo
public String getExtraLogInfo()(Code)
Get extra information to be logged with message logged in the scope of this context. the extra log info - guaranteed non- null



getSpecialGroups
public Group[] getSpecialGroups() throws SQLException(Code)
gets an array of all of the special groups that current user is a member of
throws:
  SQLException -



ignoreAuthorization
public boolean ignoreAuthorization()(Code)
Find out if the authorisation system should be ignored for this context. true if authorisation should be ignored for thissession.



inSpecialGroup
public boolean inSpecialGroup(int groupID)(Code)
test if member of special group
Parameters:
  groupID - ID of special group to test true if member



isValid
public boolean isValid()(Code)
Find out if this context is valid. Returns false if this context has been aborted or completed. true if the context is still valid, otherwisefalse



removeCached
public void removeCached(Object o, int id)(Code)
Remove an object from the object cache.
Parameters:
  o - the object to remove
Parameters:
  id - the object's ID



setCurrentLocale
public void setCurrentLocale(Locale locale)(Code)
set the current Locale
Parameters:
  Locale - the current Locale



setCurrentUser
public void setCurrentUser(EPerson user)(Code)
Set the current user. Authentication must have been performed by the caller - this call does not attempt any authentication.
Parameters:
  user - the new current user, or null if no user isauthenticated



setDispatcher
public void setDispatcher(String dispatcher)(Code)
Select an event dispatcher, null selects the default



setExtraLogInfo
public void setExtraLogInfo(String info)(Code)
Set extra information that should be added to any message logged in the scope of this context. An example of this might be the session ID of the current Web user's session:

setExtraLogInfo("session_id="+request.getSession().getId());
Parameters:
  info - the extra information to log




setIgnoreAuthorization
public void setIgnoreAuthorization(boolean b)(Code)
Specify whether the authorisation system should be ignored for this context. This should be used sparingly.
Parameters:
  b - if true, authorisation should be ignored forthis session.



setSpecialGroup
public void setSpecialGroup(int groupID)(Code)
set membership in a special group
Parameters:
  groupID - special group's ID



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.