Package org.apache.sling.distribution.util

## Class DistributionJcrUtils

- java.lang.Object
- - org.apache.sling.distribution.util.DistributionJcrUtils

    public class DistributionJcrUtils
    extends Object

Utility class for JCR related distribution operations.

### Field Summary

Fields
`static String` `DO_NOT_DISTRIBUTE`

### Constructor Summary

Constructors
`DistributionJcrUtils()`

### Method Summary

All Methods Static Methods Concrete Methods
`static boolean` `isSafe​(@NotNull javax.jcr.observation.Event jcrEvent)` checks a generated JCR event was not created by a JCR session having set the 'userData' to `DO_NOT_DISTRIBUTE`.
`static void` `setDoNotDistribute​(@NotNull javax.jcr.Session session)` set `DO_NOT_DISTRIBUTE` on the given `Session`'s `ObservationManager.setUserData(String)`

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

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

### Field Detail

#### DO_NOT_DISTRIBUTE

    public static final String DO_NOT_DISTRIBUTE

See Also:
  Constant Field Values

### Constructor Detail

#### DistributionJcrUtils

    public DistributionJcrUtils()

### Method Detail

#### isSafe

    public static boolean isSafe​(@NotNull
                                 @NotNull javax.jcr.observation.Event jcrEvent)
                          throws javax.jcr.RepositoryException

checks a generated JCR event was not created by a JCR session having set the 'userData' to `DO_NOT_DISTRIBUTE`.

Parameters:
  `jcrEvent` - an `Event`
Returns:
  `false` if the event was generated by a `Session` having its `ObservationManager.setUserData(String)` set to `DO_NOT_DISTRIBUTE`
Throws:
  `javax.jcr.RepositoryException` - if retrieving 'userData' fails

#### setDoNotDistribute

    public static void setDoNotDistribute​(@NotNull
                                          @NotNull javax.jcr.Session session)
                                   throws javax.jcr.RepositoryException

set `DO_NOT_DISTRIBUTE` on the given `Session`'s `ObservationManager.setUserData(String)`

Parameters:
  `session` - a `Session`
Throws:
  `javax.jcr.RepositoryException` - if retrieving the `ObservationManager` fails