Handler - appendDateToId

 

Description

This modifies the id of the root product to prepend or postpend the current time and/or date. This especially useful on the input to the Archive juggler to create a "rolling" archive of product.

The date format used by this juggler is configurable so that the rolling archive will be able differentiate between products collected on the the same day, month, year, second, or minute.

By changing the date format string, it is possible to set the time resolution at which the rolling archive will store product.

Configuration Variables

idAtFront
Default true.

If true, id is first followed by the date/time.
Othwerwise, date/time is first, followed by the original id string.

datePattern

The SimpleDateFormat pattern string to used to format the date.
Default is:  " M/d/yy h:mm a "

The syntax of this pattern is described in the table below.  Any characters in the format string that do not appear in this table appear literally in the formatted date.
 

Field

Full Form

Short Form

Year

yyyy (4 digits)

yy (2 digits)

Month

MMM (name)

MM (2 digits), M (1 or 2 digits)

Day of week

EEEE

EE

Day of month

dd (2 digits)

d (1 or 2 digits)

Hour (1-12)

hh (2 digits)

h (1 or 2 digits)

Hour (0-23)

HH (2 digits)

H (1 or 2 digits)

Hour (0-11)

KK

K

Hour (1-24)

kk

k

Minute

mm

Second

ss

Millisecond

SSS

AM/PM

a

Time zone

zzzz

zz

Day of week in month

F (e.g., 3rd Thursday)

Day in year

DDD (3 digits)

D (1, 2, or 3 digits)

Week in year

ww

Era (e.g., BC/AD)

G

 

An example PDIF snippet:

(filterID "via" (enabled true)
   (idAtFront true)
   (datePattern " M/d/yy h:mm a ")
)

Product

How it works

The FilterID clones the input product so that the id change that it makes does not affect other agents that may receive the same input product.

  

Revised: 12 January 1999