Application

public class Application extends Object
Known Direct Subclasses

Main object and access point for the SDK.

Every connector begins execution by creating an instance of this class and calling its start() method. This starts processing, triggering the SDK to begin making connector calls as configured in the configuration file.

Sample usage:

public static void main(String[] args) throws IOException, InterruptedException {
     Application application = new Application.Builder(
         new MyConnector(new MyRepository()), args).build();
     application.start();
   } 
 

Optional configuration parameter(s):

  • .INCREMENTAL_INTERVAL_SECONDS - Specifies the interval between scheduled incremental traversals (in seconds).
  • .TRAVERSE_ON_START - Specifies whether to run the traversal immediately at start up rather than waiting for the first interval to expire.
  • .POLL_INTERVAL_SECONDS - Specifies the interval between scheduled poll queue intervals (in seconds).
  • .TRAVERSE_INTERVAL_SECONDS - Specifies the interval between scheduled traversals (in seconds).
  • .RUN_ONCE - Specifies whether the connector should exit after a single traversal.

Nested Class Summary

class Application.AbstractApplicationHelper<C extends AbstractBuilder<C, T extends ConnectorContext>, S extends AbstractBuilder<S, T>, T> Helper class to make our class more testable: factory and util methods  
class Application.AbstractBuilder<B extends AbstractBuilder<B, H extends AbstractApplicationHelper, T extends ConnectorContext>, H, T>  
class Application.Builder  
class Application.ShutdownHook  

Constant Summary

String INCREMENTAL_INTERVAL_SECONDS
String POLL_INTERVAL_SECONDS
String RUN_ONCE
String TRAVERSE_INTERVAL_SECONDS
String TRAVERSE_ON_START

Field Summary

protected static final ExceptionHandler DEFAULT_EXCEPTION_HANDLER
protected final Connector<T extends ConnectorContext> connector
protected ConnectorScheduler<T extends ConnectorContext> connectorScheduler
protected ConnectorScheduler.ShutdownHolder shutdownHolder
protected final AtomicBoolean started

Protected Constructor Summary

Application(AbstractBuilder<? extends AbstractBuilder, H, T> builder)

Public Method Summary

static void
setLogger(Logger logger)
synchronized void
shutdown(String event)
void
start()
Begins connector execution by initializing and starting the SDK.

Protected Method Summary

T
buildConnectorContext()
Returns a connector context.
void
T
void
startScheduler(T context)

Inherited Method Summary

Constants

public static final String INCREMENTAL_INTERVAL_SECONDS

Constant Value: "schedule.incrementalTraversalIntervalSecs"

public static final String POLL_INTERVAL_SECONDS

Constant Value: "schedule.pollQueueIntervalSecs"

public static final String RUN_ONCE

Constant Value: "connector.runOnce"

public static final String TRAVERSE_INTERVAL_SECONDS

Constant Value: "schedule.traversalIntervalSecs"

public static final String TRAVERSE_ON_START

Constant Value: "schedule.performTraversalOnStart"

Fields

protected static final ExceptionHandler DEFAULT_EXCEPTION_HANDLER

protected final Connector<T extends ConnectorContext> connector

protected ConnectorScheduler<T extends ConnectorContext> connectorScheduler

protected ConnectorScheduler.ShutdownHolder shutdownHolder

protected final AtomicBoolean started

Protected Constructors

protected Application (AbstractBuilder<? extends AbstractBuilder, H, T> builder)

Parameters
builder

Public Methods

public static void setLogger (Logger logger)

Parameters
logger

public synchronized void shutdown (String event)

Parameters
event

public void start ()

Begins connector execution by initializing and starting the SDK.

This is the main entry point for the SDK. This method initializes all the objects used in traversing a repository and schedules the traversals based on the configuration parameters.

Throws
InterruptedException if aborted during start up

Protected Methods

protected T buildConnectorContext ()

Returns a connector context. Connectors that extend ConnectorContext, should override this method.

protected void startApplication ()

protected T startConnector ()

Throws
InterruptedException

protected void startScheduler (T context)

Parameters
context

Send feedback about...

Cloud Search
Cloud Search