Package org.alfresco.repo.audit.model
Class AuditApplication
java.lang.Object
org.alfresco.repo.audit.model.AuditApplication
Helper class that wraps the
audit application.
Once wrapped, client code doesn't need access to any of the generated
model-driven classes.- Since:
- 3.2
- Author:
- Derek Hulley
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classUtility class carrying information around aDataExtractor. -
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionstatic StringCompile a path or part of a path into a single string which always starts with theAUDIT_PATH_SEPARATOR.voidHelper method to check that a path is correct for this application instancestatic voidcheckPathFormat(String path) Helper method to check that a path is correct for this application instancebooleanGet the database ID for this applicationGet the key (root path) for the applicationGet the application nameGet all data extractors applicable to this application.getDataGenerators(String path) Get all data generators applicable to a given path and scope.getDataGenerators(Set<String> paths) Get all data generators applicable to a given path and scope.Get the property representing the set of disabled paths for the applicationstatic StringgetRootKey(String path) inthashCode()booleanReturnstrueif the application name has a prefix of"PreCallData"that indicates that the only purpose of the Application is to generate data to be passed to a post call audit application.toString()
-
Field Details
-
AUDIT_APPLICATION_PREFIX_FOR_PRE_DATA
- See Also:
-
AUDIT_PATH_SEPARATOR
- See Also:
-
AUDIT_KEY_PATTERN
-
AUDIT_PATH_PATTERN
-
AUDIT_INVALID_PATH_COMP_CHAR_PATTERN
-
-
Method Details
-
hashCode
public int hashCode() -
equals
-
toString
-
getApplicationName
Get the application name -
getApplicationKey
Get the key (root path) for the application -
getApplicationId
Get the database ID for this application -
getDisabledPathsId
Get the property representing the set of disabled paths for the application- Returns:
- Returns an ID of disabled paths
-
checkPath
Helper method to check that a path is correct for this application instance- Parameters:
path- the path in format /app-key/x/y/z- Throws:
AuditModelException- if the path is invalid- See Also:
-
checkPathFormat
Helper method to check that a path is correct for this application instance- Parameters:
path- the path in format /app-key/x/y/z- Throws:
AuditModelException- if the path is invalid- See Also:
-
buildPath
Compile a path or part of a path into a single string which always starts with theAUDIT_PATH_SEPARATOR. This can be a relative path so need not always start with the application root key.If the path separator is present at the beginning of a path component, then it is not added, so
"/a", "b", "/c"becomes"/a/b/c"allowing path to be appended to other paths.The final result is checked against a
regular expressionto ensure it is valid.- Parameters:
pathComponents- the elements of the path e.g."a", "b", "c".- Returns:
- Returns the compiled path e.g
"/a/b/c".
-
getRootKey
- Parameters:
path- the audit path for form /abc/def- Returns:
- the root key of form abc
-
getDataExtractors
Get all data extractors applicable to this application.- Returns:
- Returns all data extractors contained in the application
-
getDataGenerators
Get all data generators applicable to a given path and scope.- Parameters:
path- the audit path- Returns:
- Returns all data generators mapped to their key-path
-
getDataGenerators
Get all data generators applicable to a given path and scope.- Parameters:
paths- the audit paths- Returns:
- Returns all data generators mapped to their key-path
-
isApplicationJustGeneratingPreCallData
public boolean isApplicationJustGeneratingPreCallData()Returnstrueif the application name has a prefix of"PreCallData"that indicates that the only purpose of the Application is to generate data to be passed to a post call audit application. In this situation the application's audit data is not audited. This allows the post audit application to have access to 'before' values including those created by extractors and generators. Some of which will not be available (for example the node has been deleted) or will have changed as a result of the call.
-