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

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

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

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

 ETYPE-INFO              ::= SEQUENCE OF 

Author:
Apache Directory Project

Constructor Summary
ETypeInfo()
          Creates a new instance of ETypeInfo.
ETypeInfo(ETypeInfoEntry[] etypeInfoEntries)
          Creates a new instance of ETypeInfo.
 
Method Summary
 void addETypeInfoEntry(ETypeInfoEntry etypeInfoEntry)
          Adds an ETypeInfoEntry to the list
 int computeLength()
          Compute the ETypeInfo length
 boolean contains(ETypeInfoEntry etypeInfoEntry)
          Returns true if this ETypeInfoEntry contains a specified ETypeInfoEntry.
 ByteBuffer encode(ByteBuffer buffer)
          Encode the ETypeInfo message to a PDU.
 boolean equals(ETypeInfo that)
          Returns true if two ETypeInfo are equal.
 ETypeInfoEntry[] getETypeInfoEntries()
          Returns the contained ETypeInfoEntrys 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

ETypeInfo

public ETypeInfo()
Creates a new instance of ETypeInfo.


ETypeInfo

public ETypeInfo(ETypeInfoEntry[] etypeInfoEntries)
Creates a new instance of ETypeInfo.

Parameters:
etypeInfoEntries - The associated etypeInfoEntries
Method Detail

addETypeInfoEntry

public void addETypeInfoEntry(ETypeInfoEntry etypeInfoEntry)
Adds an ETypeInfoEntry to the list

Parameters:
etypeInfoEntry - The ETypeInfoEntry to add

contains

public boolean contains(ETypeInfoEntry etypeInfoEntry)
Returns true if this ETypeInfoEntry contains a specified ETypeInfoEntry.

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

hashCode

public int hashCode()

Overrides:
hashCode in class Object

equals

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

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

getETypeInfoEntries

public ETypeInfoEntry[] getETypeInfoEntries()
Returns the contained ETypeInfoEntrys as an array.

Returns:
An array of ETypeInfoEntrys.

computeLength

public int computeLength()
Compute the ETypeInfo length
 ETypeInfo :
 
 0x30 L1 ETypeInfo sequence of ETypeInfoEntry
  |
  +--> 0x30 L2[1] ETypeInfoEntry[1]
  |
  +--> 0x30 L2[2] ETypeInfoEntry[2]
  |
  ...
  |
  +--> 0x30 L2[n] ETypeInfoEntry[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 ETypeInfo message to a PDU.
 ETypeInfo :
 
 0x30 LL
   0x30 LL ETypeInfoEntry[1] 
   0x30 LL ETypeInfoEntry[1]
   ... 
   0x30 LL ETypeInfoEntry[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.