Class BasicRegistry
- java.lang.Object
-
- org.mapfish.print.servlet.registry.BasicRegistry
-
-
Constructor Summary
Constructors Constructor Description BasicRegistry()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
containsKey(java.lang.String key)
Check if something is registered for the key.void
delete(java.lang.String key)
Delete the given key.org.json.JSONObject
getJSON(java.lang.String key)
Get a json object from the registry.java.lang.Number
getNumber(java.lang.String key)
Get a number from the registry.java.lang.String
getString(java.lang.String key)
Get string from the registry.long
getTimeToKeepAfterAccessInMillis()
Return the amount of time the registry will keep an entry before purging the record.java.net.URI
getURI(java.lang.String key)
Get a URI from the registry.int
incrementInt(java.lang.String key, int amount)
Increment the value currently stored in the registry by the amount.long
incrementLong(java.lang.String key, long amount)
Increment the value currently stored in the registry by the amount.<T> T
opt(java.lang.String key, T defaultValue)
Get a value from the registry or return the default if the value is not in the registry.void
put(java.lang.String key, java.lang.Number value)
Put a number in the registry.void
put(java.lang.String key, java.lang.String value)
Put a string in the registry.void
put(java.lang.String key, java.net.URI value)
Put a URI in the registry.void
put(java.lang.String key, org.json.JSONObject value)
Put a json object in the registry.void
setTimeToKeepAfterAccessInMinutes(int timeToKeepAfterAccessInMinutes)
-
-
-
Method Detail
-
setTimeToKeepAfterAccessInMinutes
public final void setTimeToKeepAfterAccessInMinutes(int timeToKeepAfterAccessInMinutes)
-
getTimeToKeepAfterAccessInMillis
public final long getTimeToKeepAfterAccessInMillis()
Description copied from interface:Registry
Return the amount of time the registry will keep an entry before purging the record. This ability to purge old records prevents the registry from growing in size indefinitely.- Specified by:
getTimeToKeepAfterAccessInMillis
in interfaceRegistry
- Returns:
- the number of milliseconds between the last access of a record and the time when a record can be purged from the registry.
-
delete
public void delete(java.lang.String key)
Description copied from interface:Registry
Delete the given key.
-
containsKey
public final boolean containsKey(java.lang.String key)
Description copied from interface:Registry
Check if something is registered for the key.- Specified by:
containsKey
in interfaceRegistry
- Parameters:
key
- key to check for
-
put
public final void put(java.lang.String key, java.net.URI value)
Description copied from interface:Registry
Put a URI in the registry.
-
incrementLong
public final long incrementLong(java.lang.String key, long amount)
Description copied from interface:Registry
Increment the value currently stored in the registry by the amount. This assumes it is an long.If there is not value present in registry then a value will be registered as amount.
- Specified by:
incrementLong
in interfaceRegistry
- Parameters:
key
- the key of the element to incrementamount
- the amount to increment- Returns:
- the new value
-
incrementInt
public final int incrementInt(java.lang.String key, int amount)
Description copied from interface:Registry
Increment the value currently stored in the registry by the amount. This assumes it is an integer.If there is not value present in registry then a value will be registered as amount.
- Specified by:
incrementInt
in interfaceRegistry
- Parameters:
key
- the key of the element to incrementamount
- th amount to increment- Returns:
- the new value
-
getURI
public final java.net.URI getURI(java.lang.String key)
Description copied from interface:Registry
Get a URI from the registry.
-
put
public final void put(java.lang.String key, java.lang.String value)
Description copied from interface:Registry
Put a string in the registry.
-
getString
public final java.lang.String getString(java.lang.String key)
Description copied from interface:Registry
Get string from the registry.
-
put
public final void put(java.lang.String key, java.lang.Number value)
Description copied from interface:Registry
Put a number in the registry.
-
getNumber
public final java.lang.Number getNumber(java.lang.String key)
Description copied from interface:Registry
Get a number from the registry.
-
opt
public final <T> T opt(java.lang.String key, T defaultValue)
Description copied from interface:Registry
Get a value from the registry or return the default if the value is not in the registry.
-
put
public final void put(java.lang.String key, org.json.JSONObject value)
Description copied from interface:Registry
Put a json object in the registry.
-
-