Interface AuditManager
- All Superinterfaces:
ExtensionPointManager<AuditProfileType<?>>
- All Known Implementing Classes:
DelegatingAuditManager
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic interfaceAnAutoCloseablehandle returned bypushAuditContext(AuditContext)that restores the previously-activeAuditContextwhen closed, intended for use with try-with-resources. -
Method Summary
Modifier and TypeMethodDescriptionvoidRemoves the threadlocalAuditContext.Returns a populatedAuditContextif the current thread is attached to a valid http session, ie aClientReqSession(Designer, Vision) orWebUiSession(web ui since 8.3.0).Return the list of audit profiles known to this manager.@Nullable AuditProfileReturns the audit profile specified byGatewaySystemProperties.GatewayAuditProfile, ornull.@Nullable AuditProfilegetProfile(String name) Returns the named audit profile, or null if none exists with that name@Nullable AuditProfilegetProfileForProject(String projectName) Returns the audit profile for a given project.pushAuditContext(@Nullable AuditContext auditContext) SetsauditContextas the threadlocal context and returns aAuditManager.CloseableAuditContextthat restores the previous context when closed, for use with try-with-resources:voidsetAuditContext(AuditContext auditContext) Sets an threadlocal for AuditContext that will be returned bygetAuditContext()on the calling thread untilclearAuditContext()is invoked.Methods inherited from interface ExtensionPointManager
getExtensionPointCollection, getExtensionPointResourceType
-
Method Details
-
getProfile
Returns the named audit profile, or null if none exists with that name- Throws:
Exception
-
getProfileForProject
Returns the audit profile for a given project. May be null -
getGatewayAuditProfile
@Nullable AuditProfile getGatewayAuditProfile()Returns the audit profile specified byGatewaySystemProperties.GatewayAuditProfile, ornull. -
getAuditContext
Optional<AuditContext> getAuditContext()Returns a populatedAuditContextif the current thread is attached to a valid http session, ie aClientReqSession(Designer, Vision) orWebUiSession(web ui since 8.3.0). Returns an empty optional if no contextual information could be found. -
setAuditContext
Sets an threadlocal for AuditContext that will be returned bygetAuditContext()on the calling thread untilclearAuditContext()is invoked. -
clearAuditContext
void clearAuditContext()Removes the threadlocalAuditContext. Unless you are controlling the lifecycle of the thread, you should consider usingpushAuditContext(AuditContext)instead so that the previousAuditContextis restored after your code is done executing.- See Also:
-
pushAuditContext
SetsauditContextas the threadlocal context and returns aAuditManager.CloseableAuditContextthat restores the previous context when closed, for use with try-with-resources:try (var ignored = auditManager.pushAuditContext(myContext)) { ... do something ... }- Parameters:
auditContext- the context to set, or null to clear the threadlocal context for the scope- Returns:
- a
AuditManager.CloseableAuditContextthat restores the previous context onclose
-
getAvailableAuditProfiles
-