com.sun.jini.discovery.internal
Class X500Client

java.lang.Object
  extended by com.sun.jini.discovery.internal.BaseProvider
      extended by com.sun.jini.discovery.internal.X500Provider
          extended by com.sun.jini.discovery.internal.X500Client
All Implemented Interfaces:
DelayedMulticastAnnouncementDecoder, DiscoveryFormatProvider, MulticastAnnouncementDecoder, MulticastRequestEncoder
Direct Known Subclasses:
Client.ClientImpl, Client.ClientImpl

public class X500Client
extends X500Provider
implements MulticastRequestEncoder, DelayedMulticastAnnouncementDecoder

Superclass for client-side providers for the net.jini.discovery.x500.* discovery formats.


Nested Class Summary
private  class X500Client.X500MulticastAnnouncement
           
 
Nested classes/interfaces inherited from class com.sun.jini.discovery.internal.X500Provider
X500Provider.SigningBufferFactory
 
Field Summary
 
Fields inherited from class com.sun.jini.discovery.internal.X500Provider
keyAlgorithm, keyAlgorithmOID, logger, maxSignatureLength, signatureAlgorithm
 
Fields inherited from class com.sun.jini.discovery.internal.BaseProvider
formatName
 
Constructor Summary
protected X500Client(String formatName, String signatureAlgorithm, int maxSignatureLength, String keyAlgorithm, String keyAlgorithmOID)
          Creates an instance with the given attributes.
 
Method Summary
 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.
 
Methods inherited from class com.sun.jini.discovery.internal.X500Provider
checkAuthenticationPermission, getCertificate, getPrivateCredentials, secureThrow, verify
 
Methods inherited from class com.sun.jini.discovery.internal.BaseProvider
getFormatName
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.sun.jini.discovery.DiscoveryFormatProvider
getFormatName
 

Constructor Detail

X500Client

protected X500Client(String formatName,
                     String signatureAlgorithm,
                     int maxSignatureLength,
                     String keyAlgorithm,
                     String keyAlgorithmOID)
Creates an instance with the given attributes.

Method Detail

encodeMulticastRequest

public void encodeMulticastRequest(MulticastRequest request,
                                   DatagramBufferFactory bufs,
                                   InvocationConstraints constraints)
                            throws IOException
Description copied from interface: MulticastRequestEncoder
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. null 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.

Specified by:
encodeMulticastRequest in interface MulticastRequestEncoder
Parameters:
request - the request data to encode
bufs - the factory for producing buffers in which to write encoded data
constraints - the constraints to apply when encoding the data, or null
Throws:
IOException - if an error occurs in encoding the data to send
UnsupportedConstraintException - if unable to satisfy the specified constraints

decodeMulticastAnnouncement

public MulticastAnnouncement decodeMulticastAnnouncement(ByteBuffer buf,
                                                         InvocationConstraints constraints,
                                                         boolean delayConstraintCheck)
                                                  throws IOException
Description copied from interface: DelayedMulticastAnnouncementDecoder
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. 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:

If delayConstraintCheck is false, all the specified constraints are checked before this method returns.

Specified by:
decodeMulticastAnnouncement in interface DelayedMulticastAnnouncementDecoder
Parameters:
buf - 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 null
delayConstraintCheck - flag to control delayed constraint checking
Returns:
the decoded multicast announcement data
Throws:
IOException - if an error occurs in interpreting the data

decodeMulticastAnnouncement

public MulticastAnnouncement decodeMulticastAnnouncement(ByteBuffer buf,
                                                         InvocationConstraints constraints)
                                                  throws IOException
Description copied from interface: MulticastAnnouncementDecoder
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. null constraints are considered equivalent to empty constraints. All the specified constraints are checked before this method returns.

Specified by:
decodeMulticastAnnouncement in interface MulticastAnnouncementDecoder
Parameters:
buf - 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 null
Returns:
the decoded multicast announcement data
Throws:
IOException - if an error occurs in interpreting the data


Copyright 2007-2010, multiple authors.
Licensed under the Apache License, Version 2.0, see the NOTICE file for attributions.