Package net.lightapi.portal
Class HybridCommandClient
- java.lang.Object
-
- net.lightapi.portal.HybridCommandClient
-
public class HybridCommandClient extends Object
This is a client utility that is shared by all command side services to update data from the command side. It creates a HTTP/2 connection to the command side and cache that connection until the connection is closed.- Author:
- Steve Hu
-
-
Field Summary
Fields Modifier and Type Field Description static PortalClientConfigconfig
-
Constructor Summary
Constructors Constructor Description HybridCommandClient()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static com.networknt.monad.Result<String>callCommandWithToken(io.undertow.client.ClientConnection connection, String command, String token)static com.networknt.monad.Result<String>callCommandWithToken(String command, String token)static com.networknt.monad.Result<String>callCommandWithToken(String command, String token, String url)static com.networknt.monad.Result<String>createAuthCode(Map<String,Object> codeMap, String token)Create Auth code from oauth-kafka.static com.networknt.monad.Result<String>createRefreshToken(Map<String,Object> refreshTokenMap, String token)Create a refresh token from the oauth-kafka.static com.networknt.monad.Result<String>createRefToken(Map<String,Object> refTokenMap, String token)Create a reference token from the oauth-kafka.static com.networknt.monad.Result<String>createSocialUser(Map<String,Object> userMap, String token)Create a sociate user with bootstrap token from light-spa-4j statelessAuthHandler.static com.networknt.monad.Result<String>deleteAuthCode(String host, String authCode, String token)Delete Auth code from oauth-kafka
-
-
-
Field Detail
-
config
public static final PortalClientConfig config
-
-
Method Detail
-
callCommandWithToken
public static com.networknt.monad.Result<String> callCommandWithToken(String command, String token)
-
callCommandWithToken
public static com.networknt.monad.Result<String> callCommandWithToken(String command, String token, String url)
-
callCommandWithToken
public static com.networknt.monad.Result<String> callCommandWithToken(io.undertow.client.ClientConnection connection, String command, String token)
-
createRefreshToken
public static com.networknt.monad.Result<String> createRefreshToken(Map<String,Object> refreshTokenMap, String token)
Create a refresh token from the oauth-kafka. The token will be a client credential token so that there is no user_id in the JWT to bypass the match verification. This is an internal method that is called between oauth and portal services and a client credential token must be provided.- Parameters:
refreshTokenMap- map contains all the properties including refreshTokentoken- a client credential JWT token- Returns:
- Result of refreshToken
-
createAuthCode
public static com.networknt.monad.Result<String> createAuthCode(Map<String,Object> codeMap, String token)
Create Auth code from oauth-kafka.- Parameters:
codeMap- auth code maptoken- access token- Returns:
- Result of authCode
-
deleteAuthCode
public static com.networknt.monad.Result<String> deleteAuthCode(String host, String authCode, String token)
Delete Auth code from oauth-kafka- Parameters:
host- host nameauthCode- auth codetoken- access token- Returns:
- Result of authCode
-
createRefToken
public static com.networknt.monad.Result<String> createRefToken(Map<String,Object> refTokenMap, String token)
Create a reference token from the oauth-kafka. The token will be the mapping between a uuid to a JWT token and it is exchanged on the light-router.- Parameters:
refTokenMap- map contains all the properties including refreshTokentoken- a client credential JWT token- Returns:
- Result of refreshToken
-
createSocialUser
public static com.networknt.monad.Result<String> createSocialUser(Map<String,Object> userMap, String token)
Create a sociate user with bootstrap token from light-spa-4j statelessAuthHandler.- Parameters:
userMap- map contains all the properties for the social usertoken- a client credential JWT token- Returns:
- Result of refreshToken
-
-