Package com.verizon.mec.edsclientsdk
Class EdsClientSdkFactory.SdkBuilder
- java.lang.Object
-
- com.verizon.mec.edsclientsdk.EdsClientSdkFactory.SdkBuilder
-
- Enclosing class:
- EdsClientSdkFactory
public static class EdsClientSdkFactory.SdkBuilder extends java.lang.Object
EDS SDK Builder, used to construct instances ofIEdsClientSdk
. Callbuild()
to create SDK instance. All SDK settings are pre-set to default values with the exception of theMecAuthenticator
. TheMecAuthenticator
must be set prior to first SDK operation. Authenticator may be set in builder viasetAuthenticator(com.verizon.mec.edsclientsdk.api.MecAuthenticator)
(or associated methods), or later againstIEdsClientSdk
instance viaIEdsClientSdk.setAuthenticator(MecAuthenticator)
. All operations return 'this' SdkBuilder instance for methods chaining.
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description IEdsClientSdk
build()
Create SDK instance.EdsClientSdkFactory.SdkBuilder
setAllowLegacyPlayServices(boolean allowLegacyPlayServicesVersions)
Should SDK allow Google Play services version prior to v13, where app-restricted API keys are not supported? By default PlayServices v13.0+ is required.EdsClientSdkFactory.SdkBuilder
setAuthenticator(MecAuthenticator authenticator)
Set MecAuthenticator, determines how authentication is performed.EdsClientSdkFactory.SdkBuilder
setCacheDuration(java.lang.Long cacheDurationMs)
Set edge discovery result cache durationEdsClientSdkFactory.SdkBuilder
setCallbackLooper(android.os.Looper looper)
Set looper used for asynchronous callback operations.EdsClientSdkFactory.SdkBuilder
setIdmsAttestAuthenticator(java.lang.String googleApiKey, java.lang.String mecAppId)
Set IDMS Attestation authenticator.EdsClientSdkFactory.SdkBuilder
setIdmsServerTarget(java.lang.String idmsServerUrl)
Set Custom IDMS server target, used with IDMS attestation.EdsClientSdkFactory.SdkBuilder
setMecAccessTokenAuthenticator(java.lang.String accessToken)
Set MEC Access Token authenticator.EdsClientSdkFactory.SdkBuilder
setMecServerTarget(java.lang.String mecServerUrl)
Set Custom MEC server target used with access token authentication.
-
-
-
Method Detail
-
setCallbackLooper
public EdsClientSdkFactory.SdkBuilder setCallbackLooper(android.os.Looper looper)
Set looper used for asynchronous callback operations. Default is main looper- Parameters:
looper
- looper, or null to use default main looper- Returns:
- Builder, for chaining
-
setCacheDuration
public EdsClientSdkFactory.SdkBuilder setCacheDuration(java.lang.Long cacheDurationMs)
Set edge discovery result cache duration- Parameters:
cacheDurationMs
- cache duration. Null to use defaultEdsConstants.DEFAULT_EDS_CACHE_DURATION
. Negative will disable caching.- Returns:
- Builder, for chaining
-
setIdmsServerTarget
public EdsClientSdkFactory.SdkBuilder setIdmsServerTarget(@NonNull java.lang.String idmsServerUrl)
Set Custom IDMS server target, used with IDMS attestation. By default production endpoint is used:EdsConstants.IDMS_PRODUCTION_URI
Primarily for internal / development use.- Parameters:
idmsServerUrl
- Fully qualified URL for IDMS server including REST services deployment path- Returns:
- Builder, for chaining
-
setMecServerTarget
public EdsClientSdkFactory.SdkBuilder setMecServerTarget(@NonNull java.lang.String mecServerUrl)
Set Custom MEC server target used with access token authentication. By default production endpoints is used:EdsConstants.MEC_PRODUCTION_URI
Primarily for internal / development use.- Parameters:
mecServerUrl
- Fully qualified URL for MEC server including REST services deployment path.- Returns:
- this Builder, for chaining
-
setAuthenticator
public EdsClientSdkFactory.SdkBuilder setAuthenticator(@NonNull MecAuthenticator authenticator)
Set MecAuthenticator, determines how authentication is performed. An authenticator must be supplied prior to performing SDK operations. SeeMecIdmsAttestationAuthenticator
andMecAccessTokenAuthenticator
Also see alternative factory builder shortcut methodssetMecAccessTokenAuthenticator(String)
andsetIdmsAttestAuthenticator(String, String)
Also see methods for setting/updating directory on SDK:IEdsClientSdk.setAuthenticator(MecAuthenticator)
- Parameters:
authenticator
- authenticator.- Returns:
- Builder, for chaining
-
setMecAccessTokenAuthenticator
public EdsClientSdkFactory.SdkBuilder setMecAccessTokenAuthenticator(java.lang.String accessToken)
Set MEC Access Token authenticator. SetsMecAccessTokenAuthenticator
with supplied access token.- Parameters:
accessToken
- MEC access token- Returns:
- Builder, for chaining.
-
setIdmsAttestAuthenticator
public EdsClientSdkFactory.SdkBuilder setIdmsAttestAuthenticator(java.lang.String googleApiKey, java.lang.String mecAppId)
Set IDMS Attestation authenticator. SetsMecIdmsAttestationAuthenticator
with supplied paramters.- Parameters:
googleApiKey
- Google API Key for SafetyNet device attestation calls.mecAppId
- MEC AppId- Returns:
- Builder, for chaining.
-
setAllowLegacyPlayServices
public EdsClientSdkFactory.SdkBuilder setAllowLegacyPlayServices(boolean allowLegacyPlayServicesVersions)
Should SDK allow Google Play services version prior to v13, where app-restricted API keys are not supported? By default PlayServices v13.0+ is required. Google Play Services added support for API restrictions v13 (2018-ish). - If application are using the recommended API restriction for their play services key then Play Services v13+ is required. - If application are not using API restrictions this method allows loosening of play-services check to support legacy/outdated devices - If applications are only using MEC accessToken authentication then play services are not used and this can be ignored. See playstore version guidance within https://developer.android.com/training/safetynet/attestation- Parameters:
allowLegacyPlayServicesVersions
- whether to allow legacy play services versions- Returns:
- Builder, for chaining
-
build
public IEdsClientSdk build()
Create SDK instance.- Returns:
- SDK instance.
-
-