Package com.nimbusds.oauth2.sdk.id
Class Actor
- java.lang.Object
-
- com.nimbusds.oauth2.sdk.id.Actor
-
- All Implemented Interfaces:
Serializable,Comparable<Actor>,net.minidev.json.JSONAware
@Immutable public final class Actor extends Object implements Serializable, Comparable<Actor>, net.minidev.json.JSONAware
Authorised actor in impersonation and delegation cases.- See Also:
- Serialized Form
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description intcompareTo(Actor other)booleanequals(Object o)IssuergetIssuer()Returns the optional issuer for the subject.ActorgetParent()Returns the optional parent for this actor.SubjectgetSubject()Returns the subject.inthashCode()static Actorparse(net.minidev.json.JSONObject jsonObject)Parses an actor from the specified JSON object representation.static ActorparseTopLevel(net.minidev.json.JSONObject jsonObject)Parses an actor from the specified top-level JSON object contains an optional actor JSON representation.net.minidev.json.JSONObjecttoJSONObject()Returns a JSON object representation of this actor.StringtoJSONString()StringtoString()
-
-
-
Method Detail
-
getSubject
public Subject getSubject()
Returns the subject.- Returns:
- The subject.
-
getIssuer
public Issuer getIssuer()
Returns the optional issuer for the subject.- Returns:
- The issuer,
nullif not specified.
-
getParent
public Actor getParent()
Returns the optional parent for this actor.- Returns:
- The optional parent for the actor,
nullif none.
-
toJSONObject
public net.minidev.json.JSONObject toJSONObject()
Returns a JSON object representation of this actor.Simple example:
{ "sub" : "admin@example.com" }With nesting:
{ "sub" : "consumer.example.com-web-application", "iss" : "https://issuer.example.net", "act" : { "sub":"admin@example.com" } }- Returns:
- The JSON object.
-
compareTo
public int compareTo(Actor other)
- Specified by:
compareToin interfaceComparable<Actor>
-
toJSONString
public String toJSONString()
- Specified by:
toJSONStringin interfacenet.minidev.json.JSONAware
-
parse
public static Actor parse(net.minidev.json.JSONObject jsonObject) throws ParseException
Parses an actor from the specified JSON object representation.Simple example:
{ "sub" : "admin@example.com" }With nesting:
{ "sub" : "consumer.example.com-web-application", "iss" : "https://issuer.example.net", "act" : { "sub":"admin@example.com" } }- Parameters:
jsonObject- The JSON object. Must not benull.- Returns:
- The actor.
- Throws:
ParseException- If parsing failed.
-
parseTopLevel
public static Actor parseTopLevel(net.minidev.json.JSONObject jsonObject) throws ParseException
Parses an actor from the specified top-level JSON object contains an optional actor JSON representation.Simple example:
{ "aud" : "https://consumer.example.com", "iss" : "https://issuer.example.com", "exp" : 1443904177, "nbf" : 1443904077, "sub" : "user@example.com", "act" : { "sub" : "admin@example.com" } }With nesting:
{ "aud" : "https://backend.example.com", "iss" : "https://issuer.example.com", "exp" : 1443904100, "nbf" : 1443904000, "sub" : "user@example.com", "act" : { "sub" : "consumer.example.com-web-application", "iss" : "https://issuer.example.net", "act" : { "sub":"admin@example.com" } } }- Parameters:
jsonObject- The top-level JSON object to parse. Must not benull.- Returns:
- The actor,
nullif not specified. - Throws:
ParseException- If parsing failed.
-
-