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
Nested ClassesModifier and TypeClassDescriptionstatic final classSome flags used in the subscription request. -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intThe "link state" cluster connectivity monitor mode.static final intThe "node state" cluster topology monitor mode.static final intSpecial timeout value meaning "never timeout". -
Constructor Summary
ConstructorsConstructorDescriptionAFTIPCTopologySubscription(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 TypeMethodDescriptionbooleangetFlags()Returns the flags.intgetLower()Returns the lower instance value.intReturns the timeout, in seconds (orTIPC_WAIT_FOREVERfor "never timeout").intgetType()Returns the service type.intgetUpper()Returns the upper instance value.byte[]Returns the 8-byte user handle.inthashCode()booleanReturnstrueiff the subscription has theAFTIPCTopologySubscription.Flags.TIPC_SUB_CANCELflag set.booleanisPort()Returnstrueiff the subscription has theAFTIPCTopologySubscription.Flags.TIPC_SUB_PORTSflag set.booleanReturnstrueiff the subscription has theAFTIPCTopologySubscription.Flags.TIPC_SUB_SERVICEflag set.toBuffer()Converts this subscription message to a newByteBuffer.Creates anAFTIPCTopologySubscriptionthat 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_STATEandTIPC_LINK_STATE.lower- The lower instance.upper- The upper instance.flags- Any flaas (useAFTIPCTopologySubscription.Flags.NONEif 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_STATEandTIPC_LINK_STATE.lower- The lower instance.upper- The upper instance.flags- Any flaas (useAFTIPCTopologySubscription.Flags.NONEif 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_STATEandTIPC_LINK_STATE.lower- The lower instance.upper- The upper instance.flags- Any flaas (useAFTIPCTopologySubscription.Flags.NONEif 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 inAFTIPCTopologyEventmessages.
-
-
Method Details
-
toBuffer
Converts this subscription message to a newByteBuffer.- Returns:
- The new buffer, ready to read from.
-
toString
-
toCancellation
Creates anAFTIPCTopologySubscriptionthat 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_FOREVERfor "never timeout").- Returns:
- The timeout.
-
getUsrHandle
public byte[] getUsrHandle()Returns the 8-byte user handle.- Returns:
- The user handle.
-
isPort
public boolean isPort()Returnstrueiff the subscription has theAFTIPCTopologySubscription.Flags.TIPC_SUB_PORTSflag set.- Returns:
trueif this is a "port" subscription.
-
isService
public boolean isService()Returnstrueiff the subscription has theAFTIPCTopologySubscription.Flags.TIPC_SUB_SERVICEflag set.- Returns:
trueif this is a "service" subscription.
-
isCancellation
public boolean isCancellation()Returnstrueiff the subscription has theAFTIPCTopologySubscription.Flags.TIPC_SUB_CANCELflag set.- Returns:
trueif this is a "cancellation" subscription request.
-