public abstract class MetadataSource extends Object
| Modifier and Type | Field and Description |
|---|---|
protected Exception |
error |
protected Map<Class,List<SourceExceptionHandler>> |
exceptionHandlersMap |
protected long |
interRequestTime |
protected long |
lastRequest |
protected ReentrantLock |
lock |
protected int |
maxRetry |
protected String |
operationId |
protected int |
retry |
protected String |
warning |
| Modifier | Constructor and Description |
|---|---|
protected |
MetadataSource() |
| Modifier and Type | Method and Description |
|---|---|
Exception |
getError() |
protected List<SourceExceptionHandler> |
getExceptionHandler(Exception e) |
int |
getMaxRetry() |
String |
getOperationId() |
int |
getRetry() |
String |
getWarning() |
protected void |
handleException(int retry,
Exception e,
String operationId) |
abstract void |
init()
Attempts to init a session
|
protected void |
initExceptionHandlers() |
protected <T> T |
retry(Callable<T> callable)
Command pattern implementation.
|
void |
setError(Exception error) |
void |
setMaxRetry(int maxRetry) |
void |
setWarning(String warning) |
protected void |
throwSourceException(int retry,
Exception e,
String operationId) |
protected void |
throwSourceExceptionHook() |
protected long lastRequest
protected long interRequestTime
protected ReentrantLock lock
protected int maxRetry
protected int retry
protected String operationId
protected String warning
protected Map<Class,List<SourceExceptionHandler>> exceptionHandlersMap
protected Exception error
protected void initExceptionHandlers()
public String getWarning()
public void setWarning(String warning)
public int getRetry()
public int getMaxRetry()
public void setMaxRetry(int maxRetry)
public String getOperationId()
public Exception getError()
public void setError(Exception error)
protected <T> T retry(Callable<T> callable) throws MetadataSourceException
T - return type. Generics for type safety.callable - the callable to call. See the classes with the same name as
the public methods of this class.com.atmire.import_citations.configuration.SourceException - if something unrecoverable happens (e.g. network failures)MetadataSourceExceptionprotected void handleException(int retry,
Exception e,
String operationId)
throws MetadataSourceException
MetadataSourceExceptionprotected List<SourceExceptionHandler> getExceptionHandler(Exception e)
protected void throwSourceException(int retry,
Exception e,
String operationId)
throws MetadataSourceException
MetadataSourceExceptionprotected void throwSourceExceptionHook()
Copyright © 2016 DuraSpace. All rights reserved.