Class 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
    • Constructor Detail

      • HybridCommandClient

        public HybridCommandClient()
    • 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 refreshToken
        token - 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 map
        token - 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 name
        authCode - auth code
        token - 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 refreshToken
        token - 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 user
        token - a client credential JWT token
        Returns:
        Result of refreshToken