org.apache.shindig.auth
Class ForwardingSecurityToken

java.lang.Object
  extended by org.apache.shindig.auth.ForwardingSecurityToken
All Implemented Interfaces:
SecurityToken

public abstract class ForwardingSecurityToken
extends Object
implements SecurityToken

A SecurityToken that forwards all methods calls to another token. Subclasses should override one or more methods to change or add behavior.

Since:
2.0.0

Constructor Summary
protected ForwardingSecurityToken(SecurityToken delegate)
           
 
Method Summary
 String getActiveUrl()
           
 String getAppId()
           
 String getAppUrl()
           
 String getAuthenticationMode()
           
 String getContainer()
           
 String getDomain()
           
 Long getExpiresAt()
           
 long getModuleId()
           
 String getOwnerId()
           
 String getTrustedJson()
           
 String getUpdatedToken()
           
 String getViewerId()
           
 boolean isAnonymous()
           
 boolean isExpired()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ForwardingSecurityToken

protected ForwardingSecurityToken(SecurityToken delegate)
Method Detail

getOwnerId

public String getOwnerId()
Specified by:
getOwnerId in interface SecurityToken
Returns:
the owner from the token, or null if there is none.

getViewerId

public String getViewerId()
Specified by:
getViewerId in interface SecurityToken
Returns:
the viewer from the token, or null if there is none.

getAppId

public String getAppId()
Specified by:
getAppId in interface SecurityToken
Returns:
the application id from the token, or null if there is none.

getDomain

public String getDomain()
Specified by:
getDomain in interface SecurityToken
Returns:
the domain from the token, or null if there is none.

getContainer

public String getContainer()
Specified by:
getContainer in interface SecurityToken
Returns:
The container.

getAppUrl

public String getAppUrl()
Specified by:
getAppUrl in interface SecurityToken
Returns:
the URL of the application

getModuleId

public long getModuleId()
Specified by:
getModuleId in interface SecurityToken
Returns:
the module ID of the application

getExpiresAt

public Long getExpiresAt()
Specified by:
getExpiresAt in interface SecurityToken
Returns:
the timestamp that this token expires or null if unknown or indeterminate

isExpired

public boolean isExpired()
Specified by:
isExpired in interface SecurityToken
Returns:
true if the token is no longer valid

getUpdatedToken

public String getUpdatedToken()
Specified by:
getUpdatedToken in interface SecurityToken
Returns:
an updated version of the token to return to the gadget, or null if there is no need to update the token.

getAuthenticationMode

public String getAuthenticationMode()
Specified by:
getAuthenticationMode in interface SecurityToken
Returns:
the authentication mechanism used to generate this security token
See Also:
AuthenticationMode

getTrustedJson

public String getTrustedJson()
Specified by:
getTrustedJson in interface SecurityToken
Returns:
a string formatted JSON object from the container, or null if there is no JSON from the container.

isAnonymous

public boolean isAnonymous()
Specified by:
isAnonymous in interface SecurityToken
Returns:
true if the token is for an anonymous viewer/owner

getActiveUrl

public String getActiveUrl()
Specified by:
getActiveUrl in interface SecurityToken
Returns:
the URL being used by the current request The returned URL must contain at least protocol, host, and port. The returned URL may contain path or query parameters.


Copyright © 2007-2012. All Rights Reserved.