public class Client extends Object implements DelayedMulticastAnnouncementDecoder, MulticastRequestEncoder
net.jini.discovery.x500.SHA1withRSA format.| Constructor and Description |
|---|
Client()
Constructs a new instance.
|
| Modifier and Type | Method and Description |
|---|---|
MulticastAnnouncement |
decodeMulticastAnnouncement(ByteBuffer buf,
InvocationConstraints constraints)
Decodes the multicast announcement data contained in the given buffer in
a manner that satisfies the specified absolute constraints, returning a
MulticastAnnouncement instance that contains the decoded data. |
MulticastAnnouncement |
decodeMulticastAnnouncement(ByteBuffer buf,
InvocationConstraints constraints,
boolean delayConstraintCheck)
Decodes the multicast announcement data contained in the given buffer in
a manner that satisfies the specified absolute constraints, returning a
MulticastAnnouncement instance that contains the decoded data,
with constraint checking optionally delayed. |
void |
encodeMulticastRequest(MulticastRequest request,
DatagramBufferFactory bufs,
InvocationConstraints constraints)
Encodes the given multicast request 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.
|
public String getFormatName()
DiscoveryFormatProvidergetFormatName in interface DiscoveryFormatProviderpublic void encodeMulticastRequest(MulticastRequest request, DatagramBufferFactory bufs, InvocationConstraints constraints) throws IOException
MulticastRequestEncodernull constraints are
considered equivalent to empty constraints. Multicast request 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.encodeMulticastRequest in interface MulticastRequestEncoderrequest - the request 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 MulticastAnnouncement decodeMulticastAnnouncement(ByteBuffer buf, InvocationConstraints constraints) throws IOException
MulticastAnnouncementDecoderMulticastAnnouncement instance that contains the decoded data.
null constraints are considered equivalent to empty
constraints. All the specified constraints are checked before this
method returns.decodeMulticastAnnouncement in interface MulticastAnnouncementDecoderbuf - a buffer containing the packet data to decode. The
multicast announcement data must begin at position zero of
buf.constraints - the constraints to apply when decoding the data, or
nullIOException - if an error occurs in interpreting the datapublic MulticastAnnouncement decodeMulticastAnnouncement(ByteBuffer buf, InvocationConstraints constraints, boolean delayConstraintCheck) throws IOException
DelayedMulticastAnnouncementDecoderMulticastAnnouncement instance that contains the decoded data,
with constraint checking optionally delayed.
null constraints are considered equivalent to empty
constraints. Constraint checking may be delayed using the
delayConstraintCheck flag.
If the delayConstraintCheck flag is true,
the method behaves as follows:
MulticastAnnouncement's
checkConstraints
method must be invoked to complete checking of all the constraints.
MulticastAnnouncement can be invoked are always
checked before this method returns.delayConstraintCheck is false,
all the specified constraints are checked before this method returns.decodeMulticastAnnouncement in interface DelayedMulticastAnnouncementDecoderbuf - a buffer containing the packet data to decode. The contents
of buf may be used on subsequent invocations of the returned
MulticastAnnouncement instance's
checkConstraints method. The caller must ensure that the
contents of buf are not modified before invocation of the
checkConstraints method. Additionally, multicast
announcement data must begin at position zero of buf.constraints - the constraints to apply when decoding the data, or
nulldelayConstraintCheck - flag to control delayed constraint checkingIOException - if an error occurs in interpreting the dataCopyright 2007-2013, multiple authors.
Licensed under the Apache License, Version 2.0, see the NOTICE file for attributions.