Class HybridQueryClient


  • public class HybridQueryClient
    extends Object
    This is a client utility that is shared by all command side services to query data from the query side. It creates a HTTP/2 connection to the query side and cache that connection until the connection is closed. Then it create another connection and cache it. This will ensure the highest efficiency.
    Author:
    Steve Hu
    • Method Summary

      All Methods Static Methods Concrete Methods Deprecated Methods 
      Modifier and Type Method Description
      static com.networknt.monad.Result<String> callQueryExchange​(String command, io.undertow.server.HttpServerExchange exchange)  
      static com.networknt.monad.Result<String> callQueryExchangeUrl​(String command, io.undertow.server.HttpServerExchange exchange, String url)  
      static com.networknt.monad.Result<String> callQueryTokenUrl​(String command, String token, String url)  
      static com.networknt.monad.Result<String> callQueryUrl​(String command, String url)  
      static com.networknt.monad.Result<String> callQueryWithToken​(String command, String token)  
      static com.networknt.monad.Result<String> getAuthCode​(io.undertow.server.HttpServerExchange exchange, String host, int offset, int limit)
      Get authCode for host.
      static com.networknt.monad.Result<String> getAuthCode​(io.undertow.server.HttpServerExchange exchange, String url, String host, int offset, int limit)
      Get authCode for host with exchange and url.
      static com.networknt.monad.Result<String> getAuthCodeDetail​(io.undertow.server.HttpServerExchange exchange, String url, String authCode)
      Get authCode detail.
      static com.networknt.monad.Result<String> getAuthCodeDetail​(String authCode, String token)
      Get authCode detail by authCode with client credentials token from oauth-kafka.
      static com.networknt.monad.Result<String> getBlog​(io.undertow.server.HttpServerExchange exchange, String url, String host, int offset, int limit)
      Get blog list for host with exchange and url.
      static com.networknt.monad.Result<String> getBlogById​(io.undertow.server.HttpServerExchange exchange, String host, String id)
      Get blog for host and id with exchange.
      static com.networknt.monad.Result<String> getBlogById​(io.undertow.server.HttpServerExchange exchange, String url, String host, String id)
      Get blog for host and id with exchange and url.
      static com.networknt.monad.Result<String> getBlogList​(io.undertow.server.HttpServerExchange exchange, String url, String host, int offset, int limit, List<String> categories, List<String> tags)
      Get blog list for host or categories or tags with exchange and url.
      static com.networknt.monad.Result<String> getCategory​(io.undertow.server.HttpServerExchange exchange, String url, String host)
      Get category list for host with exchange and url.
      static com.networknt.monad.Result<String> getCategoryByName​(io.undertow.server.HttpServerExchange exchange, String url, String host, String name)
      Get category for host and name with exchange and url.
      static com.networknt.monad.Result<String> getCity​(io.undertow.server.HttpServerExchange exchange, String country, String province, String city)
      Get city object from a combination of country, province and city.
      static com.networknt.monad.Result<String> getClient​(io.undertow.server.HttpServerExchange exchange, String url, String host, int offset, int limit)
      Get client for host with exchange and url.
      static com.networknt.monad.Result<String> getClientById​(io.undertow.server.HttpServerExchange exchange, String url, String clientId)
      Get client detail by clientId.
      static com.networknt.monad.Result<String> getClientById​(String token, String clientId)
      Get client by clientId with client credentials token from oauth-kafka.
      static com.networknt.monad.Result<String> getClientById​(String token, String url, String clientId)
      Get client detail by clientId.
      static com.networknt.monad.Result<String> getCustomerOrderByEmail​(io.undertow.server.HttpServerExchange exchange, String url, String email, int offset, int limit)
      Get customer orders by email.
      static com.networknt.monad.Result<String> getDocument​(io.undertow.server.HttpServerExchange exchange, String url, String host, int offset, int limit)
      Get document list for host with exchange and url.
      static com.networknt.monad.Result<String> getDocumentById​(io.undertow.server.HttpServerExchange exchange, String url, String host, String id)
      Get document for host and id with exchange and url.
      static com.networknt.monad.Result<String> getEntity​(io.undertow.server.HttpServerExchange exchange, String url, String email)
      Get covid entity for the user by key.
      static com.networknt.monad.Result<String> getError​(io.undertow.server.HttpServerExchange exchange, String url, String host, int offset, int limit)
      Get error list for host with exchange and url.
      static com.networknt.monad.Result<String> getErrorByCode​(io.undertow.server.HttpServerExchange exchange, String url, String host, String errorCode)
      Get error for host and errorCode with exchange.
      static com.networknt.monad.Result<String> getHost​(io.undertow.server.HttpServerExchange exchange, String host)
      Get all the entities associated with a particular host.
      static com.networknt.monad.Result<String> getHost​(io.undertow.server.HttpServerExchange exchange, String url, String host)
      Get all the entities associated with a particular host.
      static com.networknt.monad.Result<String> getHosts()
      Get a list of hosts from reference api for host dropdowns in the UI.
      static com.networknt.monad.Result<String> getJsonSchema​(io.undertow.server.HttpServerExchange exchange, String url, String host, int offset, int limit)
      Get schema list for host with exchange and url.
      static com.networknt.monad.Result<String> getJsonSchemaById​(io.undertow.server.HttpServerExchange exchange, String host, String id)
      Get schema for host and id with exchange.
      static com.networknt.monad.Result<String> getJsonSchemaById​(io.undertow.server.HttpServerExchange exchange, String url, String host, String id)
      Get schema for host and id with exchange and url.
      static com.networknt.monad.Result<String> getJsonSchemaList​(io.undertow.server.HttpServerExchange exchange, String url, String host, int offset, int limit, List<String> categories, List<String> tags)
      Get schema list for host or categories or tags with exchange and url.
      static com.networknt.monad.Result<String> getMerchantOrderByEmail​(io.undertow.server.HttpServerExchange exchange, String url, String email, String orderStatus, int offset, int limit)
      Get merchant orders by email.
      static com.networknt.monad.Result<String> getMessageByEmail​(io.undertow.server.HttpServerExchange exchange, String url, String email)
      Get private messages for the user by email.
      static com.networknt.monad.Result<String> getNews​(io.undertow.server.HttpServerExchange exchange, String url, String host, int offset, int limit)
      Get news list for host with exchange and url.
      static com.networknt.monad.Result<String> getNewsById​(io.undertow.server.HttpServerExchange exchange, String url, String host, String id)
      Get news for host and id with exchange and url.
      static com.networknt.monad.Result<String> getNonceByEmail​(io.undertow.server.HttpServerExchange exchange, String email)
      Get Nonce for the user by email.
      static com.networknt.monad.Result<String> getNonceByEmail​(io.undertow.server.HttpServerExchange exchange, String url, String email)
      Get Nonce for the user by email.
      static com.networknt.monad.Result<String> getNotificationByEmail​(io.undertow.server.HttpServerExchange exchange, String url, String email)
      Get notification for the user by email.
      static com.networknt.monad.Result<String> getPage​(io.undertow.server.HttpServerExchange exchange, String url, String host, int offset, int limit)
      Get page list for host with exchange and url.
      static com.networknt.monad.Result<String> getPageById​(io.undertow.server.HttpServerExchange exchange, String url, String host, String id)
      Get page for host and id with exchange and url.
      static com.networknt.monad.Result<String> getPaymentByEmail​(io.undertow.server.HttpServerExchange exchange, String url, String email)
      Get payment by email.
      static com.networknt.monad.Result<String> getPaymentByEmail​(String url, String email, String token)
      Get payment by email.
      static com.networknt.monad.Result<String> getProvider​(io.undertow.server.HttpServerExchange exchange, String url, String host, int offset, int limit)
      Get provider for host with exchange and url.
      static com.networknt.monad.Result<String> getProviderDetail​(io.undertow.server.HttpServerExchange exchange, String url, String providerId)
      Get provider detail.
      static com.networknt.monad.Result<String> getRefreshToken​(io.undertow.server.HttpServerExchange exchange, String url, String host, int offset, int limit)
      Get refresh tokens for host with exchange and url.
      static com.networknt.monad.Result<String> getRefreshTokenDetail​(io.undertow.server.HttpServerExchange exchange, String url, String refreshToken)
      Get refreshToken detail.
      static com.networknt.monad.Result<String> getRefToken​(io.undertow.server.HttpServerExchange exchange, String url, String host, int offset, int limit)
      Get reference tokens for host with exchange and url.
      static com.networknt.monad.Result<String> getRefTokenDetail​(io.undertow.server.HttpServerExchange exchange, String url, String refToken)
      Get refToken detail.
      static com.networknt.monad.Result<String> getRefTokenDetail​(String refToken, String token)
      Get refToken detail by reference token with client credentials token from oauth-kafka.
      static com.networknt.monad.Result<String> getRuleByGroup​(io.undertow.server.HttpServerExchange exchange, String url, String host, String groupId)
      Get rule list for host with rule group id, exchange and url.
      static com.networknt.monad.Result<String> getRuleByHost​(io.undertow.server.HttpServerExchange exchange, String url, String host, int offset, int limit)
      Get rule list for host with exchange and url.
      static com.networknt.monad.Result<String> getRuleById​(io.undertow.server.HttpServerExchange exchange, String url, String host, String ruleId)
      Get rule for host and ruleId with exchange.
      static com.networknt.monad.Result<String> getRuleByType​(io.undertow.server.HttpServerExchange exchange, String url, String host, String ruleType)
      Get rule list for host with rule type, exchange and url.
      static com.networknt.monad.Result<String> getService​(io.undertow.server.HttpServerExchange exchange, String url, String host, String style, int offset, int limit)
      Get service for host with exchange, url and optional style.
      static com.networknt.monad.Result<String> getServiceById​(io.undertow.server.HttpServerExchange exchange, String url, String serviceId)
      Get service detail by serviceId.
      static com.networknt.monad.Result<String> getServiceRoleById​(io.undertow.server.HttpServerExchange exchange, String url, String serviceId)
      Get service roles by serviceId.
      static com.networknt.monad.Result<String> getStatusByEmail​(io.undertow.server.HttpServerExchange exchange, String url, String email)
      Get status by email.
      static com.networknt.monad.Result<String> getStatusByEmail​(String url, String email, String token)
      Get status by email with a client credentials token.
      static com.networknt.monad.Result<String> getTags​(String url, String host, String app)
      Get tags list for host and app with url.
      static com.networknt.monad.Result<String> getTemplate​(io.undertow.server.HttpServerExchange exchange, String url, String host, int offset, int limit)
      Get template list for host with exchange and url.
      static com.networknt.monad.Result<String> getTemplateById​(io.undertow.server.HttpServerExchange exchange, String url, String host, String id)
      Get template for host and id with exchange and url.
      static com.networknt.monad.Result<String> getUserByEmail​(io.undertow.server.HttpServerExchange exchange, String email)
      Get User by email with exchange and email
      static com.networknt.monad.Result<String> getUserByEmail​(io.undertow.server.HttpServerExchange exchange, String url, String email)
      Deprecated.
      Please use portal.yml config PortalByServiceUrl indicator
      static com.networknt.monad.Result<String> getUserByEmail​(String email, String token)
      Get User by email between service to service invocation.
      static com.networknt.monad.Result<String> getUserById​(io.undertow.server.HttpServerExchange exchange, String userId)
      Get User email by id with the current credentials in the exchange.
      static com.networknt.monad.Result<String> getUserById​(io.undertow.server.HttpServerExchange exchange, String url, String userId)
      Get User email by id with the same credentials token.
      static com.networknt.monad.Result<String> getUserById​(String userId, String token)
      Get User email by userId between service to service invocation.
      static com.networknt.monad.Result<String> getWebsiteByEmail​(io.undertow.server.HttpServerExchange exchange, String url, String email)
      Get website by email.
      static com.networknt.monad.Result<String> getWebsiteByEmail​(String url, String email, String token)
      Get website by email with a client credentials token.
      static com.networknt.monad.Result<String> loginUser​(String url, String email, String password)
      Get password by email for login.
    • Constructor Detail

      • HybridQueryClient

        public HybridQueryClient()
    • Method Detail

      • callQueryWithToken

        public static com.networknt.monad.Result<String> callQueryWithToken​(String command,
                                                                            String token)
      • callQueryExchangeUrl

        public static com.networknt.monad.Result<String> callQueryExchangeUrl​(String command,
                                                                              io.undertow.server.HttpServerExchange exchange,
                                                                              String url)
      • callQueryExchange

        public static com.networknt.monad.Result<String> callQueryExchange​(String command,
                                                                           io.undertow.server.HttpServerExchange exchange)
      • callQueryUrl

        public static com.networknt.monad.Result<String> callQueryUrl​(String command,
                                                                      String url)
      • callQueryTokenUrl

        public static com.networknt.monad.Result<String> callQueryTokenUrl​(String command,
                                                                           String token,
                                                                           String url)
      • getUserByEmail

        public static com.networknt.monad.Result<String> getUserByEmail​(io.undertow.server.HttpServerExchange exchange,
                                                                        String email)
        Get User by email with exchange and email
        Parameters:
        exchange - HttpServerExchange
        email - user email
        Returns:
        Result of user object in JSON
      • getUserByEmail

        public static com.networknt.monad.Result<String> getUserByEmail​(io.undertow.server.HttpServerExchange exchange,
                                                                        String url,
                                                                        String email)
        Deprecated.
        Please use portal.yml config PortalByServiceUrl indicator
        Get User by email with exchange, a specific url and email
        Parameters:
        exchange - HttpServerExchange
        url - url to a specific host
        email - user email
        Returns:
        Result of user object in JSON
      • getUserByEmail

        public static com.networknt.monad.Result<String> getUserByEmail​(String email,
                                                                        String token)
        Get User by email between service to service invocation. It is mainly called from light-spa-4j social login handlers. The token will be a bootstrap 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 portal services and a client credential token must be provided.
        Parameters:
        email - email
        token - a client credential JWT token
        Returns:
        Result of user
      • getUserById

        public static com.networknt.monad.Result<String> getUserById​(io.undertow.server.HttpServerExchange exchange,
                                                                     String userId)
        Get User email by id with the current credentials in the exchange. This means the same user is trying to get its email from userId. Or an Admin user is doing so with an authorization code token.
        Parameters:
        exchange - HttpServerExchange
        userId - userId
        Returns:
        Result of user email
      • getUserById

        public static com.networknt.monad.Result<String> getUserById​(io.undertow.server.HttpServerExchange exchange,
                                                                     String url,
                                                                     String userId)
        Get User email by id with the same credentials token. It must be the same user or an admin user. Given there is a url in the parameter, that means this is coming from the Kafka lookup already so the exact url is specified.
        Parameters:
        exchange - HttpServerExchange
        url - to a specific host
        userId - userId
        Returns:
        Result of user email
      • getUserById

        public static com.networknt.monad.Result<String> getUserById​(String userId,
                                                                     String token)
        Get User email by userId between service to service invocation. 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 portal services and a client credential token must be provided.
        Parameters:
        userId - userId
        token - a client credential JWT token
        Returns:
        Result of user email
      • getNonceByEmail

        public static com.networknt.monad.Result<String> getNonceByEmail​(io.undertow.server.HttpServerExchange exchange,
                                                                         String email)
        Get Nonce for the user by email. The result also indicates the user exists in the system.
        Parameters:
        exchange - HttpServerExchange
        email - user email
        Returns:
        Result of user object in JSON
      • getNonceByEmail

        public static com.networknt.monad.Result<String> getNonceByEmail​(io.undertow.server.HttpServerExchange exchange,
                                                                         String url,
                                                                         String email)
        Get Nonce for the user by email. The result also indicates the user exists in the system.
        Parameters:
        exchange - HttpServerExchange
        url - url to a specific host
        email - user email
        Returns:
        Result of user object in JSON
      • getCity

        public static com.networknt.monad.Result<String> getCity​(io.undertow.server.HttpServerExchange exchange,
                                                                 String country,
                                                                 String province,
                                                                 String city)
        Get city object from a combination of country, province and city. The result also indicates the city exists in the system.
        Parameters:
        exchange - HttpServerExchange
        country - of the city
        province - of the city
        city - name of the city
        Returns:
        Result of city object in JSON
      • loginUser

        public static com.networknt.monad.Result<String> loginUser​(String url,
                                                                   String email,
                                                                   String password)
        Get password by email for login.
        Parameters:
        url - url to a specific host
        email - email of the user
        password - password of the user
        Returns:
        Result of user password
      • getMessageByEmail

        public static com.networknt.monad.Result<String> getMessageByEmail​(io.undertow.server.HttpServerExchange exchange,
                                                                           String url,
                                                                           String email)
        Get private messages for the user by email. The result contains a list of messages.
        Parameters:
        exchange - HttpServerExchange
        url - host of instance that contains the state store
        email - user email
        Returns:
        Result of message list in JSON
      • getNotificationByEmail

        public static com.networknt.monad.Result<String> getNotificationByEmail​(io.undertow.server.HttpServerExchange exchange,
                                                                                String url,
                                                                                String email)
        Get notification for the user by email. The result contains a list of notifications.
        Parameters:
        exchange - HttpServerExchange
        url - host of instance that contains the state store
        email - user email
        Returns:
        Result of message list in JSON
      • getEntity

        public static com.networknt.monad.Result<String> getEntity​(io.undertow.server.HttpServerExchange exchange,
                                                                   String url,
                                                                   String email)
        Get covid entity for the user by key. The result contains an entity object.
        Parameters:
        exchange - HttpServerExchange
        url - host of instance that contains the state store
        email - entity email
        Returns:
        Result of message list in JSON
      • getStatusByEmail

        public static com.networknt.monad.Result<String> getStatusByEmail​(io.undertow.server.HttpServerExchange exchange,
                                                                          String url,
                                                                          String email)
        Get status by email. The result contains an status object.
        Parameters:
        exchange - HttpServerExchange
        url - host of instance that contains the state store
        email - entity email
        Returns:
        Result of status object in JSON
      • getStatusByEmail

        public static com.networknt.monad.Result<String> getStatusByEmail​(String url,
                                                                          String email,
                                                                          String token)
        Get status by email with a client credentials token. The result contains an status object.
        Parameters:
        token - Jwt token
        url - host of instance that contains the state store
        email - entity email
        Returns:
        Result of status object in JSON
      • getWebsiteByEmail

        public static com.networknt.monad.Result<String> getWebsiteByEmail​(io.undertow.server.HttpServerExchange exchange,
                                                                           String url,
                                                                           String email)
        Get website by email. The result contains an website object.
        Parameters:
        exchange - HttpServerExchange
        url - host of instance that contains the state store
        email - entity email
        Returns:
        Result of website object in JSON
      • getWebsiteByEmail

        public static com.networknt.monad.Result<String> getWebsiteByEmail​(String url,
                                                                           String email,
                                                                           String token)
        Get website by email with a client credentials token. The result contains a website object.
        Parameters:
        token - Jwt token
        url - host of instance that contains the state store
        email - entity email
        Returns:
        Result of website object in JSON
      • getPaymentByEmail

        public static com.networknt.monad.Result<String> getPaymentByEmail​(io.undertow.server.HttpServerExchange exchange,
                                                                           String url,
                                                                           String email)
        Get payment by email. The result contains a list of payments.
        Parameters:
        exchange - HttpServerExchange
        url - host of instance that contains the state store
        email - entity email
        Returns:
        Result of payments object in JSON
      • getPaymentByEmail

        public static com.networknt.monad.Result<String> getPaymentByEmail​(String url,
                                                                           String email,
                                                                           String token)
        Get payment by email. The result contains a list of payments. This is for API to API invocation with client credentials token.
        Parameters:
        url - host of instance that contains the state store
        email - entity email
        token - JWT token
        Returns:
        Result of payments object in JSON
      • getCustomerOrderByEmail

        public static com.networknt.monad.Result<String> getCustomerOrderByEmail​(io.undertow.server.HttpServerExchange exchange,
                                                                                 String url,
                                                                                 String email,
                                                                                 int offset,
                                                                                 int limit)
        Get customer orders by email. The result contains a list of orders for the customer email.
        Parameters:
        exchange - HttpServerExchange
        url - host of instance that contains the state store
        email - entity email
        offset - entry offset
        limit - entry limit
        Returns:
        Result of orders object in JSON
      • getMerchantOrderByEmail

        public static com.networknt.monad.Result<String> getMerchantOrderByEmail​(io.undertow.server.HttpServerExchange exchange,
                                                                                 String url,
                                                                                 String email,
                                                                                 String orderStatus,
                                                                                 int offset,
                                                                                 int limit)
        Get merchant orders by email. The result contains a list of orders for the merchant email.
        Parameters:
        exchange - HttpServerExchange
        url - host of instance that contains the state store
        email - entity email
        orderStatus - order status
        offset - order offset
        limit - order limit
        Returns:
        Result of orders object in JSON
      • getClientById

        public static com.networknt.monad.Result<String> getClientById​(io.undertow.server.HttpServerExchange exchange,
                                                                       String url,
                                                                       String clientId)
        Get client detail by clientId. The result contains a map of properties.
        Parameters:
        exchange - HttpServerExchange
        url - host of instance that contains the state store
        clientId - client id
        Returns:
        Result of client object in JSON
      • getClientById

        public static com.networknt.monad.Result<String> getClientById​(String token,
                                                                       String url,
                                                                       String clientId)
        Get client detail by clientId. The result contains a map of properties.
        Parameters:
        token - access token
        url - host of instance that contains the state store
        clientId - client id
        Returns:
        Result of client object in JSON
      • getClientById

        public static com.networknt.monad.Result<String> getClientById​(String token,
                                                                       String clientId)
        Get client by clientId with client credentials token from 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:
        clientId - client Id
        token - a client credential JWT token
        Returns:
        Result of client
      • getClient

        public static com.networknt.monad.Result<String> getClient​(io.undertow.server.HttpServerExchange exchange,
                                                                   String url,
                                                                   String host,
                                                                   int offset,
                                                                   int limit)
        Get client for host with exchange and url. The result contains a list of client.
        Parameters:
        exchange - HttpServerExchange
        url - url of target server
        host - host name
        offset - of the records
        limit - of the records
        Returns:
        Result list of client in JSON
      • getService

        public static com.networknt.monad.Result<String> getService​(io.undertow.server.HttpServerExchange exchange,
                                                                    String url,
                                                                    String host,
                                                                    String style,
                                                                    int offset,
                                                                    int limit)
        Get service for host with exchange, url and optional style. The result contains a list of service.
        Parameters:
        exchange - HttpServerExchange
        url - url of target server
        host - host name
        style - service style
        offset - of the records
        limit - of the records
        Returns:
        Result list of service in JSON
      • getServiceById

        public static com.networknt.monad.Result<String> getServiceById​(io.undertow.server.HttpServerExchange exchange,
                                                                        String url,
                                                                        String serviceId)
        Get service detail by serviceId. The result contains a map of properties.
        Parameters:
        exchange - HttpServerExchange
        url - host of instance that contains the state store
        serviceId - service id
        Returns:
        Result of client object in JSON
      • getServiceRoleById

        public static com.networknt.monad.Result<String> getServiceRoleById​(io.undertow.server.HttpServerExchange exchange,
                                                                            String url,
                                                                            String serviceId)
        Get service roles by serviceId. The result contains a map of role to role for dropdown menu on the UI.
        Parameters:
        exchange - HttpServerExchange
        url - host of instance that contains the state store
        serviceId - service id
        Returns:
        Result of role/role map in JSON
      • getRefreshTokenDetail

        public static com.networknt.monad.Result<String> getRefreshTokenDetail​(io.undertow.server.HttpServerExchange exchange,
                                                                               String url,
                                                                               String refreshToken)
        Get refreshToken detail. The result contains a map of properties.
        Parameters:
        exchange - HttpServerExchange
        url - host of instance that contains the state store
        refreshToken - refreshToken
        Returns:
        Result of refreshToken object in JSON
      • getRefreshToken

        public static com.networknt.monad.Result<String> getRefreshToken​(io.undertow.server.HttpServerExchange exchange,
                                                                         String url,
                                                                         String host,
                                                                         int offset,
                                                                         int limit)
        Get refresh tokens for host with exchange and url. The result contains a list of refresh tokens.
        Parameters:
        exchange - HttpServerExchange
        url - url of target server
        host - host name
        offset - of the records
        limit - of the records
        Returns:
        Result list of refresh tokens in JSON
      • getAuthCodeDetail

        public static com.networknt.monad.Result<String> getAuthCodeDetail​(io.undertow.server.HttpServerExchange exchange,
                                                                           String url,
                                                                           String authCode)
        Get authCode detail. The result contains a map of properties.
        Parameters:
        exchange - HttpServerExchange
        url - host of instance that contains the state store
        authCode - auth code
        Returns:
        Result of authCode object in JSON
      • getAuthCodeDetail

        public static com.networknt.monad.Result<String> getAuthCodeDetail​(String authCode,
                                                                           String token)
        Get authCode detail by authCode with client credentials token from oauth-kafka. The token will be a client credentials 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:
        authCode - Auth Code
        token - a client credential JWT token
        Returns:
        Result of authCode
      • getAuthCode

        public static com.networknt.monad.Result<String> getAuthCode​(io.undertow.server.HttpServerExchange exchange,
                                                                     String host,
                                                                     int offset,
                                                                     int limit)
        Get authCode for host. The result contains a list of auth code object.
        Parameters:
        exchange - HttpServerExchange
        host - host name
        offset - of the records
        limit - of the records
        Returns:
        Result list of authCode object in JSON
      • getAuthCode

        public static com.networknt.monad.Result<String> getAuthCode​(io.undertow.server.HttpServerExchange exchange,
                                                                     String url,
                                                                     String host,
                                                                     int offset,
                                                                     int limit)
        Get authCode for host with exchange and url. The result contains a list of auth code object.
        Parameters:
        exchange - HttpServerExchange
        url - url of target server
        host - host name
        offset - of the records
        limit - of the records
        Returns:
        Result list of authCode object in JSON
      • getRefTokenDetail

        public static com.networknt.monad.Result<String> getRefTokenDetail​(io.undertow.server.HttpServerExchange exchange,
                                                                           String url,
                                                                           String refToken)
        Get refToken detail. The result contains a map of properties.
        Parameters:
        exchange - HttpServerExchange
        url - host of instance that contains the state store
        refToken - reference token
        Returns:
        Result of refToken object in JSON
      • getRefTokenDetail

        public static com.networknt.monad.Result<String> getRefTokenDetail​(String refToken,
                                                                           String token)
        Get refToken detail by reference token with client credentials token from oauth-kafka. The token will be a client credentials 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:
        refToken - Reference Token
        token - a client credential JWT token
        Returns:
        Result of refToken
      • getRefToken

        public static com.networknt.monad.Result<String> getRefToken​(io.undertow.server.HttpServerExchange exchange,
                                                                     String url,
                                                                     String host,
                                                                     int offset,
                                                                     int limit)
        Get reference tokens for host with exchange and url. The result contains a list of reference tokens.
        Parameters:
        exchange - HttpServerExchange
        url - url of target server
        host - host name
        offset - of the records
        limit - of the records
        Returns:
        Result list of reference tokens in JSON
      • getProviderDetail

        public static com.networknt.monad.Result<String> getProviderDetail​(io.undertow.server.HttpServerExchange exchange,
                                                                           String url,
                                                                           String providerId)
        Get provider detail. The result contains a map of properties.
        Parameters:
        exchange - HttpServerExchange
        url - host of instance that contains the state store
        providerId - provider Id
        Returns:
        Result of provider object in JSON
      • getProvider

        public static com.networknt.monad.Result<String> getProvider​(io.undertow.server.HttpServerExchange exchange,
                                                                     String url,
                                                                     String host,
                                                                     int offset,
                                                                     int limit)
        Get provider for host with exchange and url. The result contains a list of providers.
        Parameters:
        exchange - HttpServerExchange
        url - url of target server
        host - host name
        offset - of the records
        limit - of the records
        Returns:
        Result list of provider object in JSON
      • getHosts

        public static com.networknt.monad.Result<String> getHosts()
        Get a list of hosts from reference api for host dropdowns in the UI.
        Returns:
        Result of list of host object in JSON
      • getHost

        public static com.networknt.monad.Result<String> getHost​(io.undertow.server.HttpServerExchange exchange,
                                                                 String url,
                                                                 String host)
        Get all the entities associated with a particular host. This method is called from the main getHost endpoint to get remote host if it is not on the local store.
        Parameters:
        exchange - HttpServerExchange
        url - url of target server
        host - host name
        Returns:
        Result map of entities in JSON
      • getHost

        public static com.networknt.monad.Result<String> getHost​(io.undertow.server.HttpServerExchange exchange,
                                                                 String host)
        Get all the entities associated with a particular host. This method is called by the createHost or updateHost command side endpoints.
        Parameters:
        exchange - HttpServerExchange
        host - host name
        Returns:
        Result map of entities in JSON
      • getCategoryByName

        public static com.networknt.monad.Result<String> getCategoryByName​(io.undertow.server.HttpServerExchange exchange,
                                                                           String url,
                                                                           String host,
                                                                           String name)
        Get category for host and name with exchange and url. The result contains a list of codes.
        Parameters:
        exchange - HttpServerExchange
        url - url of target server
        host - host name
        name - of the category
        Returns:
        Result list of category objects in JSON
      • getCategory

        public static com.networknt.monad.Result<String> getCategory​(io.undertow.server.HttpServerExchange exchange,
                                                                     String url,
                                                                     String host)
        Get category list for host with exchange and url. The result contains a list of categories.
        Parameters:
        exchange - HttpServerExchange
        url - url of target server
        host - host name
        Returns:
        Result list of category objects in JSON
      • getBlogById

        public static com.networknt.monad.Result<String> getBlogById​(io.undertow.server.HttpServerExchange exchange,
                                                                     String url,
                                                                     String host,
                                                                     String id)
        Get blog for host and id with exchange and url. The result contains a blog object.
        Parameters:
        exchange - HttpServerExchange
        url - url of target server
        host - host name
        id - of the blog
        Returns:
        Result the blog object in JSON
      • getBlogById

        public static com.networknt.monad.Result<String> getBlogById​(io.undertow.server.HttpServerExchange exchange,
                                                                     String host,
                                                                     String id)
        Get blog for host and id with exchange. The result contains a blog object.
        Parameters:
        exchange - HttpServerExchange
        host - host name
        id - of the blog
        Returns:
        Result the blog object in JSON
      • getBlogList

        public static com.networknt.monad.Result<String> getBlogList​(io.undertow.server.HttpServerExchange exchange,
                                                                     String url,
                                                                     String host,
                                                                     int offset,
                                                                     int limit,
                                                                     List<String> categories,
                                                                     List<String> tags)
        Get blog list for host or categories or tags with exchange and url. The result contains a list of detailed blog objects.
        Parameters:
        exchange - HttpServerExchange
        host - host name
        url - url of target server
        offset - of the records
        limit - of the records
        categories - list of categories
        tags - list of tags
        Returns:
        Result the blog object in JSON
      • getBlog

        public static com.networknt.monad.Result<String> getBlog​(io.undertow.server.HttpServerExchange exchange,
                                                                 String url,
                                                                 String host,
                                                                 int offset,
                                                                 int limit)
        Get blog list for host with exchange and url. The result contains a list of blogs.
        Parameters:
        exchange - HttpServerExchange
        url - url of target server
        host - host name
        offset - of the records
        limit - of the records
        Returns:
        Result list of blog objects in JSON
      • getDocumentById

        public static com.networknt.monad.Result<String> getDocumentById​(io.undertow.server.HttpServerExchange exchange,
                                                                         String url,
                                                                         String host,
                                                                         String id)
        Get document for host and id with exchange and url. The result contains a document object.
        Parameters:
        exchange - HttpServerExchange
        url - url of target server
        host - host name
        id - of the document
        Returns:
        Result the document object in JSON
      • getDocument

        public static com.networknt.monad.Result<String> getDocument​(io.undertow.server.HttpServerExchange exchange,
                                                                     String url,
                                                                     String host,
                                                                     int offset,
                                                                     int limit)
        Get document list for host with exchange and url. The result contains a list of documents.
        Parameters:
        exchange - HttpServerExchange
        url - url of target server
        host - host name
        offset - of the records
        limit - of the records
        Returns:
        Result list of document objects in JSON
      • getNewsById

        public static com.networknt.monad.Result<String> getNewsById​(io.undertow.server.HttpServerExchange exchange,
                                                                     String url,
                                                                     String host,
                                                                     String id)
        Get news for host and id with exchange and url. The result contains a news object.
        Parameters:
        exchange - HttpServerExchange
        url - url of target server
        host - host name
        id - of the document
        Returns:
        Result the news object in JSON
      • getNews

        public static com.networknt.monad.Result<String> getNews​(io.undertow.server.HttpServerExchange exchange,
                                                                 String url,
                                                                 String host,
                                                                 int offset,
                                                                 int limit)
        Get news list for host with exchange and url. The result contains a list of news.
        Parameters:
        exchange - HttpServerExchange
        url - url of target server
        host - host name
        offset - of the records
        limit - of the records
        Returns:
        Result list of news objects in JSON
      • getPageById

        public static com.networknt.monad.Result<String> getPageById​(io.undertow.server.HttpServerExchange exchange,
                                                                     String url,
                                                                     String host,
                                                                     String id)
        Get page for host and id with exchange and url. The result contains a page object.
        Parameters:
        exchange - HttpServerExchange
        url - url of target server
        host - host name
        id - of the page
        Returns:
        Result the page object in JSON
      • getPage

        public static com.networknt.monad.Result<String> getPage​(io.undertow.server.HttpServerExchange exchange,
                                                                 String url,
                                                                 String host,
                                                                 int offset,
                                                                 int limit)
        Get page list for host with exchange and url. The result contains a list of page.
        Parameters:
        exchange - HttpServerExchange
        url - url of target server
        host - host name
        offset - of the records
        limit - of the records
        Returns:
        Result list of page objects in JSON
      • getTemplateById

        public static com.networknt.monad.Result<String> getTemplateById​(io.undertow.server.HttpServerExchange exchange,
                                                                         String url,
                                                                         String host,
                                                                         String id)
        Get template for host and id with exchange and url. The result contains a template object.
        Parameters:
        exchange - HttpServerExchange
        url - url of target server
        host - host name
        id - of the template
        Returns:
        Result the template object in JSON
      • getTemplate

        public static com.networknt.monad.Result<String> getTemplate​(io.undertow.server.HttpServerExchange exchange,
                                                                     String url,
                                                                     String host,
                                                                     int offset,
                                                                     int limit)
        Get template list for host with exchange and url. The result contains a list of template.
        Parameters:
        exchange - HttpServerExchange
        url - url of target server
        host - host name
        offset - of the records
        limit - of the records
        Returns:
        Result list of template objects in JSON
      • getTags

        public static com.networknt.monad.Result<String> getTags​(String url,
                                                                 String host,
                                                                 String app)
        Get tags list for host and app with url. The result contains a list of tags for the host and app combination.
        Parameters:
        url - url of target server
        host - host name
        app - app name
        Returns:
        Result list of tags objects in JSON
      • getError

        public static com.networknt.monad.Result<String> getError​(io.undertow.server.HttpServerExchange exchange,
                                                                  String url,
                                                                  String host,
                                                                  int offset,
                                                                  int limit)
        Get error list for host with exchange and url. The result contains a list of error codes.
        Parameters:
        exchange - HttpServerExchange
        url - url of target server
        host - host name
        offset - of the records
        limit - of the records
        Returns:
        Result list of error objects in JSON
      • getErrorByCode

        public static com.networknt.monad.Result<String> getErrorByCode​(io.undertow.server.HttpServerExchange exchange,
                                                                        String url,
                                                                        String host,
                                                                        String errorCode)
        Get error for host and errorCode with exchange. The result contains a error object.
        Parameters:
        exchange - HttpServerExchange
        host - host name
        url - of the target server
        errorCode - of the error
        Returns:
        Result the error object in JSON
      • getJsonSchema

        public static com.networknt.monad.Result<String> getJsonSchema​(io.undertow.server.HttpServerExchange exchange,
                                                                       String url,
                                                                       String host,
                                                                       int offset,
                                                                       int limit)
        Get schema list for host with exchange and url. The result contains a list of schema ids.
        Parameters:
        exchange - HttpServerExchange
        url - url of target server
        host - host name
        offset - of the records
        limit - of the records
        Returns:
        Result list of schema objects in JSON
      • getJsonSchemaById

        public static com.networknt.monad.Result<String> getJsonSchemaById​(io.undertow.server.HttpServerExchange exchange,
                                                                           String url,
                                                                           String host,
                                                                           String id)
        Get schema for host and id with exchange and url. The result contains a schema object.
        Parameters:
        exchange - HttpServerExchange
        host - host name
        url - of the target server
        id - of the schema
        Returns:
        Result the schema object in JSON
      • getJsonSchemaById

        public static com.networknt.monad.Result<String> getJsonSchemaById​(io.undertow.server.HttpServerExchange exchange,
                                                                           String host,
                                                                           String id)
        Get schema for host and id with exchange. The result contains a schema object.
        Parameters:
        exchange - HttpServerExchange
        host - host name
        id - of the schema
        Returns:
        Result the schema object in JSON
      • getJsonSchemaList

        public static com.networknt.monad.Result<String> getJsonSchemaList​(io.undertow.server.HttpServerExchange exchange,
                                                                           String url,
                                                                           String host,
                                                                           int offset,
                                                                           int limit,
                                                                           List<String> categories,
                                                                           List<String> tags)
        Get schema list for host or categories or tags with exchange and url. The result contains a list of detailed schema objects.
        Parameters:
        exchange - HttpServerExchange
        host - host name
        url - url of target server
        offset - of the records
        limit - of the records
        categories - list of categories
        tags - list of tags
        Returns:
        Result the schema object in JSON
      • getRuleById

        public static com.networknt.monad.Result<String> getRuleById​(io.undertow.server.HttpServerExchange exchange,
                                                                     String url,
                                                                     String host,
                                                                     String ruleId)
        Get rule for host and ruleId with exchange. The result contains a rule object.
        Parameters:
        exchange - HttpServerExchange
        host - host name
        url - of the target server
        ruleId - of the rule
        Returns:
        Result the rule object in JSON
      • getRuleByHost

        public static com.networknt.monad.Result<String> getRuleByHost​(io.undertow.server.HttpServerExchange exchange,
                                                                       String url,
                                                                       String host,
                                                                       int offset,
                                                                       int limit)
        Get rule list for host with exchange and url. The result contains a list of rules.
        Parameters:
        exchange - HttpServerExchange
        url - url of target server
        host - host name
        offset - of the records
        limit - of the records
        Returns:
        Result list of rule objects in JSON
      • getRuleByType

        public static com.networknt.monad.Result<String> getRuleByType​(io.undertow.server.HttpServerExchange exchange,
                                                                       String url,
                                                                       String host,
                                                                       String ruleType)
        Get rule list for host with rule type, exchange and url. The result contains a list of rules.
        Parameters:
        exchange - HttpServerExchange
        url - url of target server
        host - host name
        ruleType - rule type
        Returns:
        Result list of rule objects in JSON
      • getRuleByGroup

        public static com.networknt.monad.Result<String> getRuleByGroup​(io.undertow.server.HttpServerExchange exchange,
                                                                        String url,
                                                                        String host,
                                                                        String groupId)
        Get rule list for host with rule group id, exchange and url. The result contains a list of rules.
        Parameters:
        exchange - HttpServerExchange
        url - url of target server
        host - host name
        groupId - rule groupId
        Returns:
        Result list of rule objects in JSON