more GXS changes for phase1

clean up now on by default
- unsubscription from group also leads to message clean up
- check for keep flag

added functions to retrieve stats 
- not active yet

fixed forum authen flag 
- do not need author to create group
- also policy variable not initialised correctly

added KEEP and DELETE flag 

improved GXS resilience to peers sending NULL grp/msg binary data for deserialisation (peers could crash other peer by sending empty RsTlvBinaryData)

rstokenservice iface affected so full recompile recommended

git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@6274 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
chrisparker126 2013-03-23 14:07:52 +00:00
parent 404e9362dc
commit d6328c8123
15 changed files with 299 additions and 209 deletions

View file

@ -89,11 +89,15 @@ namespace GXS_SERV {
/** START GXS Msg status flags **/
static const uint32_t GXS_MSG_STATUS_UNPROCESSED = 0x000000100;
static const uint32_t GXS_MSG_STATUS_UNPROCESSED = 0x0000001;
static const uint32_t GXS_MSG_STATUS_UNREAD = 0x00000200;
static const uint32_t GXS_MSG_STATUS_UNREAD = 0x000002;
static const uint32_t GXS_MSG_STATUS_READ = 0x00000400;
static const uint32_t GXS_MSG_STATUS_READ = 0x000004;
static const uint32_t GXS_MSG_STATUS_KEEP = 0x000008;
static const uint32_t GXS_MSG_STATUS_DELETE = 0x0000020;
/** END GXS Msg status flags **/
@ -104,7 +108,6 @@ namespace GXS_SERV {
static const uint32_t GXS_GRP_STATUS_UNREAD = 0x00000200;
/** END GXS Grp status flags **/
}

View file

@ -169,6 +169,21 @@ public:
*/
virtual bool acknowledgeTokenGrp(const uint32_t& token, RsGxsGroupId& grpId) = 0;
/*!
* Gets service statistic for a given services
* @param token value to to retrieve requested stats
* @param stats the status
* @return true if token exists false otherwise
*/
virtual bool getServiceStatistic(const uint32_t& token, GxsServiceStatistic& stats) = 0;
/*!
*
* @param token to be redeemed
* @param stats the stats associated to token request
* @return true if token is false otherwise
*/
virtual bool getGroupStatistic(const uint32_t& token, GxsGroupStatistic& stats) = 0;
};

View file

@ -216,6 +216,28 @@ public:
return mGxs->acknowledgeTokenGrp(token, grpId);
}
/*!
* Gets service statistic for a given services
* @param token value to to retrieve requested stats
* @param stats the status
* @return true if token exists false otherwise
*/
bool getServiceStatistic(const uint32_t& token, GxsServiceStatistic& stats)
{
return mGxs->getServiceStatistic(token, stats);
}
/*!
*
* @param token to be redeemed
* @param stats the stats associated to token request
* @return true if token is false otherwise
*/
bool getGroupStatistic(const uint32_t& token, GxsGroupStatistic& stats)
{
return mGxs->getGroupStatistic(token, stats);
}
private:
RsGxsIface* mGxs;

View file

@ -121,5 +121,26 @@ public:
};
class GxsGroupStatistic
{
public:
/// number of message
RsGxsGroupId mGrpId;
uint32_t mNumMsgs;
uint32_t mTotalSizeOfMsgs;
};
class GxsServiceStatistic
{
public:
uint32_t mNumMsgs;
uint32_t mNumGrps;
uint32_t mSizeOfMsgs;
uint32_t mSizeOfGrps;
uint32_t mNumGrpsSubscribed;
uint32_t mSizeStore;
};
#endif /* RSGXSIFACETYPES_H_ */

View file

@ -189,6 +189,26 @@ public:
*/
virtual uint32_t requestStatus(const uint32_t token) = 0;
/*!
* This request statistics on amount of data held
* number of groups
* number of groups subscribed
* number of messages
* size of db store
* total size of messages
* total size of groups
* @param token
*/
virtual void requestServiceStatistic(const uint32_t& token) = 0;
/*!
* To request statistic on a group
* @param token set to value to be redeemed to get statistic
* @param grpId the id of the group
*/
virtual void requestGroupStatistic(const uint32_t& token, const RsGxsGroupId& grpId) = 0;
/* Cancel Request */
/*!