public class Server extends Object implements DelayedMulticastRequestDecoder, MulticastAnnouncementEncoder
net.jini.discovery.x500.SHA1withRSA format.| Constructor and Description |
|---|
Server()
Constructs a new instance.
|
| Modifier and Type | Method and Description |
|---|---|
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. |
MulticastRequest |
decodeMulticastRequest(ByteBuffer buf,
InvocationConstraints constraints,
ClientSubjectChecker checker,
boolean delayConstraintCheck)
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, with constraint checking optionally
delayed. |
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.
|
public String getFormatName()
DiscoveryFormatProvidergetFormatName in interface DiscoveryFormatProviderpublic 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 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 datapublic MulticastRequest decodeMulticastRequest(ByteBuffer buf, InvocationConstraints constraints, ClientSubjectChecker checker, boolean delayConstraintCheck) throws IOException
DelayedMulticastRequestDecoderMulticastRequest 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:
MulticastRequest's
checkConstraints
method must be invoked to complete checking of all the constraints.
MulticastRequest can be invoked are always
checked before this method returns.delayConstraintCheck is false, all the
specified constraints are checked before this method returns.decodeMulticastRequest in interface DelayedMulticastRequestDecoderbuf - a buffer containing the packet data to decode. The contents
of buf may be used on subsequent invocations of the returned
MulticastRequest instance's checkConstraints
method. The caller must ensure that the contents of buf are
not modified before invocation of the checkConstraints
method. Additionally, 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
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.