Package com.yahoo.messagebus.routing
Class RoutingSpec
java.lang.Object
com.yahoo.messagebus.routing.RoutingSpec
Along with the
RoutingTableSpec
, RouteSpec
and HopSpec
, this holds the routing specifications
for all protocols. The only way a client can configure or alter the settings of a message bus instance is through
these classes.
This class is the root spec class for configuring message bus routing.
- Author:
- Simon Thoresen Hult
-
Constructor Summary
ConstructorDescriptionCreates an empty specification.RoutingSpec
(boolean verify) Creates an empty specification.RoutingSpec
(RoutingSpec spec) Implements the copy constructor. -
Method Summary
Modifier and TypeMethodDescriptionaddTable
(RoutingTableSpec table) Adds a routing table spec to the list of tables.Clears the list of routing table specs contained in this.boolean
int
Returns the number of routing table specs that are contained in this.getTable
(int i) Returns the routing table spec at the given index.int
hashCode()
boolean
Returns whether or not there are routing table specs contained in this.removeTable
(int i) Returns the routing table spec at the given index.setTable
(int i, RoutingTableSpec table) Sets the routing table spec at the given index.void
toConfig
(StringBuilder cfg, String prefix) Appends the content of this to the given config string builder.toString()
boolean
verify
(ApplicationSpec app, List<String> errors) Verifies the content of this against the given application.
-
Constructor Details
-
RoutingSpec
public RoutingSpec()Creates an empty specification. -
RoutingSpec
public RoutingSpec(boolean verify) Creates an empty specification.- Parameters:
verify
- Whether or not this should be verified.
-
RoutingSpec
Implements the copy constructor.- Parameters:
spec
- the spec to copy.
-
-
Method Details
-
hasTables
public boolean hasTables()Returns whether or not there are routing table specs contained in this.- Returns:
- True if there is at least one table.
-
getNumTables
public int getNumTables()Returns the number of routing table specs that are contained in this.- Returns:
- The number of routing tables.
-
getTable
Returns the routing table spec at the given index.- Parameters:
i
- The index of the routing table to return.- Returns:
- The routing table at the given index.
-
setTable
Sets the routing table spec at the given index.- Parameters:
i
- The index at which to set the routing table.table
- The routing table to set.- Returns:
- This, to allow chaining.
-
addTable
Adds a routing table spec to the list of tables.- Parameters:
table
- The routing table to add.- Returns:
- This, to allow chaining.
-
removeTable
Returns the routing table spec at the given index.- Parameters:
i
- The index of the routing table to remove.- Returns:
- The removed routing table.
-
clearTables
Clears the list of routing table specs contained in this.- Returns:
- This, to allow chaining.
-
verify
Verifies the content of this against the given application.- Parameters:
app
- The application to verify against.errors
- The list of errors found.- Returns:
- True if no errors where found.
-
toConfig
Appends the content of this to the given config string builder.- Parameters:
cfg
- The config to add to.prefix
- The prefix to use for each add.
-
toString
-
equals
-
hashCode
public int hashCode()
-