org.apache.directory.shared.kerberos.components
Class ETypeInfo2

java.lang.Object
  extended by org.apache.directory.shared.asn1.AbstractAsn1Object
      extended by org.apache.directory.shared.kerberos.components.ETypeInfo2
All Implemented Interfaces:
org.apache.directory.shared.asn1.Asn1Object

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

Store a list of ETYPE-INFO2. The ASN.1 grammar is :

 ETYPE-INFO2              ::= SEQUENCE SIZE (1..MAX) OF ETYPE-INFO2-ENTRY

Author:
Apache Directory Project

Constructor Summary
ETypeInfo2()
          Creates a new instance of ETypeInfo2.
ETypeInfo2(ETypeInfo2Entry[] etypeInfo2Entries)
          Creates a new instance of ETypeInfo2.
 
Method Summary
 void addETypeInfo2Entry(ETypeInfo2Entry etypeInfo2Entry)
          Adds an ETypeInfo2Entry to the list
 int computeLength()
          Compute the ETypeInfo2 length
 boolean contains(ETypeInfo2Entry etypeInfo2Entry)
          Returns true if this ETypeInfo2Entry contains a specified ETypeInfo2Entry.
 ByteBuffer encode(ByteBuffer buffer)
          Encode the ETypeInfo2 message to a PDU.
 boolean equals(ETypeInfo2 that)
          Returns true if two ETypeInfo2 are equal.
 ETypeInfo2Entry[] getETypeInfo2Entries()
          Returns the contained ETypeInfo2Entrys as an array.
 int hashCode()
          
 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, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ETypeInfo2

public ETypeInfo2()
Creates a new instance of ETypeInfo2.


ETypeInfo2

public ETypeInfo2(ETypeInfo2Entry[] etypeInfo2Entries)
Creates a new instance of ETypeInfo2.

Parameters:
etypeInfo2Entries - The associated etypeInfo2Entries
Method Detail

addETypeInfo2Entry

public void addETypeInfo2Entry(ETypeInfo2Entry etypeInfo2Entry)
Adds an ETypeInfo2Entry to the list

Parameters:
etypeInfo2Entry - The ETypeInfo2Entry to add

contains

public boolean contains(ETypeInfo2Entry etypeInfo2Entry)
Returns true if this ETypeInfo2Entry contains a specified ETypeInfo2Entry.

Parameters:
address - The etypeInfo2Entry we are looking for in the existing list
Returns:
true if this ETypeInfo2Entry contains a specified ETypeInfo2Entry.

hashCode

public int hashCode()

Overrides:
hashCode in class Object

equals

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

Parameters:
that - The ETypeInfo2 we want to compare with the current one
Returns:
true if two ETypeInfo2 are equal.

getETypeInfo2Entries

public ETypeInfo2Entry[] getETypeInfo2Entries()
Returns the contained ETypeInfo2Entrys as an array.

Returns:
An array of ETypeInfo2Entrys.

computeLength

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


encode

public ByteBuffer encode(ByteBuffer buffer)
                  throws org.apache.directory.shared.asn1.EncoderException
Encode the ETypeInfo2 message to a PDU.
 ETypeInfo2 :
 
 0x30 LL
   0x30 LL ETypeInfo2Entry[1] 
   0x30 LL ETypeInfo2Entry[1]
   ... 
   0x30 LL ETypeInfo2Entry[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.EncoderException

toString

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


Copyright © 2003-2012 The Apache Software Foundation. All Rights Reserved.