Internalfunctions - SmartSlog KP Library
Macros | Typedefs | Functions
subscription_changes.h File Reference

Interface for changes of the subscription. More...

#include "structures.h"

Go to the source code of this file.

Macros

#define SSLOG_EXTERN

Typedefs

typedef struct
subscription_changes_data_s 
subscription_changes_data_t
 Type that represets the subscription changes structure.

Functions

SSLOG_EXTERN int sslog_sbcr_ch_get_sequence_number (subscription_changes_data_t *changes)
 Gets a suquence number of the changes.
SSLOG_EXTERN const list_t * sslog_sbcr_ch_get_individual_by_action (subscription_changes_data_t *changes, action_type action)
 Gets all individual's UUID by action.
SSLOG_EXTERN list_t * sslog_sbcr_ch_get_individual_all (subscription_changes_data_t *changes)
 Gets all individual's UUID.
SSLOG_EXTERN const list_t * sslog_sbcr_ch_get_property_by_action (subscription_changes_data_t *changes, action_type action)
 Gets all changed properties by action.
SSLOG_EXTERN list_t * sslog_sbcr_ch_get_property_all (subscription_changes_data_t *changes)
 Gets all changed properties.
SSLOG_EXTERN list_t * sslog_sbcr_ch_get_property_by_uuid (subscription_changes_data_t *changes, const char *uuid, action_type action)
 Gets all changed properties by action for individual's UUID.
SSLOG_EXTERN list_t * sslog_sbcr_ch_get_property_by_uuid_all (subscription_changes_data_t *changes, const char *uuid)
 Gets all changed properties for individual's UUID.
SSLOG_EXTERN void sslog_sbcr_ch_print (subscription_changes_data_t *changes)
 Prints information about changes.

Detailed Description

Interface for changes of the subscription.

Author:
Aleksandr A. Lomov lomov.nosp@m.@cs..nosp@m.karel.nosp@m.ia.r.nosp@m.u
Date:
Created on April 28, 2012, 12:56 PM

LICENSE

SmartSlog KP Library is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.

SmartSlog KP Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with SmartSlog KP Library; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA

DESCRIPTION

subscription_changes.h - Interface for changes of the subscription.
Subscription changes contains information about chnanges that were perfomed under subscribed data.
This file is part of SmartSlog KP Library.

Copyright (C) SmartSlog Team (Aleksandr A. Lomov). All rights reserved.
Mail-list: smart.nosp@m.slog.nosp@m.@cs.k.nosp@m.arel.nosp@m.ia.ru


Macro Definition Documentation

#define SSLOG_EXTERN

Typedef Documentation

Type that represets the subscription changes structure.

See also:
subscription_changes_data_s

Function Documentation

SSLOG_EXTERN list_t* sslog_sbcr_ch_get_individual_all ( subscription_changes_data_t changes)

Gets all individual's UUID.

It make one list with all individual's UUIDs, that are were inserted, updated or removed.

You need to free the returned list, but without data relesed. Use #list_free_with_nodes with NULL as argument for free function.

Known bug: if under the individual was perfomed more that one actions, for example it was inserted and updated, then UUID will be inserted to list more that once. This will be fixed later.

This function sets a global error if it can't perfome operation, you can get an error code using #get_error_code function.

Parameters:
[in]changeschanges to get individuals UUIDs.
Returns:
list with UUIDs (list with strings) on success or NULL otherwise.
SSLOG_EXTERN const list_t* sslog_sbcr_ch_get_individual_by_action ( subscription_changes_data_t changes,
action_type  action 
)

Gets all individual's UUID by action.

Individuals can be inserted, removed or updated. Updated means that some properties of the individual were changed.

Do not modify or free returned list.

This function sets a global error if it can't perfome operation, you can get an error code using #get_error_code function.

Parameters:
[in]changessubscription chnages data structure.
[in]actionaction that was perfom under individuals: insert, remove, update.
Returns:
list with individuals UUIDs (list with strings) or NULL if given changes or action is incorrect.
SSLOG_EXTERN list_t* sslog_sbcr_ch_get_property_all ( subscription_changes_data_t changes)

Gets all changed properties.

You need to free the returned list, but without data relesed. Use #list_free_with_nodes with NULL as argument for free function.

This function sets a global error if it can't perfome operation, you can get an error code using #get_error_code function.

Parameters:
[in]changeschanges to get properties.
Returns:
list with properties changes (list with property_changes_data_s) on success or NULL otherwise.
See also:
property_changes_data_s
SSLOG_EXTERN const list_t* sslog_sbcr_ch_get_property_by_action ( subscription_changes_data_t changes,
action_type  action 
)

Gets all changed properties by action.

Do not modify or free returned list.

This function sets a global error if it can't perfome operation, you can get an error code using #get_error_code function.

Parameters:
[in]changeschanges to get properties.
[in]actionaction that was perfom under properties: insert, remove, update.
Returns:
list with properties changes (list with property_changes_data_s) or NULL if given changes or action is incorrect.
See also:
property_changes_data_s
SSLOG_EXTERN list_t* sslog_sbcr_ch_get_property_by_uuid ( subscription_changes_data_t changes,
const char *  uuid,
action_type  action 
)

Gets all changed properties by action for individual's UUID.

This function can returns list for updated individuals, for other returned list will be empty.

You need to free the returned list, but without data relesed. Use #list_free_with_nodes with NULL as argument for free function.

This function sets a global error if it can't perfome operation, you can get an error code using #get_error_code function.

Parameters:
[in]changeschanges to get properties.
[in]uuidindividual's UUID to get properties.
[in]actionaction that was perfom under properties: insert, remove, update.
Returns:
list with properties changes (list with property_changes_data_s) or NULL if given changes or action is incorrect.
See also:
property_changes_data_s
SSLOG_EXTERN list_t* sslog_sbcr_ch_get_property_by_uuid_all ( subscription_changes_data_t changes,
const char *  uuid 
)

Gets all changed properties for individual's UUID.

This function can returns list for updated individuals, for other returned list will be empty.

You need to free the returned list, but without data relesed. Use #list_free_with_nodes with NULL as argument for free function.

This function sets a global error if it can't perfome operation, you can get an error code using #get_error_code function.

Parameters:
[in]changeschanges to get properties.
[in]uuidindividual's UUID to get properties.
Returns:
list with properties changes (list with property_changes_data_s) or NULL if given changes or action is incorrect.
See also:
property_changes_data_s
SSLOG_EXTERN int sslog_sbcr_ch_get_sequence_number ( subscription_changes_data_t changes)

Gets a suquence number of the changes.

Changes are made based on data that were received with notification. This number is sequence of indication that was used to make changes. Firts changes are made while perfoming subscription operation, this changes has '1' as this number.

This function sets a global error if it can't perfome operation, you can get an error code using #get_error_code function.

Parameters:
[in]changessubscription chnages data structure.
Returns:
sequence number of the chnages.
SSLOG_EXTERN void sslog_sbcr_ch_print ( subscription_changes_data_t changes)

Prints information about changes.

It prints sequence number and how manu individuals and properties were inserted, updated or removed.

Parameters:
[in]changeschanges to print information about changes.