Package io.pravega.client.security.auth
Class DelegationTokenProviderFactory
- java.lang.Object
-
- io.pravega.client.security.auth.DelegationTokenProviderFactory
-
public class DelegationTokenProviderFactory extends java.lang.Object
Factory class forDelegationTokenProvider
instances.
-
-
Constructor Summary
Constructors Constructor Description DelegationTokenProviderFactory()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static DelegationTokenProvider
create(io.pravega.client.control.impl.Controller controller, io.pravega.client.segment.impl.Segment segment, io.pravega.shared.security.auth.AccessOperation accessOperation)
Creates aDelegationTokenProvider
instance with null delegation token.static DelegationTokenProvider
create(io.pravega.client.control.impl.Controller controller, java.lang.String scopeName, java.lang.String streamName, io.pravega.shared.security.auth.AccessOperation accessOperation)
Creates aDelegationTokenProvider
instance with null delegation token.static DelegationTokenProvider
create(java.lang.String delegationToken, @NonNull io.pravega.client.control.impl.Controller controller, @NonNull io.pravega.client.segment.impl.Segment segment, io.pravega.shared.security.auth.AccessOperation accessOperation)
Creates aDelegationTokenProvider
instance with the specified delegation token.static DelegationTokenProvider
create(java.lang.String delegationToken, io.pravega.client.control.impl.Controller controller, java.lang.String scopeName, java.lang.String streamName, io.pravega.shared.security.auth.AccessOperation accessOperation)
Creates aDelegationTokenProvider
instance of an appropriate type.static DelegationTokenProvider
createWithEmptyToken()
Creates aDelegationTokenProvider
instance with empty token.
-
-
-
Method Detail
-
createWithEmptyToken
public static DelegationTokenProvider createWithEmptyToken()
Creates aDelegationTokenProvider
instance with empty token. Intended to be Used for testing only.- Returns:
- a new
DelegationTokenProvider
instance
-
create
public static DelegationTokenProvider create(io.pravega.client.control.impl.Controller controller, java.lang.String scopeName, java.lang.String streamName, io.pravega.shared.security.auth.AccessOperation accessOperation)
Creates aDelegationTokenProvider
instance with null delegation token.- Parameters:
controller
- theController
client 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
DelegationTokenProvider
instance - Throws:
java.lang.NullPointerException
- ifcontroller
,scopeName
orstreamName
is nulljava.lang.IllegalArgumentException
- ifscopeName
orstreamName
is empty
-
create
public static DelegationTokenProvider create(io.pravega.client.control.impl.Controller controller, io.pravega.client.segment.impl.Segment segment, io.pravega.shared.security.auth.AccessOperation accessOperation)
Creates aDelegationTokenProvider
instance with null delegation token.- Parameters:
controller
- theController
client 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
DelegationTokenProvider
instance - Throws:
java.lang.NullPointerException
- ifcontroller
orsegment
is null
-
create
public static DelegationTokenProvider create(java.lang.String delegationToken, @NonNull @NonNull io.pravega.client.control.impl.Controller controller, @NonNull @NonNull io.pravega.client.segment.impl.Segment segment, io.pravega.shared.security.auth.AccessOperation accessOperation)
Creates aDelegationTokenProvider
instance with the specified delegation token.- Parameters:
delegationToken
- an existing delegation token to populate theDelegationTokenProvider
instance withcontroller
- theController
client 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
DelegationTokenProvider
instance - Throws:
java.lang.NullPointerException
- ifcontroller
orsegment
is null
-
create
public static DelegationTokenProvider create(java.lang.String delegationToken, io.pravega.client.control.impl.Controller controller, java.lang.String scopeName, java.lang.String streamName, io.pravega.shared.security.auth.AccessOperation accessOperation)
Creates aDelegationTokenProvider
instance of an appropriate type.- Parameters:
delegationToken
- an existing delegation token to populate theDelegationTokenProvider
instance with.controller
- theController
client 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
DelegationTokenProvider
instance
-
-