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

//******************************************************************************
//
//     FILE: zceCF_ResourcePortHandler.h
//
//******************************************************************************

#ifndef __ZCECF_RESOURCEPORTHANDLER_H
#define __ZCECF_RESOURCEPORTHANDLER_H


#if defined(OS_WIN32)
#pragma warning(disable:4786)
#endif

#include "zceOperatingEnvironment.h"

#include <string>

#include "CF.h"

class zceCF_ResourcePortHandler
{
	public :
		virtual ~zceCF_ResourcePortHandler() = 0;

		/*!
		 * \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 ) = 0;

		/*!
		 * \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 ) = 0;

		virtual char* CF_Resource_identifier(  int portIdentifier ZCE_EXC_ENV_ARG ) = 0;

		/*!
		 * \brief The configure operation allows id/value pair configuration properties to
		 * be assigned to components implementing this interface.
		 *
		 * Specification reference:  3.1.3.1.5.5.1
		 *
		 * The configure operation shall assign values to the properties as indicated in
		 * the configProperties argument. Valid properties for the configure operation
		 * shall at a minimum be the configure readwrite and writeonly properties
		 * referenced in the component's SPD.
		 *
		 * \param configProperties (::CF::Properties ) 
		 *
		 * \return This operation does not return a value.
		 *
		 * \throw PartialConfiguration The configure operation shall raise a
		 * PartialConfiguration exception when some configuration properties were
		 * successfully set and some configuration properties were not successfully set.
		 *
		 * \throw InvalidConfiguration The configure operation shall raise an
		 * InvalidConfiguration exception when a configuration error occurs that prevents
		 * any property configuration on the component.
		 *
		 */
		virtual void CF_PropertySet_configure( int portIdentifier, const CF::Properties& configProperties ZCE_EXC_ENV_ARG ) = 0;

		/*!
		 * \brief The query operation allows a component to be queried to retrieve its
		 * properties.
		 *
		 * Specification reference:  3.1.3.1.5.5.2
		 *
		 * The query operation shall return all component properties if the
		 * configProperties are zero size.
		 *
		 * The query operation shall return only those id/value pairs specified in the
		 * configProperties if the configProperties are not zero size. Valid properties
		 * for the query operation shall at a minimum be the configure, readwrite, and
		 * readonly properties, and allocation properties that have an action value of
		 * "external" as referenced in the component's SPD.
		 *
		 * \param configProperties (::CF::Properties ) 
		 *
		 * \return This operation does not return a value.
		 *
		 * \throw  The query operation shall raise the CF UnknownProperties exception when
		 * one or more properties being requested are not known by the component.
		 *
		 */
		virtual void CF_PropertySet_query( int portIdentifier, CF::Properties& configProperties ZCE_EXC_ENV_ARG ) = 0;

		/*!
		 * \brief The getPort operation provides a mechanism to obtain a specific consumer
		 * or producer Port. A PortSupplier may contain zero-to-many consumer and producer
		 * port components. The exact number is specified in the component’s Software
		 * Profile SCD (section 3.1.3.4). Multiple input and/or output ports provide
		 * flexibility for PortSuppliers that must manage varying priority levels and
		 * categories of incoming and outgoing messages, provide multi-threaded message
		 * handling, or other special message processing.
		 *
		 * Specification reference:  3.1.3.1.4.5.1
		 *
		 * The getPort operation returns the object reference to the named port as stated
		 * in the component's SCD.
		 *
		 * \param name (string ) The name of the port being requested.
		 *
		 * \return The getPort operation shall return the CORBA object reference that is
		 * associated with the input port name.
		 *
		 * \throw UnknownPort The getPort operation shall raise an UnknownPort exception
		 * if the port name is invalid.
		 *
		 */
		virtual CORBA::Object_ptr CF_PortSupplier_getPort( int portIdentifier, const char* name ZCE_EXC_ENV_ARG ) = 0;

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

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

		/*!
		 * \brief The runTest operation allows components to be "blackbox" tested. This
		 * allows Built-In Test (BIT) to be implemented and this provides a means to
		 * isolate faults (both software and hardware) within the system.
		 *
		 * Specification reference:  3.1.3.1.3.5.1
		 *
		 * The runTest operation shall use the testId parameter to determine which of its
		 * predefined test implementations should be performed. The testValues parameter
		 * CF Properties (id/value pair(s)) shall be used to provide additional
		 * information to the implementation-specific test to be run. The runTest
		 * operation shall return the result(s) of the test in the testValues parameter.
		 *
		 * \param testId (unsigned long ) Use the testId parameter to determine which of
		 * its predefined test implementations should be performed
		 *
		 * \param testValues (::CF::Properties ) The testValues parameter CF Properties
		 * (id/value pair(s)) shall be used to provide additional information to the
		 * implementation-specific test to be run. The runTest operation shall return the
		 * result(s) of the test in the testValues parameter.
		 *
		 * \return The runTest operation shall return the result(s) of the test in the
		 * testValues parameter.
		 *
		 * \throw UnknownTest The runTest operation shall raise the UnknownTest exception
		 * when there is no underlying test implementation that is associated with the
		 * input testId given.
		 *
		 * \throw UnknownProperties The runTest operation shall raise the
		 * UnknownProperties exception when the input parameter testValues contains any
		 * DataTypes that are not known by the component's test implementation or any
		 * values that are out of range for the requested test. 
		 *
		 */
		virtual void CF_TestableObject_runTest( int portIdentifier, CORBA::ULong testid, CF::Properties& testValues ZCE_EXC_ENV_ARG ) = 0;


};
#endif     // __ZCECF_RESOURCEPORTHANDLER_H

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