com.atlassian.crowd.openid.server.action
Class BaseAction

java.lang.Object
  extended by com.opensymphony.xwork.ActionSupport
      extended by com.atlassian.crowd.openid.server.action.BaseAction
All Implemented Interfaces:
com.opensymphony.xwork.Action, com.opensymphony.xwork.LocaleProvider, com.opensymphony.xwork.TextProvider, com.opensymphony.xwork.Validateable, com.opensymphony.xwork.ValidationAware, com.uwyn.rife.continuations.ContinuableObject, Serializable, Cloneable
Direct Known Subclasses:
AllowAuthentication, ChangePassword, Console, CrowdServer, EditAllowAlways, EditProfiles, ForgottenLoginDetails, GeneralOptions, Login, Logoff, ViewAuthRecord, ViewIdentity, ViewPublicIdentity, WhiteAndBlacklist

public class BaseAction
extends com.opensymphony.xwork.ActionSupport

See Also:
Serialized Form

Field Summary
protected  String actionMessageAlertColor
          Webwork action messages color settings.
static String ALERT_BLUE
           
static String ALERT_RED
           
static String ALERT_YELLOW
           
protected  OpenIDAuthenticationManager openIDAuthenticationManager
           
protected  OpenIDPropertyManager openIDPropertyManager
           
protected  ProfileManager profileManager
           
protected  SiteManager siteManager
           
protected  UserManager userManager
           
 
Fields inherited from class com.opensymphony.xwork.ActionSupport
LOG
 
Fields inherited from interface com.opensymphony.xwork.Action
ERROR, INPUT, LOGIN, NONE, SUCCESS
 
Constructor Summary
BaseAction()
           
 
Method Summary
 void addActionMessage(String color, String message)
          Sets a UI message and the color type for the user.
static String baseUrl(javax.servlet.http.HttpServletRequest request)
           
 boolean containsActionMessages()
           
 String getActionMessageAlertColor()
          Gets the action messageo color dressing to use with the decorator.
 String getBaseURL()
           
 CrowdClient getCrowdClient()
           
 CrowdHttpAuthenticator getCrowdHttpAuthenticator()
           
 String getIdentifier()
           
 String getPrincipalName()
          Gets the user's fullname for display.
 User getRemotePrincipal()
          Gets the remote principal for the request.
protected  javax.servlet.http.HttpServletRequest getRequest()
          Gets the underlying HTTP request from the Action.
protected  javax.servlet.http.HttpSession getSession()
          Gets the HTTP session for the current user.
 String getXsrfToken()
           
 String getXsrfTokenName()
           
 boolean isAdministrator()
           
 boolean isAuthenticated()
          Checks if a principal is currently authenticated verses the Crowd security server.
 void setCrowdClient(CrowdClient crowdClient)
           
 void setCrowdHttpAuthenticator(CrowdHttpAuthenticator crowdHttpAuthenticator)
           
 void setOpenIDAuthenticationManager(OpenIDAuthenticationManager openIDAuthenticationManager)
           
 void setProfileManager(ProfileManager profileManager)
           
 void setPropertyManager(OpenIDPropertyManager openIDPropertyManager)
           
 void setSiteManager(SiteManager siteManager)
           
 void setUserManager(UserManager userManager)
           
 void setXsrfTokenGenerator(XsrfTokenGenerator xsrfTokenGenerator)
           
 
Methods inherited from class com.opensymphony.xwork.ActionSupport
addActionError, addActionMessage, addFieldError, clearErrorsAndMessages, clone, doDefault, doInput, execute, getActionErrors, getActionMessages, getErrorMessages, getErrors, getFieldErrors, getLocale, getText, getText, getText, getText, getText, getText, getText, getText, getText, getTexts, getTexts, hasActionErrors, hasActionMessages, hasErrors, hasFieldErrors, hasKey, pause, setActionErrors, setActionMessages, setFieldErrors, validate
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

actionMessageAlertColor

protected String actionMessageAlertColor
Webwork action messages color settings. Displays the type of message dressing to use.


ALERT_BLUE

public static final String ALERT_BLUE
See Also:
BaseAction#actionMessageAlertColor;, Constant Field Values

ALERT_YELLOW

public static final String ALERT_YELLOW
See Also:
BaseAction#actionMessageAlertColor;, Constant Field Values

ALERT_RED

public static final String ALERT_RED
See Also:
BaseAction#actionMessageAlertColor;, Constant Field Values

openIDPropertyManager

protected OpenIDPropertyManager openIDPropertyManager

userManager

protected UserManager userManager

siteManager

protected SiteManager siteManager

profileManager

protected ProfileManager profileManager

openIDAuthenticationManager

protected OpenIDAuthenticationManager openIDAuthenticationManager
Constructor Detail

BaseAction

public BaseAction()
Method Detail

getXsrfTokenName

public String getXsrfTokenName()

getXsrfToken

public String getXsrfToken()

isAuthenticated

public boolean isAuthenticated()
Checks if a principal is currently authenticated verses the Crowd security server.

Returns:
true if and only if the principal is currently authenticated, otherwise false.

getSession

protected javax.servlet.http.HttpSession getSession()
Gets the HTTP session for the current user.

Returns:
The HTTP session.

getRequest

protected javax.servlet.http.HttpServletRequest getRequest()
Gets the underlying HTTP request from the Action.

Returns:
the underlying HTTP request.

getRemotePrincipal

@Nullable
public User getRemotePrincipal()
                        throws InvalidAuthenticationException
Gets the remote principal for the request. Cached after the first successful call. Can return null in general, but won't for /secure actions.

Returns:
the remote principal, or null if there is no remote principal.
Throws:
InvalidAuthenticationException - if the principal for the request cannot be retrieved.

getPrincipalName

public String getPrincipalName()
                        throws InvalidAuthenticationException
Gets the user's fullname for display.

Returns:
The fullname.
Throws:
InvalidAuthenticationException

getBaseURL

public String getBaseURL()

baseUrl

public static String baseUrl(javax.servlet.http.HttpServletRequest request)

isAdministrator

public boolean isAdministrator()

getActionMessageAlertColor

public String getActionMessageAlertColor()
Gets the action messageo color dressing to use with the decorator.

Returns:
The window dressing color to use.

containsActionMessages

public boolean containsActionMessages()

setPropertyManager

public void setPropertyManager(OpenIDPropertyManager openIDPropertyManager)

setUserManager

public void setUserManager(UserManager userManager)

setSiteManager

public void setSiteManager(SiteManager siteManager)

setProfileManager

public void setProfileManager(ProfileManager profileManager)

setOpenIDAuthenticationManager

public void setOpenIDAuthenticationManager(OpenIDAuthenticationManager openIDAuthenticationManager)

getIdentifier

public String getIdentifier()
                     throws InvalidAuthenticationException
Throws:
InvalidAuthenticationException

addActionMessage

public void addActionMessage(String color,
                             String message)
Sets a UI message and the color type for the user.

Parameters:
color - The color to use.
message - The message to display.

setXsrfTokenGenerator

public void setXsrfTokenGenerator(XsrfTokenGenerator xsrfTokenGenerator)

getCrowdClient

public CrowdClient getCrowdClient()

setCrowdClient

public void setCrowdClient(CrowdClient crowdClient)

getCrowdHttpAuthenticator

public CrowdHttpAuthenticator getCrowdHttpAuthenticator()

setCrowdHttpAuthenticator

public void setCrowdHttpAuthenticator(CrowdHttpAuthenticator crowdHttpAuthenticator)


Copyright © 2014 Atlassian. All Rights Reserved.