Package com.gemstone.gemfire.cache

Examples of com.gemstone.gemfire.cache.DataPolicy


   * @see com.gemstone.gemfire.cache.DataPolicy
   * @see #setDataPolicy(com.gemstone.gemfire.cache.DataPolicy)
   * @deprecated use setDataPolicy(:DataPolicy) instead.
   */
  public void setDataPolicyName(String dataPolicyName) {
    final DataPolicy resolvedDataPolicy = new DataPolicyConverter().convert(dataPolicyName);
    Assert.notNull(resolvedDataPolicy, String.format("Data Policy '%1$s' is invalid.", dataPolicyName));
    setDataPolicy(resolvedDataPolicy);
  }
View Full Code Here


   * @see com.gemstone.gemfire.cache.DataPolicy
   * @see com.gemstone.gemfire.cache.RegionFactory
   */
  protected void resolveDataPolicy(RegionFactory<K, V> regionFactory, Boolean persistent, String dataPolicy) {
    if (dataPolicy != null) {
      DataPolicy resolvedDataPolicy = new DataPolicyConverter().convert(dataPolicy);

      Assert.notNull(resolvedDataPolicy, String.format("Data Policy '%1$s' is invalid.", dataPolicy));
      assertDataPolicyAndPersistentAttributesAreCompatible(resolvedDataPolicy);

      regionFactory.setDataPolicy(resolvedDataPolicy);
      setDataPolicy(resolvedDataPolicy);
    }
    else {
      DataPolicy resolvedDataPolicy = (isPersistent() ? DataPolicy.PERSISTENT_REPLICATE : DataPolicy.DEFAULT);

      regionFactory.setDataPolicy(resolvedDataPolicy);
      setDataPolicy(resolvedDataPolicy);
    }
  }
View Full Code Here

    setDataPolicy(dataPolicy);
  }

  @Override
  protected void resolveDataPolicy(RegionFactory<K, V> regionFactory, Boolean persistent, String dataPolicy) {
    DataPolicy resolvedDataPolicy = null;

    if (dataPolicy != null) {
      resolvedDataPolicy = new DataPolicyConverter().convert(dataPolicy);
      Assert.notNull(resolvedDataPolicy, String.format("Data Policy '%1$s' is invalid.", dataPolicy));
    }
View Full Code Here

  @Override
  protected void resolveDataPolicy(RegionFactory<K, V> regionFactory, Boolean persistent, DataPolicy dataPolicy) {
    if (dataPolicy == null || DataPolicy.NORMAL.equals(dataPolicy)) {
      // NOTE this is safe since a LOCAL Scoped NORMAL Region requiring persistence can be satisfied with
      // PERSISTENT_REPLICATE, per the RegionShortcut.LOCAL_PERSISTENT
      DataPolicy resolvedDataPolicy = (isPersistent() ? DataPolicy.PERSISTENT_REPLICATE : DataPolicy.NORMAL);

      regionFactory.setDataPolicy(resolvedDataPolicy);
      setDataPolicy(resolvedDataPolicy);
    }
    else if (DataPolicy.PRELOADED.equals(dataPolicy)) {
      // NOTE this is safe since a LOCAL Scoped PRELOADED Region requiring persistence can be satisfied with
      // PERSISTENT_REPLICATE, per the RegionShortcut.LOCAL_PERSISTENT
      DataPolicy resolvedDataPolicy = (isPersistent() ? DataPolicy.PERSISTENT_REPLICATE : DataPolicy.PRELOADED);

      regionFactory.setDataPolicy(resolvedDataPolicy);
      setDataPolicy(resolvedDataPolicy);
    }
    else if (DataPolicy.PERSISTENT_REPLICATE.equals(dataPolicy)
View Full Code Here

   * @see com.gemstone.gemfire.cache.RegionFactory
   * @see com.gemstone.gemfire.cache.RegionShortcut
   */
  @Override
  protected void resolveDataPolicy(RegionFactory<K, V> regionFactory, Boolean persistent, String dataPolicy) {
    DataPolicy resolvedDataPolicy = null;

    if (dataPolicy != null) {
      resolvedDataPolicy = new DataPolicyConverter().convert(dataPolicy);
      Assert.notNull(resolvedDataPolicy, String.format("Data Policy '%1$s' is invalid.", dataPolicy));
    }
View Full Code Here

    setDataPolicy(dataPolicy);
  }

  @Override
  protected void resolveDataPolicy(RegionFactory<K, V> regionFactory, Boolean persistent, String dataPolicy) {
    DataPolicy resolvedDataPolicy = null;

    if (dataPolicy != null) {
      resolvedDataPolicy = new DataPolicyConverter().convert(dataPolicy);
      Assert.notNull(resolvedDataPolicy, String.format("Data Policy '%1$s' is invalid.", dataPolicy));
    }
View Full Code Here

      }
    });

    when(regionFactory.setDataPolicy(any(DataPolicy.class))).thenAnswer(new Answer<RegionFactory>(){
      @Override public RegionFactory answer(InvocationOnMock invocation) throws Throwable {
        DataPolicy dataPolicy = (DataPolicy) invocation.getArguments()[0];
        attributesFactory.setDataPolicy(dataPolicy);
        return regionFactory;
      }
    });
View Full Code Here

TOP

Related Classes of com.gemstone.gemfire.cache.DataPolicy

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.