com.atlassian.confluence.setup.webwork
Class AbstractAwareInterceptor

java.lang.Object
  extended by com.atlassian.confluence.setup.webwork.AbstractAwareInterceptor
All Implemented Interfaces:
com.opensymphony.xwork.interceptor.Interceptor
Direct Known Subclasses:
BootstrapAwareInterceptor, CaptchaInterceptor, CommentAwareInterceptor, PageAwareInterceptor, SpaceAwareInterceptor, UserAwareInterceptor, WebSudoInterceptor

public abstract class AbstractAwareInterceptor
extends java.lang.Object
implements com.opensymphony.xwork.interceptor.Interceptor


Constructor Summary
AbstractAwareInterceptor()
           
 
Method Summary
 void destroy()
           
protected  java.lang.String getParameter(java.lang.String parameterName)
           
protected  java.lang.String getSessionAttribute(java.lang.String key)
          Find the session attribute by the specified key, or null if it doesnt exist or if there is no session.
protected  com.atlassian.user.User getUser()
           
protected  boolean hasParameter(java.lang.String parameterName)
           
protected  boolean hasSessionAttribute(java.lang.String key)
          Detects if a session attribute exists on the current session.
 void init()
           
abstract  java.lang.String intercept(com.opensymphony.xwork.ActionInvocation actionInvocation)
           
protected  void setResponseHeader(java.lang.String name, java.lang.String value)
          Set the value of the specified response header.
protected  void setSessionAttribute(java.lang.String key, java.lang.Object value)
          Set the session attribute by the specified key to the specified value.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbstractAwareInterceptor

public AbstractAwareInterceptor()
Method Detail

destroy

public void destroy()
Specified by:
destroy in interface com.opensymphony.xwork.interceptor.Interceptor

init

public void init()
Specified by:
init in interface com.opensymphony.xwork.interceptor.Interceptor

intercept

public abstract java.lang.String intercept(com.opensymphony.xwork.ActionInvocation actionInvocation)
                                    throws java.lang.Exception
Specified by:
intercept in interface com.opensymphony.xwork.interceptor.Interceptor
Throws:
java.lang.Exception

getParameter

protected java.lang.String getParameter(java.lang.String parameterName)

hasParameter

protected boolean hasParameter(java.lang.String parameterName)

getUser

protected com.atlassian.user.User getUser()

hasSessionAttribute

protected boolean hasSessionAttribute(java.lang.String key)
Detects if a session attribute exists on the current session.

Parameters:
key - the key of the attribute to check for
Returns:
true of a current session exists and contains the specified key

getSessionAttribute

protected java.lang.String getSessionAttribute(java.lang.String key)
Find the session attribute by the specified key, or null if it doesnt exist or if there is no session.

Parameters:
key - the key to look find the attribute by
Returns:
the session value as a String

setSessionAttribute

protected void setSessionAttribute(java.lang.String key,
                                   java.lang.Object value)
Set the session attribute by the specified key to the specified value. If there is no session active this method does nothing.

Parameters:
key - the key to look find the attribute by
value - the value to set the attribute to

setResponseHeader

protected void setResponseHeader(java.lang.String name,
                                 java.lang.String value)
Set the value of the specified response header.

Parameters:
name - the name of the header item
value - the value of the header item


Copyright © 2003-2010 Atlassian. All Rights Reserved.