Entity that manages messge routing rules for a single service instance.
More...
#include <routingrules.hpp>
Entity that manages messge routing rules for a single service instance.
◆ EndpointIterator
◆ Iterator
◆ RouteSharedPtr
◆ anonymous enum
Enumerator |
---|
GetMethods | |
GetEvents | |
GetRuntimeData | |
◆ RoutingRules()
kanzi::connect::p2p::RoutingRules::RoutingRules |
( |
const string & | xml, |
|
|
const string | interfacename = "", |
|
|
bool | verboseLogging = false ) |
Constructor.
- Parameters
-
xml | The XML document describing the routing. |
interfacename | The name of the interface. |
◆ ~RoutingRules()
kanzi::connect::p2p::RoutingRules::~RoutingRules |
( |
| ) |
|
◆ addEndpoint()
void kanzi::connect::p2p::RoutingRules::addEndpoint |
( |
shared_ptr< Endpoint > | ep | ) |
|
Inserts an endpoint to list of endpoints.
- Parameters
-
ep | the endpoint to insert. |
◆ addRoute()
bool kanzi::connect::p2p::RoutingRules::addRoute |
( |
const string & | xml | ) |
|
Add new route.
- Parameters
-
xml | Contains the route definition in xml |
- Returns
- True if route was added successfully
◆ beginEndpoints()
Get iterator to beginning of endpoints.
- Returns
- iterator
◆ beginEvents()
Iterator kanzi::connect::p2p::RoutingRules::beginEvents |
( |
| ) |
|
begin iteration of events
- Returns
- iterator
◆ beginMethods()
Iterator kanzi::connect::p2p::RoutingRules::beginMethods |
( |
| ) |
|
begin iteration of methods
- Returns
- iterator
◆ clearEndpoints()
void kanzi::connect::p2p::RoutingRules::clearEndpoints |
( |
| ) |
|
Clears all existing endpoints.
◆ collectAllEndpointIdentifiers()
set< string > kanzi::connect::p2p::RoutingRules::collectAllEndpointIdentifiers |
( |
| ) |
|
|
protected |
Collects all endpoint identifiers.
- Returns
- set of endpoint identifier strings
◆ collectRequiredEndpoints()
vector< shared_ptr< RoutingRules::Endpoint > > kanzi::connect::p2p::RoutingRules::collectRequiredEndpoints |
( |
const string & | reliableBearer, |
|
|
const string & | unreliableBearer ) |
Used on service side where routing rules are analyzed and then a list of required endpoints is collected.
- Parameters
-
reliableBearer | name of the reliable bearer |
unreliableBearer | name of the unreliable bearer |
- Returns
- vector of endpoints required.
◆ endEndpoints()
Get iterator to end of endpoints.
- Returns
- iterator
◆ endEvents()
Iterator kanzi::connect::p2p::RoutingRules::endEvents |
( |
| ) |
|
◆ endMethods()
Iterator kanzi::connect::p2p::RoutingRules::endMethods |
( |
| ) |
|
◆ findEndpointForRoute()
bool kanzi::connect::p2p::RoutingRules::findEndpointForRoute |
( |
Route & | r | ) |
|
|
protected |
Fills endpoint for a route.
- Parameters
-
r | route where to the endpoint information is to be added |
- Returns
- true if matching endpoint was found.
◆ findRouteUsingEndpoint()
finds a route that uses this specific endpoint
- Parameters
-
- Returns
- route or empty shared pointer
◆ getMetaDataInt()
int kanzi::connect::p2p::RoutingRules::getMetaDataInt |
( |
const string & | name, |
|
|
int | def = -1 ) |
return integer from metadata
- Parameters
-
name | the name of the meta element to retrieve |
def | default value to return if not found |
- Returns
- retrieved value.
◆ getMetaDataString()
string kanzi::connect::p2p::RoutingRules::getMetaDataString |
( |
const string & | name | ) |
|
return stringfrom metadata
- Parameters
-
name | the name of the meta element to retrieve |
- Returns
- retrieved value. empty string if not found.
◆ getRoutesWithoutEndpoint()
Find all routes that don't have endpoint bound to them.
- Returns
- routes with no endpoint bound
◆ invokableToMessage()
string kanzi::connect::p2p::RoutingRules::invokableToMessage |
( |
const string & | invocable, |
|
|
bool | method ) |
|
protected |
Creates a corresponding message name from a invocable name.
- Parameters
-
invocable | the method name, E.g. playTrack |
method | if true, then method message name is created, else event message name is created |
- Returns
- message name
◆ isEmpty()
bool kanzi::connect::p2p::RoutingRules::isEmpty |
( |
| ) |
const |
|
inline |
Is the object empty i.e.
no routing information included
- Returns
- true if empty.
◆ removeRouteForRuntimeData()
bool kanzi::connect::p2p::RoutingRules::removeRouteForRuntimeData |
( |
| ) |
|
Remove route for runtime data.
- Returns
- True if removed successfully, false if not found
◆ removeRouteForSubject()
bool kanzi::connect::p2p::RoutingRules::removeRouteForSubject |
( |
const string & | subjectName | ) |
|
Remove route for given subject.
- Parameters
-
subjectName | Name of the method or event identifying the route to remove |
- Returns
- True if removed successfully, false if not found
◆ requireDirectLink()
bool kanzi::connect::p2p::RoutingRules::requireDirectLink |
( |
| ) |
const |
Does any of the referred routing rules require direct link(s) or is this service server only.
- Returns
- true if direct link might be required.
◆ routeForEvent()
RouteSharedPtr kanzi::connect::p2p::RoutingRules::routeForEvent |
( |
const string & | eventName | ) |
|
Returns a preferred route for a specific event.
- Parameters
-
eventName | The name of the event to ask. |
- Returns
- The route to apply.
◆ routeForEventMessage()
RouteSharedPtr kanzi::connect::p2p::RoutingRules::routeForEventMessage |
( |
const string & | eventMessageName | ) |
|
Returns a preferred route for a specific event.
- Parameters
-
eventMessageName | The name of the event message to ask. |
- Returns
- The route to apply.
◆ routeForMethod()
RouteSharedPtr kanzi::connect::p2p::RoutingRules::routeForMethod |
( |
const string & | methodName | ) |
|
Returns a preferred route for a specific method.
- Parameters
-
methodName | The name of the method to ask. |
- Returns
- The route to apply.
◆ routeForMethodMessage()
RouteSharedPtr kanzi::connect::p2p::RoutingRules::routeForMethodMessage |
( |
const string & | methodMessageName | ) |
|
Returns a preferred route for a specific method.
- Parameters
-
methodMessageName | The name of the method message to ask. |
- Returns
- The route to apply.
◆ routeForRuntimeData()
RouteSharedPtr kanzi::connect::p2p::RoutingRules::routeForRuntimeData |
( |
| ) |
|
Returns a preferred route for a runtime data.
- Returns
- The route to apply.
◆ toXml()
string kanzi::connect::p2p::RoutingRules::toXml |
( |
unordered_map< string, string > * | metadata = nullptr | ) |
|
Converts the routing information to XML.
- Parameters
-
metadata | Optional meta information put into the XML document. Name-value pairs. |
- Returns
- The XML representation of the routing information.
The documentation for this class was generated from the following file:
- connect/p2p/routingrules.hpp