Interface IntentStore

    • Method Detail

      • getIntentCount

        long getIntentCount()
        Returns the number of intents in the store.
        Returns:
        the number of intents in the store
      • getIntents

        Iterable<Intent> getIntents()
        Returns an iterable of all intents in the store.
        Returns:
        iterable of all intents
      • getIntentData

        Iterable<IntentData> getIntentData​(boolean localOnly,
                                           long olderThan)
        Returns an iterable of all intent data objects in the store.
        Parameters:
        localOnly - should only intents for which this instance is master be returned
        olderThan - specified duration in milliseconds (0 for "now")
        Returns:
        iterable of all intent data objects
      • getIntentState

        IntentState getIntentState​(Key intentKey)
        Returns the state of the specified intent.
        Parameters:
        intentKey - intent identification
        Returns:
        current intent state
      • getInstallableIntents

        List<Intent> getInstallableIntents​(Key intentKey)
        Returns the list of the installable events associated with the specified original intent.
        Parameters:
        intentKey - original intent identifier
        Returns:
        compiled installable intents, or null if no installables exist
      • write

        void write​(IntentData newData)
        Writes an IntentData object to the store.
        Parameters:
        newData - new intent data to write
      • batchWrite

        void batchWrite​(Iterable<IntentData> updates)
        Writes a batch of IntentData objects to the store. A batch has no semantics, this is simply a convenience API.
        Parameters:
        updates - collection of intent data objects to write
      • getIntent

        Intent getIntent​(Key key)
        Returns the intent with the specified identifier.
        Parameters:
        key - key
        Returns:
        intent or null if not found
      • getIntentData

        IntentData getIntentData​(Key key)
        Returns the intent data object associated with the specified key.
        Parameters:
        key - key to look up
        Returns:
        intent data object
      • addPending

        void addPending​(IntentData intent)
        Adds a new operation, which should be persisted and delegated.
        Parameters:
        intent - operation
      • isMaster

        boolean isMaster​(Key intentKey)
        Checks to see whether the calling instance is the master for processing this intent, or more specifically, the key contained in this intent.
        Parameters:
        intentKey - intentKey to check
        Returns:
        true if master; false, otherwise
      • getPending

        Iterable<Intent> getPending()
        Returns the intent requests pending processing.
        Returns:
        pending intents
      • getPendingData

        Iterable<IntentData> getPendingData()
        Returns the intent data objects that are pending processing.
        Returns:
        pending intent data objects
      • getPendingData

        IntentData getPendingData​(Key intentKey)
        Returns the intent data object that are pending processing for a specfied key.
        Parameters:
        intentKey - key to look up
        Returns:
        pending intent data object
      • getPendingData

        Iterable<IntentData> getPendingData​(boolean localOnly,
                                            long olderThan)
        Returns the intent data objects that are pending processing for longer than the specified duration.
        Parameters:
        localOnly - should only intents for which this instance is master be returned
        olderThan - specified duration in milliseconds (0 for "now")
        Returns:
        pending intent data objects