Class Tokens
java.lang.Object
com.linecorp.centraldogma.server.metadata.Tokens
- All Implemented Interfaces:
HasWeight
Holds a token map and a secret map for fast lookup.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionappIds()
Returns the applicationToken
s.findBySecret
(String secret) Returns theToken
that corresponds to the specified secret.findBySecretOrDefault
(String secret, Token defaultValue) Returns theToken
that corresponds to the specified secret.Returns theToken
that corresponds to the specified application ID.getOrDefault
(String appId, Token defaultValue) Returns theToken
that corresponds to the specified application ID.static boolean
isValidSecret
(String secret) Returnstrue
if the specified secret is valid.secrets()
Returns the secrets.toString()
static void
validateSecret
(String secret) Throws anIllegalArgumentException
if the specified secret is not valid.int
weight()
Returns the weight of this object.Returns a newTokens
which does not contain any secrets.
-
Constructor Details
-
Tokens
public Tokens()Creates a new empty instance. -
Tokens
Creates a new instance with the given application IDs and secrets.
-
-
Method Details
-
appIds
Returns the applicationToken
s. -
secrets
Returns the secrets. -
get
Returns theToken
that corresponds to the specified application ID. -
getOrDefault
Returns theToken
that corresponds to the specified application ID.defaultValue
is returned if there's no such application. -
findBySecret
Returns theToken
that corresponds to the specified secret. -
findBySecretOrDefault
Returns theToken
that corresponds to the specified secret.defaultValue
is returned if there's no such secret. -
withoutSecret
Returns a newTokens
which does not contain any secrets. -
weight
public int weight()Description copied from interface:HasWeight
Returns the weight of this object. -
toString
-
isValidSecret
Returnstrue
if the specified secret is valid. -
validateSecret
Throws anIllegalArgumentException
if the specified secret is not valid.
-