Package io.pravega.client.security.auth
Class DelegationTokenProviderFactory
- java.lang.Object
-
- io.pravega.client.security.auth.DelegationTokenProviderFactory
-
public class DelegationTokenProviderFactory extends java.lang.ObjectFactory class forDelegationTokenProviderinstances.
-
-
Constructor Summary
Constructors Constructor Description DelegationTokenProviderFactory()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static DelegationTokenProvidercreate(Controller controller, Segment segment, io.pravega.shared.security.auth.AccessOperation accessOperation)Creates aDelegationTokenProviderinstance with null delegation token.static DelegationTokenProvidercreate(Controller controller, java.lang.String scopeName, java.lang.String streamName, io.pravega.shared.security.auth.AccessOperation accessOperation)Creates aDelegationTokenProviderinstance with null delegation token.static DelegationTokenProvidercreate(java.lang.String delegationToken, @NonNull Controller controller, @NonNull Segment segment, io.pravega.shared.security.auth.AccessOperation accessOperation)Creates aDelegationTokenProviderinstance with the specified delegation token.static DelegationTokenProvidercreate(java.lang.String delegationToken, Controller controller, java.lang.String scopeName, java.lang.String streamName, io.pravega.shared.security.auth.AccessOperation accessOperation)Creates aDelegationTokenProviderinstance of an appropriate type.static DelegationTokenProvidercreateWithEmptyToken()Creates aDelegationTokenProviderinstance with empty token.
-
-
-
Method Detail
-
createWithEmptyToken
public static DelegationTokenProvider createWithEmptyToken()
Creates aDelegationTokenProviderinstance with empty token. Intended to be Used for testing only.- Returns:
- a new
DelegationTokenProviderinstance
-
create
public static DelegationTokenProvider create(Controller controller, java.lang.String scopeName, java.lang.String streamName, io.pravega.shared.security.auth.AccessOperation accessOperation)
Creates aDelegationTokenProviderinstance with null delegation token.- Parameters:
controller- theControllerclient used for obtaining a delegation token from the ControllerscopeName- the name of the scope tied to the segment, for which a delegation token is to be obtainedstreamName- the name of the stream tied to the segment, for which a delegation token is to be obtainedaccessOperation- the access operation to use when requesting a delegation token from the server- Returns:
- a new
DelegationTokenProviderinstance - Throws:
java.lang.NullPointerException- ifcontroller,scopeNameorstreamNameis nulljava.lang.IllegalArgumentException- ifscopeNameorstreamNameis empty
-
create
public static DelegationTokenProvider create(Controller controller, Segment segment, io.pravega.shared.security.auth.AccessOperation accessOperation)
Creates aDelegationTokenProviderinstance with null delegation token.- Parameters:
controller- theControllerclient used for obtaining a delegation token from the Controllersegment- theSegment, for which a delegation token is to be obtainedaccessOperation- the access operation to use when requesting a delegation token from the server- Returns:
- a new
DelegationTokenProviderinstance - Throws:
java.lang.NullPointerException- ifcontrollerorsegmentis 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 aDelegationTokenProviderinstance with the specified delegation token.- Parameters:
delegationToken- an existing delegation token to populate theDelegationTokenProviderinstance withcontroller- theControllerclient used for obtaining a delegation token from the Controllersegment- theSegment, for which a delegation token is to be obtainedaccessOperation- the access operation to use when requesting a delegation token from th server- Returns:
- a new
DelegationTokenProviderinstance - Throws:
java.lang.NullPointerException- ifcontrollerorsegmentis 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 aDelegationTokenProviderinstance of an appropriate type.- Parameters:
delegationToken- an existing delegation token to populate theDelegationTokenProviderinstance with.controller- theControllerclient used for obtaining a delegation token from the Controller if/when the token expires or is nearing expiryscopeName- the name of the scope tied to the segment, for which a delegation token is to be obtainedstreamName- the name of the stream tied to the segment, for which a delegation token is to be obtainedaccessOperation- the access operation to use when requesting a delegation token from th server- Returns:
- a new
DelegationTokenProviderinstance
-
-