The default for {@link #getResponseTypes()} is {@code "token"}.
Sample usage for a web application:
public void doGet(HttpServletRequest request, HttpServletResponse response) throws IOException { String url = new GoogleBrowserClientRequestUrl("812741506391.apps.googleusercontent.com", "https://oauth2-login-demo.appspot.com/oauthcallback", Arrays.asList( "https://www.googleapis.com/auth/userinfo.email", "https://www.googleapis.com/auth/userinfo.profile")).setState("/profile").build(); response.sendRedirect(url); }
Implementation is not thread-safe.
@since 1.7 @author Yaniv InbarUTF-8 is the character set for all conversions between strings and byte arrays.
Conversion relations:
JSONObject <=> String <=> Base64URL <=> byte[] <=> JWSObject <=> SignedJWT@author Vladimir Dzhuvinov @version $version$ (2014-10-28)
The main responsibility of this class is that of providing efficient ways to read and write a payload from and to bit streams. An instance of this class has at any given time a current value, which is set when {@linkplain #read(InputBitStream) reading}. and output when {@linkplain #write(OutputBitStream) writing}.
The current value can be modified using {@link #set(Object)}, and each implementation must document thoroughly which objects are accepted by this method.
It is expected that in most implementations reading and writing is much more efficient than reading, {@linkplain #get() getting a value}, {@linkplain #set(Object) setting that value} in another instance, andfinally {@linkplain #write(OutputBitStream) writing}.
Implementation of a payload might have parameters. If you need to know whether two instances are compatible, in the sense that each instance can read correctly data written by the other one, you can invoke the {@link #compatibleWith(Payload)} method.
Optionally, implementations can feature a parse(String)
method that returns an object of the correct type for {@link #set(Object)}. This method can be used (for instance, by reflection) to try to build a payload from a string specification (this is what happens in {@link DocumentIteratorBuilderVisitor}).
To store payloads in the index a {@link TokenStream} has to be used thatproduces payload data.
Use {@link TermPositions#getPayloadLength()} and {@link TermPositions#getPayload(byte[],int)}to retrieve the payloads from the index.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|