public class ObjectFormatCache extends Object
Modifier and Type | Field and Description |
---|---|
protected Date |
lastRefreshDate |
protected static int |
throttleIntervalSec |
static boolean |
usingFallbackFormatList |
Modifier and Type | Method and Description |
---|---|
ObjectFormat |
getFormat(ObjectFormatIdentifier formatId)
Lookup and return the format specified by the Identifier.
|
ObjectFormat |
getFormat(String fmtidStr)
Deprecated.
|
static ObjectFormatCache |
getInstance()
Create the object format cache instance if it hasn't already been created.
|
Date |
getLastRefreshDate()
Returns the date of the last refresh from the CN.
|
int |
getMinimalRefreshInterval()
Returns the minimal refresh interval (seconds)
|
protected ConcurrentHashMap<ObjectFormatIdentifier,ObjectFormat> |
getObjectFormatMap() |
boolean |
isUsingFallbackFormatList()
Returns true if the cache has not been able to successfully
refresh from the CN
|
ObjectFormatList |
listFormats()
List the object formats registered with the object format service.
|
protected void |
refreshCache()
refreshes the cache from the CN or if a CN copy cannot be obtains, temporarily
uses a static ObjectFormatList included in the libclient_java jar, accessed via
org.dataone.service.types.v2.util.ObjectFormatServiceImpl.
|
public static boolean usingFallbackFormatList
protected static int throttleIntervalSec
protected Date lastRefreshDate
public static ObjectFormatCache getInstance()
public ObjectFormatList listFormats()
public int getMinimalRefreshInterval()
public Date getLastRefreshDate()
public boolean isUsingFallbackFormatList()
protected void refreshCache() throws ServiceFailure
ServiceFailure
@Deprecated public ObjectFormat getFormat(String fmtidStr) throws NotFound
This method is deprecated in favor of the type-safe getFormat(ObjectFormatIdentifier) method
format
- - the object format identifier stringNotFound
public ObjectFormat getFormat(ObjectFormatIdentifier formatId) throws NotFound
formatId
- - the object format identifierServiceFailure
NotFound
NotImplemented
protected ConcurrentHashMap<ObjectFormatIdentifier,ObjectFormat> getObjectFormatMap()
Copyright © 2018. All Rights Reserved.