|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--hypercast.OL_Socket
This class implements all the functions of an overlay socket. It contains an overlay node that maintains the overlay topology. A forward engine is runnig inside this class for sending and receiving application messages. This class also provides interfaces for applications to handling data sending and receiving.
Field Summary |
Fields inherited from interface hypercast.I_OverlaySocket |
HOP_LIMIT_MAXIMUM |
Constructor Summary | |
OL_Socket(hypercast.HyperCastConfig config,
hypercast.I_ReceiveCallback callback)
Create an overlay socket with a HyperCastConfig object and a Callback interface. |
|
OL_Socket(hypercast.HyperCastConfig config,
hypercast.I_ReceiveCallback callback,
hypercast.NotificationHandler notificationHandler)
Create an overlay socket with a HyperCastConfig object, a callback object and a notification handler. |
|
OL_Socket(hypercast.HyperCastConfig config,
hypercast.I_ReceiveCallback callback,
hypercast.NotificationHandler notificationHandler_parameter,
hypercast.I_InterceptionCallback interceptionCallback)
Create an overlay socket with a HyperCastConfig object, a callback object and a notification handler. |
Method Summary | |
void |
appmsgArrived(hypercast.I_OverlayMessage message,
hypercast.I_ReceiveCallback callback)
Passes the message to the application via the callback. |
void |
closeSocket()
This method permanently closes the socket. |
hypercast.I_LogicalAddress |
createLogicalAddress(byte[] encodedLogicalAddress,
int offset)
Creates an I_LogicalAddress from a bytes array |
hypercast.I_LogicalAddress |
createLogicalAddress(java.lang.String logicalAddressString)
Creates a logical address object from a String. |
hypercast.I_OverlayMessage |
createMessage()
Same as calling createMessage(byte []) with parameter of null . |
hypercast.I_OverlayMessage |
createMessage(byte[] payload)
Creates an overlay message with an application payload extension. |
hypercast.I_OverlayMessage |
createMessage(byte[] payload,
byte[] streamid)
Creates a message with specified stream id. |
hypercast.I_OverlayMessage |
createMessage(byte[] payload,
int length)
Deprecated. The length parameter is redundant. |
hypercast.I_OverlayMessage |
createMessage(byte[] payload,
int length,
byte[] streamid)
Deprecated. The length parameter is redundant. |
hypercast.I_OverlayMessage |
createMessage(byte[] payload,
int length,
int servicenumber)
Deprecated. The length parameter is redundant. |
hypercast.I_OverlayMessage |
createMessage(byte[] payload,
short serviceNumber)
Create an OL_Message containing an extension that contains an appliction payload extension and a message store extension. |
short |
generateMsgIdentifier()
Returns a message identifier. |
short |
generateStreamIdentifier()
Returns a stream identifier. |
hypercast.I_LogicalAddress[] |
getChildren(hypercast.I_LogicalAddress root)
Returns an array consisting of the logical addresses of the children of this node. |
short |
getHopLimit()
Get the default hop limit for multicast packets sent out on the OL_Socket. |
hypercast.I_LogicalAddress |
getLogicalAddress()
Returns the node's logical address |
hypercast.I_LogicalAddress[] |
getLogicalAddressByName(java.lang.String name)
Implementation of I_OverlaySocket.getLogicalAddress(String) . |
hypercast.I_LogicalAddress[] |
getLogicalAddressByName(java.lang.String name,
boolean requireTrusted,
long timeout,
boolean requireSerialNumberMatch,
boolean requireAuthoritative,
int maxAge,
int maxResponses,
short minHopCount,
short maxHopCount)
Implementation of I_OverlaySocket.getLogicalAddress(String) . |
int |
getLogicalAddressByNameNonBlocking(java.lang.String name)
Implementation of I_OverlaySocket.getLogicalAddressNonBlocking(String) . |
int |
getLogicalAddressByNameNonBlocking(java.lang.String name,
boolean requireTrusted,
long timeout,
boolean requireSerialNumberMatch,
boolean requireAuthoritative,
int maxAge,
int maxResponses,
short minHopCount,
short maxHopCount)
Implementation of I_OverlaySocket.getLogicalAddressNonBlocking(String) . |
java.lang.String[] |
getNames()
Implementation of I_OverlaySocket.getName() . |
java.lang.String[] |
getNames(hypercast.I_LogicalAddress logicalAddress)
Implementation of I_OverlaySocket.getName(I_LogicalAddress) . |
java.lang.String[] |
getNames(hypercast.I_LogicalAddress peer,
boolean requireTrusted,
long timeout,
boolean requireSerialNumberMatch,
boolean requireAuthoritative,
int maxAge,
int maxResponses,
short maxHopCount,
short minHopCount)
Implementation of I_OverlaySocket.getName(I_LogicalAddress,boolean,long,boolean,boolean,int,int,short) . |
int |
getNamesNonBlocking(hypercast.I_LogicalAddress address)
Implementation of I_OverlaySocket.getNameNonBlocking(I_LogicalAddress) . |
int |
getNamesNonBlocking(hypercast.I_LogicalAddress peer,
boolean requireTrusted,
long timeout,
boolean requireSerialNumberMatch,
boolean requireAuthoritative,
int maxAge,
int maxResponses,
short minHopCount,
short maxHopCount)
Implementation of I_OverlaySocket.getNameNonBlocking(I_LogicalAddress) . |
hypercast.I_LogicalAddress[] |
getNeighbors()
Returns an array consisting of the logical addresses of this node's neighbors. |
hypercast.I_LogicalAddress |
getParent(hypercast.I_LogicalAddress root)
Returns this node's parent with respect to a tree starting at "root". |
org.w3c.dom.Element[] |
getReadSchema(org.w3c.dom.Document doc,
org.apache.xpath.XPath xpath)
Dynamically generates a subtree of the Readable Schema rooted at the path specified by the xpath. |
int |
getSoTimeout()
Retrive setting for SO_TIMEOUT. |
org.w3c.dom.Element[] |
getStats(org.w3c.dom.Document doc,
org.apache.xpath.XPath xpath)
Gets statistics information from an object which implements this interface. |
java.lang.String |
getStatsName()
Gets the element name of this I_Stats instance. |
hypercast.StreamManager |
getStreamManager()
|
byte[] |
getUniqueIdentifier()
Returns the unique identifier for this node. |
org.w3c.dom.Element[] |
getWriteSchema(org.w3c.dom.Document doc,
org.apache.xpath.XPath xpath)
Dynamically generates a subtree of the Writable Schema rooted at the path specified by the xpath. |
void |
installTrustedNamingCertificate(java.security.cert.Certificate certificate)
Implementation of I_OverlaySocket.installTrustedNamingCertificate() . |
void |
joinOverlay()
Implements the operation of joining an overlay network. |
void |
leaveOverlay()
Leaves a multicast group, stopping all threads started by joinOverlay() in reverse order. |
void |
messageArrivedFromAdapter(hypercast.I_Message msg)
This method implements the heart of the "Forwarding Engine." The bulk of the remaining portions of the forwarding engine can be found in the methods with the prefix "forward" |
void |
namingLogicalAddressChange()
Implementation of I_OverlaySocket.namingLogicalAddressChange() . |
hypercast.I_OverlayMessage |
receive()
Receives an overlay application message from this socket. |
void |
ReceiveCallback(hypercast.I_OverlayMessage message)
TODO: document me! |
hypercast.I_Message |
restoreMessage(byte[] recvbuff,
int[] validBytesStart,
int validBytesEnd)
Creates an I_Message from a byte array. |
void |
sendFlood(hypercast.I_OverlayMessage message)
Floods a message to all nodes. |
void |
sendIncast(hypercast.I_OverlayMessage message,
byte[] messageid,
hypercast.I_LogicalAddress root)
Send Incast message to root node. |
void |
sendToAll(hypercast.I_OverlayMessage message)
Sends a multicast overlay message to all nodes in the multicast group from this socket; the sender receives a copy as well. |
void |
sendToAllNeighbors(hypercast.I_OverlayMessage message)
Sends message to all the neighbors. |
void |
sendToChildren(hypercast.I_OverlayMessage message,
hypercast.I_LogicalAddress root)
Sends message to all the children nodes from this socket. |
void |
sendToNode(hypercast.I_OverlayMessage message,
hypercast.I_LogicalAddress destinationLogicalAddress)
Sends a message to a specified node. |
void |
sendToParent(hypercast.I_OverlayMessage message,
hypercast.I_LogicalAddress root)
Sends a message to parent. |
void |
setHopLimit(short hopLimit)
Set the default hop limit for multicast packets sent out on this socket. |
void |
setLogicalAddress(hypercast.I_LogicalAddress logicalAddress)
Sets the logical address to specified one. |
void |
setName(java.security.cert.Certificate certificate,
java.security.PrivateKey privateKey)
Implementation of I_OverlaySocket.setName() . |
void |
setName(java.security.cert.Certificate certificate,
java.security.PrivateKey privateKey,
java.lang.String name,
hypercast.I_LogicalAddress logicalAddress)
Assigns the specified name to the specified logical address using the specified private key (that matches the public key in the specified certificate) to create a digital signature for the new binding. |
void |
setName(java.lang.String name)
Implementation of I_OverlaySocket.setName() . |
void |
setName(java.lang.String name,
hypercast.I_LogicalAddress logicalAddress)
Assigns the specified name to the specified logical address. |
void |
setSoTimeout(int timeout)
Enable/disable SO_TIMEOUT with the specified timeout, in milliseconds. |
org.w3c.dom.Element[] |
setStats(org.w3c.dom.Document doc,
org.apache.xpath.XPath xpath,
org.w3c.dom.Element newValue)
Sets statistics information for an object which implements this interface. |
void |
setStatsName(java.lang.String name)
Assigns a name to this I_Stats instance. |
void |
timerExpired(java.lang.Object time_id)
This method is called from the timer thread of the Socket adapter. |
void |
unsetName(java.security.cert.Certificate certificate,
java.security.PrivateKey privateKey)
Implementation of I_OverlaySocket.unsetName() . |
void |
unsetName(java.lang.String name)
Implementation of I_OverlaySocket.unsetName() . |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public OL_Socket(hypercast.HyperCastConfig config, hypercast.I_ReceiveCallback callback)
config
- HyperCastConfig object which is used for configuration.callback
- I_ReceiveCallback interface for the application.OL_Socket(HyperCastConfig, I_ReceiveCallback, NotificationHandler, I_InterceptionCallback)
public OL_Socket(hypercast.HyperCastConfig config, hypercast.I_ReceiveCallback callback, hypercast.NotificationHandler notificationHandler)
config
- HyperCastConfig object which is used for configuration.callback
- I_ReceiveCallback interface for the application.notificationHandler
- a notification handler.OL_Socket(HyperCastConfig, I_ReceiveCallback, NotificationHandler, I_InterceptionCallback)
public OL_Socket(hypercast.HyperCastConfig config, hypercast.I_ReceiveCallback callback, hypercast.NotificationHandler notificationHandler_parameter, hypercast.I_InterceptionCallback interceptionCallback)
config
- HyperCastConfig object which is used for configuration.callback
- I_ReceiveCallback interface for the application.notificationHandler_parameter
- a notification handler.interceptionCallback
- a interception object.Method Detail |
public hypercast.StreamManager getStreamManager()
getStreamManager
in interface I_OverlaySocket
public void ReceiveCallback(hypercast.I_OverlayMessage message)
ReceiveCallback
in interface I_ReceiveCallback
public void joinOverlay()
Implements the operation of joining an overlay network. The call is asynchronous in the sense that upon return to the caller, the socket has *not necessarily* completed the join operation of the particular overlay protocol (or protocols in the multi-node case NB multi-node is not implemented as of Fall 2004). If an application is interested in knowing when the join operation is complete it must use the notification mechanism to receive such an event.
This call is responsible for starting all threads needed by
the socket that were not started at socket construction
time. These threads should be stopped in reverse order by
leaveOverlay()
.
joinOverlay
in interface I_OverlaySocket
leaveOverlay()
public void leaveOverlay()
joinOverlay()
in reverse order.
leaveOverlay
in interface I_OverlaySocket
joinOverlay()
public void closeSocket()
closeSocket
in interface I_OverlaySocket
public void setName(java.lang.String name)
Implementation of
I_OverlaySocket.setName()
. Delegates call to an
instance of Naming
.
setName
in interface I_OverlaySocket
name
- The string that will be set as the name of this overlay socket.
java.lang.UnsupportedOperationException
- if naming is not configuredNaming
,
I_OverlaySocket.setName(String)
public void setName(java.lang.String name, hypercast.I_LogicalAddress logicalAddress)
I_OverlaySocket
Assigns the specified name to the specified logical address. The logical address can be any address in the current logical address space. This operation allows bindings to be created for the logical addresses of sockets other than the local socket.
setName
in interface I_OverlaySocket
name
- The string that will be used as the name of a new binding.logicalAddress
- The logical address that will be used as the logical address of a new binding.public void setName(java.security.cert.Certificate certificate, java.security.PrivateKey privateKey)
Implementation of
I_OverlaySocket.setName()
. Delegates call to an
instance of Naming
.
setName
in interface I_OverlaySocket
java.lang.UnsupportedOperationException
- if naming is not configuredNaming
,
I_OverlaySocket.setName(Certificate, PrivateKey)
public void setName(java.security.cert.Certificate certificate, java.security.PrivateKey privateKey, java.lang.String name, hypercast.I_LogicalAddress logicalAddress)
I_OverlaySocket
Assigns the specified name to the specified logical address using the specified private key (that matches the public key in the specified certificate) to create a digital signature for the new binding. The subject common name of the specified certificate is used as the signer name of the binding. The logical address can be any address in the current logical address space. This operation allows bindings to be created for the logical addresses of sockets other than the local socket.
setName
in interface I_OverlaySocket
name
- The string that will be used as the name of a new binding.logicalAddress
- The logical address that will be used as the logical address of a new binding.certificate
- Certificate that contains the name that will be the signer of the new binding.privateKey
- Key used to create a digital signature for a new bindingpublic void unsetName(java.lang.String name)
Implementation of
I_OverlaySocket.unsetName()
. Delegates call to an
instance of Naming
.
unsetName
in interface I_OverlaySocket
name
- The string that will be unset as the name of this overlay socket.
java.lang.UnsupportedOperationException
- if naming is not configuredNaming
,
I_OverlaySocket.unsetName(String)
public void unsetName(java.security.cert.Certificate certificate, java.security.PrivateKey privateKey)
Implementation of
I_OverlaySocket.unsetName()
. Delegates call to an
instance of Naming
.
unsetName
in interface I_OverlaySocket
java.lang.UnsupportedOperationException
- if naming is not configuredNaming
,
I_OverlaySocket.unsetName(Certificate, PrivateKey)
public void namingLogicalAddressChange()
Implementation of
I_OverlaySocket.namingLogicalAddressChange()
. Delegates call to an
instance of Naming
.
namingLogicalAddressChange
in interface I_OverlaySocket
java.lang.UnsupportedOperationException
- if naming is not configuredNaming
,
I_OverlaySocket.namingLogicalAddressChange()
public java.lang.String[] getNames()
Implementation of
I_OverlaySocket.getName()
. Delegates call to an
instance of Naming
.
getNames
in interface I_OverlaySocket
java.lang.UnsupportedOperationException
- if naming is not configuredNaming
,
I_OverlaySocket.getNames()
public java.lang.String[] getNames(hypercast.I_LogicalAddress logicalAddress)
Implementation of
I_OverlaySocket.getName(I_LogicalAddress)
. Delegates
call to an instance of Naming
.
getNames
in interface I_OverlaySocket
logicalAddress
- The logical address of the node for which a name is requested.
java.lang.UnsupportedOperationException
- if naming is not configuredNaming
,
I_OverlaySocket.getNames(I_LogicalAddress)
public java.lang.String[] getNames(hypercast.I_LogicalAddress peer, boolean requireTrusted, long timeout, boolean requireSerialNumberMatch, boolean requireAuthoritative, int maxAge, int maxResponses, short maxHopCount, short minHopCount)
Implementation of
I_OverlaySocket.getName(I_LogicalAddress,boolean,long,boolean,boolean,int,int,short)
. Delegates
call to an instance of Naming
.
getNames
in interface I_OverlaySocket
peer
- The logical address of the node for which a name is requested.requireTrusted
- If true only trusted bindings will be acceptedtimeout
- Time in milliseconds before this query will be ended. Can be Naming.WAIT_INDEFINITELY.requireSerialNumberMatch
- Each query has a unique serial number assigned to it. If this parameter is true then
the serial number of a valid response must match the serial number of a query.requireAuthoritative
- If true only bindings received from the authoritative peer will be acceptedmaxAge
- The maximum age in milliseconds of an acceptable
query. Calculated from the time of the query for already cached
bindings; calculated from time of receipt for bindings received
after the query is made.maxResponses
- The query will end when this number of responses are received. Can be Naming.NO_RESPONSE_LIMIT.maxHopCount
- The minimum number of hops that a query must make before it is not propagated further.minHopCount
- The maximum number of hops that a query can make before it is not propagated further.
java.lang.UnsupportedOperationException
- if naming is not configuredNaming
,
I_OverlaySocket.getNames(I_LogicalAddress, boolean, long, boolean, boolean, int, int, short, short)
public int getNamesNonBlocking(hypercast.I_LogicalAddress address)
Implementation of
I_OverlaySocket.getNameNonBlocking(I_LogicalAddress)
. Delegates
call to an instance of Naming
.
getNamesNonBlocking
in interface I_OverlaySocket
java.lang.UnsupportedOperationException
- if naming is not configuredNaming
,
I_OverlaySocket.getNamesNonBlocking(I_LogicalAddress)
public int getNamesNonBlocking(hypercast.I_LogicalAddress peer, boolean requireTrusted, long timeout, boolean requireSerialNumberMatch, boolean requireAuthoritative, int maxAge, int maxResponses, short minHopCount, short maxHopCount)
Implementation of
I_OverlaySocket.getNameNonBlocking(I_LogicalAddress)
. Delegates
call to an instance of Naming
.
getNamesNonBlocking
in interface I_OverlaySocket
peer
- The logical address of the node for which a name is requested.requireTrusted
- If true only trusted bindings will be acceptedtimeout
- Time in milliseconds before this query will be ended. Can be Naming.WAIT_INDEFINITELY.requireSerialNumberMatch
- Each query has a unique serial number assigned to it. If this parameter is true then
the serial number of a valid response must match the serial number of a query.requireAuthoritative
- If true only bindings received from the authoritative peer will be acceptedmaxAge
- The maximum age in milliseconds of an acceptable
query. Calculated from the time of the query for already cached
bindings; calculated from time of receipt for bindings received
after the query is made.maxResponses
- The query will end when this number of responses are received. Can be Naming.NO_RESPONSE_LIMIT.minHopCount
- The minimum number of hops that a query must make before it is not propagated further.maxHopCount
- The maximum number of hops that a query can make before it is not propagated further.
java.lang.UnsupportedOperationException
- if naming is not configuredNaming
,
I_OverlaySocket.getNamesNonBlocking(I_LogicalAddress, boolean, long, boolean, boolean, int, int, short, short)
public hypercast.I_LogicalAddress[] getLogicalAddressByName(java.lang.String name)
Implementation of
I_OverlaySocket.getLogicalAddress(String)
. Delegates
call to an instance of Naming
.
getLogicalAddressByName
in interface I_OverlaySocket
name
- The name of a socket for which the logical address is requested.
java.lang.UnsupportedOperationException
- if naming is not configuredNaming
,
I_OverlaySocket.getLogicalAddressByName(String)
public hypercast.I_LogicalAddress[] getLogicalAddressByName(java.lang.String name, boolean requireTrusted, long timeout, boolean requireSerialNumberMatch, boolean requireAuthoritative, int maxAge, int maxResponses, short minHopCount, short maxHopCount)
Implementation of
I_OverlaySocket.getLogicalAddress(String)
. Delegates
call to an instance of Naming
.
getLogicalAddressByName
in interface I_OverlaySocket
name
- The name for which a logical address lookup is being performedrequireTrusted
- If true only trusted bindings will be acceptedtimeout
- Time in milliseconds before this query will be ended. Can be Naming.WAIT_INDEFINITELY.requireSerialNumberMatch
- Each query has a unique serial number assigned to it. If this parameter is true then
the serial number of a valid response must match the serial number of a query.requireAuthoritative
- If true only bindings received from the authoritative peer will be acceptedmaxAge
- The maximum age in milliseconds of an acceptable
query. Calculated from the time of the query for already cached
bindings; calculated from time of receipt for bindings received
after the query is made.maxResponses
- The query will end when this number of responses are received. Can be Naming.NO_RESPONSE_LIMIT.minHopCount
- The minimum number of hops that a query must make before it is not propagated further.maxHopCount
- The maximum number of hops that a query can make before it is not propagated further.
java.lang.UnsupportedOperationException
- if naming is not configuredNaming
,
I_OverlaySocket.getLogicalAddressByName(String, boolean, long, boolean, boolean, int, int, short, short)
public int getLogicalAddressByNameNonBlocking(java.lang.String name)
Implementation of
I_OverlaySocket.getLogicalAddressNonBlocking(String)
. Delegates
call to an instance of Naming
.
getLogicalAddressByNameNonBlocking
in interface I_OverlaySocket
java.lang.UnsupportedOperationException
- if naming is not configuredNaming
,
I_OverlaySocket.getLogicalAddressByNameNonBlocking(String)
public int getLogicalAddressByNameNonBlocking(java.lang.String name, boolean requireTrusted, long timeout, boolean requireSerialNumberMatch, boolean requireAuthoritative, int maxAge, int maxResponses, short minHopCount, short maxHopCount)
Implementation of
I_OverlaySocket.getLogicalAddressNonBlocking(String)
. Delegates
call to an instance of Naming
.
getLogicalAddressByNameNonBlocking
in interface I_OverlaySocket
name
- The name for which a logical address lookup is being performedrequireTrusted
- If true only trusted bindings will be acceptedtimeout
- Time in milliseconds before this query will be ended. Can be Naming.WAIT_INDEFINITELY.requireSerialNumberMatch
- Each query has a unique serial number assigned to it. If this parameter is true then
the serial number of a valid response must match the serial number of a query.requireAuthoritative
- If true only bindings received from the authoritative peer will be acceptedmaxAge
- The maximum age in milliseconds of an acceptable
query. Calculated from the time of the query for already cached
bindings; calculated from time of receipt for bindings received
after the query is made.maxResponses
- The query will end when this number of responses are received. Can be Naming.NO_RESPONSE_LIMIT.minHopCount
- The minimum number of hops that a query must make before it is not propagated further.maxHopCount
- The maximum number of hops that a query can make before it is not propagated further.
java.lang.UnsupportedOperationException
- if naming is not configuredNaming
,
I_OverlaySocket.getLogicalAddressByNameNonBlocking(String, boolean, long, boolean, boolean, int, int, short, short)
public void installTrustedNamingCertificate(java.security.cert.Certificate certificate)
Implementation of
I_OverlaySocket.installTrustedNamingCertificate()
. Delegates call to an
instance of Naming
.
installTrustedNamingCertificate
in interface I_OverlaySocket
java.lang.UnsupportedOperationException
- if naming is not configuredNaming
,
I_OverlaySocket.installTrustedNamingCertificate(Certificate)
public hypercast.I_OverlayMessage createMessage(byte[] payload, int length)
public hypercast.I_OverlayMessage createMessage(byte[] payload, int length, int servicenumber)
public hypercast.I_OverlayMessage createMessage(byte[] payload, int length, byte[] streamid)
public hypercast.I_OverlayMessage createMessage()
createMessage(byte [])
with parameter of null
.
createMessage(byte [])
public hypercast.I_OverlayMessage createMessage(byte[] payload)
createMessage
in interface I_OverlaySocket
payload
- The payload of the message.public hypercast.I_OverlayMessage createMessage(byte[] payload, short serviceNumber)
createMessage
in interface I_OverlaySocket
payload
- The data of the application programserviceNumber
- The service (FSM) that will handle the application data message
HyperCastWarningRuntimeException
- if message store is not active or service type is not supportedpublic hypercast.I_OverlayMessage createMessage(byte[] payload, byte[] streamid)
payload
- the payload of the new message, it will be stored in a payload extensionstreamid
- the stream id that identifies the service that the new message will be associated with (for (de)multiplexing), this value must be 4 bytes in length
HyperCastWarningRuntimeException
- if there is no message store configured, this is not a configuration exception because the programmer choose to create this message despite the configuration which may be correct or incorrect.public hypercast.I_LogicalAddress createLogicalAddress(byte[] encodedLogicalAddress, int offset)
createLogicalAddress
in interface I_OverlaySocket
public hypercast.I_LogicalAddress createLogicalAddress(java.lang.String logicalAddressString)
createLogicalAddress
in interface I_OverlaySocket
public void setLogicalAddress(hypercast.I_LogicalAddress logicalAddress)
setLogicalAddress
in interface I_OverlaySocket
public hypercast.I_LogicalAddress getLogicalAddress()
getLogicalAddress
in interface I_OverlaySocket
public void appmsgArrived(hypercast.I_OverlayMessage message, hypercast.I_ReceiveCallback callback)
public byte[] getUniqueIdentifier()
getUniqueIdentifier
in interface I_OverlaySocket
public short generateMsgIdentifier()
public short generateStreamIdentifier()
public hypercast.I_LogicalAddress getParent(hypercast.I_LogicalAddress root)
getParent
in interface I_OverlaySocket
public hypercast.I_LogicalAddress[] getChildren(hypercast.I_LogicalAddress root)
getChildren
in interface I_OverlaySocket
public hypercast.I_LogicalAddress[] getNeighbors()
getNeighbors
in interface I_OverlaySocket
public void messageArrivedFromAdapter(hypercast.I_Message msg)
This method implements the heart of the "Forwarding Engine." The bulk of the remaining portions of the forwarding engine can be found in the methods with the prefix "forward"
Validates the received message, delivers it to either an application or a buffering store (e.g. message store), and decides whether or not to forward it to other nodes depending on the delivery mechanism of the message and the configuration of any buffering stores. This method is called from the socket adapter thread.
This method is executed for its side effects only; there is no return value. Before calling one of the "forward" methods, this method can return, effectively dropping the message
.
messageArrivedFromAdapter
in interface I_AdapterCallback
msg
- The message that has arrived from the adapter.
HyperCastWarningRuntimeException
HyperCastFatalRuntimeException
public void sendToAll(hypercast.I_OverlayMessage message)
sendToAll
in interface I_OverlaySocket
message
- The overlay application message that is sent.
HyperCastFatalRuntimeException
- when the message is not an OL_Messagepublic void sendToChildren(hypercast.I_OverlayMessage message, hypercast.I_LogicalAddress root)
sendToChildren
in interface I_OverlaySocket
message
- the overlay application message to be sent outroot
- the logical address of the data source root
HyperCastFatalRuntimeException
public void sendToAllNeighbors(hypercast.I_OverlayMessage message)
sendToAllNeighbors
in interface I_OverlaySocket
message
- the overlay application message to be sent out
HyperCastFatalRuntimeException
public void sendToParent(hypercast.I_OverlayMessage message, hypercast.I_LogicalAddress root)
sendToParent
in interface I_OverlaySocket
message
- the overlay application message to be sent outroot
- logical address of the data source root
HyperCastFatalRuntimeException
public void sendToNode(hypercast.I_OverlayMessage message, hypercast.I_LogicalAddress destinationLogicalAddress)
sendToNode
in interface I_OverlaySocket
message
- the overlay application message to be sent outdestinationLogicalAddress
- the logical address of destination node
HyperCastFatalRuntimeException
public void sendFlood(hypercast.I_OverlayMessage message)
sendFlood
in interface I_OverlaySocket
message
- the overlay application message to be sent out
HyperCastFatalRuntimeException
public void sendIncast(hypercast.I_OverlayMessage message, byte[] messageid, hypercast.I_LogicalAddress root)
message
- the overlay application message to be sent out
HyperCastFatalRuntimeException
public hypercast.I_OverlayMessage receive()
receive
in interface I_OverlaySocket
public void setSoTimeout(int timeout)
setSoTimeout
in interface I_OverlaySocket
timeout
- the specified timeout in milliseconds.public int getSoTimeout()
getSoTimeout
in interface I_OverlaySocket
public void setHopLimit(short hopLimit)
setHopLimit
in interface I_OverlaySocket
for an explanation of the interpretation of the field value.
public short getHopLimit()
getHopLimit
in interface I_OverlaySocket
public void timerExpired(java.lang.Object time_id)
timerExpired
in interface I_AdapterCallback
public hypercast.I_Message restoreMessage(byte[] recvbuff, int[] validBytesStart, int validBytesEnd)
restoreMessage
in interface I_AdapterCallback
recvbuff
- byte array of datavalidBytesStart
- the offset from where to create the messagevalidBytesEnd
- the total valid bytes length in this array
public java.lang.String getStatsName()
I_Stats
getStatsName
in interface I_Stats
I_Stats.getStatsName()
public void setStatsName(java.lang.String name)
I_Stats
setStatsName
in interface I_Stats
name
- the name assigned to the I_Stats instance.I_Stats.setStatsName(String)
public org.w3c.dom.Element[] getStats(org.w3c.dom.Document doc, org.apache.xpath.XPath xpath) throws HyperCastStatsException
I_Stats
getStats
in interface I_Stats
xpath
- Specifies the statistic subtree to query.doc
- The document is used as a factory to create XML
objects such as Nodes and Elements as needed. TODO: describe
how the XML document in the doc is used.
HyperCastStatsException
- If the xpath does not specify a valid subtree.I_Stats.getStats(org.w3c.dom.Document, org.apache.xpath.XPath)
public org.w3c.dom.Element[] setStats(org.w3c.dom.Document doc, org.apache.xpath.XPath xpath, org.w3c.dom.Element newValue) throws HyperCastStatsException
I_Stats
setStats
in interface I_Stats
xpath
- Specifies the statistic subtree to use when updating values.doc
- The document is used as a factory to create XML
objects such as Nodes and Elements as needed. TODO: describe
how the XML document in the doc is used.
HyperCastStatsException
- If the xpath does not specify a
valid subtree or if any part of the the subtree is read-only,
or if the newValue
does not conform with the
expected format.I_Stats.setStats(org.w3c.dom.Document, org.apache.xpath.XPath, org.w3c.dom.Element)
public org.w3c.dom.Element[] getReadSchema(org.w3c.dom.Document doc, org.apache.xpath.XPath xpath) throws HyperCastStatsException
I_Stats
getReadSchema
in interface I_Stats
HyperCastStatsException
- If some part of the specified
subtree does not correctly implement this interface method.I_Stats.getReadSchema(org.w3c.dom.Document, org.apache.xpath.XPath)
public org.w3c.dom.Element[] getWriteSchema(org.w3c.dom.Document doc, org.apache.xpath.XPath xpath) throws HyperCastStatsException
I_Stats
getWriteSchema
in interface I_Stats
HyperCastStatsException
- If some part of the specified
subtree does not correctly implement this interface method.I_Stats.getWriteSchema(org.w3c.dom.Document, org.apache.xpath.XPath)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |