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

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

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

Store a list of METHOD-DATA The ASN.1 grammar is :

 METHOD-DATA     ::= SEQUENCE OF 

Author:
Apache Directory Project

Constructor Summary
MethodData()
          Creates a new instance of MethodData.
 
Method Summary
 void addPaData(PaData paData)
          Adds an PaData to the list
 int computeLength()
          Compute the METHOD-DATA length
 boolean contains(PaData paData)
          Returns true if this PaData contains a specified PaData.
 ByteBuffer encode(ByteBuffer buffer)
          Encode the METHOD-DATA message to a PDU.
 boolean equals(MethodData that)
          Returns true if two MethodData are equal.
 PaData[] getPaDatas()
          Returns the contained PaDatas 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

MethodData

public MethodData()
Creates a new instance of MethodData.

Method Detail

addPaData

public void addPaData(PaData paData)
Adds an PaData to the list

Parameters:
paData - The PaData to add

contains

public boolean contains(PaData paData)
Returns true if this PaData contains a specified PaData.

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

hashCode

public int hashCode()

Overrides:
hashCode in class Object

equals

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

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

getPaDatas

public PaData[] getPaDatas()
Returns the contained PaDatas as an array.

Returns:
An array of PaDatas.

computeLength

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