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 Object
implements com.opensymphony.xwork.interceptor.Interceptor


Constructor Summary
AbstractAwareInterceptor()
           
 
Method Summary
 void destroy()
           
protected  String getParameter(String parameterName)
           
protected  String getSessionAttribute(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(String parameterName)
           
protected  boolean hasSessionAttribute(String key)
          Detects if a session attribute exists on the current session.
 void init()
           
abstract  String intercept(com.opensymphony.xwork.ActionInvocation actionInvocation)
           
protected  void setResponseHeader(String name, String value)
          Set the value of the specified response header.
protected  void setSessionAttribute(String key, 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 String intercept(com.opensymphony.xwork.ActionInvocation actionInvocation)
                          throws Exception
Specified by:
intercept in interface com.opensymphony.xwork.interceptor.Interceptor
Throws:
Exception

getParameter

protected String getParameter(String parameterName)

hasParameter

protected boolean hasParameter(String parameterName)

getUser

protected com.atlassian.user.User getUser()

hasSessionAttribute

protected boolean hasSessionAttribute(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 String getSessionAttribute(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(String key,
                                   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(String name,
                                 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-2011 Atlassian. All Rights Reserved.