Class PrincipalSearchReport
- java.lang.Object
-
- org.apache.jackrabbit.webdav.version.report.AbstractReport
-
- org.apache.jackrabbit.webdav.security.report.AbstractSecurityReport
-
- org.apache.jackrabbit.webdav.security.report.PrincipalSearchReport
-
- All Implemented Interfaces:
Report,XmlSerializable
public class PrincipalSearchReport extends AbstractSecurityReport
ThePrincipalSearchReportperforms a search for all principals that match the search criteria specified in the request.The following XML structure is required in the request body:
<!ELEMENT principal-property-search ((property-search+), prop?, apply-to-principal-collection-set?) > <!ELEMENT property-search (prop, match) > prop: see RFC 2518, Section 12.11 <!ELEMENT match #PCDATA > <!ELEMENT apply-to-principal-collection-set #EMPTY >
DAV:property-search contains lists the properties to be searched inside the DAV:prop element and the query string inside the DAV:match element. Multiple DAV:property-search elements or multiple elements within the DAV:prop element will be interpreted with a logical AND.DAV:prop lists the property names to be reported in the response for each of the principle resources found.
DAV:apply-to-principal-collection-set: Optional empty element. If present in the request body the search will be executed over all members of the collections that are listed as values in the DAV:principal-collection-set property present on the resource the report has been requested for. Otherwise the search is limited to all members (at any depth) of that resource itself.
The response body must contain a single DAV:multistatus XML element.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected classPrincipalSearchReport.SearchArgumentInner utility class preparing the query arguments present in the DAV:property-search element(s).
-
Field Summary
Fields Modifier and Type Field Description static StringREPORT_NAMEThe report namestatic ReportTypeREPORT_TYPEThe report typestatic StringXML_APPLY_TO_PRINCIPAL_COLLECTION_SETstatic StringXML_MATCHstatic StringXML_PROPERTY_SEARCH-
Fields inherited from class org.apache.jackrabbit.webdav.security.report.AbstractSecurityReport
responses
-
-
Constructor Summary
Constructors Constructor Description PrincipalSearchReport()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description PrincipalSearchReport.SearchArgument[]getSearchArguments()Retrieve the search arguments used to run the search for principals.
Note, that the search result must be converted toMultiStatusResponses that must be returned back to this report.String[]getSearchRoots()Retrieve the the locations where the search should be performed.
Note, that the search result must be converted toMultiStatusResponses that must be returned back to this report.ReportTypegetType()Returns the registered type of this report.voidinit(DavResource resource, ReportInfo info)Checks if the given resource and report info are notnull, that the requested report type matches this implementation and that no other Depth header than 0 is present.voidsetResponses(MultiStatusResponse[] responses)Write the search result back to the report.-
Methods inherited from class org.apache.jackrabbit.webdav.security.report.AbstractSecurityReport
isMultiStatusReport, toXml
-
Methods inherited from class org.apache.jackrabbit.webdav.version.report.AbstractReport
normalizeResourceHref
-
-
-
-
Field Detail
-
XML_APPLY_TO_PRINCIPAL_COLLECTION_SET
public static final String XML_APPLY_TO_PRINCIPAL_COLLECTION_SET
- See Also:
- Constant Field Values
-
XML_PROPERTY_SEARCH
public static final String XML_PROPERTY_SEARCH
- See Also:
- Constant Field Values
-
XML_MATCH
public static final String XML_MATCH
- See Also:
- Constant Field Values
-
REPORT_NAME
public static final String REPORT_NAME
The report name- See Also:
- Constant Field Values
-
REPORT_TYPE
public static final ReportType REPORT_TYPE
The report type
-
-
Method Detail
-
getType
public ReportType getType()
Description copied from interface:ReportReturns the registered type of this report.- Returns:
- the type of this report.
- See Also:
Report.getType()
-
init
public void init(DavResource resource, ReportInfo info) throws DavException
Description copied from class:AbstractSecurityReportChecks if the given resource and report info are notnull, that the requested report type matches this implementation and that no other Depth header than 0 is present.- Specified by:
initin interfaceReport- Overrides:
initin classAbstractSecurityReport- Throws:
DavException- See Also:
Report.init(DavResource, ReportInfo)
-
getSearchRoots
public String[] getSearchRoots()
Retrieve the the locations where the search should be performed.
Note, that the search result must be converted toMultiStatusResponses that must be returned back to this report.- Returns:
- href of collections that act as start for the search.
- See Also:
setResponses(MultiStatusResponse[])
-
getSearchArguments
public PrincipalSearchReport.SearchArgument[] getSearchArguments()
Retrieve the search arguments used to run the search for principals.
Note, that the search result must be converted toMultiStatusResponses that must be returned back to this report.- Returns:
- array of
SearchArgumentused to run the principal search. - See Also:
setResponses(MultiStatusResponse[])
-
setResponses
public void setResponses(MultiStatusResponse[] responses)
Write the search result back to the report.- Parameters:
responses-
-
-