com.fatwire.agent
Interface IConnectorContext


public interface IConnectorContext

Connector context class. This class is used to store some common information for all connectors as well as some common methods. It is also used as a 'bridge' between the runtime system and a connector implementation. For instance guessMIMEType() method is used to retrieve item's MIME type based on the file name.


Method Summary
 java.lang.String getAgentID()
          Retrieves the unique Agent identifier.
 java.lang.String getAgentUrl()
          Retrieves a URL which could be used to access the Web server hosted by the Agent runtime (if any).
 java.lang.String getDataDir()
          Retrieves data directory.
 int getHearbeatInterval()
          Retrieves heartbeat interval.
 java.lang.String guessMIMEType(java.lang.String ext)
          Tries to 'guess' a MIME type using a file extension.
 void itemCreated(ItemEventArgs e)
          This method is used by the content providers which support the incremental synchronization.
 void itemDeleted(ItemEventArgs e)
          This method is used by the content providers which support the incremental synchronization.
 void itemRenamed(ItemEventArgs e)
          This method is used by the content providers which support the incremental synchronization.
 void itemUpdated(ItemEventArgs e)
          This method is used by the content providers which support the incremental synchronization.
 void repositoryCreated(RepositoryEventArgs e)
          This method is invoked by the connector's code to notify the Agent runtime system that a new repository has been created.
 void repositoryDeleted(RepositoryEventArgs e)
          This method is invoked by the connector's code to notify the Agent runtime system that a new repository has been deleted.
 void repositoryResync(RepositoryEventArgs e)
          This method is invoked by the connector's code to notify the Agent runtime system that the repository should be resynchronized, i.e.
 void repositoryUpdated(RepositoryEventArgs e)
          This method is invoked by the connector's code to notify the Agent runtime system that the repository has been updated, i.e its name or other parameters are changed.
 

Method Detail

getAgentID

java.lang.String getAgentID()
Retrieves the unique Agent identifier.

It is placed in 'agentid' attribute in 'catalog.xml' file. It is unique to any Agent and is generated during the installation procedure.

Returns:
Agent unique id.

getAgentUrl

java.lang.String getAgentUrl()
Retrieves a URL which could be used to access the Web server hosted by the Agent runtime (if any).

Returns:
Agent URL

getHearbeatInterval

int getHearbeatInterval()
Retrieves heartbeat interval.

Agent sends periodic (heartbeat) messages to all registered providers. See HeartbeatInfo for details.

Returns:
heartbeat interval in seconds.

getDataDir

java.lang.String getDataDir()
Retrieves data directory. It could be an absolute or a relative path. Data directory is a directory where conf, security and other data-containing directories reside. By default a parent directory of the current working directory is taken.

Returns:
data directory.

guessMIMEType

java.lang.String guessMIMEType(java.lang.String ext)
Tries to 'guess' a MIME type using a file extension.

All MIME types are stored in 'types.xml' file. For instance for '.txt' extension this method returns 'text/plain'.

Parameters:
ext - file extension.
Returns:
MIME type of the supplied file extension.

repositoryCreated

void repositoryCreated(RepositoryEventArgs e)
This method is invoked by the connector's code to notify the Agent runtime system that a new repository has been created.

Parameters:
e - repository event arguments.

repositoryUpdated

void repositoryUpdated(RepositoryEventArgs e)
This method is invoked by the connector's code to notify the Agent runtime system that the repository has been updated, i.e its name or other parameters are changed.

Parameters:
e - repository event arguments.

repositoryDeleted

void repositoryDeleted(RepositoryEventArgs e)
This method is invoked by the connector's code to notify the Agent runtime system that a new repository has been deleted.

Parameters:
e - repository event arguments.

repositoryResync

void repositoryResync(RepositoryEventArgs e)
This method is invoked by the connector's code to notify the Agent runtime system that the repository should be resynchronized, i.e. a new bulk replication cycle should be started shortly.

Parameters:
e - repository event arguments.

itemCreated

void itemCreated(ItemEventArgs e)
This method is used by the content providers which support the incremental synchronization.

It signals the Agent runtime system that a new item has been created and this change should be propagated to the target provider.


itemRenamed

void itemRenamed(ItemEventArgs e)
This method is used by the content providers which support the incremental synchronization.

It signals the Agent runtime system that the item has been renamed and this change should be propagated to the target provider.


itemUpdated

void itemUpdated(ItemEventArgs e)
This method is used by the content providers which support the incremental synchronization.

It signals the Agent runtime system that the item has been updated and this change should be propagated to the target provider.


itemDeleted

void itemDeleted(ItemEventArgs e)
This method is used by the content providers which support the incremental synchronization.

It signals the Agent runtime system that the item has been deleted and this change should be propagated to the target provider.