org.wso2.carbon.databridge.agent.endpoint
Class DataEndpoint

java.lang.Object
  extended by org.wso2.carbon.databridge.agent.endpoint.DataEndpoint
Direct Known Subclasses:
BinaryDataEndpoint, ThriftDataEndpoint

public abstract class DataEndpoint
extends Object

Abstract class for DataEndpoint, and this is a main class that needs to be implemented for supporting different transports to DataPublisher. This abstraction provides the additional functionality to handle failover, asynchronous connection to the endpoint, etc.


Nested Class Summary
static class DataEndpoint.State
           
 
Constructor Summary
DataEndpoint()
           
 
Method Summary
abstract  String getClientPoolFactoryClass()
          Get the class name of implementation for org.wso2.carbon.databridge.agent.client.AbstractClientPoolFactory class.
protected  DataEndpointConfiguration getDataEndpointConfiguration()
           
abstract  String getSecureClientPoolFactoryClass()
          Get the class name of implementation for org.wso2.carbon.databridge.agent.client.AbstractSecureClientPoolFactory class.
 DataEndpoint.State getState()
           
 void initialize(DataEndpointConfiguration dataEndpointConfiguration)
           
protected abstract  String login(Object client, String userName, String password)
          Login to the endpoint and return the sessionId.
protected abstract  void logout(Object client, String sessionId)
          Logout from the endpoint.
protected abstract  void send(Object client, List<org.wso2.carbon.databridge.commons.Event> events)
          Send the list of events to the actual endpoint.
 void shutdown()
          Graceful shutdown until publish all the events given to the endpoint.
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

DataEndpoint

public DataEndpoint()
Method Detail

initialize

public void initialize(DataEndpointConfiguration dataEndpointConfiguration)
                throws DataEndpointException,
                       DataEndpointAuthenticationException,
                       org.wso2.carbon.databridge.commons.exception.TransportException
Throws:
DataEndpointException
DataEndpointAuthenticationException
org.wso2.carbon.databridge.commons.exception.TransportException

login

protected abstract String login(Object client,
                                String userName,
                                String password)
                         throws DataEndpointAuthenticationException
Login to the endpoint and return the sessionId.

Parameters:
client - The client which can be used to connect to the endpoint.
userName - The username which is used to login,
password - The password which is required for the login operation.
Returns:
returns the sessionId
Throws:
DataEndpointAuthenticationException

logout

protected abstract void logout(Object client,
                               String sessionId)
                        throws DataEndpointAuthenticationException
Logout from the endpoint.

Parameters:
client - The client that is used to logout operation.
sessionId - The current session Id.
Throws:
DataEndpointAuthenticationException

getState

public DataEndpoint.State getState()

send

protected abstract void send(Object client,
                             List<org.wso2.carbon.databridge.commons.Event> events)
                      throws DataEndpointException,
                             org.wso2.carbon.databridge.commons.exception.SessionTimeoutException,
                             org.wso2.carbon.databridge.commons.exception.UndefinedEventTypeException
Send the list of events to the actual endpoint.

Parameters:
client - The client that can be used to send the events.
events - List of events that needs to be sent.
Throws:
DataEndpointException
org.wso2.carbon.databridge.commons.exception.SessionTimeoutException
org.wso2.carbon.databridge.commons.exception.UndefinedEventTypeException

getDataEndpointConfiguration

protected DataEndpointConfiguration getDataEndpointConfiguration()

toString

public String toString()
Overrides:
toString in class Object

shutdown

public void shutdown()
Graceful shutdown until publish all the events given to the endpoint.


getClientPoolFactoryClass

public abstract String getClientPoolFactoryClass()
Get the class name of implementation for org.wso2.carbon.databridge.agent.client.AbstractClientPoolFactory class.

Returns:
Canonical name of the implementing class.

getSecureClientPoolFactoryClass

public abstract String getSecureClientPoolFactoryClass()
Get the class name of implementation for org.wso2.carbon.databridge.agent.client.AbstractSecureClientPoolFactory class.

Returns:
Canonical name of the implementing class.


Copyright © 2015 WSO2. All rights reserved.