org.exoplatform.services.security.sso.spnego.message
Class ParseState

java.lang.Object
  extended by org.exoplatform.services.security.sso.spnego.message.ParseState

public class ParseState
extends Object

Author:
Martin Algesten

Constructor Summary
ParseState(byte[] token)
           
 
Method Summary
 void addMessage(String message)
           
 boolean expect(int[] b, boolean moveIndex, String message)
          Expects the current position to hold the given array of values b.
 boolean expect(int b, boolean moveIndex, String message)
          Expects the current position to hold value b.
 int getIndex()
           
 LinkedList<String> getMessages()
           
 String getPhase()
           
 byte[] getToken()
           
 int parseDerLength()
          Calculates the der encoded length at the current position and moves the index counter forward.
 void setIndex(int index)
           
 void setMessages(LinkedList<String> messages)
           
 void setPhase(String phase)
           
 void setToken(byte[] token)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ParseState

public ParseState(byte[] token)
Method Detail

expect

public boolean expect(int b,
                      boolean moveIndex,
                      String message)
Expects the current position to hold value b.

Parameters:
b - The boolean to expect
moveIndex - Tells if we are to move the index counter.
message - Message to add to messages if the position does not hold the expected byte. Doesn't get added if null.
Returns:
true if the current index holds the value given.

expect

public boolean expect(int[] b,
                      boolean moveIndex,
                      String message)
Expects the current position to hold the given array of values b.

Parameters:
b - the array of values expected.
moveIndex - Tells if we are to move the index counter.
message - Message to add to messages if the position does not hold the expected bytes. Doesn't get added if null.
Returns:
true if there's a complete match between current position and the value given.

parseDerLength

public int parseDerLength()
Calculates the der encoded length at the current position and moves the index counter forward.


getIndex

public int getIndex()

setIndex

public void setIndex(int index)

getMessages

public LinkedList<String> getMessages()

setMessages

public void setMessages(LinkedList<String> messages)

addMessage

public void addMessage(String message)

getToken

public byte[] getToken()

setToken

public void setToken(byte[] token)

getPhase

public String getPhase()

setPhase

public void setPhase(String phase)


Copyright © 2009 eXo Platform SAS. All Rights Reserved.