Class InventoryContract


  • public final class InventoryContract
    extends Object
    The contract between the inventory provider and apps. For more detailed information about inventory please read IInventoryService.

    The content provider for inventory may be used directly by apps wishing to use a Cursor to navigate a large inventory database. Read Content provider basics for an overview of how to interact with a content provider. In this case only methods which read data such as ContentResolver.query(Uri, String[], Bundle, CancellationSignal) will work. Methods which write data will be rejected.

    Using this contract requires the client app have Permission.INVENTORY_R permission.

    Note that there are frequently multiple content URIs which join multiple tables such as InventoryContract.ItemModifierGroup.CONTENT_WITH_NAME_URI. These join tables are very helpful when a client app needs to display filtered results. In this particular example an app can retrieve ModifierGroup details for a particular Item by querying the above content URI and selecting by InventoryContract.ItemModifierGroupColumns.ITEM_ID.

    To insert/update/delete inventory use the IInventoryService via binding to the AIDL service, or through the wrapper class InventoryConnector.

    The inventory database is typically kept up to date using push notifications from the Clover server to the client, so in most cases any changes made through the web or through another device will be immediately reflected on all devices belonging to a particular merchant. When network connections are available but unreliable, the inventory service will attempt to synchronize its local database (i.e. the backing store for this content provider) with the server on a regular basis, usually on an interval no greater than 3 hours.

    • Field Detail

      • GET_COUNT_METHOD

        public static final String GET_COUNT_METHOD
        Call method to get the inventory item count.
        See Also:
        Constant Field Values
      • GET_ITEM_MOD_OR_VAR_COUNT_METHOD

        public static final String GET_ITEM_MOD_OR_VAR_COUNT_METHOD
        Call method to get the inventory item count.
        See Also:
        Constant Field Values
      • GET_ITEMS_WITH_VARIANTS_METHOD

        public static final String GET_ITEMS_WITH_VARIANTS_METHOD
        Call method to get the inventory item count with variants.
        See Also:
        Constant Field Values
      • GET_ITEMS_WITH_MODIFIERS_METHOD

        public static final String GET_ITEMS_WITH_MODIFIERS_METHOD
        Call method to get the inventory item count with modifiers.
        See Also:
        Constant Field Values
      • AUTHORITY_URI

        public static final Uri AUTHORITY_URI
        A content:// style uri to the authority for the modifiers provider
    • Constructor Detail

      • InventoryContract

        public InventoryContract()