Class BasicRegistry
java.lang.Object
org.mapfish.print.servlet.registry.BasicRegistry
- All Implemented Interfaces:
Registry
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfinal boolean
containsKey
(String key) Check if something is registered for the key.void
Delete the given key.final org.json.JSONObject
Get a json object from the registry.final Number
Get a number from the registry.final String
Get string from the registry.final long
Return the amount of time the registry will keep an entry before purging the record.final URI
Get a URI from the registry.final int
incrementInt
(String key, int amount) Increment the value currently stored in the registry by the amount.final long
incrementLong
(String key, long amount) Increment the value currently stored in the registry by the amount.final <T> T
Get a value from the registry or return the default if the value is not in the registry.final void
Put a number in the registry.final void
Put a string in the registry.final void
Put a URI in the registry.final void
Put a json object in the registry.final void
setTimeToKeepAfterAccessInMinutes
(int timeToKeepAfterAccessInMinutes)
-
Constructor Details
-
BasicRegistry
public BasicRegistry()
-
-
Method Details
-
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
Description copied from interface:Registry
Delete the given key. -
containsKey
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
Description copied from interface:Registry
Put a URI in the registry. -
incrementLong
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
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
Description copied from interface:Registry
Get a URI from the registry. -
put
Description copied from interface:Registry
Put a string in the registry. -
getString
Description copied from interface:Registry
Get string from the registry. -
put
Description copied from interface:Registry
Put a number in the registry. -
getNumber
Description copied from interface:Registry
Get a number from the registry. -
opt
Description copied from interface:Registry
Get a value from the registry or return the default if the value is not in the registry. -
put
Description copied from interface:Registry
Put a json object in the registry. -
getJSON
Description copied from interface:Registry
Get a json object from the registry.
-