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 voidfromXML(XMLEventReader xer)protected voidfromXMLNEW(XMLEventReader xer)protected voidfromXMLOLD(XMLEventReader xer)List<String>getAudience()DategetCreationTS()OA2ClientgetErsatzClient()longgetExpiresAt()longgetIssuedAt()StringgetIssuer()longgetLifetime()edu.uiuc.ncsa.security.core.IdentifiergetParentID()TXRecordgetPreviousTXR()The TXRecord that was this TXRecord updates.List<URI>getResource()List<String>getScopes()StringgetStoredToken()The actual token (including any encodings, signatures etc.) returned to the user.net.sf.json.JSONObjectgetToken()The un-encoded tokengetStoredToken().StringgetTokenType()The requested token type from the TX request.booleanhasAudience()booleanhasPreviousTX()booleanhasResources()booleanhasScopes()booleanhasToken()booleanisValid()voidsetAudience(List<String> audience)voidsetErsatzClient(OA2Client ersatzClient)voidsetExpiresAt(long expiresAt)voidsetIssuedAt(long issuedAt)voidsetIssuer(String issuer)voidsetLifetime(long lifetime)voidsetParentID(edu.uiuc.ncsa.security.core.Identifier parentID)voidsetPreviousTXR(TXRecord previousTXR)voidsetResource(List<URI> resource)voidsetScopes(Collection<String> newScopes)Convenience method.voidsetScopes(List<String> scopes)voidsetStoredToken(String storedToken)voidsetToken(net.sf.json.JSONObject token)voidsetTokenType(String tokenType)voidsetValid(boolean valid)voidtoXML(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:
getCreationTSin 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
-
-