public abstract class SDKModules extends java.lang.Object implements SDKInterface
Module-related methods of SDKInterface| Modifier and Type | Class and Description |
|---|---|
static interface |
SDKModules.Modulator |
| Modifier and Type | Field and Description |
|---|---|
protected int |
consents
Currently enabled features with consents
|
protected java.util.Map<java.lang.Integer,Module> |
modules |
| Constructor and Description |
|---|
SDKModules() |
| Modifier and Type | Method and Description |
|---|---|
protected void |
buildModules(CtxCore ctx,
int features)
Create instances of
Modules required by SDKInterface.config(). |
protected void |
eachModule(SDKModules.Modulator modulator) |
SessionImpl |
getSession() |
void |
init(CtxCore ctx) |
boolean |
isTracking(java.lang.Integer feat)
Check if consent has been given for a feature
|
<T extends Module> |
module(java.lang.Class<T> cls)
Return module instance by
Module class |
protected Module |
module(int feature)
Return module instance by
ConfigCore.Feature |
void |
onConsent(CtxCore ctx,
int consent)
Callback to add consents to the list
|
void |
onConsentRemoval(CtxCore ctx,
int noConsent)
Callback to remove consents from the list
|
SessionImpl |
onSessionBegan(CtxCore ctx,
SessionImpl session)
Notify all
Module instances about new session has just been started |
SessionImpl |
onSessionEnded(CtxCore ctx,
SessionImpl session)
Notify all
Module instances session was ended |
protected void |
prepareMappings(CtxCore ctx)
Create instances of
Modules required by SDKInterface.config(). |
protected static void |
registerDefaultModuleMapping(int feature,
java.lang.Class<? extends Module> cls) |
protected static void |
registerModuleMapping(int feature,
java.lang.Class<? extends Module> cls) |
SessionImpl |
session(CtxCore ctx,
java.lang.Long id)
Get current
SessionImpl or create new one if current is null. |
void |
stop(CtxCore ctx,
boolean clear) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitconfig, onCrash, onDeviceId, onRequest, onSignal, onSignal, onUserChanged, storableList, storablePop, storablePurge, storableRead, storableReadBytes, storableReadBytes, storableReadBytesOneOf, storableRemove, storableWrite, storableWrite, userprotected int consents
protected java.util.Map<java.lang.Integer,Module> modules
protected static void registerDefaultModuleMapping(int feature,
java.lang.Class<? extends Module> cls)
protected static void registerModuleMapping(int feature,
java.lang.Class<? extends Module> cls)
public boolean isTracking(java.lang.Integer feat)
feat - feature to test against, pass null to test if any consent giventrue if consent has been givenpublic void init(CtxCore ctx)
init in interface SDKInterfacepublic void stop(CtxCore ctx, boolean clear)
stop in interface SDKInterfacepublic void onConsent(CtxCore ctx, int consent)
consent - consents to addpublic void onConsentRemoval(CtxCore ctx, int noConsent)
noConsent - consents to removeprotected void prepareMappings(CtxCore ctx) throws java.lang.IllegalStateException
Modules required by SDKInterface.config().
Uses moduleMappings for ConfigCore.Feature / CoreFeature
- Class<Module> mapping to enable overriding by app developer.ctx - CtxCore object containing config with mapping overridesjava.lang.IllegalArgumentException - in case some Module finds SDKInterface.config() inconsistent.java.lang.IllegalStateException - when this module is run second time on the same Core instance.protected void buildModules(CtxCore ctx, int features) throws java.lang.IllegalArgumentException, java.lang.IllegalStateException
Modules required by SDKInterface.config().
Uses moduleMappings for ConfigCore.Feature / CoreFeature
- Class<Module> mapping to enable overriding by app developer.ctx - CtxCore objectfeatures - consents bitmask to check againstjava.lang.IllegalArgumentException - in case some Module finds SDKInterface.config() inconsistent.java.lang.IllegalStateException - when this module is run second time on the same Core instance.protected Module module(int feature)
ConfigCore.Featurepublic <T extends Module> T module(java.lang.Class<T> cls)
Module classprotected void eachModule(SDKModules.Modulator modulator)
public SessionImpl onSessionBegan(CtxCore ctx, SessionImpl session)
SDKInterfaceModule instances about new session has just been startedonSessionBegan in interface SDKInterfacesession - session to beginpublic SessionImpl onSessionEnded(CtxCore ctx, SessionImpl session)
SDKInterfaceModule instances session was endedonSessionEnded in interface SDKInterfacesession - session to endpublic SessionImpl getSession()
getSession in interface SDKInterfacepublic SessionImpl session(CtxCore ctx, java.lang.Long id)
SDKInterfaceSessionImpl or create new one if current is null.session in interface SDKInterfacectx - Ctx to create new SessionImpl inid - ID of new SessionImpl if neededSessionImpl instance