Top Description Methods
org.javamoney.moneta.spi.loader

public Interface ResourceCache

Known Direct Implementers
org.javamoney.moneta.spi.loader.urlconnection.URLConnectionResourceCache, org.javamoney.moneta.spi.loader.okhttp.OkHttpResourceCache
Imports
java.io.IOException

Abstraction of a ResourceCache.
Authors
Anatole Tresch, Werner Keil

Method Summary

Modifier and TypeMethod and Description
public void
clear(String
the resource identifier, not null.
resourceId
)

Remove a cache entry.

public boolean

Returns:

true, if the resource was found in the local cache.
isCached
(String
The resourceId
resourceId
)

Allows to query if a resource with the given id is present within the local cache.

public byte[]

Returns:

the data of the resource.
read
(String
the resource id.
resourceId
)

Reads the given resource, identified by the resourceId, from the cache.

public void
write(String
the resource id, never null.
resourceId
,
byte[]
the data
data
)

Write the given byte array to the format store and register it on the given resource ID.

Method Detail

clearback to summary
public void clear(String resourceId)

Remove a cache entry.

Parameters
resourceId:String

the resource identifier, not null.

isCachedback to summary
public boolean isCached(String resourceId)

Allows to query if a resource with the given id is present within the local cache.

Parameters
resourceId:String

The resourceId

Returns:boolean

true, if the resource was found in the local cache.

readback to summary
public byte[] read(String resourceId)

Reads the given resource, identified by the resourceId, from the cache.

Parameters
resourceId:String

the resource id.

Returns:byte[]

the data of the resource.

Exceptions
IllegalArgumentException:
if no such resource is existing.
writeback to summary
public void write(String resourceId, byte[] data) throws IOException

Write the given byte array to the format store and register it on the given resource ID.

Parameters
resourceId:String

the resource id, never null.

data:byte[]

the data

Exceptions
IOException:
when an IO error occurs.