Module org.newsclub.net.unix.tipc
Package org.newsclub.net.unix.tipc
Class AFTIPCTopologySubscription
java.lang.Object
org.newsclub.net.unix.tipc.AFTIPCTopologySubscription
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic final class
Some flags used in the subscription request. -
Field Summary
Modifier and TypeFieldDescriptionstatic final int
The "link state" cluster connectivity monitor mode.static final int
The "node state" cluster topology monitor mode.static final int
Special timeout value meaning "never timeout". -
Constructor Summary
ConstructorDescriptionAFTIPCTopologySubscription
(int type, int lower, int upper, AFTIPCTopologySubscription.Flags flags) Creates a new subscription message that does not time out.AFTIPCTopologySubscription
(int type, int lower, int upper, AFTIPCTopologySubscription.Flags flags, int timeoutSeconds) Creates a new subscription message.AFTIPCTopologySubscription
(int type, int lower, int upper, AFTIPCTopologySubscription.Flags flags, int timeoutSeconds, byte[] usrHandle) Creates a new subscription message. -
Method Summary
Modifier and TypeMethodDescriptionboolean
getFlags()
Returns the flags.int
getLower()
Returns the lower instance value.int
Returns the timeout, in seconds (orTIPC_WAIT_FOREVER
for "never timeout").int
getType()
Returns the service type.int
getUpper()
Returns the upper instance value.byte[]
Returns the 8-byte user handle.int
hashCode()
boolean
Returnstrue
iff the subscription has theAFTIPCTopologySubscription.Flags.TIPC_SUB_CANCEL
flag set.boolean
isPort()
Returnstrue
iff the subscription has theAFTIPCTopologySubscription.Flags.TIPC_SUB_PORTS
flag set.boolean
Returnstrue
iff the subscription has theAFTIPCTopologySubscription.Flags.TIPC_SUB_SERVICE
flag set.toBuffer()
Converts this subscription message to a newByteBuffer
.Creates anAFTIPCTopologySubscription
that cancels this subscription.toString()
-
Field Details
-
TIPC_WAIT_FOREVER
public static final int TIPC_WAIT_FOREVERSpecial timeout value meaning "never timeout".- See Also:
-
TIPC_NODE_STATE
public static final int TIPC_NODE_STATEThe "node state" cluster topology monitor mode. When TIPC establishes contact with another node, it does internally create a binding {type = TIPC_NODE_STATE, instance = peer node hash number} in the binding table. This makes it possible for applications on a node to keep track of reachable peer nodes at any time. *- See Also:
-
TIPC_LINK_STATE
public static final int TIPC_LINK_STATEThe "link state" cluster connectivity monitor mode. When TIPC establishes a new link to another node, it does internally create a binding {type = TIPC_LINK_STATE, instance = peer node hash number} in the binding table. This makes it possible for applications on a node to keep track of working links to peer nodes at any time. This type of binding differs from the topology subscription binding (TIPC_NODE_STATE
) in that there may be two links, and hence two bindings, to keep track of for each peer node. Although this binding type only is published with node visibility, it is possible to combine it with remote node topology subscriptions to obtain a full and continuous matrix view of the connectivity in the cluster.- See Also:
-
-
Constructor Details
-
AFTIPCTopologySubscription
public AFTIPCTopologySubscription(int type, int lower, int upper, AFTIPCTopologySubscription.Flags flags) Creates a new subscription message that does not time out.- Parameters:
type
- The service type (any service, particularlyTIPC_NODE_STATE
andTIPC_LINK_STATE
.lower
- The lower instance.upper
- The upper instance.flags
- Any flaas (useAFTIPCTopologySubscription.Flags.NONE
if you don't have any).
-
AFTIPCTopologySubscription
public AFTIPCTopologySubscription(int type, int lower, int upper, AFTIPCTopologySubscription.Flags flags, int timeoutSeconds) Creates a new subscription message.- Parameters:
type
- The service type (any service, particularlyTIPC_NODE_STATE
andTIPC_LINK_STATE
.lower
- The lower instance.upper
- The upper instance.flags
- Any flaas (useAFTIPCTopologySubscription.Flags.NONE
if you don't have any).timeoutSeconds
- The timeout (in seconds), or -1 if this should never time out.
-
AFTIPCTopologySubscription
public AFTIPCTopologySubscription(int type, int lower, int upper, AFTIPCTopologySubscription.Flags flags, int timeoutSeconds, byte[] usrHandle) Creates a new subscription message.- Parameters:
type
- The service type (any service, particularlyTIPC_NODE_STATE
andTIPC_LINK_STATE
.lower
- The lower instance.upper
- The upper instance.flags
- Any flaas (useAFTIPCTopologySubscription.Flags.NONE
if you don't have any).timeoutSeconds
- The timeout (in seconds), or -1 if this should never time out.usrHandle
- A custom 8-byte message that is included inAFTIPCTopologyEvent
messages.
-
-
Method Details
-
toBuffer
Converts this subscription message to a newByteBuffer
.- Returns:
- The new buffer, ready to read from.
-
toString
-
toCancellation
Creates anAFTIPCTopologySubscription
that cancels this subscription. Note that a cancellation cannot be cancelled again.- Returns:
- The new
AFTIPCTopologySubscription
.
-
hashCode
-
equals
-
getType
public int getType()Returns the service type.- Returns:
- The type.
-
getLower
public int getLower()Returns the lower instance value.- Returns:
- The lower instance value.
-
getUpper
public int getUpper()Returns the upper instance value.- Returns:
- The upper instance value.
-
getFlags
-
getTimeout
public int getTimeout()Returns the timeout, in seconds (orTIPC_WAIT_FOREVER
for "never timeout").- Returns:
- The timeout.
-
getUsrHandle
public byte[] getUsrHandle()Returns the 8-byte user handle.- Returns:
- The user handle.
-
isPort
public boolean isPort()Returnstrue
iff the subscription has theAFTIPCTopologySubscription.Flags.TIPC_SUB_PORTS
flag set.- Returns:
true
if this is a "port" subscription.
-
isService
public boolean isService()Returnstrue
iff the subscription has theAFTIPCTopologySubscription.Flags.TIPC_SUB_SERVICE
flag set.- Returns:
true
if this is a "service" subscription.
-
isCancellation
public boolean isCancellation()Returnstrue
iff the subscription has theAFTIPCTopologySubscription.Flags.TIPC_SUB_CANCEL
flag set.- Returns:
true
if this is a "cancellation" subscription request.
-