com.thomsonreuters.ema.access.OmmProviderClient Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of ema Show documentation
Show all versions of ema Show documentation
Enterprise Message API (EMA) Java Edition
///*|-----------------------------------------------------------------------------
// *| This source code is provided under the Apache 2.0 license --
// *| and is provided AS IS with no warranty or guarantee of fit for purpose. --
// *| See the project's LICENSE.md for details. --
// *| Copyright Thomson Reuters 2016. All rights reserved. --
///*|-----------------------------------------------------------------------------
package com.thomsonreuters.ema.access;
/**
* OmmProviderClient interface provides callback methods to pass received messages.
*
* Application needs to implement an application client class inheriting from OmmProviderClient.
* In its own class, application needs to override callback methods it desires to use for item processing.
*
* Application may chose to implement specific callbacks (e.g. {@link #onRefreshMsg(RefreshMsg, OmmProviderEvent)})
* or a general callback (e.g. {@link #onAllMsg(Msg, OmmProviderEvent)}).
*
* Thread safety of all OmmProviderClient methods depends on the user's implementation.
*
*
* The following code snippet shows basic usage of OmmProviderClient class to print
* received refresh, and status messages to screen.
*
*
* class AppClient implements OmmProviderClient
* {
* public void onRefreshMsg(RefreshMsg refreshMsg, OmmProviderEvent event)
* {
* System.out.println("Handle: " + event.handle() + " Closure: " + event.closure());
* System.out.println(refreshMsg);
* }
*
* public void onStatusMsg(StatusMsg statusMsg, OmmProviderEvent event)
* {
* System.out.println("Handle: " + event.handle() + " Closure: " + event.closure());
* System.out.println(statusMsg);
* }
*
* public void onGenericMsg(GenericMsg genericMsg, OmmProviderEvent consumerEvent){}
* public void onAllMsg(Msg msg, OmmProviderEvent consumerEvent){}
* public void onPostMsg(PostMsg postMsg, OmmProviderEvent providerEvent) {}
* public void onReqMsg(ReqMsg reqMsg, OmmProviderEvent providerEvent) {}
* public void onReissue(ReqMsg reqMsg, OmmProviderEvent providerEvent) {}
* public void onClose(OmmProviderEvent providerEvent) {}
* }
*
*
*
* @see OmmProvider
* @see OmmProviderEvent
* @see Msg
* @see GenericMsg
* @see RefreshMsg
* @see PostMsg
* @see ReqMsg
*
*/
public interface OmmProviderClient {
/**
* This callback is invoked upon receiving a refresh message.
* Refresh message may be a start, interim or final part.
*
* @param refreshMsg received RefreshMsg ({@link com.thomsonreuters.ema.access.RefreshMsg})
* @param providerEvent identifies open item for which this message is received
*/
public void onRefreshMsg(RefreshMsg refreshMsg, OmmProviderEvent providerEvent);
/**
* This callback is invoked upon receiving a status message.
*
* @param statusMsg received StatusMsg
* @param providerEvent identifies open item for which this message is received
*/
public void onStatusMsg(StatusMsg statusMsg, OmmProviderEvent providerEvent);
/**
* This callback is invoked upon receiving any generic message.
*
* @param genericMsg received GenericMsg ({@link com.thomsonreuters.ema.access.GenericMsg})
* @param providerEvent identifies open item for which this message is received
*/
public void onGenericMsg(GenericMsg genericMsg, OmmProviderEvent providerEvent);
/**
* This callback is invoked upon receiving any post message.
*
* @param postMsg received PostMsg ({@link com.thomsonreuters.ema.access.PostMsg})
* @param providerEvent identifies open item for which this message is received
*/
public void onPostMsg(PostMsg postMsg, OmmProviderEvent providerEvent);
/**
* This callback is invoked upon receiving an initial item request message.
*
* @param reqMsg received ReqMsg ({@link com.thomsonreuters.ema.access.ReqMsg})
* @param providerEvent identifies open item for which this message is received
*/
public void onReqMsg(ReqMsg reqMsg, OmmProviderEvent providerEvent);
/**
* This callback is invoked upon receiving a reissue request.
*
* @param reqMsg received ReqMsg ({@link com.thomsonreuters.ema.access.ReqMsg})
* @param providerEvent identifies open item for which this message is received
*/
public void onReissue(ReqMsg reqMsg, OmmProviderEvent providerEvent);
/**
* This callback is invoked upon receiving a close request message.
*
* @param reqMsg received ReqMsg ({@link com.thomsonreuters.ema.access.ReqMsg})
* @param providerEvent identifies open item for which this message is received
*/
public void onClose(ReqMsg reqMsg, OmmProviderEvent providerEvent );
/**
* This callback is invoked upon receiving any message.
*
* @param msg received message
* @param providerEvent identifies open item for which this message is received
*/
public void onAllMsg(Msg msg, OmmProviderEvent providerEvent);
}