Class TXRecord
- java.lang.Object
-
- edu.uiuc.ncsa.security.core.util.IdentifiableImpl
-
- org.oa4mp.server.loader.oauth2.storage.tx.TXRecord
-
- All Implemented Interfaces:
edu.uiuc.ncsa.security.core.DateComparable
,edu.uiuc.ncsa.security.core.Identifiable
,Serializable
,Cloneable
public class TXRecord extends edu.uiuc.ncsa.security.core.util.IdentifiableImpl implements edu.uiuc.ncsa.security.core.Identifiable, Cloneable, edu.uiuc.ncsa.security.core.DateComparable
Created by Jeff Gaynor
on 12/14/20 at 8:54 AM- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description TXRecord(edu.uiuc.ncsa.security.core.Identifier identifier)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
fromXML(XMLEventReader xer)
protected void
fromXMLNEW(XMLEventReader xer)
protected void
fromXMLOLD(XMLEventReader xer)
List<String>
getAudience()
Date
getCreationTS()
OA2Client
getErsatzClient()
long
getExpiresAt()
long
getIssuedAt()
String
getIssuer()
long
getLifetime()
edu.uiuc.ncsa.security.core.Identifier
getParentID()
TXRecord
getPreviousTXR()
The TXRecord that was this TXRecord updates.List<URI>
getResource()
List<String>
getScopes()
String
getStoredToken()
The actual token (including any encodings, signatures etc.) returned to the user.net.sf.json.JSONObject
getToken()
The un-encoded tokengetStoredToken()
.String
getTokenType()
The requested token type from the TX request.boolean
hasAudience()
boolean
hasPreviousTX()
boolean
hasResources()
boolean
hasScopes()
boolean
hasToken()
boolean
isValid()
void
setAudience(List<String> audience)
void
setErsatzClient(OA2Client ersatzClient)
void
setExpiresAt(long expiresAt)
void
setIssuedAt(long issuedAt)
void
setIssuer(String issuer)
void
setLifetime(long lifetime)
void
setParentID(edu.uiuc.ncsa.security.core.Identifier parentID)
void
setPreviousTXR(TXRecord previousTXR)
void
setResource(List<URI> resource)
void
setScopes(Collection<String> newScopes)
Convenience method.void
setScopes(List<String> scopes)
void
setStoredToken(String storedToken)
void
setToken(net.sf.json.JSONObject token)
void
setTokenType(String tokenType)
void
setValid(boolean valid)
void
toXML(XMLStreamWriter xsw)
This andfromXML(XMLEventReader)
are needed for QDL state storage.-
Methods inherited from class edu.uiuc.ncsa.security.core.util.IdentifiableImpl
clone, equals, getDescription, getIdentifier, getIdentifierString, isReadOnly, setDescription, setIdentifier, setReadOnly
-
-
-
-
Method Detail
-
getCreationTS
public Date getCreationTS()
- Specified by:
getCreationTS
in interfaceedu.uiuc.ncsa.security.core.DateComparable
-
getStoredToken
public String getStoredToken()
The actual token (including any encodings, signatures etc.) returned to the user.- Returns:
-
setStoredToken
public void setStoredToken(String storedToken)
-
getPreviousTXR
public TXRecord getPreviousTXR()
The TXRecord that was this TXRecord updates. In a token exchange, this is the TXRecord of the last token. If this is null, the token was updated directly from the transaction and that should be used.- Returns:
-
setPreviousTXR
public void setPreviousTXR(TXRecord previousTXR)
-
getToken
public net.sf.json.JSONObject getToken()
The un-encoded tokengetStoredToken()
. In JWTs this is the payload (for header.payload.signature). Since spent too much time decoding it on the fly, we just stash a readable copy here.- Returns:
-
setToken
public void setToken(net.sf.json.JSONObject token)
-
hasToken
public boolean hasToken()
-
hasPreviousTX
public boolean hasPreviousTX()
-
getParentID
public edu.uiuc.ncsa.security.core.Identifier getParentID()
-
setParentID
public void setParentID(edu.uiuc.ncsa.security.core.Identifier parentID)
-
getLifetime
public long getLifetime()
-
setLifetime
public void setLifetime(long lifetime)
-
getIssuedAt
public long getIssuedAt()
-
setIssuedAt
public void setIssuedAt(long issuedAt)
-
getExpiresAt
public long getExpiresAt()
-
setExpiresAt
public void setExpiresAt(long expiresAt)
-
isValid
public boolean isValid()
-
setValid
public void setValid(boolean valid)
-
getTokenType
public String getTokenType()
The requested token type from the TX request.- Returns:
-
setTokenType
public void setTokenType(String tokenType)
-
setScopes
public void setScopes(Collection<String> newScopes)
Convenience method. Just got tired of translating this- Parameters:
newScopes
-
-
hasAudience
public boolean hasAudience()
-
getIssuer
public String getIssuer()
-
setIssuer
public void setIssuer(String issuer)
-
hasResources
public boolean hasResources()
-
hasScopes
public boolean hasScopes()
-
getErsatzClient
public OA2Client getErsatzClient()
-
setErsatzClient
public void setErsatzClient(OA2Client ersatzClient)
-
toXML
public void toXML(XMLStreamWriter xsw) throws XMLStreamException
This andfromXML(XMLEventReader)
are needed for QDL state storage.- Parameters:
xsw
-- Throws:
XMLStreamException
-
fromXML
public void fromXML(XMLEventReader xer) throws XMLStreamException
- Throws:
XMLStreamException
-
fromXMLOLD
protected void fromXMLOLD(XMLEventReader xer) throws XMLStreamException
- Throws:
XMLStreamException
-
fromXMLNEW
protected void fromXMLNEW(XMLEventReader xer) throws XMLStreamException
- Throws:
XMLStreamException
-
-