|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.jcs.utils.key.KeyGeneratorUtil
public final class KeyGeneratorUtil
This can create and parse request ids. You can use it to generate keys that contain a create time stamp.
You can set a system property called "KEY_LEAD_NUMBER" to override the lead number. The value must be a simple int from 1 to 9.
Field Summary | |
---|---|
protected static long |
counterResetIntervalMillis
How often should we reset the counter. |
static int |
DEFAULT_LEAD_NUMBER
The default lead number. |
static String |
KEY_LEAD_NUMBER_PROPERTY_NAME
The name of the system property that can be used to override the default. |
protected static int |
leadNumber
We lead with a number so it can be converted to a number. |
Constructor Summary | |
---|---|
KeyGeneratorUtil()
|
Method Summary | |
---|---|
static String |
generateRequestId()
Creates a query id in the format 1001010121712345 where the first 8 digits (10010101) is a 8 digit number where: 1 is a padding digit and 001 is the first day of the year. |
static Date |
getDateOfShopFromRequestId(String queryId)
This DddHHmm. |
protected static int |
getNextRequestCounter()
Automatically increment and return the request counter. |
protected static void |
resetCounter()
reset the counter and the reset time. |
protected static void |
setLeadFromSystemProperty()
Sets the lead number from a system property |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected static long counterResetIntervalMillis
public static final String KEY_LEAD_NUMBER_PROPERTY_NAME
public static final int DEFAULT_LEAD_NUMBER
protected static int leadNumber
Constructor Detail |
---|
public KeyGeneratorUtil()
Method Detail |
---|
protected static void setLeadFromSystemProperty()
public static String generateRequestId()
public static Date getDateOfShopFromRequestId(String queryId) throws ParseException
This has to get the current year and set it, since the source data does not have the year.
queryId
- queryId
ParseException
- ParseExceptionprotected static int getNextRequestCounter()
protected static void resetCounter()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |