org.apache.directory.server.kerberos.shared.messages.value
Class HostAddresses

java.lang.Object
  extended by org.apache.directory.shared.asn1.AbstractAsn1Object
      extended by org.apache.directory.server.kerberos.shared.messages.value.HostAddresses
All Implemented Interfaces:
org.apache.directory.shared.asn1.Asn1Object

public class HostAddresses
extends org.apache.directory.shared.asn1.AbstractAsn1Object

Store a list of addresses. The ASN.1 grammar is : -- NOTE: HostAddresses is always used as an OPTIONAL field and -- should not be empty. HostAddresses -- NOTE: subtly different from rfc1510, -- but has a value mapping and encodes the same ::= SEQUENCE OF HostAddress

Version:
$Rev: 902575 $, $Date: 2010-01-24 15:38:06 +0100 (Sun, 24 Jan 2010) $
Author:
Apache Directory Project

Field Summary
 
Fields inherited from class org.apache.directory.shared.asn1.AbstractAsn1Object
parent
 
Constructor Summary
HostAddresses()
          Creates a new instance of HostAddresses.
HostAddresses(HostAddress[] addresses)
          Creates a new instance of HostAddresses.
 
Method Summary
 void addHostAddress(HostAddress hostAddress)
           
 int computeLength()
          Compute the hostAddresses length HostAddresses : 0x30 L1 hostAddresses sequence of HostAddresses | +--> 0x30 L2[1] Hostaddress[1] | +--> 0x30 L2[2] Hostaddress[2] | ...
 boolean contains(HostAddress address)
          Returns true if this HostAddresses contains a specified HostAddress.
 java.nio.ByteBuffer encode(java.nio.ByteBuffer buffer)
          Encode the HostAddress message to a PDU.
 boolean equals(HostAddresses that)
          Returns true if two HostAddresses are equal.
 HostAddress[] getAddresses()
          Returns the contained HostAddresss as an array.
 java.lang.String toString()
           
 
Methods inherited from class org.apache.directory.shared.asn1.AbstractAsn1Object
addLength, getCurrentLength, getExpectedLength, getParent, getTlvId, setCurrentLength, setExpectedLength, setParent
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

HostAddresses

public HostAddresses()
Creates a new instance of HostAddresses.


HostAddresses

public HostAddresses(HostAddress[] addresses)
Creates a new instance of HostAddresses.

Parameters:
addresses - The associated addresses
Method Detail

addHostAddress

public void addHostAddress(HostAddress hostAddress)

contains

public boolean contains(HostAddress address)
Returns true if this HostAddresses contains a specified HostAddress.

Parameters:
address -
Returns:
true if this HostAddresses contains a specified HostAddress.

equals

public boolean equals(HostAddresses that)
Returns true if two HostAddresses are equal.

Parameters:
that -
Returns:
true if two HostAddresses are equal.

getAddresses

public HostAddress[] getAddresses()
Returns the contained HostAddresss as an array.

Returns:
An array of HostAddresss.

computeLength

public int computeLength()
Compute the hostAddresses length HostAddresses : 0x30 L1 hostAddresses sequence of HostAddresses | +--> 0x30 L2[1] Hostaddress[1] | +--> 0x30 L2[2] Hostaddress[2] | ... | +--> 0x30 L2[n] Hostaddress[n] where L1 = sum( L2[1], l2[2], ..., L2[n] )

Specified by:
computeLength in interface org.apache.directory.shared.asn1.Asn1Object
Specified by:
computeLength in class org.apache.directory.shared.asn1.AbstractAsn1Object

encode

public java.nio.ByteBuffer encode(java.nio.ByteBuffer buffer)
                           throws org.apache.directory.shared.asn1.codec.EncoderException
Encode the HostAddress message to a PDU. HostAddress : 0x30 LL 0x30 LL hostaddress[1] 0x30 LL hostaddress[1] ... 0x30 LL hostaddress[1]

Specified by:
encode in interface org.apache.directory.shared.asn1.Asn1Object
Overrides:
encode in class org.apache.directory.shared.asn1.AbstractAsn1Object
Parameters:
buffer - The buffer where to put the PDU. It should have been allocated before, with the right size.
Returns:
The constructed PDU.
Throws:
org.apache.directory.shared.asn1.codec.EncoderException

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object
See Also:
Object.toString()


Copyright © 2003-2011 Apache Software Foundation. All Rights Reserved.