All Categories Class Hierarchy This Category Next Indexes
Publish_Subscribe Class CATVpmPubSubUsrAdmin
CATVpmPubSubUsrAdmin
public class CATVpmPubSubUsrAdmin
Publish/Subscribe administration class.
Role: This class provides administration tools for Publish/Subscribe,
mainly based on event management, making it possible to create custom events
that can be used in the VPM aplication.
This class should not be used in end-user, interactive programs. Moreover,
it only provides static methods: it is not meant to be instantiated.
Method Index
- o
CloseConnection()
- Closes the connection to the publish/subscribe database.
- o
Commit()
- Commits changes to the Publish/Subscribe database.
- o
CreateEvent(char* const,char* const)
- Creates a new Publish/Subscribe event in the database.
- o
DeleteEvent(char* const)
- Deletes an existing Publish/Subscribe event from the database.
- o
GetEvent(char* const)
- Finds a Publish/Subscribe event from its name.
- o
GetEventChildren(char* const,char**&)
- Finds the children of a Publish/Subscribe event.
- o
GetRootEvents(char**&)
- Finds Publish/Subscribe root events, e.
- o
OpenConnection()
- Opens a connection to the Publish/Subscribe database.
- o
Rollback()
- Rollbacks changes to the Publish/Subscribe database.
Methods
o CloseConnection
| public static int CloseConnection( | ) |
-
Closes the connection to the publish/subscribe database.
Role: Use this method to close the connection to the database.
Precondition: the connection to the Publish/Subscribe data-
must have been opened previously by
OpenConnection.
- Returns:
- 0 if successful,
-1 if internal Publish/Subscribe manager cannot be found,
1 otherwise.
o Commit
| public static int Commit( | ) |
-
Commits changes to the Publish/Subscribe database.
Role: Use this method to commit any prior changes made in the
database (event creation or deletion, for example).
- Returns:
- 0 if successful,
-1 if internal Publish/Subscribe manager cannot be found,
1 otherwise.
o CreateEvent
| public static int CreateEvent( | const char* const | iName, |
| const char* const | iFatherName) |
-
Creates a new Publish/Subscribe event in the database.
Role: Use this method to create new, custom events.
Triggering custom events is the responsibility of the legacy code.
#Commit or method #Rollback should be called afterwards to either confirm or cancel the operation.
- Parameters:
-
- iName
- Name of the event to create.
The name of custom events must be prefixed by "Extern.".
- iFatherName
- Name of the event parent.
- Returns:
- 0 if successful,
-1 if internal Publish/Subscribe manager cannot be found,
1 otherwise.
o DeleteEvent
| public static int DeleteEvent( | const char* const | iName) |
-
Deletes an existing Publish/Subscribe event from the database.
Role: Use this method to create new, custom events.
Triggering custom events is the responsibility of the legacy code.
#Commit or method #Rollback should be called afterwards to either confirm or cancel the operation.
- Parameters:
-
- iName
- Name of the event to delete.
Only custom events (the name of which is prefixed by "Extern.") can
be deleted.
- Returns:
- 0 if successful,
-1 if internal Publish/Subscribe manager cannot be found,
1 otherwise.
o GetEvent
| public static int GetEvent( | const char* const | iName) |
-
Finds a Publish/Subscribe event from its name.
Role: Use this method to check whether a particular event alrea-
dy exists in the database.
- Parameters:
-
- iName
- Name of the event to find,
- Returns:
- 0 if the event is found,
-1 if internal Publish/Subscribe manager cannot be found,
1 otherwise.
o GetEventChildren
| public static int GetEventChildren( | const char* const | iFatherName, |
| char**& | oChildrenNames) |
-
Finds the children of a Publish/Subscribe event.
Role: Use this method to retrieve the sub-events of a particular
event.
- Parameters:
-
- iFatherNames
- Name of the father event.
- oChildrenNames
- Output array of the children events names.
Memory de-allocation (using the delete[] operator) is the
responsibility of the calling method.
- Returns:
- Size of the output array oChildrenNames.
o GetRootEvents
| public static int GetRootEvents( | char**& | oNames) |
-
Finds Publish/Subscribe root events, e.g. events with no father.
Role: Use this method to retrieve all root events (e.g. top part,
model, action events, etc), from which you can then obtain the event
sub-trees, using
GetEventChildren.
- Parameters:
-
- oNames
- Output arrays of the events names.
Memory de-allocation (using the delete[] operator) is the
responsibility of the calling method.
- Returns:
- Size of the output array oNames.
o OpenConnection
| public static int OpenConnection( | ) |
-
Opens a connection to the Publish/Subscribe database.
Role: Use this method in the first place, before any other one
in the Publish/Subscribe API suite, in order to open a valid connection
to the database.
Precondition: the connection to the Publish/Subscribe data-
base relies on a valid VPM session (from which it automatically retrie-
ves the user/password, if required); a prior successful login is thus
mandatory.
- See also:
- CATVpmSCUsrLogin for details on VPM login.
- Returns:
- 0 if successful,
-1 if internal Publish/Subscribe manager cannot be found,
1 otherwise.
o Rollback
| public static int Rollback( | ) |
-
Rollbacks changes to the Publish/Subscribe database.
Role: Use this method to rollback any prior changes made in the
database (event creation or deletion, for example).
- Returns:
- 0 if successful,
-1 if internal Publish/Subscribe manager cannot be found,
1 otherwise.
This object is included in the file: CATVpmPubSubUsrAdmin.h
If needed, your Imakefile.mk should include the module: VPMPR0PUBSUB