Class DelegationTokenProviderFactory


  • public class DelegationTokenProviderFactory
    extends java.lang.Object
    Factory class for DelegationTokenProvider instances.
    • Constructor Detail

      • DelegationTokenProviderFactory

        public DelegationTokenProviderFactory()
    • Method Detail

      • create

        public static DelegationTokenProvider create​(Controller controller,
                                                     java.lang.String scopeName,
                                                     java.lang.String streamName,
                                                     io.pravega.shared.security.auth.AccessOperation accessOperation)
        Creates a DelegationTokenProvider instance with null delegation token.
        Parameters:
        controller - the Controller client used for obtaining a delegation token from the Controller
        scopeName - the name of the scope tied to the segment, for which a delegation token is to be obtained
        streamName - the name of the stream tied to the segment, for which a delegation token is to be obtained
        accessOperation - the access operation to use when requesting a delegation token from the server
        Returns:
        a new DelegationTokenProvider instance
        Throws:
        java.lang.NullPointerException - if controller, scopeName or streamName is null
        java.lang.IllegalArgumentException - if scopeName or streamName is empty
      • create

        public static DelegationTokenProvider create​(Controller controller,
                                                     Segment segment,
                                                     io.pravega.shared.security.auth.AccessOperation accessOperation)
        Creates a DelegationTokenProvider instance with null delegation token.
        Parameters:
        controller - the Controller client used for obtaining a delegation token from the Controller
        segment - the Segment, for which a delegation token is to be obtained
        accessOperation - the access operation to use when requesting a delegation token from the server
        Returns:
        a new DelegationTokenProvider instance
        Throws:
        java.lang.NullPointerException - if controller or segment is null
      • create

        public static DelegationTokenProvider create​(java.lang.String delegationToken,
                                                     @NonNull
                                                     @NonNull Controller controller,
                                                     @NonNull
                                                     @NonNull Segment segment,
                                                     io.pravega.shared.security.auth.AccessOperation accessOperation)
        Creates a DelegationTokenProvider instance with the specified delegation token.
        Parameters:
        delegationToken - an existing delegation token to populate the DelegationTokenProvider instance with
        controller - the Controller client used for obtaining a delegation token from the Controller
        segment - the Segment, for which a delegation token is to be obtained
        accessOperation - the access operation to use when requesting a delegation token from th server
        Returns:
        a new DelegationTokenProvider instance
        Throws:
        java.lang.NullPointerException - if controller or segment is null
      • create

        public static DelegationTokenProvider create​(java.lang.String delegationToken,
                                                     Controller controller,
                                                     java.lang.String scopeName,
                                                     java.lang.String streamName,
                                                     io.pravega.shared.security.auth.AccessOperation accessOperation)
        Creates a DelegationTokenProvider instance of an appropriate type.
        Parameters:
        delegationToken - an existing delegation token to populate the DelegationTokenProvider instance with.
        controller - the Controller client used for obtaining a delegation token from the Controller if/when the token expires or is nearing expiry
        scopeName - the name of the scope tied to the segment, for which a delegation token is to be obtained
        streamName - the name of the stream tied to the segment, for which a delegation token is to be obtained
        accessOperation - the access operation to use when requesting a delegation token from th server
        Returns:
        a new DelegationTokenProvider instance