//******************************************************************************
//
// Restricted Rights
// WARNING: This is a restricted distribution Zeligsoft file.
//
//******************************************************************************
//
// Copyright (C) 2006 Zeligsoft Inc. - All Rights Reserved
//

//******************************************************************************
//
//     FILE: zceProcessTxWorker.h
//
//******************************************************************************

#ifndef __ZCEPROCESSTXWORKER_H
#define __ZCEPROCESSTXWORKER_H


#include <iostream>
#include <iomanip>
#include <stdio.h>
#include <string>
#include <sstream>

#include "PortTypes.h"

#include "zceOperatingEnvironment.h"

#include "zceProcessTxServant.h"

#include "zcePushPorts_OctetSeqConsumerPortHandler.h"

#include "zcePushPorts_OctetSeqConsumerUsesPort.h"

class zceProcessTxWorker : 
		public zcePushPorts_OctetSeqConsumerPortHandler
{

	public:
		zceProcessTxWorker( const ProcessTx_params& execParams , zcePushPorts_OctetSeqConsumerUsesPort* portDataOut ZCE_EXC_ENV_ARG );

		virtual ~zceProcessTxWorker();

		void setportDataOut( zcePushPorts_OctetSeqConsumerUsesPort& portDataOut );

		void initExecParams( const ProcessTx_params& params ZCE_EXC_ENV_ARG);

		void config_propDestinationId( const CORBA::String_var& propdestinationid ZCE_EXC_ENV_ARG );

		void config_propQoS( const CORBA::Long& propqos ZCE_EXC_ENV_ARG );

		void config_propModulation( const CORBA::Long& propmodulation ZCE_EXC_ENV_ARG );

		void config_propApplicationType( const CORBA::Long& propapplicationtype ZCE_EXC_ENV_ARG );


		void query_propDestinationId( CORBA::String_var& propdestinationid ZCE_EXC_ENV_ARG );

		void query_propQoS( CORBA::Long& propqos ZCE_EXC_ENV_ARG );

		void query_propModulation( CORBA::Long& propmodulation ZCE_EXC_ENV_ARG );

		void query_propApplicationType( CORBA::Long& propapplicationtype ZCE_EXC_ENV_ARG );



		/*!	\brief
		 *
		 *	 Describe operation here.
		 * 
		 *	\throw ::CF::LifeCycle::InitializeError
		 * 
		 */
		virtual void CF_LifeCycle_initialize( int portIdentifier ZCE_EXC_ENV_ARG );

		/*!	\brief
		 *
		 *	 Describe operation here.
		 * 
		 *	\throw ::CF::LifeCycle::ReleaseError
		 * 
		 */
		virtual void CF_LifeCycle_releaseObject( int portIdentifier ZCE_EXC_ENV_ARG );

		/*!
		 * \brief The start operation is provided to command a Resource implementing this
		 * interface to start internal processing.
		 *
		 * Specification reference:  3.1.3.1.6.5.2
		 *
		 * The start operation puts the Resource in an operating condition.
		 *
		 * \return This operation does not return a value.
		 *
		 * \throw StartError The start operation shall raise the StartError exception if
		 * an error occurs while starting the resource.
		 *
		 */
		virtual void CF_Resource_start( int portIdentifier ZCE_EXC_ENV_ARG );

		/*!
		 * \brief The stop operation is provided to command a Resource implementing this
		 * interface to stop internal processing.
		 *
		 * Specification reference:  3.1.3.1.6.5.1
		 *
		 * The stop operation shall disable all current operations and put the Resource in
		 * a non-operating condition. Subsequent configure, query, and start operations
		 * are not inhibited by the stop operation.
		 *
		 * \return This operation does not return a value.
		 *
		 * \throw StopError The stop operation shall raise the StopError exception if an
		 * error occurs while stopping the resource.
		 *
		 */
		virtual void CF_Resource_stop( int portIdentifier ZCE_EXC_ENV_ARG );

		/*!	\brief
		 *
		 *	 Describe operation here.
		 * 
		 *	\param msg ( ::CF::OctetSequence ) 
		 * 
		 *	\param options ( ::CF::Properties ) 
		 * 
		 */
		virtual void PushPorts_OctetSeqConsumer_processOctetMsg( int portIdentifier, const CF::OctetSequence& msg, const CF::Properties& options ZCE_EXC_ENV_ARG );


		#if defined(DEBUG_MSGS)
		void setDebugStream(const std::ostream& stream);

		void debugMsg(const std::string&);
		#endif

	private:
		zcePushPorts_OctetSeqConsumerUsesPort* portDataOut_;


		ProcessTx_params execParams_;
		
		CORBA::String_var mPropDestinationId; ///< DestinationId property (Ex. 00905551112233)
		CORBA::Long mPropApplicationType; ///< ApplicationType property (0 = voice, 1 = data)
		CORBA::Long mPropQoS; ///< Quality of Service property (Between 1 and 5)
		CORBA::Long mPropModulation; ///< Modulation type property (Any long value)

		#if defined(DEBUG_MSGS)
		std::ostream debug_;
		#endif

};
#endif     // __ZCEPROCESSTXWORKER_H

// End-Of-File
//------------------------------------------------------------------------------
