Public Types | Public Member Functions | Static Public Member Functions
Tonido::Data::Group Class Reference

Holds a peer group. More...

List of all members.

Public Types

enum  GroupType { GROUP_PRIVATE = 0, GROUP_PUBLIC }
typedef boost::shared_ptr< GroupSharedPtr
typedef std::vector
< Group::SharedPtr > 
Collection

Public Member Functions

 Group (const std::string &a_groupName, const std::string &a_description, const Data::RawData::SharedPtr &a_rawData, GroupType a_groupType)
 Ctor.
 Group (const Poco::UUID &a_groupId, const std::string &a_groupName, const std::string &a_description, const std::string &a_password, const Data::RawData::SharedPtr &a_rawData, const std::string &a_statusSet, GroupType a_groupType, const std::string &a_rootPassword, const std::string &a_rootSeed, const std::string &a_masterPassword)
 ~Group (void)
 Dtor.
Poco::UUID getGroupID ()
 Get Group Identifier.
void setGroupID (const Poco::UUID &value)
 Set Group Identifier.
const std::string & getPassword () const
 Get Group Password.
const Data::RawData::SharedPtr & getImage ()
 Get Group Image.
bool generateGroupPasswordToken (const std::string &a_seed, std::string &a_token) const
 Generates a password based on the Group Password.
bool getPasswordAdminToken (const std::string &a_seed, std::string &a_token) const
 Generates a password based on the Group Admin Password.
void setPassword (const std::string &a_password)
 Set the group password.
const std::string & getGroupName ()
 Get the Group Name.
void setGroupName (const std::string &value)
 Set the name for the group.
const std::string & getStatusSet ()
 Get the status set for the group.
void setStatusSet (const std::string &value)
 Sets the status set for the group.
const std::string & getDescription ()
 Get the description for the group.
void setDescription (const std::string &value)
 Set the description for the group.
void setImage (const Data::RawData::SharedPtr &a_rawData)
 Set Group's Image.
void setGroupType (GroupType a_groupType)
 Set the Group Type.
GroupType getGroupType ()
 Get the Group Type.
void initNewGroup ()
 Initializes all the required variables for a new group.
bool generateGroupAdminPasswordToken (const PeerID &a_peerID, const std::string &a_seed, std::string &a_token)
 Generate Group Admin Password Token.
const std::string & getRootSeed ()
 Gets the current group admin seed.
void setRootSeed (const std::string &a_rootSeed)
 Sets the current Group Admin seed.
const std::string & getRootPassword ()
 Gets the current Group Admin Password.
void setRootPassword (const std::string &a_rootPassword)
 Sets the current Group Admin Password.
const std::string & getMasterPassword ()
 Gets the Master Password.
void changePassword ()
 Changes the password associated with the group.
std::string generateMasterPassword (const PeerID &a_peerID)
 Generate Master Password for given Peer ID.

Static Public Member Functions

static const Group::SharedPtr & getFromCollection (const Group::Collection &a_collection, int index)
 Script Helper to get a specific group from a collection.

Detailed Description

Holds a peer group.


Constructor & Destructor Documentation

Tonido::Data::Group::Group ( const std::string &  a_groupName,
const std::string &  a_description,
const Data::RawData::SharedPtr &  a_rawData,
GroupType  a_groupType 
)

Ctor.

details if needed ...

Tonido::Data::Group::~Group ( void  )

Dtor.

details if needed ...


Member Function Documentation

bool Tonido::Data::Group::generateGroupAdminPasswordToken ( const PeerID a_peerID,
const std::string &  a_seed,
std::string &  a_token 
)

Generate Group Admin Password Token.

Parameters:
[in]a_peerIDpeer id
[in]a_seedseed
[out]a_tokengenerated password
Returns:
true on successs, false otherwise
bool Tonido::Data::Group::generateGroupPasswordToken ( const std::string &  a_seed,
std::string &  a_token 
) const

Generates a password based on the Group Password.

Parameters:
[in]a_seedseed
[out]a_tokennew password
Returns:
true on successs, false otherwise
std::string Tonido::Data::Group::generateMasterPassword ( const PeerID a_peerID)

Generate Master Password for given Peer ID.

Parameters:
[in]a_peerIDpeer id to generate password for
Returns:
generated password
const std::string& Tonido::Data::Group::getDescription ( )

Get the description for the group.

Returns:
the description of the group
static const Group::SharedPtr& Tonido::Data::Group::getFromCollection ( const Group::Collection &  a_collection,
int  index 
) [static]

Script Helper to get a specific group from a collection.

Parameters:
[in]a_collectioncollection to get group from
[out]indexindex of the collection to get group
Returns:
group on successs
Poco::UUID Tonido::Data::Group::getGroupID ( )

Get Group Identifier.

Returns:
group id
const std::string& Tonido::Data::Group::getGroupName ( )

Get the Group Name.

Returns:
the group name
GroupType Tonido::Data::Group::getGroupType ( )

Get the Group Type.

Returns:
the group type
const Data::RawData::SharedPtr& Tonido::Data::Group::getImage ( )

Get Group Image.

Returns:
group image
const std::string& Tonido::Data::Group::getMasterPassword ( )

Gets the Master Password.

Returns:
the master password
const std::string& Tonido::Data::Group::getPassword ( ) const

Get Group Password.

Returns:
group password
bool Tonido::Data::Group::getPasswordAdminToken ( const std::string &  a_seed,
std::string &  a_token 
) const

Generates a password based on the Group Admin Password.

Parameters:
[in]a_seedseed
[out]a_tokennew password
Returns:
true on successs, false otherwise
const std::string& Tonido::Data::Group::getRootPassword ( )

Gets the current Group Admin Password.

Returns:
group admin password
const std::string& Tonido::Data::Group::getRootSeed ( )

Gets the current group admin seed.

Returns:
group admin seed
const std::string& Tonido::Data::Group::getStatusSet ( )

Get the status set for the group.

Returns:
the status of the group
void Tonido::Data::Group::setDescription ( const std::string &  value)

Set the description for the group.

Parameters:
[in]valuegroup description to set
void Tonido::Data::Group::setGroupID ( const Poco::UUID &  value)

Set Group Identifier.

Parameters:
[in]valuegroup id to set
void Tonido::Data::Group::setGroupName ( const std::string &  value)

Set the name for the group.

Parameters:
[in]valuegroup name to set
void Tonido::Data::Group::setGroupType ( GroupType  a_groupType)

Set the Group Type.

Parameters:
[in]a_groupTypegroup type to set
void Tonido::Data::Group::setImage ( const Data::RawData::SharedPtr &  a_rawData)

Set Group's Image.

Parameters:
[in]a_rawDatagroup image to set
void Tonido::Data::Group::setPassword ( const std::string &  a_password)

Set the group password.

Parameters:
[in]a_passwordnew group password to set
void Tonido::Data::Group::setRootPassword ( const std::string &  a_rootPassword)

Sets the current Group Admin Password.

Parameters:
[in]a_rootPasswordgroup admin password to set
void Tonido::Data::Group::setRootSeed ( const std::string &  a_rootSeed)

Sets the current Group Admin seed.

Parameters:
[out]a_rootSeedseed to set
void Tonido::Data::Group::setStatusSet ( const std::string &  value)

Sets the status set for the group.

Parameters:
[in]valuegroup status to set

Generated on Wed Oct 12 2011 21:46:53. © CodeLathe LLC 2007-2011. All Rights Reserved.