Class ObjectToStringResourceResolver

  • All Implemented Interfaces:
    AuditResourceResolver

    public class ObjectToStringResourceResolver
    extends java.lang.Object
    implements AuditResourceResolver
    Inspektr ResourceResolver that resolves resource as a target object's toString method call
    Author:
    Dmitriy Kopylenko
    • Field Summary

      Fields 
      Modifier and Type Field Description
      protected java.util.function.Function<java.lang.String[],​java.lang.String[]> resourcePostProcessor  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.lang.String[] resolveFrom​(org.aspectj.lang.JoinPoint target, java.lang.Exception exception)
      Resolve the auditable resource for an audit-able action that has incurred an exception.
      java.lang.String[] resolveFrom​(org.aspectj.lang.JoinPoint target, java.lang.Object returnValue)
      Resolve the auditable resource.
      void setAuditFormat​(AuditTrailManager.AuditFormats auditFormat)  
      void setResourcePostProcessor​(java.util.function.Function<java.lang.String[],​java.lang.String[]> resourcePostProcessor)  
      java.lang.String toResourceString​(java.lang.Object arg)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • resourcePostProcessor

        protected java.util.function.Function<java.lang.String[],​java.lang.String[]> resourcePostProcessor
    • Constructor Detail

      • ObjectToStringResourceResolver

        public ObjectToStringResourceResolver()
    • Method Detail

      • setResourcePostProcessor

        public void setResourcePostProcessor​(java.util.function.Function<java.lang.String[],​java.lang.String[]> resourcePostProcessor)
      • resolveFrom

        public java.lang.String[] resolveFrom​(org.aspectj.lang.JoinPoint target,
                                              java.lang.Object returnValue)
        Description copied from interface: AuditResourceResolver
        Resolve the auditable resource.
        Specified by:
        resolveFrom in interface AuditResourceResolver
        Parameters:
        target - the join point that contains the arguments.
        returnValue - The returned value
        Returns:
        The resource String.
      • resolveFrom

        public java.lang.String[] resolveFrom​(org.aspectj.lang.JoinPoint target,
                                              java.lang.Exception exception)
        Description copied from interface: AuditResourceResolver
        Resolve the auditable resource for an audit-able action that has incurred an exception.
        Specified by:
        resolveFrom in interface AuditResourceResolver
        Parameters:
        target - the join point that contains the arguments.
        exception - The exception incurred when the join point proceeds.
        Returns:
        The resource String.
      • toResourceString

        public java.lang.String toResourceString​(java.lang.Object arg)