public class Server extends Object implements MulticastRequestDecoder, MulticastAnnouncementEncoder, UnicastDiscoveryServer
net.jini.discovery.plaintext discovery format.| Constructor and Description |
|---|
Server()
Constructs a new instance.
|
| Modifier and Type | Method and Description |
|---|---|
void |
checkUnicastDiscoveryConstraints(InvocationConstraints constraints)
Checks and returns normally if this server is capable of fulfilling the given absolute
constraints.
|
MulticastRequest |
decodeMulticastRequest(ByteBuffer buf,
InvocationConstraints constraints,
ClientSubjectChecker checker)
Decodes the multicast request data contained in the given buffer in a manner that satisfies
the specified absolute constraints and client subject checker (if any), returning a
MulticastRequest instance that contains the decoded data. |
void |
encodeMulticastAnnouncement(MulticastAnnouncement announcement,
DatagramBufferFactory bufs,
InvocationConstraints constraints)
Encodes the given multicast announcement data into byte buffers obtained from the provided
datagram buffer factory, in a manner that satisfies the specified absolute constraints.
|
String |
getFormatName()
Returns the name of the format implemented by this provider.
|
void |
handleUnicastDiscovery(UnicastResponse response,
Socket socket,
InvocationConstraints constraints,
ClientSubjectChecker checker,
Collection context,
ByteBuffer received,
ByteBuffer sent)
Handles the server side of unicast discovery, transmitting the given response data over the
provided socket using the given collection of object stream context objects in a manner that
satisfies the specified absolute constraints and client subject checker (if any).
|
public String getFormatName()
DiscoveryFormatProvidergetFormatName in interface DiscoveryFormatProviderpublic MulticastRequest decodeMulticastRequest(ByteBuffer buf, InvocationConstraints constraints, ClientSubjectChecker checker) throws IOException
MulticastRequestDecoderMulticastRequest instance that contains the decoded data. null constraints are
considered equivalent to empty constraints. All the specified constraints are checked before
this method returns.decodeMulticastRequest in interface MulticastRequestDecoderbuf - a buffer containing the packet data to decode. The multicast request data
must begin at position zero of buf.constraints - the constraints to apply when decoding the data, or nullchecker - the object to use to check the client subject, or nullIOException - if an error occurs in interpreting the dataUnsupportedConstraintException - if unable to satisfy the specified constraintspublic void encodeMulticastAnnouncement(MulticastAnnouncement announcement, DatagramBufferFactory bufs, InvocationConstraints constraints) throws IOException
MulticastAnnouncementEncodernull constraints are considered equivalent to empty constraints. Multicast
announcement data that is too large to fit in a single datagram buffer is split across
multiple buffers, with the constraints applied to each; this method is responsible for
determining if and when to split the data based on the available space in the obtained
buffers.encodeMulticastAnnouncement in interface MulticastAnnouncementEncoderannouncement - the announcement data to encodebufs - the factory for producing buffers in which to write encoded dataconstraints - the constraints to apply when encoding the data, or nullIOException - if an error occurs in encoding the data to
sendUnsupportedConstraintException - if unable to satisfy the specified
constraintspublic void checkUnicastDiscoveryConstraints(InvocationConstraints constraints) throws UnsupportedConstraintException
UnicastDiscoveryServernull constraints are considered equivalent to empty constraints.checkUnicastDiscoveryConstraints in interface UnicastDiscoveryServerconstraints - the constraints to check, or nullUnsupportedConstraintException - if unable to satisfy the specified constraintspublic void handleUnicastDiscovery(UnicastResponse response, Socket socket, InvocationConstraints constraints, ClientSubjectChecker checker, Collection context, ByteBuffer received, ByteBuffer sent) throws IOException
UnicastDiscoveryServernull constraints are considered
equivalent to empty constraints.handleUnicastDiscovery in interface UnicastDiscoveryServerresponse - the unicast response data to transmitsocket - the socket on which to handle unicast discoveryconstraints - the constraints to apply to unicast discovery, or nullchecker - the object to use to check the client subject, or nullcontext - the collection of context information objects to use when marshalling the
registrar proxyreceived - a buffer containing the data already receivedsent - a buffer containing the data already sentIOException - if an error occurs in interpreting received data or in
formatting data to sendUnsupportedConstraintException - if unable to satisfy the specified constraintsCopyright © GigaSpaces.