public class ActorRequestFactory
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
static class |
ActorRequestFactory.Builder
A builder for
ActorRequestFactory . |
Modifier | Constructor and Description |
---|---|
protected |
ActorRequestFactory(ActorRequestFactory.Builder builder) |
Modifier and Type | Method and Description |
---|---|
io.spine.core.UserId |
actor()
Obtains the ID of the user on behalf of whom the requests are created.
|
CommandFactory |
command()
Creates an instance of
CommandFactory based on configuration of this
ActorRequestFactory instance. |
protected io.spine.core.CommandContext |
createCommandContext()
Creates new
CommandContext . |
static ActorRequestFactory |
fromContext(io.spine.core.ActorContext actorContext)
Creates an instance by the passed
ActorContext . |
static ActorRequestFactory.Builder |
newBuilder()
Creates a builder for a new request factory.
|
QueryFactory |
query()
Creates an instance of
QueryFactory based on configuration of this
ActorRequestFactory instance. |
ActorRequestFactory |
switchTimeZone(io.spine.time.ZoneId zoneId)
Creates a copy of this factory placed at a new time zone with the passed ID.
|
ActorRequestFactory |
switchTimeZone(io.spine.time.ZoneOffset zoneOffset,
io.spine.time.ZoneId zoneId)
Creates a copy of this factory placed at a new time zone with the passed offset and ID.
|
@Nullable io.spine.core.TenantId |
tenantId()
Obtains the ID of the tenant to which the actor belongs or
null
for single-tenant execution context. |
TopicFactory |
topic()
Creates an instance of
TopicFactory based on configuration of this
ActorRequestFactory instance. |
io.spine.time.ZoneId |
zoneId()
Obtains the ID of the time zone in which the actor works.
|
io.spine.time.ZoneOffset |
zoneOffset()
Obtains the offset of the time zone in which the actor works.
|
protected ActorRequestFactory(ActorRequestFactory.Builder builder)
public static ActorRequestFactory.Builder newBuilder()
public static ActorRequestFactory fromContext(io.spine.core.ActorContext actorContext)
ActorContext
.public io.spine.core.UserId actor()
public io.spine.time.ZoneOffset zoneOffset()
public io.spine.time.ZoneId zoneId()
public @Nullable io.spine.core.TenantId tenantId()
null
for single-tenant execution context.public ActorRequestFactory switchTimeZone(io.spine.time.ZoneOffset zoneOffset, io.spine.time.ZoneId zoneId)
Use this method for obtaining new request factory as the user moves to a new location.
zoneOffset
- the offset of the new time zonezoneId
- the ID of the new time zonepublic ActorRequestFactory switchTimeZone(io.spine.time.ZoneId zoneId)
The zone offset is calculated using the current time.
zoneId
- the ID of the new time zonepublic QueryFactory query()
QueryFactory
based on configuration of this
ActorRequestFactory
instance.QueryFactory
public TopicFactory topic()
TopicFactory
based on configuration of this
ActorRequestFactory
instance.TopicFactory
public CommandFactory command()
CommandFactory
based on configuration of this
ActorRequestFactory
instance.CommandFactory
protected io.spine.core.CommandContext createCommandContext()
CommandContext
.CommandFactory.createContext()