Class PreAuthToken
-
- All Implemented Interfaces:
-
java.io.Externalizable
,java.io.Serializable
,java.lang.Comparable
,org.apache.avro.generic.GenericContainer
,org.apache.avro.generic.GenericRecord
,org.apache.avro.generic.IndexedRecord
,org.apache.avro.specific.SpecificRecord
public class PreAuthToken extends SpecificRecordBase implements SpecificRecord
A token issued to a holding identity, used to authenticate a registration request.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public class
PreAuthToken.Builder
RecordBuilder for PreAuthToken instances.
-
Field Summary
Fields Modifier and Type Field Description public final static Schema
SCHEMA$
public String
id
public String
ownerX500Name
public Instant
ttl
public PreAuthTokenStatus
status
public String
creationRemark
public String
removalRemark
-
Constructor Summary
Constructors Constructor Description PreAuthToken()
Default constructor. PreAuthToken(String id, String ownerX500Name, Instant ttl, PreAuthTokenStatus status, String creationRemark, String removalRemark)
All-args constructor.
-
Method Summary
Modifier and Type Method Description String
getId()
Gets the value of the 'id' field. void
setId(String value)
Sets the value of the 'id' field. String
getOwnerX500Name()
Gets the value of the 'ownerX500Name' field. void
setOwnerX500Name(String value)
Sets the value of the 'ownerX500Name' field. Instant
getTtl()
Gets the value of the 'ttl' field. void
setTtl(Instant value)
Sets the value of the 'ttl' field. PreAuthTokenStatus
getStatus()
Gets the value of the 'status' field. void
setStatus(PreAuthTokenStatus value)
Sets the value of the 'status' field. String
getCreationRemark()
Gets the value of the 'creationRemark' field. void
setCreationRemark(String value)
Sets the value of the 'creationRemark' field. String
getRemovalRemark()
Gets the value of the 'removalRemark' field. void
setRemovalRemark(String value)
Sets the value of the 'removalRemark' field. static Schema
getClassSchema()
static BinaryMessageEncoder<PreAuthToken>
getEncoder()
Return the BinaryMessageEncoder instance used by this class. static BinaryMessageDecoder<PreAuthToken>
getDecoder()
Return the BinaryMessageDecoder instance used by this class. static BinaryMessageDecoder<PreAuthToken>
createDecoder(SchemaStore resolver)
Create a new BinaryMessageDecoder instance for this class that uses the specified SchemaStore. ByteBuffer
toByteBuffer()
Serializes this PreAuthToken to a ByteBuffer. static PreAuthToken
fromByteBuffer(ByteBuffer b)
Deserializes a PreAuthToken from a ByteBuffer. SpecificData
getSpecificData()
Schema
getSchema()
Object
get(int field$)
void
put(int field$, Object value$)
static PreAuthToken.Builder
newBuilder()
Creates a new PreAuthToken RecordBuilder. static PreAuthToken.Builder
newBuilder(PreAuthToken.Builder other)
Creates a new PreAuthToken RecordBuilder by copying an existing Builder. static PreAuthToken.Builder
newBuilder(PreAuthToken other)
Creates a new PreAuthToken RecordBuilder by copying an existing PreAuthToken instance. void
writeExternal(ObjectOutput out)
void
readExternal(ObjectInput in)
-
Methods inherited from class org.apache.avro.specific.SpecificRecordBase
compareTo, customDecode, customEncode, equals, getConversion, hashCode, toString
-
Methods inherited from class org.apache.avro.generic.GenericRecord
hasField
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
-
Constructor Detail
-
PreAuthToken
PreAuthToken()
Default constructor.
-
PreAuthToken
PreAuthToken(String id, String ownerX500Name, Instant ttl, PreAuthTokenStatus status, String creationRemark, String removalRemark)
All-args constructor.- Parameters:
id
- A unique identifier of the token.ownerX500Name
- The X500 name of the holding identity that the token belongs to.ttl
- Unix timestamp for when the pre auth token expires.status
- The current status of the token.creationRemark
- An optional remark added when the token was created.removalRemark
- An optional remark added when the token is consumed, revoked or auto invalidated.
-
-
Method Detail
-
setId
void setId(String value)
Sets the value of the 'id' field. A unique identifier of the token.
- Parameters:
value
- the value to set.
-
getOwnerX500Name
String getOwnerX500Name()
Gets the value of the 'ownerX500Name' field.
-
setOwnerX500Name
void setOwnerX500Name(String value)
Sets the value of the 'ownerX500Name' field. The X500 name of the holding identity that the token belongs to.
- Parameters:
value
- the value to set.
-
setTtl
void setTtl(Instant value)
Sets the value of the 'ttl' field. Unix timestamp for when the pre auth token expires. In milliseconds since the epoch.
- Parameters:
value
- the value to set.
-
getStatus
PreAuthTokenStatus getStatus()
Gets the value of the 'status' field.
-
setStatus
void setStatus(PreAuthTokenStatus value)
Sets the value of the 'status' field. The current status of the token.
- Parameters:
value
- the value to set.
-
getCreationRemark
String getCreationRemark()
Gets the value of the 'creationRemark' field.
-
setCreationRemark
void setCreationRemark(String value)
Sets the value of the 'creationRemark' field. An optional remark added when the token was created.
- Parameters:
value
- the value to set.
-
getRemovalRemark
String getRemovalRemark()
Gets the value of the 'removalRemark' field.
-
setRemovalRemark
void setRemovalRemark(String value)
Sets the value of the 'removalRemark' field. An optional remark added when the token is consumed, revoked or auto invalidated.
- Parameters:
value
- the value to set.
-
getClassSchema
static Schema getClassSchema()
-
getEncoder
static BinaryMessageEncoder<PreAuthToken> getEncoder()
Return the BinaryMessageEncoder instance used by this class.
-
getDecoder
static BinaryMessageDecoder<PreAuthToken> getDecoder()
Return the BinaryMessageDecoder instance used by this class.
-
createDecoder
static BinaryMessageDecoder<PreAuthToken> createDecoder(SchemaStore resolver)
Create a new BinaryMessageDecoder instance for this class that uses the specified SchemaStore.
- Parameters:
resolver
- a SchemaStore used to find schemas by fingerprint
-
toByteBuffer
ByteBuffer toByteBuffer()
Serializes this PreAuthToken to a ByteBuffer.
-
fromByteBuffer
static PreAuthToken fromByteBuffer(ByteBuffer b)
Deserializes a PreAuthToken from a ByteBuffer.
- Parameters:
b
- a byte buffer holding serialized data for an instance of this class
-
getSpecificData
SpecificData getSpecificData()
-
getSchema
Schema getSchema()
-
newBuilder
static PreAuthToken.Builder newBuilder()
Creates a new PreAuthToken RecordBuilder.
-
newBuilder
static PreAuthToken.Builder newBuilder(PreAuthToken.Builder other)
Creates a new PreAuthToken RecordBuilder by copying an existing Builder.
- Parameters:
other
- The existing builder to copy.
-
newBuilder
static PreAuthToken.Builder newBuilder(PreAuthToken other)
Creates a new PreAuthToken RecordBuilder by copying an existing PreAuthToken instance.
- Parameters:
other
- The existing instance to copy.
-
writeExternal
void writeExternal(ObjectOutput out)
-
readExternal
void readExternal(ObjectInput in)
-
-
-
-