Package org.apache.catalina.servlets
Class DataSourcePropertyStore
- java.lang.Object
-
- org.apache.catalina.servlets.DataSourcePropertyStore
-
- All Implemented Interfaces:
WebdavServlet.PropertyStore
public class DataSourcePropertyStore extends java.lang.Object implements WebdavServlet.PropertyStore
WebDAV dead properties storage using a DataSource.A single properties table with four columns is used:
- path: the resource path
- namespace: the node namespace
- name: the local name in the namespace
- node: the full serialized XML node including the name
tableNameproperty of the store.Example table schema:
CREATE TABLE properties ( path VARCHAR(1024) NOT NULL, namespace VARCHAR(64) NOT NULL, name VARCHAR(64) NOT NULL, node VARCHAR(2048) NOT NULL, PRIMARY KEY (path, namespace, name) )
-
-
Field Summary
Fields Modifier and Type Field Description protected javax.sql.DataSourcedataSourceDataSource instance being used.protected static StringManagersmThe string manager for this package.
-
Constructor Summary
Constructors Constructor Description DataSourcePropertyStore()Default constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidcopy(java.lang.String source, java.lang.String destination)Copy resource.voiddelete(java.lang.String resource)Delete specified resource.voiddestroy()Destroy the store.java.lang.StringgetDataSourceName()Return the DataSource JNDI name, will be prefixed with java:comp/env for the lookup.java.lang.StringgetTableName()Return the table name that will be used in the database.voidinit()Initialize the store.voidperiodicEvent()Periodic event for maintenance tasks.booleanpropfind(java.lang.String resource, org.w3c.dom.Node property, boolean nameOnly, XMLWriter generatedXML)Generate propfind XML fragments for dead properties.voidproppatch(java.lang.String resource, java.util.ArrayList<WebdavServlet.ProppatchOperation> operations)Apply proppatch to the specified resource.voidsetDataSourceName(java.lang.String dataSourceName)Set the DataSource JNDI name, will be prefixed with java:comp/env for the lookup.voidsetTableName(java.lang.String tableName)Set the table name to use in the database.
-
-
-
Field Detail
-
sm
protected static final StringManager sm
The string manager for this package.
-
dataSource
protected javax.sql.DataSource dataSource
DataSource instance being used.
-
-
Method Detail
-
getDataSourceName
public java.lang.String getDataSourceName()
Return the DataSource JNDI name, will be prefixed with java:comp/env for the lookup.- Returns:
- the DataSource JNDI name
-
setDataSourceName
public void setDataSourceName(java.lang.String dataSourceName)
Set the DataSource JNDI name, will be prefixed with java:comp/env for the lookup.- Parameters:
dataSourceName- the DataSource JNDI name
-
getTableName
public java.lang.String getTableName()
Return the table name that will be used in the database.- Returns:
- the table name
-
setTableName
public void setTableName(java.lang.String tableName)
Set the table name to use in the database.- Parameters:
tableName- the table name
-
init
public void init()
Description copied from interface:WebdavServlet.PropertyStoreInitialize the store. This is tied to the Servlet lifecycle and is called by its init method.- Specified by:
initin interfaceWebdavServlet.PropertyStore
-
destroy
public void destroy()
Description copied from interface:WebdavServlet.PropertyStoreDestroy the store. This is tied to the Servlet lifecycle and is called by its destroy method.- Specified by:
destroyin interfaceWebdavServlet.PropertyStore
-
periodicEvent
public void periodicEvent()
Description copied from interface:WebdavServlet.PropertyStorePeriodic event for maintenance tasks.- Specified by:
periodicEventin interfaceWebdavServlet.PropertyStore
-
copy
public void copy(java.lang.String source, java.lang.String destination)Description copied from interface:WebdavServlet.PropertyStoreCopy resource. Dead properties should be copied to the destination path.- Specified by:
copyin interfaceWebdavServlet.PropertyStore- Parameters:
source- the copy source pathdestination- the copy destination path
-
delete
public void delete(java.lang.String resource)
Description copied from interface:WebdavServlet.PropertyStoreDelete specified resource. Dead properties on a deleted resource should be deleted.- Specified by:
deletein interfaceWebdavServlet.PropertyStore- Parameters:
resource- the path of the resource to delete
-
propfind
public boolean propfind(java.lang.String resource, org.w3c.dom.Node property, boolean nameOnly, XMLWriter generatedXML)Description copied from interface:WebdavServlet.PropertyStoreGenerate propfind XML fragments for dead properties.- Specified by:
propfindin interfaceWebdavServlet.PropertyStore- Parameters:
resource- the resource pathproperty- the dead property, if null then all dead properties must be writtennameOnly- true if only the property name element should be generatedgeneratedXML- the current generated XML for the PROPFIND response- Returns:
- true if a property was specified and a corresponding dead property was found on the resource, false otherwise
-
proppatch
public void proppatch(java.lang.String resource, java.util.ArrayList<WebdavServlet.ProppatchOperation> operations)Description copied from interface:WebdavServlet.PropertyStoreApply proppatch to the specified resource.- Specified by:
proppatchin interfaceWebdavServlet.PropertyStore- Parameters:
resource- the resource path on which to apply the proppatchoperations- the set and remove to apply, the final status codes of the result should be set on each operation
-
-