|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.veriplace.web.Veriplace
public class Veriplace
Veriplace client for web applications. The web client hides many of the details of Veriplace's OAuth-based authorization process, providing a persistent state across transactions that may involve redirects and callbacks.
An instance of Veriplace manages the following resources:
Client which handles communication with the Veriplace server. This is the
lower-level client API, which you can still access if desired. Redirector allowing Veriplace to perform browser redirects transparently. StatusViewRenderer allowing Veriplace to
display error or waiting pages automatically.
All of this class's methods operate on a VeriplaceState object, which holds all
the information that is associated with the current HTTP request. When a request completes
successfully, it updates the VeriplaceState's properties.
If a request cannot be completed, it throws a subclass of VeriplaceException.
The web client defines several new exception classes for non-error conditions that can interrupt
the handling of a request: RespondedException, which usually means that the user
has been redirected to the Veriplace site, and WaitingException, which means that
the application is waiting for an asynchronous request and may wish to display an
intermediate status page.
The standard Veriplace frameworks for servlets
(AbstractVeriplaceServlet) and Spring servlets
(VeriplaceInterceptor), and the
JSP tag library, take
care of creating and configuring the Veriplace instance and calling the appropriate
methods to acquire user or location data; applications using those frameworks will usually
just interact with the VeriplaceState class to get the data.
| Constructor Summary | |
|---|---|
protected |
Veriplace()
|
|
Veriplace(Client client)
Creates a Veriplace instance using an existing Client. |
|
Veriplace(ClientFactory clientFactory)
Creates a Veriplace instance using a specific ClientFactory. |
|
Veriplace(java.util.Properties properties)
Creates a Veriplace instance and initializes its Client
using a Properties object, with the keys defined by DefaultClientFactory. |
|
Veriplace(java.lang.String propertiesFileName)
Creates a Veriplace instance and initializes its Client
using properties file, with the keys defined by ClientFactory. |
|
Veriplace(Veriplace fromInstance,
Client newClient)
Creates a Veriplace instance with the same properties as another instance, but using a different Veriplace client. |
| Method Summary | |
|---|---|
java.lang.String |
getCallbackUrl(VeriplaceState state)
Constructs a URL for returning to the current request from an external page, and passing along any necessary attributes to recreate the current state. |
Client |
getClient()
Returns the Client that handles lower-level
communications with the Veriplace server. |
ClientFactory |
getClientFactory()
Returns the currently configured ClientFactory, if any. |
GetLocationRequestManager |
getGetLocationRequestManager()
See setGetLocationRequestManager(GetLocationRequestManager). |
UserTokenStore |
getGetLocationTokenStore()
See setGetLocationTokenStore(UserTokenStore). |
java.util.Properties |
getProperties()
|
Redirector |
getRedirector()
See setRedirector(Redirector). |
StatusViewRenderer |
getStatusViewRenderer()
See setStatusViewRenderer(StatusViewRenderer). |
VeriplaceState |
open(HttpServletRequest request,
HttpServletResponse response)
Creates a new VeriplaceState object for the current HTTP
request. |
void |
requireGetLocationPermission(VeriplaceState state)
Deprecated. |
void |
requireGetLocationPermissionImmediate(VeriplaceState state)
Deprecated. |
void |
requireLocation(VeriplaceState state)
Deprecated. |
void |
requireLocation(VeriplaceState state,
long locationId)
Deprecated. |
void |
requireUser(VeriplaceState state)
Deprecated. |
void |
requireUser(VeriplaceState state,
UserDiscoveryParameters parameters)
Deprecated. |
void |
requireUserImmediate(VeriplaceState state)
Deprecated. |
void |
setGetLocationRequestManager(GetLocationRequestManager lrm)
Designates a GetLocationRequestManager object to provide background
processing of location requests. |
void |
setGetLocationTokenStore(UserTokenStore store)
Designates a UserTokenStore object to provide cacheing of
Veriplace access tokens. |
void |
setRedirector(Redirector redirector)
Designates a Redirector object which will take care of sending
redirect responses. |
void |
setStatusViewRenderer(StatusViewRenderer statusViewRenderer)
Designates a StatusViewRenderer object which will be used to
display special status pages (errors, or a "please wait" page) if appropriate. |
protected void |
tryStatusView(VeriplaceState state,
java.lang.Exception e,
java.lang.String callbackUrl)
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
protected Veriplace()
public Veriplace(Client client)
Client.
public Veriplace(ClientFactory clientFactory)
throws ConfigurationException
ClientFactory.
ConfigurationException - if a configuration property is invalid
public Veriplace(java.util.Properties properties)
throws ConfigurationException
Client
using a Properties object, with the keys defined by DefaultClientFactory.
ConfigurationException - if a configuration property is invalid
public Veriplace(java.lang.String propertiesFileName)
throws java.io.IOException,
ConfigurationException
Client
using properties file, with the keys defined by ClientFactory.
ConfigurationException - if a configuration property is invalid
java.io.IOException
public Veriplace(Veriplace fromInstance,
Client newClient)
| Method Detail |
|---|
public Client getClient()
Client that handles lower-level
communications with the Veriplace server. This object provides several capabilities
that don't have corresponding methods in the web client API, simply because they
don't require any transaction state management and are not needed by most
applications, such as the methods in PermissionAPI.
public ClientFactory getClientFactory()
ClientFactory, if any.
public java.util.Properties getProperties()
public Redirector getRedirector()
setRedirector(Redirector).
public void setRedirector(Redirector redirector)
Redirector object which will take care of sending
redirect responses. If you don't specify otherwise, it uses DefaultRedirector.
public StatusViewRenderer getStatusViewRenderer()
setStatusViewRenderer(StatusViewRenderer).
public void setStatusViewRenderer(StatusViewRenderer statusViewRenderer)
StatusViewRenderer object which will be used to
display special status pages (errors, or a "please wait" page) if appropriate. This should normally
be an instance of ServletStatusViewRenderer, except for Spring
applications which should use SpringStatusViewRenderer. If you do
not have a ViewRenderer, you can still make a request but you will have to catch errors (or
WaitingException) and handle them appropriately.
public GetLocationRequestManager getGetLocationRequestManager()
setGetLocationRequestManager(GetLocationRequestManager).
public void setGetLocationRequestManager(GetLocationRequestManager lrm)
GetLocationRequestManager object to provide background
processing of location requests. By default, it will use an implementation based on
MemoryRequestStore.
public UserTokenStore getGetLocationTokenStore()
setGetLocationTokenStore(UserTokenStore).
public void setGetLocationTokenStore(UserTokenStore store)
UserTokenStore object to provide cacheing of
Veriplace access tokens. By default, it will use a MemoryUserTokenStore.
public VeriplaceState open(HttpServletRequest request,
HttpServletResponse response)
VeriplaceState object for the current HTTP
request. This object receives the results of user and location queries, and maintains
other information (access tokens and callback state) that allow operations to be carried
out across multiple requests and callbacks.
public void requireUser(VeriplaceState state)
throws RespondedException,
UserDiscoveryException,
UnexpectedException,
ServletException
VeriplaceState.requireUser().
RespondedException
UserDiscoveryException
UnexpectedException
ServletException
public void requireUser(VeriplaceState state,
UserDiscoveryParameters parameters)
throws RespondedException,
UserDiscoveryException,
UnexpectedException,
ServletException
VeriplaceState.requireUser(UserDiscoveryParameters).
RespondedException
UserDiscoveryException
UnexpectedException
ServletException
public void requireUserImmediate(VeriplaceState state)
throws UserDiscoveryNotPermittedException,
UnexpectedException,
ServletException
VeriplaceState.requireUserImmediate().
UserDiscoveryNotPermittedException
UnexpectedException
ServletException
public void requireGetLocationPermission(VeriplaceState state)
throws RespondedException,
RequestDeniedException,
UnexpectedException,
ServletException
VeriplaceState.requireGetLocationPermission().
RespondedException
RequestDeniedException
UnexpectedException
ServletException
public void requireGetLocationPermissionImmediate(VeriplaceState state)
throws GetLocationNotPermittedException,
UserDiscoveryException,
UnexpectedException
VeriplaceState.requireGetLocationPermissionImmediate().
GetLocationNotPermittedException
UserDiscoveryException
UnexpectedException
public void requireLocation(VeriplaceState state)
throws RespondedException,
WaitingException,
RequestDeniedException,
UnexpectedException,
ServletException
VeriplaceState.requireLocation().
RespondedException
WaitingException
RequestDeniedException
UnexpectedException
ServletException
public void requireLocation(VeriplaceState state,
long locationId)
throws RespondedException,
RequestDeniedException,
UnexpectedException,
ServletException
VeriplaceState.requireLocation(long).
RespondedException
RequestDeniedException
UnexpectedException
ServletExceptionpublic java.lang.String getCallbackUrl(VeriplaceState state)
protected void tryStatusView(VeriplaceState state,
java.lang.Exception e,
java.lang.String callbackUrl)
throws RespondedWithStatusViewException,
UnexpectedException,
ServletException
RespondedWithStatusViewException
UnexpectedException
ServletException
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||