12.6.1.2 Communication Layer



 

Introduction

 

Communication between the Central Server and Distributed Mediation Servers can be operated in one-way or two-way modes, these modes are explained in Communication Mechanism. One-way communication mode is initiated and maintained only by the Distributed Mediation Servers and so, the communication is established and persists only for the time the data is transferred to the Central Server. On the other hand, two-way communication mode is maintained by both the Central and Distributed Mediation Server and so, the communication is persistent.

 

Interfaces and Usage

 

Communication customization is controlled by two interfaces namely, SPPCommInitIfc and SPPRegionalCommIfc. These interfaces have to be implemented at the Central Server and Distributed Regional Server respectively. The CommunicationInfo.xml present in the conf directory of the respective servers decides what kind of communication will exist between the Central Server and the Distributed Mediation Servers.

 

SPPCommInitIfc interface is implemented for establishing the communication link. The methods provided by this interface are init(), open() and shutdown(). A CommunicationException is thrown if there are any errors.

public void init(Properties args) throws CommunicationException;

The argument to this method is a Properties object containing the MainProps and UserProps values obtained from CommunicationInfo.xml configuration file.

 

public SPPRegionalCommIfc open(Properties params) throws CommunicationException;

public void shutdown() throws CommunicationException;

 

SPPRegionalCommIfc interface implements the protocol specific logic for data transfer. The methods provided by this interface are initialize(),  write(), read() and shutdown(). A communication exception is thrown if there are any errors.

public boolean initialize(Properties args) throws CommunicationException;

public DataObject write(DataObject dataObject) throws CommunicationException;

public DataObject read() throws CommunicationException;

public void shutdown() throws CommunicationException;



Copyright © 1996-2004, AdventNet Inc. All Rights Reserved.