HDIV API 2.0.4

org.hdiv.session
Interface ISession

All Known Implementing Classes:
SessionHDIV

public interface ISession

A custom wrapper for http session request that returns a wrapped http session.

Author:
Roberto Velasco

Method Summary
 void addPage(java.lang.String pageId, IPage page)
          It adds a new page to the user session.
 ICipherHTTP getDecryptCipher()
          Inilitializes the data decrypter.
 ICipherHTTP getEncryptCipher()
          Initializes the data cipher.
 IPage getPage(java.lang.String pageId)
          Returns the page with id pageId.
 java.lang.String getPageId()
          Obtains from the user session the page identifier where the current request or form is
 IState getState(java.lang.String pageId, java.lang.String stateId)
          Obtains the state identifier stateId related to the page identifier pageId.
 java.lang.String getStateHash(java.lang.String pageId, java.lang.String stateId)
          Obtains the hash of the state identifier stateId related to page identifier pageId.
 javax.servlet.http.HttpSession getWebSession()
           
 void removeEndedPages(java.lang.String conversationId)
          Deletes from session the data related to the finished flows.
 

Method Detail

addPage

void addPage(java.lang.String pageId,
             IPage page)
It adds a new page to the user session. To do this it adds a new page identifier to the cache and if it has reached the maximun size allowed, the oldest page is deleted from the session and from the cache itself.

Parameters:
pageId - Page identifier
page - Page with all the information about states

removeEndedPages

void removeEndedPages(java.lang.String conversationId)
Deletes from session the data related to the finished flows. This means a memory consumption optimization because useless objects of type IPage are deleted.

Parameters:
conversationId - finished flow identifier
Since:
HDIV 2.0.3

getState

IState getState(java.lang.String pageId,
                java.lang.String stateId)
Obtains the state identifier stateId related to the page identifier pageId.

Returns:
State identifier stateId throws HDIVException If the state doesn't exist a new HDIV exception is thrown.

getStateHash

java.lang.String getStateHash(java.lang.String pageId,
                              java.lang.String stateId)
Obtains the hash of the state identifier stateId related to page identifier pageId.

Returns:
Hash of the state identifier stateId
Throws:
HDIVException - If the state doesn't exist a new HDIV exception is thrown.

getPageId

java.lang.String getPageId()
Obtains from the user session the page identifier where the current request or form is

Returns:
Returns the pageId.

getPage

IPage getPage(java.lang.String pageId)
Returns the page with id pageId.

Parameters:
pageId - page id
Returns:
Returns the page with id pageId.
Since:
HDIV 2.0.4

getWebSession

javax.servlet.http.HttpSession getWebSession()
Returns:
Returns the HTTP session.

getEncryptCipher

ICipherHTTP getEncryptCipher()
Initializes the data cipher.

Returns:
Returns the data cipher initialized with the symmetric key
Throws:
HDIVException - If the state doesn't exist a new HDIV exception is thrown.

getDecryptCipher

ICipherHTTP getDecryptCipher()
Inilitializes the data decrypter.

Returns:
Returns the data decrypter initialized with the symmetric key.
Throws:
HDIVException - if there is an error in cipher initialization.

HDIV 2.0.4

Copyright © 2008 hdiv.org. All Rights Reserved.