public abstract class ConnectorState
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
static class |
ConnectorState.Builder |
static class |
ConnectorState.ScanStatus |
Modifier and Type | Field and Description |
---|---|
ConnectorState.ScanStatus |
currentScan
Detailed status for current scan (if a scan is currently running)
|
protected java.lang.Throwable |
exceptionForStatus
If relevant, exception that lead to the connector being in this status
|
java.util.List<java.lang.String> |
loggingContext
Internal, framework usage only
|
ConnectorState.ScanStatus |
previousScan
Detailed status for previous scan (if a scan has ever been performed)
|
protected java.lang.String |
reasonForStatus
Global message indicating reason of last status change.
|
long |
scanCounter
Counter indicating how many times we tried to run the scan.
|
protected ConnectorStatus |
status |
Modifier | Constructor and Description |
---|---|
protected |
ConnectorState()
Default constructor.
|
protected |
ConnectorState(ConnectorStatus status)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
static ConnectorState.Builder |
builder() |
void |
clearSpecificMeasure()
Remove all custom metrics.
|
java.lang.Throwable |
getExceptionForStatus() |
java.lang.String |
getReasonForStatus() |
long |
getScanCounter() |
ConnectorStatus |
getStatus()
Get the status
|
abstract void |
incDeleted()
Increment the counter representing the number of documents deleted by the connector.
|
abstract void |
incDeleted(long increment)
Add a specific amount to the counter representing the number of documents deleted by the connector.
|
abstract void |
incPushed()
Increment the number of documents pushed by the scan in progress.
|
abstract void |
incPushed(long increment)
Add a specific amount of documents pushed by the scan in progress.
|
void |
incScanCounter() |
void |
incScanned()
Increment the counter representing the number of objects retrieved from the source.
|
void |
incScanned(long increment)
Add a specific amount to the counter representing the number of objets retrieved from the source.
|
boolean |
isStatus(ConnectorStatus status)
Test current status
|
void |
popLoggingContext() |
void |
pushLoggingContext()
Push the logging context for the connector.
|
void |
removeSpecificMeasure(java.lang.String name)
Remove a custom metric
|
void |
resetScanCounter() |
void |
setSpecificMeasure(java.lang.String name,
java.lang.Number value)
Set a custom metric, retrievable by the MAMI operation connector#GetConnectorsStatus
|
void |
setStatus(ConnectorStatus status) |
void |
setStatus(ConnectorStatus status,
java.lang.String reason) |
void |
setStatus(ConnectorStatus status,
java.lang.String reason,
java.lang.Throwable t)
Set the status
|
void |
startScan()
Reset internal counters.
|
void |
stopScan() |
java.lang.String |
toString()
Convert the current state to a string.
|
static java.lang.String |
toString(ConnectorStatus status)
Convert the 'status' to a string.
|
void |
waitStatus(ConnectorStatus expected)
BLock the current thread until the connector scan status is the one specified in parameter.
|
void |
waitStatusChange()
Deprecated.
|
void |
waitStatusChange(ConnectorStatus curStatus)
Block the current thread until the connector scan status changes.
|
boolean |
waitStatusChange(ConnectorStatus curStatus,
long timeoutMs)
Block the current thread until the connector scan status changes.
|
protected ConnectorStatus status
protected java.lang.String reasonForStatus
protected java.lang.Throwable exceptionForStatus
public ConnectorState.ScanStatus previousScan
public ConnectorState.ScanStatus currentScan
public long scanCounter
public java.util.List<java.lang.String> loggingContext
protected ConnectorState(ConnectorStatus status)
protected ConnectorState()
public static ConnectorState.Builder builder()
public ConnectorStatus getStatus()
public boolean isStatus(ConnectorStatus status)
status
- A statuspublic void waitStatusChange(ConnectorStatus curStatus)
curStatus
- The status to be monitored.@Deprecated public void waitStatusChange()
public boolean waitStatusChange(ConnectorStatus curStatus, long timeoutMs)
curStatus
- The status to be monitored.timeoutMs
- The timeout value, in milliseconds.public void waitStatus(ConnectorStatus expected)
expected
- The expected connector scan status.public java.lang.String getReasonForStatus()
public java.lang.Throwable getExceptionForStatus()
public void pushLoggingContext()
public void popLoggingContext()
public void startScan()
public abstract void incPushed()
public abstract void incPushed(long increment)
increment
- Is now done by the connector server if the counting PAPi is not disabled. Else this method has become a non-operation. The data modified by this method is ignored.public abstract void incDeleted()
public abstract void incDeleted(long increment)
increment
- Is now done by the connector server if the counting PAPi is not disabled. Else this method has become a non-operation. The data modified by this method is ignored.public void incScanned()
public void incScanned(long increment)
increment
- public void setSpecificMeasure(java.lang.String name, java.lang.Number value)
name
- Label of the metricvalue
- its value
This can be used to build custom chart in the Monitoring Console for instance.public void removeSpecificMeasure(java.lang.String name)
name
- Label of the metric to remove.public void clearSpecificMeasure()
Connector.scan(com.exalead.papi.helper.PushAPI, String, Object)
member method.public void stopScan()
public void setStatus(ConnectorStatus status)
public void setStatus(ConnectorStatus status, java.lang.String reason)
public void resetScanCounter()
public long getScanCounter()
public void incScanCounter()
public void setStatus(ConnectorStatus status, java.lang.String reason, java.lang.Throwable t) throws java.lang.IllegalStateException
java.lang.IllegalStateException
- if the transition state is invalidpublic java.lang.String toString()
toString
in class java.lang.Object
public static java.lang.String toString(ConnectorStatus status)
Copyright © 2021 Dassault Systèmes, All Rights Reserved.