HyprDbAdapter

HYPR SDK for Android

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 Type Method and Description
      void audit(HyprBaseActivity activity, HyprUserAgentOperation.HyprOperationCallback operationCallback, java.lang.String message)
      Send an audit message to the server to include in the server log files.
      HyprAppProfileData getAppProfileByDbId(android.content.Context context, java.lang.String appProfileDbId)
      Call to get the App Profile Data Object by DB ID.
      HyprAppProfileData getAppProfileByMachineProfileDbId(android.content.Context context, java.lang.String machineProfileDbId)
      Call to get the App Profile Data Object by Machine Profile DB ID.
      HyprAppProfileData getAppProfileByUrlAndAppId(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.
      HyprAppProfileData getAppProfileByUserProfileDbId(android.content.Context context, java.lang.String userProfileDbId)
      Call to get the App Profile Data Object by User Profile DB ID.
      HyprAppProfileData getCurHyprAppProfileData(android.content.Context context)
      Call to get the Current App Profile Data Object.
      java.lang.String getCurHyprAppProfileDataDbId(android.content.Context context)
      Call to get the Current App Profile DB ID.
      java.lang.String getFacetId(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.
      HyprFeatureData getHyprFeatureData(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).
      HyprMachineProfileData getHyprMachineProfileDataFromPushPayload(android.content.Context context, java.lang.String payloadId, java.lang.String payload)
      Call to get the Machine Profile Data Object from the push payload.
      HyprMachineProfileData getMachineProfileByDbId(android.content.Context context, java.lang.String machineProfileDbId)
      Call to get the Machine Profile Data Object by DB ID.
      java.lang.String getPushChannelId()
      Override required by customer if using Push Notifications.
      java.lang.String getPushId(android.content.Context context)
      Override required by customer if using Push Notifications without Firebase.
      HyprUserProfileData getUserProfileByDbId(android.content.Context context, java.lang.String userProfileDbId)
      Call to get the User Profile Data Object by DB Id.
      HyprUserProfileData getUserProfileByMachineProfileDbId(android.content.Context context, java.lang.String machineProfileDbId)
      Call to get the User Profile Data Object by Machine Profile DB Id.
      boolean isFeatureEnabled(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).
      boolean isMagicLinkUriAvailable(android.content.Context context)
      Call in top-level app do determine if a push is ready for processing.
      boolean isPushPayloadAvailable(android.content.Context context)
      Call in top-level app do determine if a magic link / uri is ready for processing.
      boolean isPushPayloadTransactionAvailable(android.content.Context context)
      Call in top-level app do determine if a push is ready for processing and is a transaction.
      boolean isRefreshFeatureFlagsNeeded()
      Call to determine if a refresh of feature flags is needed.
      void logDiagnostic(HyprBaseActivity activity, HyprUserAgentOperation.HyprOperationCallback operationCallback, java.lang.String message)
      Deprecated. 
      void onNewAppProfileCreated(android.content.Context context, HyprAppProfileData appProfile)
      Called after a new App Profile is created.
      void onNewIntent(android.content.Context context, android.content.Intent intent)
      Process push notifications.
      void setAllCurProfilesByMachineProfileDbId(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.
      void setCurHyprAppProfileDataByDbId(android.content.Context context, java.lang.String appProfileDbId)
      Call to set the Current App Profile Data by passed in DB ID.
      void setCurProfilesByUserProfileDbId(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