Class AddValueToCache

    • Constructor Detail

      • AddValueToCache

        public AddValueToCache()
    • Method Detail

      • doService

        public void doService​(AdaptrisMessage msg)
                       throws ServiceException
        Description copied from interface: Service

        Apply the service to the message.

        Parameters:
        msg - the AdaptrisMessage to process
        Throws:
        ServiceException - wrapping any underlying Exceptions
      • withExpiry

        public <T extends AddValueToCache> T withExpiry​(java.lang.String s)
      • getExpiry

        public java.lang.String getExpiry()
      • setExpiry

        public void setExpiry​(java.lang.String s)
        Set the cache expiry for any value added to the cache (if any).

        The rules once the value has been resolved are :

        • If the value is numeric and less than System.currentTimeMillis() then it is treated as relative to now(); expiry is in milliseconds
        • If the value is numberic and greater than System.currentTimeMillis() then it is treated as absolute; expiry is in milliseconds
        • If the value is a recognised value from DateFormatUtil.parse(String) then it is treated as absolute
        • If it can't be resolved by any of those means, then it is ignored (i.e. treated as though there is no expiry).
        Parameters:
        s - the expiry, which supports the %message{} syntax to resolve metadata.