/******************************************************************
- *
- * Copyright 2014 Samsung Electronics All Rights Reserved.
- *
- *
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- ******************************************************************/
+*
+* Copyright 2014 Samsung Electronics All Rights Reserved.
+*
+*
+*
+* Licensed under the Apache License, Version 2.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*
+******************************************************************/
+
+/**
+* @file
+*
+* This file defines basic interface of Soft Sensor Manager.
+*/
+
#ifndef _SSMInterface_H_
#define _SSMInterface_H_
* @class IModelData
* @brief This class represents context model data package
*
- * @see
*/
class IModelData
{
public:
/**
- * @fn getDataId
- * @brief Get affected DataId. ContextModel has plenty of data so \n
+ * Get affected DataId. ContextModel has plenty of data so \n
* returned data is matched from given condition
*
- *
- * @return int
- * @warning
- * @exception
- * @see
+ * @return int - the affected DataId
*/
virtual int getDataId() = 0;
/**
- * @fn getPropertyCount
- * @brief ContextModel has at least one property that contains data \n
- * property as described from its specification.
- *
+ * ContextModel has at least one property that contains data \n
+ * property is described from its specification.
*
- * @return int
- * @warning
- * @exception
- * @see
+ * @return int - number of properties
*/
virtual int getPropertyCount() = 0;
/**
- * @fn getPropertyName
- * @brief Retrieve propertyName
+ * Retrieve propertyName
*
- * @param [in] propertyIndex - index of property to read
+ * @param propertyIndex - index of property to read
*
- * @return std::string
- * @warning
- * @exception
- * @see
+ * @return std::string - property name
*/
virtual std::string getPropertyName(int propertyIndex) = 0;
/**
- * @fn getPropertyValue
- * @brief Retrieve propertyValue
+ * Retrieve propertyValue
*
- * @param [in] propertyIndex - index of property to read
+ * @param propertyIndex index of property to read
*
- * @return std::string
- * @warning
- * @exception
- * @see
+ * @return std::string - property value
*/
virtual std::string getPropertyValue(int propertyIndex) = 0;
/**
- * @fn getPropertyValueByName
- * @brief Retrieve propertyValue using given name
+ * Retrieve propertyValue using given name
*
- * @param [in] propertyName - property name to look for
+ * @param propertyName - property name looking for
*
- * @return std::string
- * @warning
- * @exception
- * @see
+ * @return std::string - property name
*/
virtual std::string getPropertyValueByName(std::string propertyName) = 0;
protected:
{
public:
/**
- * @fn getAffectedModels
- * @brief Get affected ContextModels. The CQL can specify multiple ContextModels for retrieving data.
+ * Get affected ContextModels. The query can specify multiple ContextModels for retrieving data.
*
- * @param [in, out] pAffectedModels - affected ContextModel list
+ * @param pAffectedModels - affected ContextModel list
*
- * @return SSMRESULT
- * @warning
- * @exception
- * @see
+ * @return SSMRESULT - return value of the API. Returns SSM_S_OK if success
*/
virtual SSMRESULT getAffectedModels(std::vector<std::string> *pAffectedModels) = 0;
/**
- * @fn getModelDataCount
- * @brief Get affected data count. There are multiple data that can exist from given condition.
+ * Get affected data count. There are multiple data can exist from given condition.
*
- * @param [in] modelName - affected ContextModel name
+ * @param modelName - affected ContextModel name
*
- * @param [in, out] pDataCount - affected dataId count
+ * @param pDataCount - affected dataId count
*
- * @return SSMRESULT
- * @warning
- * @exception
- * @see
+ * @return SSMRESULT - return value of the API. Returns SSM_S_OK if success
*/
virtual SSMRESULT getModelDataCount(std::string modelName, int *pDataCount) = 0;
/**
- * @fn getModelData
- * @brief Get actual Context Model data
- *
- * @param [in] modelName - affected ContextModel name
+ * Get actual Context Model data
*
+ * @param modelName - affected ContextModel name
*
- * @param [in] dataIndex - affected dataId index
+ * @param dataIndex - affected dataId index
*
+ * @param ppModelData - affected ContextModel data reader
*
- * @param [out] ppModelData - affected ContextModel data reader
- *
- * @return SSMRESULT
- * @warning
- * @exception
- * @see
+ * @return SSMRESULT - return value of the API. Returns SSM_S_OK if success
*/
virtual SSMRESULT getModelData(std::string modelName, int dataIndex, IModelData **ppModelData) = 0;
protected:
{
public:
/**
- * @fn onQueryEngineEvent
- * @brief Transmit result of SSMCore to Application layer
+ * Transmit result of SSMCore to Application layer
*
- * @param [in] cqid - entered ContextQuery ID
+ * @param cqid - entered ContextQuery ID
*
- * @param [in] pResult - result of SSMCore
+ * @param pResult - result of SSMCore
*
- * @return SSMRESULT
- * @warning
- * @exception
- * @see
+ * @return SSMRESULT - return value of the API. Returns SSM_S_OK if success
*/
virtual SSMRESULT onQueryEngineEvent(int cqid, IDataReader *pResult) = 0;
protected:
};
/**
- * @fn InitializeSSM
- * @brief Initialize Soft sensor manager using given configuration information.
+ * Initialize Soft sensor manager using given configuration information.
*
- * @param [in] xmlDescription - specification described in XML
+ * @param xmlDescription - specification described in XML
*
- * @return SSMRESULT
- * @warning
- * @exception
- * @see
+ * @return SSMRESULT - return value of the API. Returns SSM_S_OK if success
*/
SSMRESULT InitializeSSM(std::string xmlDescription);
/**
- * @fn TerminateSSM
- * @brief Terminates Soft sensor manager
- *
+ * Terminates Soft sensor manager
*
- * @return SSMRESULT
- * @warning
- * @exception
- * @see
+ * @return SSMRESULT - return value of the API. Returns SSM_S_OK if success
*/
SSMRESULT TerminateSSM();
/**
- * @fn RegisterQuery
- * @brief Execute ContextQuery and return ContextQuery ID
+ * Execute query and return ContextQuery ID
*
- * @param [in] queryString - query for requesting data
+ * @param queryString - query for requesting data
*
- * @param [in] listener - listener for receiving data related to query
+ * @param listener - listener for receiving data related to query
*
- * @param [in, out] cqid - ID of ContextQuery
+ * @param cqid - ID of ContextQuery
*
- * @return SSMRESULT
- * @warning
- * @exception
- * @see
+ * @return SSMRESULT - return value of the API. Returns SSM_S_OK if success
*/
SSMRESULT RegisterQuery(std::string queryString, IQueryEngineEvent *listener, int &cqid);
/**
- * @fn UnregisterQuery
- * @brief unregister registered ContextQuery according to cqid
+ * Unregister registered query according to cqid
*
- * @param [in] cqid - Context query corresponding to the cqid to be unregistered
+ * @param cqid - Query corresponding to the cqid will be terminated
*
- * @return SSMRESULT
- * @warning
- * @exception
- * @see
+ * @return SSMRESULT - return value of the API. Returns SSM_S_OK if success
*/
SSMRESULT UnregisterQuery(int cqid);
}
* limitations under the License.
*
******************************************************************/
-
/**
* @file CoreController.java
*
}
/**
- * @fn InitializeSSMCore
- * @brief Initialize a framework using the given configuration
- *
- * @param [in] xmlDescription - Framework specifications described in XML format
- *
- *
- * @return void
- */
+ * Initialize a framework using the given configuration
+ *
+ * @param xmlDescription
+ * - Framework specifications described in XML format
+ *
+ * @return void
+ *
+ */
public native void InitializeSSMCore(String xmlDescription)
throws Exception;
/**
- * @fn StartSSMCore
- * @brief Starts the framework that allows other devices to discover and communicate
- * with the SSMCore and underlying query engine.
- *
- * @return void
- */
+ * Starts the framework that allows other devices to discover and communicate
+ * with the SSMCore and underlying query engine.
+ *
+ * @return void
+ *
+ */
public native void StartSSMCore() throws Exception;
/**
- * @fn StopSSMCore
- * @brief Stops the framework and terminate all communications.
- *
- * @return void
- */
+ * Stops the framework and terminate all communications.
+ *
+ * @return void
+ *
+ */
public native void StopSSMCore() throws Exception;
/**
- * @fn TerminateSSMCore
- * @brief Terminate the framework, return all allocated resources
- *
- * @return void
- */
+ * Terminate the framework, return all allocated resources
+ *
+ * @return void
+ *
+ */
public native void TerminateSSMCore() throws Exception;
/**
- * @fn CreateQueryEngine
- * @brief Creates an instance of the Query Engine
- *
- * @return QueryEngine - QueryEngine object created
- */
+ * Creates an instance of the Query Engine
+ *
+ * @return QueryEngine - QueryEngine object created
+ *
+ */
public native QueryEngine CreateQueryEngine() throws Exception;
/**
- * @fn ReleaseQueryEngine
- * @brief Release the QueryEngine object.
- *
- * @param [in] queryEngine - QueryEngine instance to be released
- *
- * @return int - success or failure result
- */
+ * Release the QueryEngine object.
+ *
+ * @param queryEngine
+ * - QueryEngine instance to be released
+ *
+ * @return int - success or failure result
+ *
+ */
public native int ReleaseQueryEngine(QueryEngine queryEngine);
// QueryEngine
/**
- * @fn ExecuteContextQuery
- * @brief Execute the query with the QueryEngine and return ContextQuery ID
- * for the query
- *
- * @param [in] pQueryEngineInstance - instance(created on creation of the QueryEngine)
- * of the query engine with which the query is to be executed
- *
- * @param [in] contextQuery - query string to be executed
- *
- * @return int - ID of context query executed
- */
+ * Execute the query with the QueryEngine and return ContextQuery ID
+ * for the query
+ *
+ * @param pQueryEngineInstance
+ * - instance(created on creation of the QueryEngine)
+ * of the query engine with which the query is to be executed
+ *
+ * @param contextQuery
+ * - query string to be executed
+ *
+ * @return int - ID of context query executed
+ *
+ */
public native int ExecuteContextQuery(int pQueryEngineInstance,
String contextQuery) throws Exception;
/**
- * @fn RegisterQueryEvent
- * @brief Register QueryEngineEvent to QueryEngine.
+ * Register QueryEngineEvent to QueryEngine.
*
- * @param [in] pQueryEngineInstance - instance(created on creation of the QueryEngine)
+ * @param pQueryEngineInstance
+ * - instance(created on creation of the QueryEngine)
* of the query engine with which the query is to be registered
*
- * @param [in] queryEngineEvent - the event to register with QueryEngine
+ * @param queryEngineEvent
+ * - the event to register with QueryEngine
*
* @return void
+ *
*/
public native void RegisterQueryEvent(int pQueryEngineInstance,
IQueryEngineEvent queryEngineEvent);
/**
- * @fn KillContextQuery
- * @brief Kill the registered ContextQuery corresponding to the to cqid
+ * Kill the registered ContextQuery corresponding to the to cqid
*
- * @param [in] pQueryEngineInstance - instance(created on creation of the QueryEngine)
- * of the query engine with which the query is to be terminated
+ * @param pQueryEngineInstance
+ * - instance(created on creation of the QueryEngine)
+ * of the query engine with which the query is to be terminated
*
- * @param [in] cqid - ContextQuery ID of the query to be terminated
+ * @param cqid
+ * - ContextQuery ID of the query to be terminated
*
* @return void
+ *
*/
public native void KillContextQuery(int pQueryEngineInstance, int cqid)
throws Exception;
// IModelData
/**
- * @fn GetDataId
- * @brief Get the affected DataId - ContextModel has plenty of data so
- * returned data is matched from given condition which in this case is the model
- * data object instance
- *
- *@param [in] pIModelDataInstance - instance(created on creation of the ModelData)
- * of the model data for which Data ID is to be returned
- *
- * @return int - the affected DataId
- */
+ * Get the affected DataId. ContextModel has plenty of data so returned data is matched
+ * from given condition which in this case is the model data object instance
+ *
+ * @param pIModelDataInstance
+ * - instance(created on creation of the ModelData)
+ * of the model data for which Data ID is to be returned
+ *
+ * @return int - the affected DataId
+ *
+ */
public native int GetDataId(int pIModelDataInstance);
/**
- * @fn GetPropertyCount
- * @brief ContextModel has at least one property that contains data \n
- * property is described from its specification.
- *
- *@param [in] pIModelDataInstance - instance(created on creation of the ModelData)
- * of the model data for which propertycount is to be returned
- *
- * @return int
- */
+ * ContextModel has at least one property that contains data \n
+ * property is described from its specification.
+ *
+ * @param pIModelDataInstance - instance(created on creation of the ModelData)
+ * of the model data for which propertycount is to be returned
+ *
+ * @return @return int - number of properties
+ *
+ */
public native int GetPropertyCount(int pIModelDataInstance);
/**
- * @fn GetPropertyName
- * @brief Retrieve the name of the property using the given index
- *
- * @param [in] pIModelDataInstance - instance(created on creation of the ModelData)
- * of the model data for which property name is to be returned
- *
- * @param [in] propertyIndex - index of property to read
- *
- * @return String - property name
- */
+ * Retrieve the name of the property using the given index
+ *
+ * @param pIModelDataInstance
+ * - instance(created on creation of the ModelData)
+ * of the model data for which property name is to be returned
+ *
+ * @param propertyIndex
+ * - index of property to read
+ *
+ * @return String - property name
+ *
+ */
public native String GetPropertyName(int pIModelDataInstance,
int propertyIndex);
/**
- * @fn GetPropertyValue
- * @brief Retrieve the value of the property using the given index
- *
- * @param [in] pIModelDataInstance - instance(created on creation of the ModelData)
- * of the model data for which property value is to be returned
- *
- * @param [in] propertyIndex - index of property to read
- *
- * @return String - property value
- */
+ * Retrieve the value of the property using the given index
+ *
+ * @param pIModelDataInstance
+ * - instance(created on creation of the ModelData)
+ * of the model data for which property value is to be returned
+ *
+ * @param propertyIndex
+ * - index of property to read
+ *
+ * @return String - property value
+ *
+ */
public native String GetPropertyValue(int pIModelDataInstance,
int propertyIndex);
// IDataReader
/**
- * @fn GetAffectedModels
- * @brief Get affected context models. The CQL(context query language) can specify
- * multiple ContextModels for retrieving data so a list of string of affected
- * dacontext models is returned
- *
- * @param [in] pDataReaderInstance - instance(created on creation of the DataReader)
- * of the data reader class object
- *
- * @return List<String> - affected ContextModel list
- */
+ * Get affected context models. The CQL(context query language) can specify
+ * multiple ContextModels for retrieving data so a list of string of affected
+ * dacontext models is returned
+ *
+ * @param pDataReaderInstance
+ * - instance(created on creation of the DataReader)
+ * of the data reader class object
+ *
+ * @return List<String> - affected ContextModel list
+ *
+ */
public native List<String> GetAffectedModels(int pDataReaderInstance);
/**
- * @fn GetModelDataCount
- * @brief Get affected model data count. There can be multiple data models existing
- * from the given condition, return the count.
- *
- * @param [in] pDataReaderInstance - instance(created on creation of the DataReader)
- * of the data reader class object
- *
- * @param [in] modelName - affected ContextModel name
- *
- * @return int - affected dataId count
- */
+ * Get affected model data count. There can be multiple data models existing
+ * from the given condition, return the count.
+ *
+ * @param pDataReaderInstance
+ * - instance(created on creation of the DataReader)
+ * of the data reader class object
+ *
+ * @param modelName
+ * - affected ContextModel name
+ *
+ * @return int - affected dataId count
+ *
+ */
public native int GetModelDataCount(int pDataReaderInstance,
String modelName) throws Exception;
/**
- * @fn GetModelData
- * @brief Get actual Context Model data
- *
- * @param [in] pDataReaderInstance - instance(created on creation of the DataReader)
- * of the data reader class object
- *
- * @param [in] modelName - affected ContextModel name
- *
- * @param [in] dataIndex - affected dataId index
- *
- * @return ModelData - affected ContextModel data reader
- */
+ * Get actual Context Model data
+ *
+ * @param pDataReaderInstance
+ * - instance(created on creation of the DataReader)
+ * of the data reader class object
+ *
+ * @param modelName
+ * - affected ContextModel name
+ *
+ * @param dataIndex
+ * - affected dataId index
+ *
+ * @return ModelData - affected ContextModel data reader
+ *
+ */
public native ModelData GetModelData(int pDataReaderInstance,
String modelName, int dataIndex) throws Exception;
/**
- * @fn RegisterReportReceiver
- * @brief To register the report receiver to receive messages
- *
- * @param [in] reportReceiver - report receiver instance
- *
- * @return void
- */
+ * To register the report receiver to receive messages
+ *
+ * @param reportReceiver
+ * - report receiver instance
+ *
+ * @return void
+ *
+ */
public native void RegisterReportReceiver(IReportReceiver reportReceiver);
}
\ No newline at end of file
}
/**
- * @fn GetAffectedModels
- * @brief Get affected context models. The CQL(context query language) can specify
- * multiple ContextModels for retrieving data, so a list of strings of affected
- * context models is returned.
- *
- * @return List<String> - affected ContextModel list
- */
+ * Get affected context models. The CQL(context query language) can specify
+ * multiple ContextModels for retrieving data so a list of string of affected
+ * dacontext models is returned
+ *
+ * @return List<String> - affected ContextModel list
+ *
+ */
public List<String> GetAffectedModels()
{
return CoreController.getInstance().GetAffectedModels(
}
/**
- * @fn GetModelDataCount
- * @brief Get affected model data count. There can be multiple data models existing
- * from the given condition, return the count matching the condition.
- *
- * @param [in] modelName - affected ContextModel name
- *
- * @return int - affected dataId count
- */
+ * Get affected model data count. There can be multiple data models existing
+ * from the given condition, return the count.
+ *
+ * @param modelName
+ * - affected ContextModel name
+ *
+ * @return int - affected dataId count
+ *
+ */
public int GetModelDataCount(String modelName) throws Exception
{
return CoreController.getInstance().GetModelDataCount(
}
/**
- * @fn GetModelData
- * @brief Get actual Context Model data
- *
- * @param [in] modelName - affected ContextModel name
- *
- *
- * @param [in] dataIndex - affected dataId index
- *
- * @return ModelData - affected ContextModel data reader
- */
+ * Get actual Context Model data
+ *
+ * @param modelName
+ * - affected ContextModel name
+ *
+ * @param dataIndex
+ * - affected dataId index
+ *
+ * @return ModelData - affected ContextModel data reader
+ *
+ */
public ModelData GetModelData(String modelName, int dataIndex)
throws Exception
{
* @brief This file provides a class that represents Query Engine's event that contains results
*
*/
+
package org.iotivity.service.ssm;
-/**
+ /**
* @class IQueryEngineEvent
* @brief This is an interface class for sample applications.It handles the response from
* SSMCore received asynchronously on making a query with the SSMCore.
* The Application should call registerQuery() and add a listener.
*
*
- *<pre>
- *Sample code :
+ Sample code :
int cqid = SoftSensorManager.registerQuery(edtQuery.getText().toString(), mQueryEngineEventListener);
mRunningQueries.add(cqid);
}
}
};
- </pre>
*/
public abstract class IQueryEngineEvent
{
/**
- * @fn OnQueryEngineEvent
- * @brief Transmits result of SSMCore to Application layer
- * This abstract method needs to be implemeted by application
- * as a precondition for query engine implementation.
- *
- * @param [in] cqid - ContextQuery ID of the registered query
- *
- * @param [in] result - data received from SSMCore
- *
- * @return void
- *
- */
+ * Transmits result of SSMCore to Application layer
+ * This abstract method needs to be implemeted by application
+ * as a precondition for query engine implementation.
+ *
+ * @param cqid
+ * - ContextQuery ID of the registered query
+ *
+ * @param result
+ * - data received from SSMCore
+ *
+ * @return void
+ *
+ */
public abstract void OnQueryEngineEvent(int cqid, DataReader result);
}
\ No newline at end of file
*/
public abstract class IReportReceiver
{
-
/**
- * @fn OnMessageReceived
- * @brief Handle response on receiving message
- * This abstract method needs to be implemeted by application
- * as a precondition for query engine implementation.
- *
- * @param [in] tag
- *
- * @param [in] msg - received message
- *
- *
- * @return void
- */
+ * Handle response on receiving message
+ * This abstract method needs to be implemeted by application
+ * as a precondition for query engine implementation.
+ *
+ * @param tag
+ *
+ * @param msg - received message
+ *
+ * @return void
+ *
+ */
public abstract void OnMessageReceived(String tag, String msg);
}
\ No newline at end of file
package org.iotivity.service.ssm;
/**
- * @class ModelData
- * @brief This class provides a set of API for DataReader class to handle the data
- * received by IQueryEngineEvent listeners from SSMCore
- *
- */
+ * @class ModelData
+ * @brief This class provides a set of API for DataReader class to handle the data
+ * received by IQueryEngineEvent listeners from SSMCore
+ *
+ */
public class ModelData
{
}
/**
- * @fn GetDataId
- * @brief Get the affected DataId - ContextModel has plenty of data so the
- * returned data is matched fom given condition and returned,
- * which in this case is the model data object instance
- *
- * @return int - the affected DataId
- */
+ * Get the affected DataId. ContextModel has plenty of data so returned data is matched
+ * from given condition which in this case is the model data object instance
+ *
+ * @return int - the affected DataId
+ *
+ */
public int GetDataId()
{
return CoreController.getInstance().GetDataId(pIModelDataInstance);
}
/**
- * @fn GetPropertyCount
- * @brief ContextModel has at least one property that contains data \n
- * the property is described from its specification.
- *
- * @return int -the property count
- */
+ * ContextModel has at least one property that contains data \n
+ * property is described from its specification.
+ *
+ * @return int - number of properties
+ *
+ */
public int GetPropertyCount()
{
return CoreController.getInstance().GetPropertyCount(
}
/**
- * @fn GetPropertyName
- * @brief Retrieve the name of the property using the given index value
- *
- * @param [in] propertyIndex - index of property to read
- *
- * @return String - the property name
- */
+ * Retrieve the name of the property using the given index
+ *
+ * @param propertyIndex
+ * - index of property to read
+ *
+ * @return String - property name
+ *
+ */
public String GetPropertyName(int propertyIndex)
{
return CoreController.getInstance().GetPropertyName(
}
/**
- * @fn GetPropertyValue
- * @brief Retrieve the value of the property using the given index value
- *
- * @param [in] propertyIndex - index of property to read
- *
- * @return String - the property value
- */
+ * Retrieve the value of the property using the given index
+ *
+ * @param propertyIndex
+ * - index of property to read
+ *
+ * @return String - property value
+ *
+ */
public String GetPropertyValue(int propertyIndex)
{
return CoreController.getInstance().GetPropertyValue(
}
/**
- * @fn GetQueryEngineInstance
- * @brief Obtain the instance value of the called query engine object,
+ * Obtain the instance value of the called query engine object,
* this value is set on creation of the QueryEngine object
*
* @return int - Instance of the query engine object, set on object's creation
+ *
*/
public int GetQueryEngineInstance()
{
}
/**
- * @fn ExecuteContextQuery
- * @brief Execute the query with the QueryEngine and return the generated ContextQuery ID
- * for the query string.
+ * Execute the query with the QueryEngine and return ContextQuery ID
+ * for the query
*
- * @param [in] contextQuery - query string to execute
+ * @param contextQuery
+ * - query string to be executed
*
- * @return int - generated ID for the ContextQuery string
+ * @return int - ID of context query executed
+ *
*/
public int ExecuteContextQuery(String contextQuery) throws Exception
{
}
/**
- * @fn RegisterQueryEvent
- * @brief Register QueryEngineEvent to the QueryEngine.
+ * Register QueryEngineEvent to QueryEngine
*
- * @param [in] queryEngineEvent - the event to register with QueryEngine
+ * @param queryEngineEvent
+ * - the event to register with QueryEngine
*
* @return void
+ *
*/
public void RegisterQueryEvent(IQueryEngineEvent queryEngineEvent)
{
}
/**
- * @fn KillContextQuery
- * @brief Kill the registered ContextQuery corresponding to the to cqid
+ * Kill the registered ContextQuery corresponding to the to cqid
*
- * @param [in] cqid - ContextQuery ID of the query to be terminated.
- * This ID was generated on execution of the query
+ * @param cqid
+ * - ContextQuery ID of the query to be terminated
*
* @return void
+ *
*/
public void KillContextQuery(int cqid) throws Exception
{
private Map<Integer, IQueryEngineEvent> mMapListener = new HashMap<Integer, IQueryEngineEvent>();
/**
- * @fn OnQueryEngineEvent
- * @brief Transmits result of SSMCore to Application layer
- *
- * @param [in] cqid - ContextQuery ID of the registered query
- *
- * @param [in] result - data received from SSMCore
- *
- * @return void
- */
+ * Transmits result of SSMCore to Application layer
+ * This abstract method needs to be implemeted by application
+ * as a precondition for query engine implementation.
+ *
+ * @param cqid
+ * - ContextQuery ID of the registered query
+ *
+ * @param result
+ * - data received from SSMCore
+ *
+ * @return void
+ *
+ */
public void OnQueryEngineEvent(int cqid, DataReader result)
{
mMtxListener.lock();
}
/**
- * @fn lockListener
- * @brief To lock QueryEngineEventReceiver object to execute a query atomicaly,
- * this is done to provide synchronization in case of multiple queries.
- *
- * @return void
- */
+ * To lock QueryEngineEventReceiver object to execute a query atomicaly,
+ * this is done to provide synchronization in case of multiple queries.
+ *
+ * @return void
+ *
+ */
void lockListener()
{
mMtxListener.lock();
}
/**
- * @fn unlockListener
- * @brief release the QueryEngineEventReceiver object
- *
- * @return void
- */
+ * release the QueryEngineEventReceiver object
+ *
+ * @return void
+ *
+ */
void unlockListener()
{
mMtxListener.unlock();
}
/**
- * @fn addListener
- * @brief add listener to receive response for the registered query with SSMCore.
- * Listen for callbacks from SSMCore.
- * This is also a precondition for implementing query engine object.
- *
- * @param [in] cqid - ContextQuery ID of the registered query
- *
- * @param [in] engineEvent - query engine's event that contains the results
- *
- * @return void
- */
+ * add listener to receive response for the registered query with SSMCore.
+ * Listen for callbacks from SSMCore.
+ * This is also a precondition for implementing query engine object.
+ *
+ * @param cqid
+ * - ContextQuery ID of the registered query
+ *
+ * @param engineEvent
+ * - query engine's event that contains the results
+ *
+ * @return void
+ */
void addListener(int cqid, IQueryEngineEvent engineEvent)
{
mMapListener.put(cqid, engineEvent);
}
/**
- * @fn removeListener
- * @brief Remove listener for a query on unregistering it
- *
- * @param [in] cqid - ContextQuery ID of the registered query
- *
- * @return void
- */
+ * Remove listener for a query on unregistering it
+ *
+ * @param cqid
+ * - ContextQuery ID of the registered query
+ *
+ * @return void
+ *
+ */
void removeListener(int cqid)
{
mMapListener.remove(cqid);
}
/**
- * @fn startSSMCore
- * @brief Starts the framework that allows other devices to discover and communicate
- * with the SSMCore and underlying query engine.
- *
- * @param [in] initConfig - initial framework specifications
- *
- * @return void
- */
+ * Starts the framework that allows other devices to discover and communicate
+ * with the SSMCore and underlying query engine.
+ *
+ * @param initConfig
+ * - initial framework specifications
+ *
+ * @return void
+ *
+ */
public void startSSMCore(String initConfig) throws Exception
{
mSSMCore = CoreController.getInstance();
}
/**
- * @fn stopSSMCore
- * @brief Stops the framework and terminate all communications.
- *
- * @return void
- */
+ * Stops the framework and terminate all communications.
+ *
+ * @return void
+ *
+ */
public void stopSSMCore() throws Exception
{
mQueryEngine.RegisterQueryEvent(null);
}
/**
- * @fn registerQuery
- * @brief Register the query and execute statement with the query engine
- * and add listener for the registered query so as to get response data.
- * After success response message for registration, SSMCore sends an
- * event to the client, if the specified condtions in the query is satisfied.
- *
- * @param [in] contextQuery - query for requesting data
- *
- * @param [in] listener - listener for receiving response data of the query
- *
- * @return int - ContextQuery ID
- */
+ * Register the query and execute statement with the query engine
+ * and add listener for the registered query so as to get response data.
+ * After success response message for registration, SSMCore sends an
+ * event to the client, if the specified condtions in the query is satisfied.
+ *
+ * @param contextQuery
+ * - query for requesting data
+ *
+ * @param listener
+ * - listener for receiving response data of the query
+ *
+ * @return int - ContextQuery ID
+ *
+ */
public int registerQuery(String contextQuery, IQueryEngineEvent listener)
throws Exception
{
}
/**
- * @fn unregisterQuery
- * @brief unregister a registered query using its query ID the query corresponding
- * to the cqid will be terminated and removes listener for the given query
- * The SSMCore will not send any callbacks after successful unregistration.
- *
- *
- * @param [in] cqid - ContextQuery ID of the query to be unregistered
- *
- * @return void
- */
+ * unregister a registered query using its query ID the query corresponding
+ * to the cqid will be terminated and removes listener for the given query
+ * The SSMCore will not send any callbacks after successful unregistration.
+ *
+ *
+ * @param cqid - ContextQuery ID of the query to be unregistered
+ *
+ * @return void
+ *
+ */
public void unregisterQuery(int cqid) throws Exception
{
try {
* limitations under the License.
*
******************************************************************/
+
+/**
+* @file
+*
+* This file defines basic interface of Soft Sensor Manager.
+*/
+
#ifndef _SSMInterface_H_
#define _SSMInterface_H_
* @class IModelData
* @brief This class represents context model data package
*
- * @see
*/
class IModelData
{
public:
/**
- * @fn getDataId
- * @brief Get affected DataId. ContextModel has plenty of data so \n
+ * Get affected DataId. ContextModel has plenty of data so \n
* returned data is matched from given condition
*
- * @param None
- *
- * @return int
- * @warning
- * @exception
- * @see
+ * @return int - the affected DataId
*/
virtual int getDataId() = 0;
/**
- * @fn GetPropertyCount
- * @brief ContextModel has at least one property that contains data \n
+ * ContextModel has at least one property that contains data \n
* property is described from its specification.
*
- * @param None
- *
- * @return int
- * @warning
- * @exception
- * @see
+ * @return int - number of properties
*/
virtual int getPropertyCount() = 0;
/**
- * @fn getPropertyName
- * @brief Retrieve propertyName
+ * Retrieve propertyName
*
- * @param [in] int propertyIndex - index of property to read
+ * @param propertyIndex - index of property to read
*
- * @return std::string
- * @warning
- * @exception
- * @see
+ * @return std::string - property name
*/
virtual std::string getPropertyName(int propertyIndex) = 0;
/**
- * @fn getPropertyValue
- * @brief Retrieve propertyValue
+ * Retrieve propertyValue
*
- * @param [in] int propertyIndex - index of property to read
+ * @param propertyIndex index of property to read
*
- * @return std::string
- * @warning
- * @exception
- * @see
+ * @return std::string - property value
*/
virtual std::string getPropertyValue(int propertyIndex) = 0;
/**
- * @fn getPropertyValueByName
- * @brief Retrieve propertyValue using given name
+ * Retrieve propertyValue using given name
*
- * @param [in] std::string propertyName - property name looking for
+ * @param propertyName - property name looking for
*
- * @return std::string
- * @warning
- * @exception
- * @see
+ * @return std::string - property name
*/
virtual std::string getPropertyValueByName(std::string propertyName) = 0;
protected:
{
public:
/**
- * @fn getAffectedModels
- * @brief Get affected ContextModels. The CQL can specify multiple ContextModels for retrieving data.
+ * Get affected ContextModels. The query can specify multiple ContextModels for retrieving data.
*
- * @param [in, out] std::vector<std::string> *pAffectedModels - affected ContextModel list
+ * @param pAffectedModels - affected ContextModel list
*
- * @return SSMRESULT
- * @warning
- * @exception
- * @see
+ * @return SSMRESULT - return value of the API. Returns SSM_S_OK if success
*/
virtual SSMRESULT getAffectedModels(std::vector<std::string> *pAffectedModels) = 0;
/**
- * @fn getModelDataCount
- * @brief Get affected data count. There are multiple data can exist from given condition.
+ * Get affected data count. There are multiple data can exist from given condition.
*
- * @param [in] std::string modelName - affected ContextModel name
+ * @param modelName - affected ContextModel name
*
- * @param [in, out] int *pDataCount - affected dataId count
+ * @param pDataCount - affected dataId count
*
- * @return SSMRESULT
- * @warning
- * @exception
- * @see
+ * @return SSMRESULT - return value of the API. Returns SSM_S_OK if success
*/
virtual SSMRESULT getModelDataCount(std::string modelName, int *pDataCount) = 0;
/**
- * @fn getModelData
- * @brief Get actual Context Model data
- *
- * @param [in] std::string modelName - affected ContextModel name
+ * Get actual Context Model data
*
+ * @param modelName - affected ContextModel name
*
- * @param [in] int dataIndex - affected dataId index
+ * @param dataIndex - affected dataId index
*
+ * @param ppModelData - affected ContextModel data reader
*
- * @param [out] IModelData **ppModelData - affected ContextModel data reader
- *
- * @return SSMRESULT
- * @warning
- * @exception
- * @see
+ * @return SSMRESULT - return value of the API. Returns SSM_S_OK if success
*/
virtual SSMRESULT getModelData(std::string modelName, int dataIndex, IModelData **ppModelData) = 0;
protected:
{
public:
/**
- * @fn onQueryEngineEvent
- * @brief Transmit result of SSMCore to Application layer
+ * Transmit result of SSMCore to Application layer
*
- * @param [in] int cqid - entered ContextQuery ID
+ * @param cqid - entered ContextQuery ID
*
- * @param [in] IDataReader *pResult - result of SSMCore
+ * @param pResult - result of SSMCore
*
- * @return SSMRESULT
- * @warning
- * @exception
- * @see
+ * @return SSMRESULT - return value of the API. Returns SSM_S_OK if success
*/
virtual SSMRESULT onQueryEngineEvent(int cqid, IDataReader *pResult) = 0;
protected:
};
/**
- * @fn InitializeSSM
- * @brief Initialize Soft sensor manager using given configuration information.
+ * Initialize Soft sensor manager using given configuration information.
*
- * @param [in] std::string xmlDescription - specification described in XML
+ * @param xmlDescription - specification described in XML
*
- * @return SSMRESULT
- * @warning
- * @exception
- * @see
+ * @return SSMRESULT - return value of the API. Returns SSM_S_OK if success
*/
SSMRESULT InitializeSSM(std::string xmlDescription);
/**
- * @fn TerminateSSM
- * @brief Terminates Soft sensor manager
- *
- * @param None
+ * Terminates Soft sensor manager
*
- * @return SSMRESULT
- * @warning
- * @exception
- * @see
+ * @return SSMRESULT - return value of the API. Returns SSM_S_OK if success
*/
SSMRESULT TerminateSSM();
/**
- * @fn RegisterQuery
- * @brief Execute ContextQuery and return ContextQuery ID
+ * Execute query and return ContextQuery ID
*
- * @param [in] std::string queryString - query for requesting data
+ * @param queryString - query for requesting data
*
- * @param [in] IQueryEngineEvent listener - listener for receiving data related to query
+ * @param listener - listener for receiving data related to query
*
- * @param [in, out] int &cqid - ID of ContextQuery
+ * @param cqid - ID of ContextQuery
*
- * @return SSMRESULT
- * @warning
- * @exception
- * @see
+ * @return SSMRESULT - return value of the API. Returns SSM_S_OK if success
*/
SSMRESULT RegisterQuery(std::string queryString, IQueryEngineEvent *listener, int &cqid);
/**
- * @fn UnregisterQuery
- * @brief unregister registered ContextQuery according to cqid
+ * Unregister registered query according to cqid
*
- * @param [in] int cqid - Context query corresponding to the cqid will be terminated
+ * @param cqid - Query corresponding to the cqid will be terminated
*
- * @return SSMRESULT
- * @warning
- * @exception
- * @see
+ * @return SSMRESULT - return value of the API. Returns SSM_S_OK if success
*/
SSMRESULT UnregisterQuery(int cqid);
}