Package com.tibco.tibjms.admin
Class RouteInfo
- java.lang.Object
-
- com.tibco.tibjms.admin.RouteInfo
-
public class RouteInfo extends java.lang.Object
An object of this class represents the configuration and optionally statistical data about the routed server. When this object is received via the call to method TibjmsAdmin.getRoute(), it does not contain statistical information about the route. Only objects returned by method TibjmsAdmin.getRouteStatistics(name) return RouteInfo objects including all statistical data.
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
DEFAULT_DAG_ZONE
The name of the zone that routes are members of if no zone name is specified.static short
ZONE_TYPE_MULTI_HOP
A m-hop (Multi-Hop) zone is one in which topic messages can be routed across multiple hops and the routes between servers may not form a cycle.static short
ZONE_TYPE_ONE_HOP
A 1-Hop zone is one in which messages can be routed at most 1 hop away.static short
ZONE_TYPE_UNKNOWN
A zone of unknown type indicates some kind of error.
-
Constructor Summary
Constructors Constructor Description RouteInfo(java.lang.String name, java.lang.String url, java.util.Map params)
The public constructor used to create a RouteInfo object.RouteInfo(java.lang.String name, java.lang.String url, java.util.Map params, java.lang.String zoneName, short zoneType)
The public constructor used to create a RouteInfo object that is part of a specific zone.RouteInfo(java.lang.String name, java.lang.String url, java.util.Map params, java.lang.String zoneName, short zoneType, int topicPrefetch)
The public constructor used to create a RouteInfo object that is part of a specific zone.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addIncomingSelector(RouteSelector rs)
Add a new incoming selector to the route.void
addOutgoingSelector(RouteSelector rs)
Add a new outgoing selector to the route.static RouteInfo
from(javax.management.openmbean.CompositeData cd)
For Internal use only, may be removed or deprecated in future.long
getBacklogCount()
Get the route's backlog count.long
getBacklogSize()
Get the route's backlog size.long
getConnectionID()
Returns connection ID of this route or 0 if route is not connected.DetailedDestStat[]
getDetailedStatistics()
Returns detailed destination statistics for all destinations being sent to or received from this route.StatData
getInboundStatistics()
Returns cumulative inbound statistics for all destinations on this route.RouteSelector[]
getIncomingSelectors()
Get the selectors that will be run on messages received by this route.java.lang.String
getName()
Get the name of the remote server in this route.java.lang.String
getOAuth2ClientId()
Get the OAuth 2.0 client ID.java.lang.Boolean
getOAuth2DisableVerifyHostname()
Returns whether client verification of the OAuth 2.0 authorization server's hostname is disabled.java.lang.String
getOAuth2ExpectedHostname()
Get the hostname expected to be set in the OAuth 2.0 authorization server host's certificate.java.lang.String
getOAuth2GrantType()
Get the OAuth 2.0 grant type used to obtain access tokens from the OAuth 2.0 authorization server.java.lang.String
getOAuth2ServerTrustFile()
Get the path to the trust file used to verify the OAuth 2.0 authorization server's identity.java.lang.String
getOAuth2ServerURL()
Get the URL of the OAuth 2.0 authorization server that will issue access tokens for authenticating with the EMS server at the other end of the route.StatData
getOutboundStatistics()
Returns cumulative outbound statistics for all destinations on this route.RouteSelector[]
getOutgoingSelectors()
Get the selectors that will be run on messages before they are sent to this route.java.util.Map
getParams()
Get the TLS parameters for the connection to the remote server.int
getTopicPrefetch()
Get the topic prefetch of this route.java.lang.String
getURL()
Get the URL of the remote server in this route.java.lang.String
getZoneName()
Get the name of the zone this route is in.short
getZoneType()
Get the type of zone this route is in.boolean
isConfigured()
Indicates whether or not the route is defined in the server configuration.boolean
isConnected()
Indicates whether or not the route is connected.boolean
isStalled()
Indicates whether or not this route has stalled destinations.void
removeIncomingSelector(java.lang.String topic)
Remove the incoming selector on a given topic.void
removeOutgoingSelector(java.lang.String topic)
Remove the outgoing selector on a given topic.void
setName(java.lang.String name)
Set the name of the remote server in this route.void
setOAuth2ClientId(java.lang.String id)
Set the OAuth 2.0 client ID.void
setOAuth2ClientSecret(java.lang.String secret)
Set the OAuth 2.0 client secret.void
setOAuth2DisableVerifyHostname(java.lang.Boolean disableVerifyHostName)
Set whether client verification of the OAuth 2.0 authorization server's hostname should be disabled.void
setOAuth2ExpectedHostname(java.lang.String expectedHostName)
Set the hostname expected to be found in the OAuth 2.0 authorization server host's certificate.void
setOAuth2GrantType(java.lang.String grantType)
Set the OAuth 2.0 grant type used to obtain access tokens from the OAuth 2.0 authorization server.void
setOAuth2ServerTrustFile(java.lang.String file)
Set the path to the trust file used to verify the OAuth 2.0 authorization server's identity.void
setOAuth2ServerURL(java.lang.String url)
Set the URL of the OAuth 2.0 authorization server that will issue access tokens for authenticating with the EMS server at the other end of the route.void
setSSLParams(java.util.Map params)
Set the TLS parameters for the connection to the remote server.void
setTopicPrefetch(int prefetch)
Set the topic prefetch of this route.void
setURL(java.lang.String url)
Set the URL of the remote server in this route.java.lang.String
statString()
Helper method to generate the statistical information in string form.java.lang.String
toString()
void
updateIncomingSelector(RouteSelector rs)
Replace the current incoming selector on a given topic with a new one.void
updateOutgoingSelector(RouteSelector rs)
Replace the current outgoing selector on a given topic with a new one.
-
-
-
Field Detail
-
ZONE_TYPE_MULTI_HOP
public static final short ZONE_TYPE_MULTI_HOP
A m-hop (Multi-Hop) zone is one in which topic messages can be routed across multiple hops and the routes between servers may not form a cycle.- See Also:
- Constant Field Values
-
ZONE_TYPE_ONE_HOP
public static final short ZONE_TYPE_ONE_HOP
A 1-Hop zone is one in which messages can be routed at most 1 hop away. A typical 1-Hop zone is one in which every server has a route to every other server in the zone.- See Also:
- Constant Field Values
-
ZONE_TYPE_UNKNOWN
public static final short ZONE_TYPE_UNKNOWN
A zone of unknown type indicates some kind of error.- See Also:
- Constant Field Values
-
DEFAULT_DAG_ZONE
public static final java.lang.String DEFAULT_DAG_ZONE
The name of the zone that routes are members of if no zone name is specified. This zone is a DAG zone.- See Also:
- Constant Field Values
-
-
Constructor Detail
-
RouteInfo
public RouteInfo(java.lang.String name, java.lang.String url, java.util.Map params)
The public constructor used to create a RouteInfo object. The route does not exist on the server until this RouteInfo is passed to TibjmsAdmin.createRoute(). The route created will be a member of the default DAG zone (DEFAULT_DAG_ZONE
).- Parameters:
name
- the name of the remote server that this route is to.url
- the URL of the remote server.params
- the TLS parameters for the connection to the remote server (can be null).
-
RouteInfo
public RouteInfo(java.lang.String name, java.lang.String url, java.util.Map params, java.lang.String zoneName, short zoneType)
The public constructor used to create a RouteInfo object that is part of a specific zone. The route does not exist on the server until this RouteInfo is passed to TibjmsAdmin.createRoute().- Parameters:
name
- the name of the remote server that this route is to.url
- the URL of the remote server.params
- the TLS parameters for the connection to the remote server (can be null).zoneName
- the name of the route's zone.zoneType
- the type of routing in the zone, eitherZONE_TYPE_MULTI_HOP
orZONE_TYPE_ONE_HOP
.
-
RouteInfo
public RouteInfo(java.lang.String name, java.lang.String url, java.util.Map params, java.lang.String zoneName, short zoneType, int topicPrefetch)
The public constructor used to create a RouteInfo object that is part of a specific zone. The route does not exist on the server until this RouteInfo is passed to TibjmsAdmin.createRoute().- Parameters:
name
- the name of the remote server that this route is to.url
- the URL of the remote server.params
- the TLS parameters for the connection to the remote server (can be null).zoneName
- the name of the route's zone.zoneType
- the type of routing in the zone, eitherZONE_TYPE_MULTI_HOP
orZONE_TYPE_ONE_HOP
.topicPrefetch
- the prefetch that overrides individual topic prefetches- Since:
- EMS 8.1
-
-
Method Detail
-
isConfigured
public boolean isConfigured()
Indicates whether or not the route is defined in the server configuration. Note that if the route is not configured, its parameters can not be changed.- Returns:
- true if this route is defined in the server configuration and, false if this route is not defined, but is present via a remote server connecting to this server.
-
isConnected
public boolean isConnected()
Indicates whether or not the route is connected.- Returns:
- true if this route is connected and false if this route is defined in the server configuration but is not connected.
-
isStalled
public boolean isStalled()
Indicates whether or not this route has stalled destinations. Notice this flag is set if any number of destinations are stalled. It does not indicate if all destinations sent by this route are stalled.- Returns:
- true if this route has any stalled destination, false otherwise.
-
getConnectionID
public long getConnectionID()
Returns connection ID of this route or 0 if route is not connected.
-
getBacklogCount
public long getBacklogCount()
Get the route's backlog count.- Returns:
- the number of messages in the route's backlog
- Since:
- EMS 5.0
-
getBacklogSize
public long getBacklogSize()
Get the route's backlog size.- Returns:
- the size of all messages in the route's backlog
- Since:
- EMS 5.0
-
getURL
public java.lang.String getURL()
Get the URL of the remote server in this route.- Returns:
- the URL of the remote server in this route.
-
setURL
public void setURL(java.lang.String url)
Set the URL of the remote server in this route.- Parameters:
url
- the URL of the remote server in this route.
-
getName
public java.lang.String getName()
Get the name of the remote server in this route.- Returns:
- the name of the remote server in this route.
-
setName
public void setName(java.lang.String name)
Set the name of the remote server in this route. The name of existing route can not be changed. This method is used to create the new route.- Parameters:
name
- the name of the remote server in this route.
-
getTopicPrefetch
public int getTopicPrefetch()
Get the topic prefetch of this route.- Returns:
- the topic prefetch of this route.
- Since:
- EMS 8.1
-
setTopicPrefetch
public void setTopicPrefetch(int prefetch)
Set the topic prefetch of this route.- Parameters:
prefetch
- the topic prefetch of this route.- Since:
- EMS 8.1
-
getParams
public java.util.Map getParams()
Get the TLS parameters for the connection to the remote server.- Returns:
- the TLS parameters for the connection to the remote server or null if none exist.
-
setSSLParams
public void setSSLParams(java.util.Map params)
Set the TLS parameters for the connection to the remote server.- Parameters:
params
- the TLS parameters for the connection to the remote server.
-
getZoneName
public java.lang.String getZoneName()
Get the name of the zone this route is in.- Returns:
- the name of the zone this route is in. For pre-3.2 servers this will be
DEFAULT_DAG_ZONE
.
-
getZoneType
public short getZoneType()
Get the type of zone this route is in.- Returns:
- the type of zone this route is in. For pre-3.2 servers this will be
ZONE_TYPE_MULTI_HOP
.
-
getInboundStatistics
public StatData getInboundStatistics()
Returns cumulative inbound statistics for all destinations on this route. Inbound statistics refers to all messages this route sends to the connected server.- Returns:
- the cumulative inbound statistics for all destinations on this route.
-
getOutboundStatistics
public StatData getOutboundStatistics()
Returns cumulative outbound statistics for all destinations on this route. Outbound data refers to all messages the server sends to this route.- Returns:
- cumulative outbound statistics for all destinations on this route.
-
getDetailedStatistics
public DetailedDestStat[] getDetailedStatistics()
Returns detailed destination statistics for all destinations being sent to or received from this route.- Returns:
- detailed destination statistics for all destinations being sent to or received from this route.
-
getIncomingSelectors
public RouteSelector[] getIncomingSelectors()
Get the selectors that will be run on messages received by this route. Only messages that match at least one of the selectors will be received by the route.- Returns:
- an array of RouteSelector objects.
-
addIncomingSelector
public void addIncomingSelector(RouteSelector rs) throws java.lang.IllegalArgumentException
Add a new incoming selector to the route. If there is already a selector on that topic, the old one will be replaced by the new one.- Parameters:
rs
- the new selector.- Throws:
java.lang.IllegalArgumentException
- if rs is null.
-
removeIncomingSelector
public void removeIncomingSelector(java.lang.String topic) throws TibjmsAdminInvalidNameException
Remove the incoming selector on a given topic.- Parameters:
topic
- the topic to remove the selector from.- Throws:
TibjmsAdminInvalidNameException
- if topic is not a valid topic.
-
updateIncomingSelector
public void updateIncomingSelector(RouteSelector rs) throws java.lang.IllegalArgumentException
Replace the current incoming selector on a given topic with a new one.- Parameters:
rs
- the updated selector.- Throws:
java.lang.IllegalArgumentException
- if rs is null.
-
getOutgoingSelectors
public RouteSelector[] getOutgoingSelectors()
Get the selectors that will be run on messages before they are sent to this route. Only messages that match at least one of the selectors will be forwarded by the route.- Returns:
- an array of RouteSelector objects.
-
addOutgoingSelector
public void addOutgoingSelector(RouteSelector rs) throws java.lang.IllegalArgumentException
Add a new outgoing selector to the route. If there is already a selector on that topic, the old one will be replaced by the new one.- Parameters:
rs
- the new selector.- Throws:
java.lang.IllegalArgumentException
- if rs is null.
-
removeOutgoingSelector
public void removeOutgoingSelector(java.lang.String topic) throws TibjmsAdminInvalidNameException
Remove the outgoing selector on a given topic.- Parameters:
topic
- the topic to remove the selector from.- Throws:
TibjmsAdminInvalidNameException
- if topic is not a valid topic.
-
updateOutgoingSelector
public void updateOutgoingSelector(RouteSelector rs) throws java.lang.IllegalArgumentException
Replace the current outgoing selector on a given topic with a new one.- Parameters:
rs
- the updated selector.- Throws:
java.lang.IllegalArgumentException
- if rs is null.
-
getOAuth2ServerURL
public java.lang.String getOAuth2ServerURL()
Get the URL of the OAuth 2.0 authorization server that will issue access tokens for authenticating with the EMS server at the other end of the route.- Returns:
- the URL of the OAuth 2.0 authorization server.
- Since:
- EMS 10.3.0
-
setOAuth2ServerURL
public void setOAuth2ServerURL(java.lang.String url)
Set the URL of the OAuth 2.0 authorization server that will issue access tokens for authenticating with the EMS server at the other end of the route.- Parameters:
the
- URL of the OAuth 2.0 authorization server.- Since:
- EMS 10.3.0
-
getOAuth2GrantType
public java.lang.String getOAuth2GrantType()
Get the OAuth 2.0 grant type used to obtain access tokens from the OAuth 2.0 authorization server. Obtained access tokens will be used to authenticate with the EMS server at the other end of the route.- Returns:
- the OAuth 2.0 grant type.
- Since:
- EMS 10.3.0
-
setOAuth2GrantType
public void setOAuth2GrantType(java.lang.String grantType)
Set the OAuth 2.0 grant type used to obtain access tokens from the OAuth 2.0 authorization server. Obtained access tokens will be used to authenticate with the EMS server at the other end of the route.- Since:
- EMS 10.3.0
-
getOAuth2ClientId
public java.lang.String getOAuth2ClientId()
Get the OAuth 2.0 client ID. This value is used along with the OAuth 2.0 client secret to connect to the OAuth 2.0 authorization server and obtain access token for authenticating with the EMS server at the other end of the route.- Returns:
- the OAuth 2.0 client ID.
- Since:
- EMS 10.3.0
-
setOAuth2ClientId
public void setOAuth2ClientId(java.lang.String id)
Set the OAuth 2.0 client ID. This value is used along with the OAuth 2.0 client secret to connect to the OAuth 2.0 authorization server and obtain access tokens for authenticating with the EMS server at the other end of the route.- Parameters:
the
- OAuth 2.0 client ID.- Since:
- EMS 10.3.0
-
setOAuth2ClientSecret
public void setOAuth2ClientSecret(java.lang.String secret)
Set the OAuth 2.0 client secret. This value is used along with the OAuth 2.0 client ID to connect to the OAuth 2.0 authorization server and obtain access tokens for authenticating with the EMS server at the other end of the route.- Parameters:
the
- OAuth 2.0 client secret.- Since:
- EMS 10.3.0
-
getOAuth2ServerTrustFile
public java.lang.String getOAuth2ServerTrustFile()
Get the path to the trust file used to verify the OAuth 2.0 authorization server's identity. This verification is performed when connecting to a secure authorization server to obtain access tokens for authenticating with the EMS server at the other end of the route.- Returns:
- the path to trust file.
- Since:
- EMS 10.3.0
-
setOAuth2ServerTrustFile
public void setOAuth2ServerTrustFile(java.lang.String file)
Set the path to the trust file used to verify the OAuth 2.0 authorization server's identity. This verification is performed when connecting to a secure authorization server to obtain access tokens for authenticating with the EMS server at the other end of the route.- Parameters:
the
- path to the trust file.- Since:
- EMS 10.3.0
-
getOAuth2DisableVerifyHostname
public java.lang.Boolean getOAuth2DisableVerifyHostname()
Returns whether client verification of the OAuth 2.0 authorization server's hostname is disabled. Verification is enabled by default and is performed when connecting to a secure authorization server to obtain access tokens for authenticating with the EMS server at the other end of the route.- Returns:
- true if verification is disabled, false otherwise.
- Since:
- EMS 10.3.0
-
setOAuth2DisableVerifyHostname
public void setOAuth2DisableVerifyHostname(java.lang.Boolean disableVerifyHostName)
Set whether client verification of the OAuth 2.0 authorization server's hostname should be disabled. Verification is enabled by default and is performed when connecting to a secure authorization server to obtain access tokens for authenticating with the EMS server at the other end of the route.- Parameters:
true
- if verification should be disabled, false otherwise.- Since:
- EMS 10.3.0
-
getOAuth2ExpectedHostname
public java.lang.String getOAuth2ExpectedHostname()
Get the hostname expected to be set in the OAuth 2.0 authorization server host's certificate. Hostname verification is performed when connecting to a secure authorization server to obtain access tokens for authenticating with the EMS server at the other end of the route.- Returns:
- the expected hostname.
- Since:
- EMS 10.3.0
-
setOAuth2ExpectedHostname
public void setOAuth2ExpectedHostname(java.lang.String expectedHostName)
Set the hostname expected to be found in the OAuth 2.0 authorization server host's certificate. Hostname verification is performed when connecting to a secure authorization server to obtain access tokens for authenticating with the EMS server at the other end of the route.- Parameters:
the
- expected hostname.- Since:
- EMS 10.3.0
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
statString
public java.lang.String statString()
Helper method to generate the statistical information in string form.- Returns:
- a String representation of statistical information.
-
from
public static RouteInfo from(javax.management.openmbean.CompositeData cd) throws java.lang.Exception
For Internal use only, may be removed or deprecated in future.- Returns:
- a RouteInfo object from CompositeData
- Throws:
java.lang.IllegalArgumentException
- if CompositeType does not match or if a null CompositeData is passed.java.lang.Exception
-
-