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 backed by a DataSource. Usually table and column names are configurable, but for simplicity this is not the case. The schema is: table properties ( path, namespace, name, node ) path: the resource path namespace: the node namespace name: the local name in the namespace node: the full serialized XML node including the name
-
-
Field Summary
Fields Modifier and Type Field Description protected javax.sql.DataSource
dataSource
DataSource instance being used.protected static StringManager
sm
-
Constructor Summary
Constructors Constructor Description DataSourcePropertyStore()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
copy(java.lang.String source, java.lang.String destination)
Copy resource.void
delete(java.lang.String resource)
Delete specified resource.void
destroy()
Destroy the store.java.lang.String
getDataSourceName()
void
init()
Initialize the store.void
periodicEvent()
Periodic event for maintenance tasks.boolean
propfind(java.lang.String resource, org.w3c.dom.Node property, boolean nameOnly, XMLWriter generatedXML)
Generate propfind XML fragments for dead properties.void
proppatch(java.lang.String resource, java.util.ArrayList<WebdavServlet.ProppatchOperation> operations)
Apply proppatch to the specified resource.void
setDataSourceName(java.lang.String dataSourceName)
-
-
-
Field Detail
-
sm
protected static final StringManager sm
-
dataSource
protected javax.sql.DataSource dataSource
DataSource instance being used.
-
-
Method Detail
-
getDataSourceName
public java.lang.String getDataSourceName()
- Returns:
- the dataSourceName
-
setDataSourceName
public void setDataSourceName(java.lang.String dataSourceName)
- Parameters:
dataSourceName
- the dataSourceName to set
-
init
public void init()
Description copied from interface:WebdavServlet.PropertyStore
Initialize the store. This is tied to the Servlet lifecycle and is called by its init method.- Specified by:
init
in interfaceWebdavServlet.PropertyStore
-
destroy
public void destroy()
Description copied from interface:WebdavServlet.PropertyStore
Destroy the store. This is tied to the Servlet lifecycle and is called by its destroy method.- Specified by:
destroy
in interfaceWebdavServlet.PropertyStore
-
periodicEvent
public void periodicEvent()
Description copied from interface:WebdavServlet.PropertyStore
Periodic event for maintenance tasks.- Specified by:
periodicEvent
in interfaceWebdavServlet.PropertyStore
-
copy
public void copy(java.lang.String source, java.lang.String destination)
Description copied from interface:WebdavServlet.PropertyStore
Copy resource. Dead properties should be copied to the destination path.- Specified by:
copy
in 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.PropertyStore
Delete specified resource. Dead properties on a deleted resource should be deleted.- Specified by:
delete
in 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.PropertyStore
Generate propfind XML fragments for dead properties.- Specified by:
propfind
in 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.PropertyStore
Apply proppatch to the specified resource.- Specified by:
proppatch
in 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
-
-