public interface Client
Modifier and Type | Method and Description |
---|---|
com.google.common.util.concurrent.ListenableFuture<Session> |
authenticate(java.lang.String id,
java.util.Map<java.lang.String,java.lang.String> defaultProperties,
java.util.Map<java.lang.String,java.lang.String> customProperties)
Authenticate against the server.
|
com.google.common.util.concurrent.ListenableFuture<com.google.protobuf.Empty> |
authenticateLogout(@NonNull Session session)
Log out a session, invalidate a refresh token, or log out all sessions/refresh tokens for a user.
|
com.google.common.util.concurrent.ListenableFuture<com.google.protobuf.Empty> |
deleteIdentity(@NonNull Session session)
Delete the caller's identity and associated data.
|
com.google.common.util.concurrent.ListenableFuture<com.google.protobuf.Empty> |
deleteMessage(@NonNull Session session,
@NonNull java.lang.String messageId)
The request to delete a scheduled message.
|
void |
disconnect()
Disconnects the client.
|
void |
disconnect(long timeout,
@NonNull java.util.concurrent.TimeUnit unit)
Disconnects the client.
|
com.google.common.util.concurrent.ListenableFuture<com.google.protobuf.Empty> |
event(@NonNull Session session,
@NonNull Event event)
Send an event for this session.
|
com.google.common.util.concurrent.ListenableFuture<com.google.protobuf.Empty> |
events(@NonNull Session session,
@NonNull java.util.List<Event> events)
Send a batch of events for this session.
|
com.google.common.util.concurrent.ListenableFuture<ExperimentList> |
getAllExperiments(@NonNull Session session)
Get all experiments data.
|
com.google.common.util.concurrent.ListenableFuture<ExperimentList> |
getExperiments(@NonNull Session session,
java.lang.String... names)
Get specific experiments data.
|
com.google.common.util.concurrent.ListenableFuture<Flag> |
getFlag(@NonNull Session session,
@NonNull java.lang.String name)
Get a single flag for this identity.
|
com.google.common.util.concurrent.ListenableFuture<Flag> |
getFlag(@NonNull Session session,
@NonNull java.lang.String name,
@NonNull java.lang.String defaultValue)
Get a single flag for this identity.
|
com.google.common.util.concurrent.ListenableFuture<Flag> |
getFlagDefault(@NonNull java.lang.String name)
Get a single default flag for this identity.
|
com.google.common.util.concurrent.ListenableFuture<Flag> |
getFlagDefault(@NonNull java.lang.String name,
@NonNull java.lang.String defaultValue)
Get a single default flag for this identity.
|
com.google.common.util.concurrent.ListenableFuture<FlagList> |
getFlags(@NonNull Session session,
java.lang.String... names)
Get flags for this identity.
|
com.google.common.util.concurrent.ListenableFuture<FlagList> |
getFlagsDefault(java.lang.String... names)
List all available default flags.
|
com.google.common.util.concurrent.ListenableFuture<LiveEventList> |
getLiveEvents(@NonNull Session session,
java.lang.String... names)
Get live events.
|
com.google.common.util.concurrent.ListenableFuture<GetMessageListResponse> |
getMessageList(@NonNull Session session)
Get the list of messages for the identity.
|
com.google.common.util.concurrent.ListenableFuture<GetMessageListResponse> |
getMessageList(@NonNull Session session,
@NonNull int limit)
Get the list of messages for the identity.
|
com.google.common.util.concurrent.ListenableFuture<GetMessageListResponse> |
getMessageList(@NonNull Session session,
@NonNull int limit,
@NonNull boolean forward)
Get the list of messages for the identity.
|
com.google.common.util.concurrent.ListenableFuture<GetMessageListResponse> |
getMessageList(@NonNull Session session,
@NonNull int limit,
@NonNull boolean forward,
@NonNull java.lang.String cursor)
Get the list of messages for the identity.
|
com.google.common.util.concurrent.ListenableFuture<Session> |
identify(@NonNull Session session,
@NonNull java.lang.String id,
@NonNull java.util.Map<java.lang.String,java.lang.String> defaultProperties,
@NonNull java.util.Map<java.lang.String,java.lang.String> customProperties)
Identify a session with a new ID.
|
com.google.common.util.concurrent.ListenableFuture<Properties> |
listProperties(@NonNull Session session)
List properties associated with this identity.
|
com.google.common.util.concurrent.ListenableFuture<Session> |
sessionRefresh(Session session)
Refresh a user's session using a refresh token retrieved from a previous authentication request.
|
com.google.common.util.concurrent.ListenableFuture<com.google.protobuf.Empty> |
updateMessage(@NonNull Session session,
@NonNull java.lang.String id,
@NonNull long readTime)
The request to update the status of a message.
|
com.google.common.util.concurrent.ListenableFuture<com.google.protobuf.Empty> |
updateMessage(@NonNull Session session,
@NonNull java.lang.String id,
@NonNull long readTime,
@NonNull long consumeTime)
The request to update the status of a message.
|
com.google.common.util.concurrent.ListenableFuture<com.google.protobuf.Empty> |
updateProperties(@NonNull Session session,
@NonNull java.util.Map<java.lang.String,java.lang.String> defaultProperties,
@NonNull java.util.Map<java.lang.String,java.lang.String> customProperties)
Update or create properties for an identity.
|
com.google.common.util.concurrent.ListenableFuture<com.google.protobuf.Empty> |
updateProperties(@NonNull Session session,
@NonNull java.util.Map<java.lang.String,java.lang.String> defaultProperties,
@NonNull java.util.Map<java.lang.String,java.lang.String> customProperties,
@NonNull boolean recompute)
Update or create properties for an identity.
|
com.google.common.util.concurrent.ListenableFuture<Session> authenticate(java.lang.String id, java.util.Map<java.lang.String,java.lang.String> defaultProperties, java.util.Map<java.lang.String,java.lang.String> customProperties)
id
- An optional user id.defaultProperties
- Optional default properties to update with this call. If not set, properties are left as they are on the server.customProperties
- Optional custom properties to update with this call. If not set, properties are left as they are on the server.com.google.common.util.concurrent.ListenableFuture<com.google.protobuf.Empty> authenticateLogout(@NonNull @NonNull Session session)
session
- The session of the user.com.google.common.util.concurrent.ListenableFuture<com.google.protobuf.Empty> deleteIdentity(@NonNull @NonNull Session session)
session
- The session of the user.com.google.common.util.concurrent.ListenableFuture<com.google.protobuf.Empty> deleteMessage(@NonNull @NonNull Session session, @NonNull @NonNull java.lang.String messageId)
session
- The session of the user.messageId
- The ID of the message to delete.void disconnect()
void disconnect(long timeout, @NonNull @NonNull java.util.concurrent.TimeUnit unit) throws java.lang.InterruptedException
java.lang.InterruptedException
com.google.common.util.concurrent.ListenableFuture<com.google.protobuf.Empty> event(@NonNull @NonNull Session session, @NonNull @NonNull Event event)
session
- The session of the user.event
- The event to send.com.google.common.util.concurrent.ListenableFuture<com.google.protobuf.Empty> events(@NonNull @NonNull Session session, @NonNull @NonNull java.util.List<Event> events)
session
- The session of the user.events
- The batch of events which will be sent.com.google.common.util.concurrent.ListenableFuture<ExperimentList> getAllExperiments(@NonNull @NonNull Session session)
session
- The session of the user.com.google.common.util.concurrent.ListenableFuture<ExperimentList> getExperiments(@NonNull @NonNull Session session, @NonNull java.lang.String... names)
session
- The session of the user.names
- Experiment names.com.google.common.util.concurrent.ListenableFuture<Flag> getFlag(@NonNull @NonNull Session session, @NonNull @NonNull java.lang.String name, @NonNull @NonNull java.lang.String defaultValue)
session
- The session of the user.name
- The name of the flag.defaultValue
- The default value if the server is unreachable or the flag does not exist.com.google.common.util.concurrent.ListenableFuture<Flag> getFlag(@NonNull @NonNull Session session, @NonNull @NonNull java.lang.String name)
session
- The session of the user.name
- The name of the flag.com.google.common.util.concurrent.ListenableFuture<FlagList> getFlags(@NonNull @NonNull Session session, @NonNull java.lang.String... names)
session
- The session of the user.names
- The names of the flags.com.google.common.util.concurrent.ListenableFuture<FlagList> getFlagsDefault(java.lang.String... names)
names
- Flag names, if empty all flags are returned.com.google.common.util.concurrent.ListenableFuture<Flag> getFlagDefault(@NonNull @NonNull java.lang.String name)
name
- The name of the flag.com.google.common.util.concurrent.ListenableFuture<Flag> getFlagDefault(@NonNull @NonNull java.lang.String name, @NonNull @NonNull java.lang.String defaultValue)
getFlagDefault(String)
this method will return the default
value specified and will not raise an exception if the network is unreachable.name
- The name of the flag.defaultValue
- The default value if the server is unreachable or the flag does not exist.com.google.common.util.concurrent.ListenableFuture<LiveEventList> getLiveEvents(@NonNull @NonNull Session session, java.lang.String... names)
session
- The session of the user.names
- The live events to get. Returns all live events if none are supplied.com.google.common.util.concurrent.ListenableFuture<GetMessageListResponse> getMessageList(@NonNull @NonNull Session session)
session
- The session of the user.com.google.common.util.concurrent.ListenableFuture<GetMessageListResponse> getMessageList(@NonNull @NonNull Session session, @NonNull @NonNull int limit)
session
- The session of the user.limit
- Max number of messages to return. Between 1 and 100.com.google.common.util.concurrent.ListenableFuture<GetMessageListResponse> getMessageList(@NonNull @NonNull Session session, @NonNull @NonNull int limit, @NonNull @NonNull boolean forward)
session
- The session of the user.limit
- Max number of messages to return. Between 1 and 100.forward
- True if listing should be older messages to newer, false if reverse.com.google.common.util.concurrent.ListenableFuture<GetMessageListResponse> getMessageList(@NonNull @NonNull Session session, @NonNull @NonNull int limit, @NonNull @NonNull boolean forward, @NonNull @NonNull java.lang.String cursor)
session
- The session of the user.limit
- Max number of messages to return. Between 1 and 100.forward
- True if listing should be older messages to newer, false if reverse.cursor
- A pagination cursor.com.google.common.util.concurrent.ListenableFuture<Properties> listProperties(@NonNull @NonNull Session session)
session
- The session of the user.com.google.common.util.concurrent.ListenableFuture<Session> identify(@NonNull @NonNull Session session, @NonNull @NonNull java.lang.String id, @NonNull @NonNull java.util.Map<java.lang.String,java.lang.String> defaultProperties, @NonNull @NonNull java.util.Map<java.lang.String,java.lang.String> customProperties)
session
- The session of the user.id
- Identity ID to enrich the current session and return a new session. The old session will
no longer be usable. Must be between eight and 128 characters (inclusive). Must be an alphanumeric string
with only underscores and hyphens allowed.defaultProperties
- The default properties.customProperties
- The custom event properties.com.google.common.util.concurrent.ListenableFuture<Session> sessionRefresh(Session session)
session
- The session of the user.com.google.common.util.concurrent.ListenableFuture<com.google.protobuf.Empty> updateMessage(@NonNull @NonNull Session session, @NonNull @NonNull java.lang.String id, @NonNull @NonNull long readTime)
session
- The session of the user.id
- The identifier of the message.readTime
- The time the message was read at the client.com.google.common.util.concurrent.ListenableFuture<com.google.protobuf.Empty> updateMessage(@NonNull @NonNull Session session, @NonNull @NonNull java.lang.String id, @NonNull @NonNull long readTime, @NonNull @NonNull long consumeTime)
session
- The session of the user.id
- The identifier of the message.readTime
- The time the message was read at the client.consumeTime
- The time the message was consumed by the identity.com.google.common.util.concurrent.ListenableFuture<com.google.protobuf.Empty> updateProperties(@NonNull @NonNull Session session, @NonNull @NonNull java.util.Map<java.lang.String,java.lang.String> defaultProperties, @NonNull @NonNull java.util.Map<java.lang.String,java.lang.String> customProperties)
session
- The session of the user.defaultProperties
- The properties to update or create.customProperties
- The properties to update or create.com.google.common.util.concurrent.ListenableFuture<com.google.protobuf.Empty> updateProperties(@NonNull @NonNull Session session, @NonNull @NonNull java.util.Map<java.lang.String,java.lang.String> defaultProperties, @NonNull @NonNull java.util.Map<java.lang.String,java.lang.String> customProperties, @NonNull @NonNull boolean recompute)
session
- The session of the user.defaultProperties
- The properties to update or create.customProperties
- The properties to update or create.recompute
- Informs the server to recompute the audience membership of the identity.