X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=service%2Fnotification%2Finclude%2FNSProviderInterface.h;h=260c554e3c9df4e6d908ff393bcc70e4fa9b7353;hb=7f00f942c39b7bc27c7eeecf213a239c3fe4173c;hp=56ec2042287c6290770df42fbb64f29460f78648;hpb=7c574a4e5dd1c0f986fe3df26eb11ff9f82ec77c;p=platform%2Fupstream%2Fiotivity.git diff --git a/service/notification/include/NSProviderInterface.h b/service/notification/include/NSProviderInterface.h index 56ec204..260c554 100644 --- a/service/notification/include/NSProviderInterface.h +++ b/service/notification/include/NSProviderInterface.h @@ -35,17 +35,16 @@ extern "C" #include "NSCommon.h" #include #include - /** - * Provider uses this callback function to receive subscription request of consumer - * @param[in] consumer Consumer who subscribes the resource + * Invoked when provider receives the subscription request of consumer. + * @param[in] consumer Consumer who subscribes the notification message resource */ typedef void (*NSSubscribeRequestCallback)(NSConsumer *); /** - * Provider use this callback function to receive the status of the message - * synchronization - * @param[in] sync Synchronization information of the notification message + * Invoked when synchronization data which has notification message + * read/deleted event from consumer is received. + * @param[in] sync Synchronization information of the notification message */ typedef void (*NSProviderSyncInfoCallback)(NSSyncInfo *); @@ -58,76 +57,85 @@ typedef struct NSSubscribeRequestCallback subRequestCallback; /* Invoked when the synchronization data, read and deleted, is sent by consumer is received */ NSProviderSyncInfoCallback syncInfoCallback; - /* Set the policy for notification servcie refering to following - * if policy is true, provider decides to allow or deny for all the subscribing consumers. - * Otherwise(policy is false) consumer decides to request subscription to discovered providers. + /* Set the policy for notification servcie which checks whether provider is capable of + * denying the subscription of notification message from consumer + * and getting controllabliity to set consumer topic list. + * If true, provider is able to control subscription request and consumer topic list. + * Otherwise(policy is false), consumer can do the same. */ - bool policy; - /* User Information */ + bool subControllability; + /* User defined information such as device friendly name */ char * userInfo; + /* Set on/off for secure resource channel setting */ + bool resourceSecurity; } NSProviderConfig; /** - * Initialize notification service for provider service + * Initialize notification service for provider * @param[in] config Refer to NSProviderConfig - * @return ::NS_OK or result code of NSResult + * @return ::NS_OK if the action is requested succesfully */ NSResult NSStartProvider(NSProviderConfig config); /** * Terminate notification service for provider - * @return ::NS_OK or result code of NSResult + * @return ::NS_OK if the action is requested succesfully */ NSResult NSStopProvider(); /** - * Request to publish resource to cloud server + * Request to publish resource using remote relay server * @param[in] server address combined with IP address and port number using delimiter : - * @return ::NS_OK or result code of NSResult + * @return ::NS_OK if the action is requested succesfully or NS_FAIL if wrong parameter is set. */ -NSResult NSProviderEnableRemoteService(char *serverAddress); +NSResult NSProviderEnableRemoteService(char * serverAddress); /** - * Request to cancel remote service using cloud server + * Request to terminate remote service from relay server * @param[in] server address combined with IP address and port number using delimiter : + * @return ::NS_OK if the action is requested succesfully or NS_FAIL if wrong parameter is set. + */ +NSResult NSProviderDisableRemoteService(char * serverAddress); + +#ifdef WITH_MQ +/** + * Request to subscribe to remote MQ address as parameter. + * @param[in] server address combined with IP address and port number and MQ broker uri using delimiter : + * @param[in] topicName the interest Topic name for subscription. * @return ::NS_OK or result code of NSResult */ -NSResult NSProviderDisableRemoteService(char *serverAddress); +NSResult NSProviderSubscribeMQService(const char * serverAddress, const char * topicName); +#endif /** * Send notification message to all subscribers * @param[in] message Notification message including id, title, contentText - * @return ::NS_OK or result code of NSResult + * @return ::NS_OK if the action is requested succesfully or NS_FAIL if wrong parameter is set. */ -NSResult NSSendMessage(NSMessage *msg); +NSResult NSSendMessage(NSMessage * msg); /** * Send acceptance to consumer who subscribes the resource of notification message + * This function is valid only when subControllability is set true. * @param[in] consumer Consumer who subscribes the resource - * @param[in] accepted the result of acceptance; Allow or Deny - * @return ::NS_OK or result code of NSResult + * @param[in] accepted the result of acceptance; ALLOW or DENY + * @return ::NS_OK if this function is requested succesfully + * or NS_FAIL if subContollability is false. */ -NSResult NSAcceptSubscription(NSConsumer *consumer, bool accepted); +NSResult NSAcceptSubscription(const char * consumerId, bool accepted); /** - * Get consumer list that is stored in the cache of notification service - * @param[in] list Consumer list - * @param[in] size the number of consumers stored in the cache - * @return ::NS_OK or result code of NSResult - */ -//TODO will use Function. -// NSResult NSGetConsumerList(uint8_t *list, uint32_t size); - -/** - * Send read-check to provider in order to synchronize notification status with other consumers - * @param[in] message Notification message to synchronize the status - * @return ::NS_OK or result code of NSResult + * Send synchronizad state of notificaion message to consumers + * @param[in] messageiId ID of notification message + * @param[in] type SyncType of the syncInfo message + * @return ::NS_OK if the action is requested succesfully or NS_FAIL if wrong parameter is set. */ NSResult NSProviderSendSyncInfo(uint64_t messageId, NSSyncType type); /** - * Initialize NSMessage struct, our service set message id and provider(device) id + * Initialize NSMessage struct. + * Service sets mandatory fields which message id and provider(device) id are filled with. * @return ::NSMessage * */ NSMessage * NSCreateMessage(); @@ -135,45 +143,45 @@ NSMessage * NSCreateMessage(); /** * Add topic to topic list which is located in provider service storage * @param[in] topicName Topic name to add - * @return ::NS_OK or result code of NSResult + * @return ::NS_OK if the action is requested succesfully or NS_FAIL if wrong parameter is set. */ -NSResult NSProviderAddTopic(char* topicName); +NSResult NSProviderRegisterTopic(const char * topicName); /** * Delete topic from topic list * @param[in] topicName Topic name to delete - * @return ::NS_OK or result code of NSResult + * @return ::NS_OK if the action is requested succesfully or NS_FAIL if wrong parameter is set. */ -NSResult NSProviderDeleteTopic(char* topicName); +NSResult NSProviderUnregisterTopic(const char * topicName); /** * Select a topic name for a consumer * @param[in] consumerId consumer id for which the user on provider selects a topic * @param[in] topicName Topic name to select - * @return ::NS_OK or result code of NSResult + * @return ::NS_OK if the action is requested succesfully or NS_FAIL if subContollability is false */ -NSResult NSProviderSelectTopic(char* consumerId, char* topicName); +NSResult NSProviderSetConsumerTopic(const char * consumerId, const char * topicName); /** * Unselect a topic from the topic list for consumer * @param[in] consumerId consumer id for which the user on provider unselects a topic * @param[in] topicName Topic name to unselect - * @return ::NS_OK or result code of NSResult + * @return ::NS_OK if the action is requested succesfully or NS_FAIL if subContollability is false */ -NSResult NSProviderUnselectTopic(char* consumerId, char* topicName); +NSResult NSProviderUnsetConsumerTopic(const char * consumerId, const char * topicName); /** * Request topic list with selection state for the consumer * @param[in] consumerid the id of consumer which topic list is subscribed for * @return :: Topic list */ -NSTopics * NSProviderGetConsumerTopics(char *consumerId); +NSTopicLL * NSProviderGetConsumerTopics(const char * consumerId); /** * Request topics list already registered by provider user * @return :: Topic list */ -NSTopics * NSProviderGetTopics(); +NSTopicLL * NSProviderGetTopics(); #ifdef __cplusplus }