Skip to main content

HyprDbAdapter

Class HyprDbAdapter

  • java.lang.Object
    • com.hypr.hyprandroidcommon.uiadapter.adapters.HyprDbAdapter
  • All Implemented Interfaces:
    java.io.Serializable


    public class HyprDbAdapter
    extends java.lang.Object
    implements java.io.Serializable
    This class should be extended by the top-level application.
    • Constructor Summary

      Constructors 
      Constructor and Description
      HyprDbAdapter()
    • Method Summary

      All Methods Instance Methods Concrete Methods Deprecated Methods 
      Modifier and TypeMethod and Description
      voidaudit(HyprBaseActivity activity, HyprUserAgentOperation.HyprOperationCallback operationCallback, java.lang.String message)
      Send an audit message to the server to include in the server log files.
      HyprAppProfileDatagetAppProfileByDbId(android.content.Context context, java.lang.String appProfileDbId)
      Call to get the App Profile Data Object by DB ID.
      HyprAppProfileDatagetAppProfileByMachineProfileDbId(android.content.Context context, java.lang.String machineProfileDbId)
      Call to get the App Profile Data Object by Machine Profile DB ID.
      HyprAppProfileDatagetAppProfileByUrlAndAppId(android.content.Context context, java.lang.String rpUrl, java.lang.String rpAppId)
      Call to get the App Profile Data Object by RP URL and RP App ID.
      HyprAppProfileDatagetAppProfileByUserProfileDbId(android.content.Context context, java.lang.String userProfileDbId)
      Call to get the App Profile Data Object by User Profile DB ID.
      HyprAppProfileDatagetCurHyprAppProfileData(android.content.Context context)
      Call to get the Current App Profile Data Object.
      java.lang.StringgetCurHyprAppProfileDataDbId(android.content.Context context)
      Call to get the Current App Profile DB ID.
      java.lang.StringgetFacetId(android.content.Context context)
      Call to get the current Facet ID.
      java.util.List<HyprAppProfileData>getHyprAppProfileDatas(android.content.Context context)
      Call to get the list of App Profile Data Objects.
      HyprFeatureDatagetHyprFeatureData(android.content.Context context, java.lang.String appProfileDbId, HyprFeatureData.HyprFeatureName hyprFeatureName)
      Call to get a specific HyprFeatureData object for the RP Server Url for the passed in App Profile (DB ID).
      HyprMachineProfileDatagetHyprMachineProfileDataFromPushPayload(android.content.Context context, java.lang.String payloadId, java.lang.String payload)
      Call to get the Machine Profile Data Object from the push payload.
      HyprMachineProfileDatagetMachineProfileByDbId(android.content.Context context, java.lang.String machineProfileDbId)
      Call to get the Machine Profile Data Object by DB ID.
      java.lang.StringgetPushChannelId()
      Override required by customer if using Push Notifications.
      java.lang.StringgetPushId(android.content.Context context)
      Override required by customer if using Push Notifications without Firebase.
      HyprUserProfileDatagetUserProfileByDbId(android.content.Context context, java.lang.String userProfileDbId)
      Call to get the User Profile Data Object by DB Id.
      HyprUserProfileDatagetUserProfileByMachineProfileDbId(android.content.Context context, java.lang.String machineProfileDbId)
      Call to get the User Profile Data Object by Machine Profile DB Id.
      booleanisFeatureEnabled(android.content.Context context, java.lang.String appProfileDbId, HyprFeatureData.HyprFeatureName hyprFeatureName)
      Call to determine if a specific feature is enabled on a RP Server Url for the passed in App Profile (DB ID).
      booleanisMagicLinkUriAvailable(android.content.Context context)
      Call in top-level app do determine if a push is ready for processing.
      booleanisPushPayloadAvailable(android.content.Context context)
      Call in top-level app do determine if a magic link / uri is ready for processing.
      booleanisPushPayloadTransactionAvailable(android.content.Context context)
      Call in top-level app do determine if a push is ready for processing and is a transaction.
      booleanisRefreshFeatureFlagsNeeded()
      Call to determine if a refresh of feature flags is needed.
      voidlogDiagnostic(HyprBaseActivity activity, HyprUserAgentOperation.HyprOperationCallback operationCallback, java.lang.String message)
      Deprecated. 
      voidonNewAppProfileCreated(android.content.Context context, HyprAppProfileData appProfile)
      Called after a new App Profile is created.
      voidonNewIntent(android.content.Context context, android.content.Intent intent)
      Process push notifications.
      voidsetAllCurProfilesByMachineProfileDbId(android.content.Context context, java.lang.String machineProfileDbId)
      Call to set the Current App Profile, Current User Profile, and Current Machine Profile by the passed in Machine Profile DB ID.
      voidsetCurHyprAppProfileDataByDbId(android.content.Context context, java.lang.String appProfileDbId)
      Call to set the Current App Profile Data by passed in DB ID.
      voidsetCurProfilesByUserProfileDbId(android.content.Context context, java.lang.String userProfileDbId)
      Call to set the Current App Profile and Current User Profile by the passed in User Profile DB ID.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • HyprDbAdapter

        public HyprDbAdapter()
    • Method Detail

      • getPushChannelId

        @NonNull
        public java.lang.String getPushChannelId()
        Override required by customer if using Push Notifications.
        Returns:
        Firebase token or Urban Airship ChannelId
      • getPushId

        @NonNull
        public java.lang.String getPushId(@NonNull
        android.content.Context context)
        throws HyprException
        Override required by customer if using Push Notifications without Firebase.
        Parameters:
        context - Context
        Returns:
        GcmSenderId
        Throws:
        HyprException -
      • onNewAppProfileCreated

        public void onNewAppProfileCreated(@NonNull
        android.content.Context context,
        @NonNull
        HyprAppProfileData appProfile)
        Called after a new App Profile is created. Put any DB customizations here for the new App Profile.
        Parameters:
        context - Context
        appProfile - HyprAppProfileData
      • onNewIntent

        public void onNewIntent(@NonNull
        android.content.Context context,
        @Nullable
        android.content.Intent intent)
        Process push notifications. Call this in top-level app onNewIntent if using Push Notifications.
        Parameters:
        context - Context
        intent - Intent Data
      • isMagicLinkUriAvailable

        public final boolean isMagicLinkUriAvailable(@NonNull
        android.content.Context context)
        Call in top-level app do determine if a push is ready for processing.
        Parameters:
        context - Context
        Returns:
        If push payload is ready for processing.
      • isPushPayloadAvailable

        public final boolean isPushPayloadAvailable(@NonNull
        android.content.Context context)
        Call in top-level app do determine if a magic link / uri is ready for processing.
        Parameters:
        context - Context
        Returns:
        If uri is ready for processing.
      • isPushPayloadTransactionAvailable

        public final boolean isPushPayloadTransactionAvailable(@NonNull
        android.content.Context context)
        Call in top-level app do determine if a push is ready for processing and is a transaction.
        Parameters:
        context - Context
        Returns:
        If push payload is ready for processing and is a transaction.
      • getFacetId

        @Nullable
        public final java.lang.String getFacetId(@NonNull
        android.content.Context context)
        Call to get the current Facet ID.
        Parameters:
        context - Context
        Returns:
        FacetId String
      • isRefreshFeatureFlagsNeeded

        public final boolean isRefreshFeatureFlagsNeeded()
        Call to determine if a refresh of feature flags is needed. If the Application was just launched or the Application was put in the background, then this should return true. NOTE: A feature is global to all RP Applications on a RP Server Url.
        Returns:
        If a refresh of feature flags is needed.
      • isFeatureEnabled

        public final boolean isFeatureEnabled(@NonNull
        android.content.Context context,
        @NonNull
        java.lang.String appProfileDbId,
        @NonNull
        HyprFeatureData.HyprFeatureName hyprFeatureName)
        throws HyprException
        Call to determine if a specific feature is enabled on a RP Server Url for the passed in App Profile (DB ID). NOTE: A feature is global to all RP Applications on a RP Server Url.
        Parameters:
        context - Context
        appProfileDbId - App Profile DB ID
        hyprFeatureName - HyprFeatureData.HyprFeatureName enum for feature name
        Returns:
        If feature is enabled for the passed in App Profile Db ID
        Throws:
        HyprException - Exception thrown on failure
      • getHyprFeatureData

        public final HyprFeatureData getHyprFeatureData(@NonNull
        android.content.Context context,
        @NonNull
        java.lang.String appProfileDbId,
        @NonNull
        HyprFeatureData.HyprFeatureName hyprFeatureName)
        throws HyprException
        Call to get a specific HyprFeatureData object for the RP Server Url for the passed in App Profile (DB ID). NOTE: A feature is global to all RP Applications on a RP Server Url.
        Parameters:
        context - Context
        appProfileDbId - App Profile DB ID
        hyprFeatureName - HyprFeatureData.HyprFeatureName enum for feature name
        Returns:
        HyprFeatureData
        Throws:
        HyprException - Exception thrown on failure
      • getHyprAppProfileDatas

        @NonNull
        public final java.util.List<HyprAppProfileData> getHyprAppProfileDatas(@NonNull
        android.content.Context context)
        Call to get the list of App Profile Data Objects.
        Parameters:
        context - Context
        Returns:
        App Profile Data Objects
      • getAppProfileByDbId

        @NonNull
        public final HyprAppProfileData getAppProfileByDbId(@NonNull
        android.content.Context context,
        @NonNull
        java.lang.String appProfileDbId)
        throws HyprException
        Call to get the App Profile Data Object by DB ID.
        Parameters:
        context - Context
        appProfileDbId - App Profile DB ID
        Returns:
        App Profile Data
        Throws:
        HyprException - Exception thrown on failure
      • getAppProfileByUserProfileDbId

        @NonNull
        public final HyprAppProfileData getAppProfileByUserProfileDbId(@NonNull
        android.content.Context context,
        @NonNull
        java.lang.String userProfileDbId)
        throws HyprException
        Call to get the App Profile Data Object by User Profile DB ID.
        Parameters:
        userProfileDbId - User Profile DB ID
        Returns:
        App Profile Data
        Throws:
        HyprException - Exception thrown on failure
      • getAppProfileByMachineProfileDbId

        @NonNull
        public final HyprAppProfileData getAppProfileByMachineProfileDbId(@NonNull
        android.content.Context context,
        @NonNull
        java.lang.String machineProfileDbId)
        throws HyprException
        Call to get the App Profile Data Object by Machine Profile DB ID.
        Parameters:
        context - Context
        machineProfileDbId - Machine Profile DB ID
        Returns:
        App Profile Data
        Throws:
        HyprException - Exception thrown on failure
      • getAppProfileByUrlAndAppId

        @NonNull
        public HyprAppProfileData getAppProfileByUrlAndAppId(@NonNull
        android.content.Context context,
        @NonNull
        java.lang.String rpUrl,
        @NonNull
        java.lang.String rpAppId)
        throws HyprException
        Call to get the App Profile Data Object by RP URL and RP App ID.
        Parameters:
        context - Context
        rpUrl - RP URL
        rpAppId - RP App ID
        Returns:
        App Profile Data
        Throws:
        HyprException - Exception thrown on failure
      • getCurHyprAppProfileData

        @NonNull
        public final HyprAppProfileData getCurHyprAppProfileData(@NonNull
        android.content.Context context)
        throws HyprException
        Call to get the Current App Profile Data Object.
        Parameters:
        context - Context
        Returns:
        Current App Profile Data
        Throws:
        HyprException - Exception thrown on failure
      • setCurHyprAppProfileDataByDbId

        public final void setCurHyprAppProfileDataByDbId(@NonNull
        android.content.Context context,
        @NonNull
        java.lang.String appProfileDbId)
        throws HyprException
        Call to set the Current App Profile Data by passed in DB ID.
        Parameters:
        context - Context
        appProfileDbId - App Profile DB ID
        Throws:
        HyprException - Exception thrown on failure
      • getCurHyprAppProfileDataDbId

        public final java.lang.String getCurHyprAppProfileDataDbId(@NonNull
        android.content.Context context)
        throws HyprException
        Call to get the Current App Profile DB ID.
        Parameters:
        context - Context
        Returns:
        Current App Profile DB ID
        Throws:
        HyprException - Exception thrown on failure
      • getUserProfileByDbId

        @NonNull
        public final HyprUserProfileData getUserProfileByDbId(@NonNull
        android.content.Context context,
        @NonNull
        java.lang.String userProfileDbId)
        throws HyprException
        Call to get the User Profile Data Object by DB Id.
        Parameters:
        context - Context
        userProfileDbId - User Profile DB ID
        Returns:
        User Profile Data
        Throws:
        HyprException - Exception thrown on failure
      • getUserProfileByMachineProfileDbId

        @NonNull
        public final HyprUserProfileData getUserProfileByMachineProfileDbId(@NonNull
        android.content.Context context,
        @NonNull
        java.lang.String machineProfileDbId)
        throws HyprException
        Call to get the User Profile Data Object by Machine Profile DB Id.
        Parameters:
        context - Context
        machineProfileDbId - Machine Profile DB ID
        Returns:
        User Profile Data
        Throws:
        HyprException - Exception thrown on failure
      • setCurProfilesByUserProfileDbId

        public final void setCurProfilesByUserProfileDbId(@NonNull
        android.content.Context context,
        @NonNull
        java.lang.String userProfileDbId)
        throws HyprException
        Call to set the Current App Profile and Current User Profile by the passed in User Profile DB ID.
        Parameters:
        context - Context
        userProfileDbId - User Profile DB ID
        Throws:
        HyprException - Exception thrown on failure
      • getMachineProfileByDbId

        @NonNull
        public final HyprMachineProfileData getMachineProfileByDbId(@NonNull
        android.content.Context context,
        @NonNull
        java.lang.String machineProfileDbId)
        throws HyprException
        Call to get the Machine Profile Data Object by DB ID.
        Parameters:
        context - Context
        machineProfileDbId - Machine Profile DB ID
        Returns:
        Machine Profile Data
        Throws:
        HyprException - Exception thrown on failure
      • getHyprMachineProfileDataFromPushPayload

        @Nullable
        public final HyprMachineProfileData getHyprMachineProfileDataFromPushPayload(@NonNull
        android.content.Context context,
        @NonNull
        java.lang.String payloadId,
        @NonNull
        java.lang.String payload)
        Call to get the Machine Profile Data Object from the push payload.
        Parameters:
        context - Context
        payloadId - Payload ID
        payload - Payload
        Returns:
        Machine Profile Data, returns null if does not exist.
      • setAllCurProfilesByMachineProfileDbId

        public final void setAllCurProfilesByMachineProfileDbId(@NonNull
        android.content.Context context,
        @NonNull
        java.lang.String machineProfileDbId)
        throws HyprException
        Call to set the Current App Profile, Current User Profile, and Current Machine Profile by the passed in Machine Profile DB ID.
        Parameters:
        context - Context
        machineProfileDbId - Machine Profile DB ID
        Throws:
        HyprException - Exception thrown on failure
      • logDiagnostic

        @Deprecated
        public final void logDiagnostic(@NonNull
        HyprBaseActivity activity,
        @NonNull
        HyprUserAgentOperation.HyprOperationCallback operationCallback,
        @NonNull
        java.lang.String message)
        throws HyprException
        Deprecated. 
        Send a diagnostic message to the server to include in the server log files.
        Parameters:
        activity - Activity
        operationCallback - Operational Callback
        message - Message to send
        Throws:
        HyprException - Exception thrown on failure
      • audit

        public final void audit(@NonNull
        HyprBaseActivity activity,
        @NonNull
        HyprUserAgentOperation.HyprOperationCallback operationCallback,
        @NonNull
        java.lang.String message)
        throws HyprException
        Send an audit message to the server to include in the server log files. Uses the Current App Profile server.
        Parameters:
        activity - Activity
        operationCallback - Operational Callback
        message - Message to send
        Throws:
        HyprException - Exception thrown on failure