com.fatwire.agent
Interface IProviderSession


public interface IProviderSession

Provider session. This session established by the Agent runtime system with a content provider (external system).

There could be numerous providers per a single connector. Each of these providers can hold its own properties, e.g. credential sets.


Method Summary
 IRepository createRepository(RepositoryInfo rinfo)
          Creates a new repository.
 int deleteRepositories(java.util.List<java.lang.String> repids)
          Deletes repositories.
 void disconnect()
          Desconnects this session.
 Properties getProperties()
          Gets this provider session custom properties.
 java.util.List<IRepository> getRepositories()
          Get the list of all repositories available via this provider.
 IRepository getRepositoryByID(java.lang.String repid)
          Gets repository by its unique identifier.
 ProviderState getState()
          Gets state of this provider session.
 void sendHeartbeat(HeartbeatInfo hinfo)
          Sends heartbeat message to the system represented by this provider.
 IRepository updateRepository(RepositoryInfo rinfo)
          Updates reposotory information (name, custom properties).
 

Method Detail

disconnect

void disconnect()
                throws AgentException
Desconnects this session. It can't be used any more.

Throws:
AgentException - if error occures during the disconnect operation.

getProperties

Properties getProperties()
Gets this provider session custom properties.

Returns:
provider session properties.

getState

ProviderState getState()
Gets state of this provider session.

Returns:
provider session state.

sendHeartbeat

void sendHeartbeat(HeartbeatInfo hinfo)
                   throws AgentException
Sends heartbeat message to the system represented by this provider. These messages could be used for different purposes, e.g. notify the other system where provider is connected that the Agent runtime is alive or retrieve events from that system. In normal operation mode HeartbeatState set to HeartbeatState.Normal. Before Agent shuts down SendHeartbeat methods from all providers are invoked the last time with HeartbeatState set to HeartbeatState.Stopping.

Throws:
AgentException - if the provider failed to send a hearbeat message.

getRepositories

java.util.List<IRepository> getRepositories()
                                            throws AgentException
Get the list of all repositories available via this provider.

Returns:
the list of repositories.
Throws:
AgentException - if the provider failed to extract the list of repositories.

getRepositoryByID

IRepository getRepositoryByID(java.lang.String repid)
                              throws NotFoundException,
                                     AgentException
Gets repository by its unique identifier.

Parameters:
id - repository unique identifier.
Returns:
repository.
Throws:
NotFoundException - if the repository asked doesn't exits.
AgentException - if the repository could not be retrieved.

createRepository

IRepository createRepository(RepositoryInfo rinfo)
                             throws AgentException
Creates a new repository.

Parameters:
rinfo - repository information block with name set.
Returns:
repository with id and creation/modification times set.
Throws:
AgentException - if the repository could not be created.

updateRepository

IRepository updateRepository(RepositoryInfo rinfo)
                             throws AgentException
Updates reposotory information (name, custom properties). Identifier must be set in rinfo.

Parameters:
rinfo - repository info to update.
Returns:
updated repository.
Throws:
AgentException - if the repository could not be updated.

deleteRepositories

int deleteRepositories(java.util.List<java.lang.String> repids)
                       throws AgentException
Deletes repositories.

Parameters:
repids - the list of repository identifiers.
Returns:
the number of repositories deleted if any.
Throws:
AgentException - if an error occured during the deletion operation.