public class DelegationTokenProviderFactory
extends java.lang.Object
DelegationTokenProvider
instances.Constructor and Description |
---|
DelegationTokenProviderFactory() |
Modifier and Type | Method and Description |
---|---|
static DelegationTokenProvider |
create(io.pravega.client.stream.impl.Controller controller,
io.pravega.client.segment.impl.Segment segment)
Creates a
DelegationTokenProvider instance with null delegation token. |
static DelegationTokenProvider |
create(io.pravega.client.stream.impl.Controller controller,
java.lang.String scopeName,
java.lang.String streamName)
Creates a
DelegationTokenProvider instance with null delegation token. |
static DelegationTokenProvider |
create(java.lang.String delegationToken,
@NonNull io.pravega.client.stream.impl.Controller controller,
@NonNull io.pravega.client.segment.impl.Segment segment)
Creates a
DelegationTokenProvider instance with the specified delegation token. |
static DelegationTokenProvider |
create(java.lang.String delegationToken,
io.pravega.client.stream.impl.Controller controller,
java.lang.String scopeName,
java.lang.String streamName)
Creates a
DelegationTokenProvider instance of an appropriate type. |
static DelegationTokenProvider |
createWithEmptyToken()
Creates a
DelegationTokenProvider instance with empty token. |
public static DelegationTokenProvider createWithEmptyToken()
DelegationTokenProvider
instance with empty token. Intended to be Used for testing only.DelegationTokenProvider
instancepublic static DelegationTokenProvider create(io.pravega.client.stream.impl.Controller controller, java.lang.String scopeName, java.lang.String streamName)
DelegationTokenProvider
instance with null delegation token.controller
- the Controller
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 obtainedDelegationTokenProvider
instancejava.lang.NullPointerException
- if controller
, scopeName
or streamName
is nulljava.lang.IllegalArgumentException
- if scopeName
or streamName
is emptypublic static DelegationTokenProvider create(io.pravega.client.stream.impl.Controller controller, io.pravega.client.segment.impl.Segment segment)
DelegationTokenProvider
instance with null delegation token.controller
- the Controller
client used for obtaining a delegation token from the Controllersegment
- the Segment
, for which a delegation token is to be obtainedDelegationTokenProvider
instancejava.lang.NullPointerException
- if controller
or segment
is nullpublic static DelegationTokenProvider create(java.lang.String delegationToken, @NonNull @NonNull io.pravega.client.stream.impl.Controller controller, @NonNull @NonNull io.pravega.client.segment.impl.Segment segment)
DelegationTokenProvider
instance with the specified delegation token.delegationToken
- an existing delegation token to populate the DelegationTokenProvider
instance withcontroller
- the Controller
client used for obtaining a delegation token from the Controllersegment
- the Segment
, for which a delegation token is to be obtainedDelegationTokenProvider
instancejava.lang.NullPointerException
- if controller
or segment
is nullpublic static DelegationTokenProvider create(java.lang.String delegationToken, io.pravega.client.stream.impl.Controller controller, java.lang.String scopeName, java.lang.String streamName)
DelegationTokenProvider
instance of an appropriate type.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 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 obtainedDelegationTokenProvider
instance