Package net.ygbstudio.jbrave.core.local
Class ClientInfo
java.lang.Object
net.ygbstudio.jbrave.core.local.ClientInfo
Represents the client information.
This class represents a source of truth for admission control/pacing semantics tied to a token identity.
-
Method Summary
Modifier and TypeMethodDescriptionstatic @NotNull ClientInfoCreate a new instance of ClientInfo from the preconfigured environment variableBRAVE_SUBSCRIPTION_TOKENstatic @NotNull ClientInfofromEnvironment(String envVarName) Create a new instance of ClientInfo from environment variable.static @NotNull ClientInfofromProperties(String propertiesFileName) Create a new instance of ClientInfo from properties file with the preconfigured property namebrave.subscriptionTokenstatic @NotNull ClientInfofromProperties(String propertiesFileName, String customPropertyName) Create a new instance of ClientInfo from properties file.
-
Method Details
-
fromProperties
@Contract("_,_ -> new") @NotNull public static @NotNull ClientInfo fromProperties(String propertiesFileName, String customPropertyName) Create a new instance of ClientInfo from properties file.- Parameters:
propertiesFileName- the name of the properties file.customPropertyName- property name specified by the caller.- Returns:
- a new instance of ClientInfo.
-
fromProperties
Create a new instance of ClientInfo from properties file with the preconfigured property namebrave.subscriptionToken- Parameters:
propertiesFileName- the name of the properties file.- Returns:
- a new instance of ClientInfo.
-
fromEnvironment
Create a new instance of ClientInfo from environment variable.- Parameters:
envVarName- Environment variable specified by the caller.- Returns:
- a new instance of ClientInfo.
- Throws:
BraveLocalEnvironmentException- if the environment variable is not set.
-
fromEnvironment
Create a new instance of ClientInfo from the preconfigured environment variableBRAVE_SUBSCRIPTION_TOKEN- Returns:
- a new instance of ClientInfo.
- Throws:
BraveLocalEnvironmentException- if the environment variable is not set.
-
subscriptionToken
-
requestGate
-