org.modeshape.jcr

## Class Upgrades

- java.lang.Object
- - org.modeshape.jcr.Upgrades

-     public class Upgrades
      extends Object

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Class and Description
    --- | ---
    `static interface` | `Upgrades.Context`
    `protected static class` | `Upgrades.ModeShape_3_6_0` Upgrade operation handling moving to ModeShape 3.6.0.Final.
    `protected static class` | `Upgrades.ModeShape_3_7_4` Upgrade operation handling moving to ModeShape 3.8.0.Final.
    `protected static class` | `Upgrades.UpgradeOperation`

  - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `protected static int` | `EMPTY_UPGRADES_ID`
    `protected static Logger` | `LOGGER`
    `static Upgrades` | `STANDARD_UPGRADES` The standard upgrades for the built-in components and content of ModeShape.

  - ### Constructor Summary

    Constructors
    Modifier | Constructor and Description
    --- | ---
    `protected` | `Upgrades(Upgrades.UpgradeOperation... operations)`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `int` | `applyUpgradesSince(int lastId, Upgrades.Context resources)` Apply any upgrades that are more recent than identified by the last upgraded identifier.
    `int` | `getLatestAvailableUpgradeId()` Get the identifier of the latest upgrade known to this object.
    `boolean` | `isUpgradeRequired(int lastId)` Determine if an `upgrade` is required given the identifier of the last known upgrade, which is compared to the identifiers of the registered upgrades.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Field Detail

    - #### LOGGER

          protected static final Logger LOGGER

    - #### EMPTY_UPGRADES_ID

          protected static final int EMPTY_UPGRADES_ID

      See Also:
        Constant Field Values

    - #### STANDARD_UPGRADES

          public static final Upgrades STANDARD_UPGRADES

      The standard upgrades for the built-in components and content of ModeShape.

  - ### Constructor Detail

    - #### Upgrades

          protected Upgrades(Upgrades.UpgradeOperation... operations)

  - ### Method Detail

    - #### applyUpgradesSince

          public final int applyUpgradesSince(int lastId,
                               Upgrades.Context resources)

      Apply any upgrades that are more recent than identified by the last upgraded identifier.
      Parameters:
        `lastId` - the identifier of the last upgrade that was successfully run against the repository
        `resources` - the resources for the repository
      Returns:
        the identifier of the last upgrade applied to the repository; may be the same or greater than `lastId`

    - #### isUpgradeRequired

          public final boolean isUpgradeRequired(int lastId)

      Determine if an `upgrade` is required given the identifier of the last known upgrade, which is compared to the identifiers of the registered upgrades.
      Parameters:
        `lastId` - the identifier of the last known/successful upgrade previously applied to the repository
      Returns:
        true if this contains at least one upgrade that should be applied to the repository, or false otherwise

    - #### getLatestAvailableUpgradeId

          public final int getLatestAvailableUpgradeId()

      Get the identifier of the latest upgrade known to this object.
      Returns:
        the latest identifier; 0 if there are no upgrades in this object, or positive number

Copyright © 2008-2014 JBoss, a division of Red Hat. All Rights Reserved.