-
Notifications
You must be signed in to change notification settings - Fork 61
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #974 from DataDog/mconstantin/rumm-2267/session-re…
…play-public-api RUMM-2267 Add Session Replay public API
- Loading branch information
Showing
19 changed files
with
245 additions
and
49 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
43 changes: 43 additions & 0 deletions
43
...ndroid/src/main/kotlin/com/datadog/android/sessionreplay/internal/SessionReplayFeature.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
/* | ||
* Unless explicitly stated otherwise all files in this repository are licensed under the Apache License Version 2.0. | ||
* This product includes software developed at Datadog (https://www.datadoghq.com/). | ||
* Copyright 2016-Present Datadog, Inc. | ||
*/ | ||
|
||
package com.datadog.android.sessionreplay.internal | ||
|
||
import android.content.Context | ||
import com.datadog.android.core.configuration.Configuration | ||
import com.datadog.android.core.internal.CoreFeature | ||
import com.datadog.android.core.internal.SdkFeature | ||
import com.datadog.android.core.internal.net.DataUploader | ||
import com.datadog.android.core.internal.net.NoOpDataUploader | ||
import com.datadog.android.core.internal.persistence.PersistenceStrategy | ||
import com.datadog.android.core.internal.utils.sdkLogger | ||
import com.datadog.android.sessionreplay.internal.domain.SessionReplayRecordPersistenceStrategy | ||
|
||
internal class SessionReplayFeature(coreFeature: CoreFeature) : | ||
SdkFeature<Any, Configuration.Feature.SessionReplay>(coreFeature) { | ||
|
||
override fun createPersistenceStrategy( | ||
context: Context, | ||
configuration: Configuration.Feature.SessionReplay | ||
): PersistenceStrategy<Any> { | ||
return SessionReplayRecordPersistenceStrategy( | ||
coreFeature.trackingConsentProvider, | ||
context, | ||
coreFeature.persistenceExecutorService, | ||
sdkLogger, | ||
coreFeature.localDataEncryption | ||
) | ||
} | ||
|
||
override fun createUploader(configuration: Configuration.Feature.SessionReplay): DataUploader { | ||
// TODO: This will be added later in RUMM-2273 | ||
return NoOpDataUploader() | ||
} | ||
|
||
companion object { | ||
const val SESSION_REPLAY_FEATURE_NAME = "session-replay" | ||
} | ||
} |
17 changes: 17 additions & 0 deletions
17
...oid/src/main/kotlin/com/datadog/android/sessionreplay/internal/domain/RecordSerializer.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
/* | ||
* Unless explicitly stated otherwise all files in this repository are licensed under the Apache License Version 2.0. | ||
* This product includes software developed at Datadog (https://www.datadoghq.com/). | ||
* Copyright 2016-Present Datadog, Inc. | ||
*/ | ||
|
||
package com.datadog.android.sessionreplay.internal.domain | ||
|
||
import com.datadog.android.core.internal.persistence.Serializer | ||
|
||
internal class RecordSerializer : Serializer<Any> { | ||
override fun serialize(model: Any): String? { | ||
// TODO: This will be switched to a Serializer<Record> once the models | ||
// will be in place. RUMM-2330" | ||
return null | ||
} | ||
} |
41 changes: 41 additions & 0 deletions
41
...m/datadog/android/sessionreplay/internal/domain/SessionReplayRecordPersistenceStrategy.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
/* | ||
* Unless explicitly stated otherwise all files in this repository are licensed under the Apache License Version 2.0. | ||
* This product includes software developed at Datadog (https://www.datadoghq.com/). | ||
* Copyright 2016-Present Datadog, Inc. | ||
*/ | ||
|
||
package com.datadog.android.sessionreplay.internal.domain | ||
|
||
import android.content.Context | ||
import com.datadog.android.core.internal.persistence.PayloadDecoration | ||
import com.datadog.android.core.internal.persistence.file.FileMover | ||
import com.datadog.android.core.internal.persistence.file.advanced.FeatureFileOrchestrator | ||
import com.datadog.android.core.internal.persistence.file.batch.BatchFilePersistenceStrategy | ||
import com.datadog.android.core.internal.persistence.file.batch.BatchFileReaderWriter | ||
import com.datadog.android.core.internal.privacy.ConsentProvider | ||
import com.datadog.android.log.Logger | ||
import com.datadog.android.security.Encryption | ||
import com.datadog.android.sessionreplay.internal.SessionReplayFeature | ||
import java.util.concurrent.ExecutorService | ||
|
||
internal class SessionReplayRecordPersistenceStrategy( | ||
consentProvider: ConsentProvider, | ||
context: Context, | ||
executorService: ExecutorService, | ||
internalLogger: Logger, | ||
localDataEncryption: Encryption? | ||
) : BatchFilePersistenceStrategy<Any>( | ||
FeatureFileOrchestrator( | ||
consentProvider, | ||
context, | ||
SessionReplayFeature.SESSION_REPLAY_FEATURE_NAME, | ||
executorService, | ||
internalLogger | ||
), | ||
executorService, | ||
RecordSerializer(), | ||
PayloadDecoration.NEW_LINE_DECORATION, | ||
internalLogger, | ||
BatchFileReaderWriter.create(internalLogger, localDataEncryption), | ||
FileMover(internalLogger) | ||
) |
Oops, something went wrong.