Package com.attivio.connector
Class DataSourceAPIErrorDescriptorImpl
- java.lang.Object
-
- com.attivio.connector.DataSourceAPIErrorDescriptorImpl
-
- All Implemented Interfaces:
DataSourceAPIErrorDescriptor
public class DataSourceAPIErrorDescriptorImpl extends java.lang.Object implements DataSourceAPIErrorDescriptor
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface com.attivio.sdk.scanner.DataSourceAPIErrorDescriptor
DataSourceAPIErrorDescriptor.LogLevel
-
-
Constructor Summary
Constructors Constructor Description DataSourceAPIErrorDescriptorImpl()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.String
getErrorId()
E.g.java.lang.String
getErrorMessage()
The error message could be used for logging and/or system events.java.util.Properties
getErrorProperties()
DataSourceAPIErrorDescriptor.LogLevel
getLogLevel()
Define the logging level.int
getNumRetries()
The number of times to retry after a failure.int
getPercentTimeoutIncreaseOnRetry()
How much to increase the timeout period on each retry.SystemEvent.Severity
getSystemEventSevirity()
Generate a system event with the specified severity.boolean
isFatal()
void
setErrorId(java.lang.String errorId)
void
setErrorMessage(java.lang.String errorMessage)
void
setErrorProperties(java.util.Properties errorProperties)
void
setFatal(boolean fatal)
void
setLogLevel(DataSourceAPIErrorDescriptor.LogLevel logLevel)
void
setNumRetries(int numRetries)
void
setPercentTimeoutIncreaseOnRetry(int percentTimeoutIncreaseOnRetry)
void
setSystemEventSevirity(SystemEvent.Severity systemEventSevirity)
-
-
-
Method Detail
-
getPercentTimeoutIncreaseOnRetry
public int getPercentTimeoutIncreaseOnRetry()
Description copied from interface:DataSourceAPIErrorDescriptor
How much to increase the timeout period on each retry. For example, if 150% and timeout for the first attempt is 8 seconds: The timeout for the second attempt will be 12 seconds and for the third attempt will be 18 seconds.- Specified by:
getPercentTimeoutIncreaseOnRetry
in interfaceDataSourceAPIErrorDescriptor
- Returns:
- value >= 100 (100 means no change in timeout on subsequent attempts).
-
setPercentTimeoutIncreaseOnRetry
public void setPercentTimeoutIncreaseOnRetry(int percentTimeoutIncreaseOnRetry)
-
getErrorId
public java.lang.String getErrorId()
Description copied from interface:DataSourceAPIErrorDescriptor
E.g. http-401- Specified by:
getErrorId
in interfaceDataSourceAPIErrorDescriptor
- Returns:
- non blank value
-
setErrorId
public void setErrorId(java.lang.String errorId)
-
isFatal
public boolean isFatal()
- Specified by:
isFatal
in interfaceDataSourceAPIErrorDescriptor
- Returns:
- true if this error should stop the scanner
-
setFatal
public void setFatal(boolean fatal)
-
getNumRetries
public int getNumRetries()
Description copied from interface:DataSourceAPIErrorDescriptor
The number of times to retry after a failure.- Specified by:
getNumRetries
in interfaceDataSourceAPIErrorDescriptor
- Returns:
- A value < 0 to use the default number of retries
-
setNumRetries
public void setNumRetries(int numRetries)
-
getLogLevel
public DataSourceAPIErrorDescriptor.LogLevel getLogLevel()
Description copied from interface:DataSourceAPIErrorDescriptor
Define the logging level. Don't log if null;- Specified by:
getLogLevel
in interfaceDataSourceAPIErrorDescriptor
- Returns:
-
setLogLevel
public void setLogLevel(DataSourceAPIErrorDescriptor.LogLevel logLevel)
-
getSystemEventSevirity
public SystemEvent.Severity getSystemEventSevirity()
Description copied from interface:DataSourceAPIErrorDescriptor
Generate a system event with the specified severity. Use the text returned fromDataSourceAPIErrorDescriptor.getErrorMessage()
as the event's text- Specified by:
getSystemEventSevirity
in interfaceDataSourceAPIErrorDescriptor
- Returns:
- null if a system event should not be generated
-
setSystemEventSevirity
public void setSystemEventSevirity(SystemEvent.Severity systemEventSevirity)
-
getErrorProperties
public java.util.Properties getErrorProperties()
- Specified by:
getErrorProperties
in interfaceDataSourceAPIErrorDescriptor
- Returns:
- additional error properties
-
setErrorProperties
public void setErrorProperties(java.util.Properties errorProperties)
-
getErrorMessage
public java.lang.String getErrorMessage()
Description copied from interface:DataSourceAPIErrorDescriptor
The error message could be used for logging and/or system events. Its form is a String format, e.g. "Failed to fetch doc %s".- Specified by:
getErrorMessage
in interfaceDataSourceAPIErrorDescriptor
- Returns:
- null or blank is optional
-
setErrorMessage
public void setErrorMessage(java.lang.String errorMessage)
-
-