Object PubSignalsStore
-
- All Implemented Interfaces:
public class PubSignalsStoreThis class is responsible for storing and retrieving publisher signals. These signals are used by the server to make better ad serving decisions.
The signals are stored in a persistent cache and are retrieved when needed.
V1 - Publisher signals are key-value pairs that are sent to the server along with the ad request. These signals are non obj/auto/dir signals that support general and ad-specific keys. These are controlled by the generalKeys and adSpecificKeys in the config. New signals overwrite old signals. The data is sent by the publisher and is not collected automatically by the SDK.
V2 - Publisher signals are categorized into old flow and new flow signals. New flow signals are obj/auto/dir signals that support publisher provided bid signals (obj_)/(dir_) and automatically collected bid signals (auto_*). obj refers to signals provided via MaxAd object, auto refers to signals collected automatically by the SDK, dir refers to signals provided directly in a map format.
New signals are appended to existing signals, and are retained until they expire or count limit is reached. The signals are also checked for expiration on new session and removed if expired.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public @interfacePubSignalsStore.SignalDataTypepublic @interfacePubSignalsStore.AdFormatpublic @interfacePubSignalsStore.SignalPrefixpublic @interfacePubSignalsStore.MaxAdMethod
-
Field Summary
Fields Modifier and Type Field Description public final static StringSIGNALS_FILEpublic final static StringSAVED_SIGNALSpublic final static StringIMP_DEPTHpublic final static StringEXT_DATApublic final static StringKEY_DIRECT_IMPRESSION_DEPTHpublic final static StringKEY_OBJ_IMPRESSION_DEPTHpublic final static StringKEY_AUTO_IMPRESSION_DEPTHpublic final static StringKEY_DIRECT_SESSION_DEPTHpublic final static StringKEY_OBJ_SESSION_DEPTHpublic final static StringKEY_AUTO_SESSION_DEPTHprivate final AsyncRefreshableProperty<JSONObject>cachedJsonPropertyprivate final AsyncRefreshableProperty<JSONObject>impressionDepthArrayPropertypublic final static PubSignalsStoreINSTANCE
-
Method Summary
Modifier and Type Method Description final UnitonNewSession()final UnitsavePublisherSignals(Map<String, Object> signals)Save the publisher signals to the persistent cache. final Map<String, Object>getPublisherSignals()Get the publisher signals from the persistent cache. final Unitreset()Reset the publisher signals. final JSONObjectgetPubSignalsJson()final JSONObjectgetPublisherSynapseSignalsJson()Returns the Synapse ppspayload.final JSONObjectgetInterceptedSynapseSignalsJson()Returns the Synapse intspayload containing only SDK-collected auto/intercepted signals.final UnitsetDao(PrefDao dao)final UnitresetSessionRestartObserverForTest()final UnitsetSessionDepthForTest(JSONObject value)final JSONObjectgetSessionDepthForTest()final UnitresetSessionDepthForTest()final AsyncRefreshableProperty<JSONObject>getCachedJsonProperty()final AsyncRefreshableProperty<JSONObject>getImpressionDepthArrayProperty()-
-
Method Detail
-
onNewSession
final Unit onNewSession()
-
savePublisherSignals
final Unit savePublisherSignals(Map<String, Object> signals)
Save the publisher signals to the persistent cache.
- Parameters:
signals- The signals to be saved.
-
getPublisherSignals
final Map<String, Object> getPublisherSignals()
Get the publisher signals from the persistent cache.
- Returns:
The publisher signals.
-
getPubSignalsJson
final JSONObject getPubSignalsJson()
- Returns:
The publisher signals in JSON format.
-
getPublisherSynapseSignalsJson
final JSONObject getPublisherSynapseSignalsJson()
Returns the Synapse
ppspayload. Auto/intercepted signals are intentionally excluded and emitted byintsinstead, matching the platform split used by Synapse.
-
getInterceptedSynapseSignalsJson
final JSONObject getInterceptedSynapseSignalsJson()
Returns the Synapse
intspayload containing only SDK-collected auto/intercepted signals.
-
resetSessionRestartObserverForTest
final Unit resetSessionRestartObserverForTest()
-
setSessionDepthForTest
final Unit setSessionDepthForTest(JSONObject value)
-
getSessionDepthForTest
final JSONObject getSessionDepthForTest()
-
resetSessionDepthForTest
final Unit resetSessionDepthForTest()
-
getCachedJsonProperty
final AsyncRefreshableProperty<JSONObject> getCachedJsonProperty()
-
getImpressionDepthArrayProperty
final AsyncRefreshableProperty<JSONObject> getImpressionDepthArrayProperty()
-
-
-
-