Package io.stargate.auth
Enum SourceAPI
- java.lang.Object
-
- java.lang.Enum<SourceAPI>
-
- io.stargate.auth.SourceAPI
-
- All Implemented Interfaces:
Serializable,Comparable<SourceAPI>
public enum SourceAPI extends Enum<SourceAPI>
Defines what API is a source of the request performing the authorization.
-
-
Field Summary
Fields Modifier and Type Field Description static StringCUSTOM_PAYLOAD_KEY
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static SourceAPIfromCustomPayload(Map<String,ByteBuffer> customPayload, SourceAPI defaultIfMissing)StringgetName()voidtoCustomPayload(Map<String,ByteBuffer> customPayload)static SourceAPIvalueOf(String name)Returns the enum constant of this type with the specified name.static SourceAPI[]values()Returns an array containing the constants of this enum type, in the order they are declared.
-
-
-
Enum Constant Detail
-
GRAPHQL
public static final SourceAPI GRAPHQL
Used for GraphQL API.
-
CQL
public static final SourceAPI CQL
Used for CQL traffic (and gRPC).
-
REST
public static final SourceAPI REST
Used for REST and Docs API, as historically they were one.
-
JSON
public static final SourceAPI JSON
Used for JSON API.
-
-
Field Detail
-
CUSTOM_PAYLOAD_KEY
public static final String CUSTOM_PAYLOAD_KEY
- See Also:
- Constant Field Values
-
-
Method Detail
-
values
public static SourceAPI[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:for (SourceAPI c : SourceAPI.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static SourceAPI valueOf(String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)- Parameters:
name- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException- if this enum type has no constant with the specified nameNullPointerException- if the argument is null
-
getName
public String getName()
-
toCustomPayload
public void toCustomPayload(Map<String,ByteBuffer> customPayload)
-
fromCustomPayload
public static SourceAPI fromCustomPayload(Map<String,ByteBuffer> customPayload, SourceAPI defaultIfMissing)
-
-