Package io.grpc.alts

Class AltsContextUtil


  • @ExperimentalApi("https://github.com/grpc/grpc-java/issues/7864")
    public final class AltsContextUtil
    extends Object
    Utility class for AltsContext.
    • Method Detail

      • createFrom

        public static AltsContext createFrom​(io.grpc.ServerCall<?,​?> call)
        Creates an AltsContext from ALTS context information in the ServerCall.
        Parameters:
        call - the ServerCall containing the ALTS information
        Returns:
        the created AltsContext
        Throws:
        IllegalArgumentException - if the ServerCall has no ALTS information.
      • createFrom

        public static AltsContext createFrom​(io.grpc.ClientCall<?,​?> call)
        Creates an AltsContext from ALTS context information in the ClientCall.
        Parameters:
        call - the ClientCall containing the ALTS information
        Returns:
        the created AltsContext
        Throws:
        IllegalArgumentException - if the ClientCall has no ALTS information.
      • createFrom

        public static AltsContext createFrom​(io.grpc.Attributes attributes)
        Creates an AltsContext from ALTS context information in the Attributes.
        Parameters:
        attributes - the Attributes containing the ALTS information
        Returns:
        the created AltsContext
        Throws:
        IllegalArgumentException - if the Attributes has no ALTS information.
      • check

        public static boolean check​(io.grpc.ServerCall<?,​?> call)
        Checks if the ServerCall contains ALTS information.
        Parameters:
        call - the ServerCall to check
        Returns:
        true, if the ServerCall contains ALTS information and false otherwise.
      • check

        public static boolean check​(io.grpc.ClientCall<?,​?> call)
        Checks if the ClientCall contains ALTS information.
        Parameters:
        call - the ClientCall to check
        Returns:
        true, if the ClientCall contains ALTS information and false otherwise.
      • check

        public static boolean check​(io.grpc.Attributes attributes)
        Checks if the Attributes contains ALTS information.
        Parameters:
        attributes - the Attributes to check
        Returns:
        true, if the Attributes contains ALTS information and false otherwise.