Class AddTimestampMetadataService

  • All Implemented Interfaces:
    AdaptrisComponent, ComponentLifecycle, ComponentLifecycleExtension, MessageEventGenerator, Service, StateManagedComponent

    @ComponentProfile(summary="Add a timestamp as metadata",
                      tag="service,metadata,timestamp,datetime")
    public class AddTimestampMetadataService
    extends ServiceImp
    Adds timestamp information as metadata.

    In addition to supporting all the patterns allowed by SimpleDateFormat, this service also supports the special values SECONDS_SINCE_EPOCH and MILLISECONDS_SINCE_EPOCH which describe the number of seconds and milliseconds since midnight Jan 1, 1970 UTC respectively. If specified as the format, then the long value associated will be emitted.

    See Also:
    DateFormatUtil.CustomDateFormat

    In the adapter configuration file this class is aliased as add-timestamp-metadata-service which is the preferred alternative to the fully qualified classname when building your configuration.

    • Constructor Detail

      • AddTimestampMetadataService

        public AddTimestampMetadataService()
      • AddTimestampMetadataService

        public AddTimestampMetadataService​(java.lang.String format,
                                           java.lang.String metadataKey)
      • AddTimestampMetadataService

        public AddTimestampMetadataService​(java.lang.String format,
                                           java.lang.String metadataKey,
                                           java.lang.Boolean alwaysReplace)
      • AddTimestampMetadataService

        public AddTimestampMetadataService​(java.lang.String format,
                                           java.lang.String metadataKey,
                                           java.lang.Boolean alwaysReplace,
                                           java.lang.String offset)
      • AddTimestampMetadataService

        public AddTimestampMetadataService​(java.lang.String format,
                                           java.lang.String metadataKey,
                                           java.lang.Boolean alwaysReplace,
                                           TimestampGenerator s)
    • Method Detail

      • getMetadataKey

        public java.lang.String getMetadataKey()
        Returns:
        the metadataKey
      • setMetadataKey

        public void setMetadataKey​(java.lang.String metadataKey)
        Parameters:
        metadataKey - the metadataKey to set
      • getAlwaysReplace

        public java.lang.Boolean getAlwaysReplace()
        Returns:
        the alwaysReplace
      • setAlwaysReplace

        public void setAlwaysReplace​(java.lang.Boolean b)
        Specify whether to always replace the metadata.
        Parameters:
        b - the alwaysReplace to set, default is false.
      • getTimestampGenerator

        public TimestampGenerator getTimestampGenerator()
        Returns:
        the timestampGenerator
      • setTimestampGenerator

        public void setTimestampGenerator​(TimestampGenerator s)
        Parameters:
        s - the timestampGenerator to set
      • setDateFormatBuilder

        public void setDateFormatBuilder​(DateFormatBuilder builder)