Java v3.0.X
Introduction
SDK overview
Release notes
SDK features
Prerequisites
Good to know
Getting Started
Installation
Manual installation
Initialization
Parameter
Type
Description
Flagship configuration : FlagshipConfig.
public FlagshipConfig<T> withLogLevel(LogManager.Level level)
public FlagshipConfig<T> withLogLevel(LogManager.Level level)Parameter
Type
Description
public FlagshipConfig<T> withLogManager(LogManager logManager)
public FlagshipConfig<T> withLogManager(LogManager logManager)Parameter
Type
Description
public FlagshipConfig<T> withTimeout(int timeout)
public FlagshipConfig<T> withTimeout(int timeout)Parameter
Type
Description
public FlagshipConfig<T> withStatusListener(Flagship.StatusListener listener)
public FlagshipConfig<T> withStatusListener(Flagship.StatusListener listener)Parameter
Type
Description
public FlagshipConfig<T> withCacheManager(CacheManager customCacheManager)
public FlagshipConfig<T> withCacheManager(CacheManager customCacheManager)Parameter
Type
Description
public FlagshipConfig<T> withPollingIntervals(long time, TimeUnit timeUnit)
public FlagshipConfig<T> withPollingIntervals(long time, TimeUnit timeUnit)Parameter
Type
Description
Decision Mode
DecisionApiMode
DecisionApiModeBucketingMode
BucketingModeSDK Status
Status
Description
public Status getStatus()
public Status getStatus()Manage visitor
public static Visitor.Builder newVisitor(String visitorId)
public static Visitor.Builder newVisitor(String visitorId)Parameter
Type
Description
Visitor Builder
public Builder isAuthenticated(boolean isAuthenticated)
public Builder isAuthenticated(boolean isAuthenticated)Parameter
Type
Description
public Builder hasConsented(boolean hasConsented)
public Builder hasConsented(boolean hasConsented)Parameter
Type
Description
public Builder context(HashMap<String, Object> context)
public Builder context(HashMap<String, Object> context)Parameter
Type
Description
public Visitor build()
public Visitor build()Updating Visitor context
public <T> void updateContext(String key, T value)
public <T> void updateContext(String key, T value)Parameter
Type
Description
public void updateContext(HashMap<String, Object> context)
public void updateContext(HashMap<String, Object> context)Parameter
Type
Description
public <T> void updateContext(FlagshipContext<T> flagshipContext, T value)
public <T> void updateContext(FlagshipContext<T> flagshipContext, T value)Parameter
Type
Description
public <T> void clearContext()
public <T> void clearContext()public HashMap<String, Object> getContext()
public HashMap<String, Object> getContext()Managing visitor consent
public void setConsent(Boolean hasConsented)
public void setConsent(Boolean hasConsented)Parameter
Type
Description
Handle Visitor cache
interface IVisitorCacheImplementation
interface IVisitorCacheImplementationpublic void cacheVisitor(String visitorId, JSONObject data)
public void cacheVisitor(String visitorId, JSONObject data)Parameter
Type
Description
public JSONObject lookupVisitor(String visitorId)
public JSONObject lookupVisitor(String visitorId)Parameter
Type
Description
public void flushVisitor(String visitorId)
public void flushVisitor(String visitorId)Parameter
Type
Description
interface IHitCacheImplementation
interface IHitCacheImplementationpublic void cacheHit(String visitorId, JSONObject data)
public void cacheHit(String visitorId, JSONObject data)Parameter
Type
Description
public JSONArray lookupHits(String visitorId)
public JSONArray lookupHits(String visitorId)Parameter
Type
Description
public void flushHits(String visitorId)
public void flushHits(String visitorId)Parameter
Type
Description
Experience Continuity
Authenticate
Parameter
Type
Description
Unauthenticate
Code example
Final implementation example
Manage Visitor Flags
Fetching Flags
public CompletableFuture<Visitor> fetchFlags()
public CompletableFuture<Visitor> fetchFlags()Return
Description
Getting flags
public <T> Flag<T> getFlag(String key, T defaultValue)
public <T> Flag<T> getFlag(String key, T defaultValue)Parameter
Type
Description
Getting flags current values
fun value(userExposed: Boolean = true): T?
fun value(userExposed: Boolean = true): T?Parameter
Type
Description
Get Flag metadata
fun metadata() : FlagMetadata
fun metadata() : FlagMetadataField
Type
Description
Report a Flag exposition
Parameter
Type
Description
fun exists()
fun exists()Hit Tracking
Send Hit
public void sendHit(Hit hit)
public void sendHit(Hit hit)Parameter
Type
Description
Hit common optional parameters
Parameter
Type
Description
Page
public Page(String location)
public Page(String location)Builder Parameter
Type
Description
Screen
public Screen(String location)
public Screen(String location)Builder Parameter
Type
Description
Transaction
Transaction(String transactionId, String affiliation)
Transaction(String transactionId, String affiliation)Builder Parameter
Type
Description
Item
Item(String transactionId, String productName, String productSku)
Item(String transactionId, String productName, String productSku)Builder Parameter
Type
Description
Event
public Event(EventCategory category, String action)
public Event(EventCategory category, String action)Builder Parameter
Type
Description
Appendix
Predefined user context keys : FlagshipContext
SDK Variable Name
Description
Context variable name
Type
Auto-set by SDK
Example
Cache data format
IVisitorCacheImplementation lookup format
IHitCacheImplementation lookup format
Last updated
Was this helpful?

