org.apache.oltu.oauth2.jwt
Class JWT.Builder

java.lang.Object
  extended by org.apache.oltu.commons.json.CustomizableBuilder<JWT>
      extended by org.apache.oltu.oauth2.jwt.JWT.Builder
Enclosing class:
JWT

public static final class JWT.Builder
extends org.apache.oltu.commons.json.CustomizableBuilder<JWT>

A simple JWT builder.


Constructor Summary
JWT.Builder()
           
JWT.Builder(String rawString)
           
 
Method Summary
 JWT build()
          Creates a new JWT instance.
 JWT.Builder setClaimsSetAudience(String claimsSetAudience)
          Sets the JWT Claims Set aud.
 JWT.Builder setClaimsSetCustomField(String key, Object value)
          Set the JWT Claims Set custom field.
 JWT.Builder setClaimsSetExpirationTime(long claimsSetExpirationTime)
          Sets the JWT Claims Set exp.
 JWT.Builder setClaimsSetIssuedAt(long claimsSetIssuedAt)
          Sets the JWT Claims Set issuedAt.
 JWT.Builder setClaimsSetIssuer(String claimsSetIssuer)
          Sets the JWT Claims Set iss.
 JWT.Builder setClaimsSetJwdId(String claimsSetJwdId)
          Sets the JWT Claims Set jti.
 JWT.Builder setClaimsSetNotBefore(String claimsSetNotBefore)
          Sets the JWT Claims Set nbf.
 JWT.Builder setClaimsSetSubject(String claimsSetSubject)
          Sets the JWT Claims Set sub.
 JWT.Builder setClaimsSetType(String claimsSetType)
          Sets the JWT Claims Set typ.
 JWT.Builder setHeaderAlgorithm(String headerAlgorithm)
          Sets the JWT Header alg.
 JWT.Builder setHeaderContentType(String headerContentType)
          Sets the JWT Header cty.
 JWT.Builder setHeaderCustomField(String key, Object value)
          Set the JWT Header custom field.
 JWT.Builder setHeaderType(String headerType)
          Sets the JWT Header typ.
 JWT.Builder setSignature(String signature)
          Sets the JWT signature.
 
Methods inherited from class org.apache.oltu.commons.json.CustomizableBuilder
getCustomFields, setCustomField
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JWT.Builder

public JWT.Builder()

JWT.Builder

public JWT.Builder(String rawString)
Method Detail

setHeaderType

public JWT.Builder setHeaderType(String headerType)
Sets the JWT Header typ.

Parameters:
headerType - the JWT Header typ.
Returns:
this builder instance.

setHeaderAlgorithm

public JWT.Builder setHeaderAlgorithm(String headerAlgorithm)
Sets the JWT Header alg.

Parameters:
headerAlgorithm - the JWT Header alg.
Returns:
this builder instance.

setHeaderContentType

public JWT.Builder setHeaderContentType(String headerContentType)
Sets the JWT Header cty.

Parameters:
headerContentType - the JWT Header cty.
Returns:
this builder instance.

setHeaderCustomField

public JWT.Builder setHeaderCustomField(String key,
                                        Object value)
Set the JWT Header custom field.

Parameters:
key - the custom field name.
value - value the custom field value.
Returns:
this builder instance.

setClaimsSetIssuer

public JWT.Builder setClaimsSetIssuer(String claimsSetIssuer)
Sets the JWT Claims Set iss.

Parameters:
claimsSetIssuer - the JWT Claims Set iss.
Returns:
this builder instance.

setClaimsSetSubject

public JWT.Builder setClaimsSetSubject(String claimsSetSubject)
Sets the JWT Claims Set sub.

Parameters:
claimsSetSubject - the JWT Claims Set sub.
Returns:
this builder instance.

setClaimsSetAudience

public JWT.Builder setClaimsSetAudience(String claimsSetAudience)
Sets the JWT Claims Set aud.

Parameters:
claimsSetAudience - the JWT Claims Set aud.
Returns:
this builder instance.

setClaimsSetExpirationTime

public JWT.Builder setClaimsSetExpirationTime(long claimsSetExpirationTime)
Sets the JWT Claims Set exp.

Parameters:
claimsSetExpirationTime - the JWT Claims Set exp.
Returns:
this builder instance.

setClaimsSetNotBefore

public JWT.Builder setClaimsSetNotBefore(String claimsSetNotBefore)
Sets the JWT Claims Set nbf.

Parameters:
claimsSetNotBefore - the JWT Claims Set nbf.
Returns:
this builder instance.

setClaimsSetIssuedAt

public JWT.Builder setClaimsSetIssuedAt(long claimsSetIssuedAt)
Sets the JWT Claims Set issuedAt.

Parameters:
claimsSetIssuedAt - the JWT Claims Set issuedAt.
Returns:
this builder instance.

setClaimsSetJwdId

public JWT.Builder setClaimsSetJwdId(String claimsSetJwdId)
Sets the JWT Claims Set jti.

Parameters:
claimsSetJwdId - the JWT Claims Set jti.
Returns:
this builder instance.

setClaimsSetType

public JWT.Builder setClaimsSetType(String claimsSetType)
Sets the JWT Claims Set typ.

Parameters:
claimsSetType - the JWT Claims Set typ.
Returns:
this builder instance.

setClaimsSetCustomField

public JWT.Builder setClaimsSetCustomField(String key,
                                           Object value)
Set the JWT Claims Set custom field.

Parameters:
key - the custom field name.
value - value the custom field value.
Returns:
this builder instance.

setSignature

public JWT.Builder setSignature(String signature)
Sets the JWT signature.

Parameters:
signature -
Returns:
this builder instance.

build

public JWT build()
Creates a new JWT instance.

Specified by:
build in class org.apache.oltu.commons.json.CustomizableBuilder<JWT>
Returns:
a new JWT instance.


Copyright © 2010–2014 The Apache Software Foundation. All rights reserved.