Java Doc for BaseXmlFileStorage.java in  » ERP-CRM-Financial » sakai » org » sakaiproject » util » 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 » ERP CRM Financial » sakai » org.sakaiproject.util 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   org.sakaiproject.util.BaseXmlFileStorage

BaseXmlFileStorage
public class BaseXmlFileStorage (Code)

BaseXmlFileStorage is a class that stores Resources (of some type) in an XML file
backed memory store, provides locked access, and generally implements a service's
"storage" class. The service's storage class can extend this to provide covers to
turn Resource and Edit into something more type specific to the service.


Inner Class :protected class Container

Field Summary
protected  booleanm_caseInsensitive
     If set, we treat reasource ids as case insensitive.
protected  Stringm_containerTagName
     The xml tag name for the element holding each container entry.
protected  Stringm_entryTagName
     The xml tag name for the element holding each actual entry.
protected  Stringm_fileStoragePath
     A full path and file name to the storage file.
protected  Hashtablem_locks
     Store all locks (across all containers), keyed by entry Resource reference.
protected  Stringm_rootTagName
     The xml tag name for the root element holding the multiple entries.
protected  Hashtablem_store
     Two level store: Hashtables keyed by container ref of Container.
protected  StorageUserm_user
     The StorageUser to callback for new Resource and Edit objects.

Constructor Summary
public  BaseXmlFileStorage(String path, String root, String container, String entry, StorageUser user)
     Construct.

Method Summary
public  voidcancelContainer(Edit edit)
     Cancel the changes and release the locked container.
public  voidcancelResource(String container, Edit edit)
     Cancel the changes and release the lock.
protected  StringcaseId(String id)
     Fix the case of resource ids to support case insensitive ids if enabled
Parameters:
  The - id to fix.
public  booleancheckContainer(String ref)
     Check if a container by this id exists.
Parameters:
  ref - The container reference.
public  booleancheckResource(String container, String id)
     Check if a resource by this id exists.
Parameters:
  container - The container id.
Parameters:
  id - The id.
public  voidclose()
     Close.
public  voidcommitContainer(Edit edit)
     Commit the changes and release the locked container.
public  voidcommitResource(String container, Edit edit)
     Commit the changes and release the lock.
public  intcountAllResources(String container)
     Count all entries.
Parameters:
  container - The container id.
protected  DocumentcreateDocument()
    
public  EditeditContainer(String ref)
     Return a lock on the container with this id, or null if a lock cannot be made.
Parameters:
  ref - The container reference.
public  EditeditResource(String container, String id)
     Return a lock on the entry with this id, or null if a lock cannot be made.
Parameters:
  container - The container id.
Parameters:
  id - The id.
protected  voidfinalize()
     Clean up.
protected  voidflush()
    
public  ListgetAllContainers()
     Get a list of all containers.
public  ListgetAllResources(String container)
     Get all entries.
Parameters:
  container - The container id.
public  ListgetAllResources(String container, int first, int last)
     Get all entries within a range sorted by id.
Parameters:
  container - The container id.
Parameters:
  first - The first position.
Parameters:
  last - The last position.
public  EntitygetContainer(String ref)
     Get the container with this id, or null if not found.
Parameters:
  ref - The container reference.
public  ListgetContainerIdsMatching(String context)
     Access a list of container ids that match (start with) the root.
Parameters:
  context - The reference root to match.
public  EntitygetResource(String container, String id)
     Get the entry with this id, or null if not found.
Parameters:
  container - The container id.
Parameters:
  id - The id.
public  ListgetResources(String container, Time afterDate, int limitedToLatest, String draftsForId, boolean pubViewOnly)
     Get resources filtered by date and count and drafts, in descending (latest first) order
Parameters:
  container - The container id.
Parameters:
  afterDate - if null, no date limit, else limited to only messages after this date.
Parameters:
  limitedToLatest - if 0, no count limit, else limited to only the latest this number of messages.
Parameters:
  draftsForId - how to handle drafts: null means no drafts, "*" means all, otherwise drafts only if created by this userId.
Parameters:
  pubViewOnly - if true, include only messages marked pubview, else include any.
public  booleanisEmpty(String container)
    
protected  Documentload()
    
public  voidopen()
     Open and be ready to read / write.
public  EditputContainer(String ref)
     Add a new container with this id.
Parameters:
  ref - The channel reference.
public  EditputResource(String container, String id, Object[] others)
     Add a new entry with this id.
public  voidremoveContainer(Edit edit)
     Remove this container and all it contains.
public  voidremoveResource(String container, Edit edit)
     Remove this entry.
protected  voidsetCaseInsensitivity(boolean setting)
     Enable / disable case insensitive ids.

Field Detail
m_caseInsensitive
protected boolean m_caseInsensitive(Code)
If set, we treat reasource ids as case insensitive.



m_containerTagName
protected String m_containerTagName(Code)
The xml tag name for the element holding each container entry.



m_entryTagName
protected String m_entryTagName(Code)
The xml tag name for the element holding each actual entry.



m_fileStoragePath
protected String m_fileStoragePath(Code)
A full path and file name to the storage file.



m_locks
protected Hashtable m_locks(Code)
Store all locks (across all containers), keyed by entry Resource reference.



m_rootTagName
protected String m_rootTagName(Code)
The xml tag name for the root element holding the multiple entries.



m_store
protected Hashtable m_store(Code)
Two level store: Hashtables keyed by container ref of Container.



m_user
protected StorageUser m_user(Code)
The StorageUser to callback for new Resource and Edit objects.




Constructor Detail
BaseXmlFileStorage
public BaseXmlFileStorage(String path, String root, String container, String entry, StorageUser user)(Code)
Construct.
Parameters:
  path - The storage path.
Parameters:
  root - The xml tag name for the root element holding the multiple entries.
Parameters:
  container - The xml tag name for the element holding each container entry (may be null if there's no container structure and all entries are in the root).
Parameters:
  entry - The xml tag name for the element holding each actual entry.
Parameters:
  user - The StorageUser class to call back for creation of Resource and Edit objects.




Method Detail
cancelContainer
public void cancelContainer(Edit edit)(Code)
Cancel the changes and release the locked container.
Parameters:
  container - The container id.
Parameters:
  edit - The entry to cancel.



cancelResource
public void cancelResource(String container, Edit edit)(Code)
Cancel the changes and release the lock.
Parameters:
  container - The container id.
Parameters:
  edit - The entry to cancel.



caseId
protected String caseId(String id)(Code)
Fix the case of resource ids to support case insensitive ids if enabled
Parameters:
  The - id to fix. The id, case modified as needed.



checkContainer
public boolean checkContainer(String ref)(Code)
Check if a container by this id exists.
Parameters:
  ref - The container reference. true if a resource by this id exists, false if not.



checkResource
public boolean checkResource(String container, String id)(Code)
Check if a resource by this id exists.
Parameters:
  container - The container id.
Parameters:
  id - The id. true if a resource by this id exists, false if not.



close
public void close()(Code)
Close.



commitContainer
public void commitContainer(Edit edit)(Code)
Commit the changes and release the locked container.
Parameters:
  container - The container id.
Parameters:
  edit - The entry to commit.



commitResource
public void commitResource(String container, Edit edit)(Code)
Commit the changes and release the lock.
Parameters:
  container - The container id.
Parameters:
  edit - The entry to commit.



countAllResources
public int countAllResources(String container)(Code)
Count all entries.
Parameters:
  container - The container id. The count of all entries.



createDocument
protected Document createDocument()(Code)
Create and return the XML Document for our storaghe



editContainer
public Edit editContainer(String ref)(Code)
Return a lock on the container with this id, or null if a lock cannot be made.
Parameters:
  ref - The container reference. The locked object with this id, or null if a lock cannot be made.



editResource
public Edit editResource(String container, String id)(Code)
Return a lock on the entry with this id, or null if a lock cannot be made.
Parameters:
  container - The container id.
Parameters:
  id - The id. The locked object with this id, or null if a lock cannot be made.



finalize
protected void finalize()(Code)
Clean up.



flush
protected void flush()(Code)
flush



getAllContainers
public List getAllContainers()(Code)
Get a list of all containers. A list (Resource) of all containers, or empty if none defined.



getAllResources
public List getAllResources(String container)(Code)
Get all entries.
Parameters:
  container - The container id. The list (Resource) of all entries.



getAllResources
public List getAllResources(String container, int first, int last)(Code)
Get all entries within a range sorted by id.
Parameters:
  container - The container id.
Parameters:
  first - The first position.
Parameters:
  last - The last position. The list (Resource) of all entries within a range sorted by id.



getContainer
public Entity getContainer(String ref)(Code)
Get the container with this id, or null if not found.
Parameters:
  ref - The container reference. The container with this id, or null if not found.



getContainerIdsMatching
public List getContainerIdsMatching(String context)(Code)
Access a list of container ids that match (start with) the root.
Parameters:
  context - The reference root to match. A List (String) of container id which match the root.



getResource
public Entity getResource(String container, String id)(Code)
Get the entry with this id, or null if not found.
Parameters:
  container - The container id.
Parameters:
  id - The id. The entry with this id, or null if not found.



getResources
public List getResources(String container, Time afterDate, int limitedToLatest, String draftsForId, boolean pubViewOnly)(Code)
Get resources filtered by date and count and drafts, in descending (latest first) order
Parameters:
  container - The container id.
Parameters:
  afterDate - if null, no date limit, else limited to only messages after this date.
Parameters:
  limitedToLatest - if 0, no count limit, else limited to only the latest this number of messages.
Parameters:
  draftsForId - how to handle drafts: null means no drafts, "*" means all, otherwise drafts only if created by this userId.
Parameters:
  pubViewOnly - if true, include only messages marked pubview, else include any. A list of Message objects that meet the criteria; may be empty



isEmpty
public boolean isEmpty(String container)(Code)
Determine if empty true if empty, false if not.



load
protected Document load()(Code)
Load the Xml Document



open
public void open()(Code)
Open and be ready to read / write.



putContainer
public Edit putContainer(String ref)(Code)
Add a new container with this id.
Parameters:
  ref - The channel reference. The locked object with this id, or null if the id is in use.



putResource
public Edit putResource(String container, String id, Object[] others)(Code)
Add a new entry with this id.
Parameters:
  container - The container id.
Parameters:
  id - The id.
Parameters:
  others - Other fields for the newResource call The locked object with this id, or null if the id is in use.



removeContainer
public void removeContainer(Edit edit)(Code)
Remove this container and all it contains.
Parameters:
  container - The container id.
Parameters:
  edit - The entry to remove.



removeResource
public void removeResource(String container, Edit edit)(Code)
Remove this entry.
Parameters:
  container - The container id.
Parameters:
  edit - The entry to remove.



setCaseInsensitivity
protected void setCaseInsensitivity(boolean setting)(Code)
Enable / disable case insensitive ids.
Parameters:
  setting - true to set case insensitivity, false to set case sensitivity.



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.