[76/93] incubator-geode git commit: GEODE-288: move admin package to internal

2016-10-26 Thread klund
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/895fd144/geode-core/src/main/java/org/apache/geode/admin/jmx/internal/MemberInfoWithStatsMBean.java
--
diff --git 
a/geode-core/src/main/java/org/apache/geode/admin/jmx/internal/MemberInfoWithStatsMBean.java
 
b/geode-core/src/main/java/org/apache/geode/admin/jmx/internal/MemberInfoWithStatsMBean.java
deleted file mode 100644
index 40a514a..000
--- 
a/geode-core/src/main/java/org/apache/geode/admin/jmx/internal/MemberInfoWithStatsMBean.java
+++ /dev/null
@@ -1,1347 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more 
contributor license
- * agreements. See the NOTICE file distributed with this work for additional 
information regarding
- * copyright ownership. The ASF licenses this file to You under the Apache 
License, Version 2.0 (the
- * "License"); you may not use this file except in compliance with the 
License. You may obtain a
- * copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software 
distributed under the License
- * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 
KIND, either express
- * or implied. See the License for the specific language governing permissions 
and limitations under
- * the License.
- */
-package org.apache.geode.admin.jmx.internal;
-
-import static org.apache.geode.distributed.ConfigurationProperties.*;
-
-import org.apache.geode.admin.*;
-import org.apache.geode.admin.jmx.Agent;
-import org.apache.geode.cache.InterestPolicy;
-import org.apache.geode.cache.SubscriptionAttributes;
-import org.apache.geode.distributed.internal.DistributionConfig;
-import org.apache.geode.internal.GemFireVersion;
-import org.apache.geode.internal.admin.remote.ClientHealthStats;
-import org.apache.geode.internal.i18n.LocalizedStrings;
-import org.apache.geode.internal.logging.LogService;
-import org.apache.geode.internal.logging.log4j.LocalizedMessage;
-import mx4j.AbstractDynamicMBean;
-import org.apache.logging.log4j.Logger;
-
-import javax.management.*;
-import java.net.InetAddress;
-import java.text.MessageFormat;
-import java.util.*;
-import java.util.concurrent.atomic.AtomicLong;
-
-/**
- * This class uses the JMX Attributes/Operations that use (return/throw) 
GemFire types. This is the
- * single MBean accessible with ObjectName string {@link 
MemberInfoWithStatsMBean#MBEAN_NAME}}. This
- * MBean can be used to retrieve the all member details as plain java types.
- * 
- * This MBean also acts as a Notification Hub for all the Notifications that 
are defined for Admin
- * Distributed System.
- * 
- * 
- * @since GemFire 6.5
- */
-public class MemberInfoWithStatsMBean extends AbstractDynamicMBean implements 
NotificationEmitter {
-  private static final Logger logger = LogService.getLogger();
-
-  /* constants defining max no of attributes/operations/notifications */
-  private static final int MAX_ATTRIBUTES_COUNT = 3;
-  private static final int MAX_OPERATIONS_COUNT = 3;
-  private static final int MAX_NOTIFICATIONS_COUNT = 9;
-
-  private static final String NOT_AVAILABLE_STR = "N/A";
-  private static final String NOT_AVAILABLE = null;
-  private static final Number NOT_AVAILABLE_NUMBER = null;
-
-  /*
-   * String constant used for a region that is used on admin side just as a 
root for rootRegions
-   * defined on the member
-   */
-  private static final String PLACE_HOLDER_ROOT_REGION = "/Root/";
-
-  /* String that are used to form QueryExp/ObjectName for querying MBeanServer 
*/
-  private static final String REGION_QUERY_EXPRESSION = 
"*GemFire.Cache*:*,owner={0},type=Region";
-  private static final String STATS_QUERY_EXPRESSION = 
"*GemFire.Statistic*:*,source={0},name={1}";
-
-  /** mbean name string for this MBean */
-  /* default */static final String MBEAN_NAME = 
"GemFire:type=MemberInfoWithStatsMBean";
-
-  /** ObjectName handle for this MBean */
-  private ObjectName objectName;
-
-  /** version of the GemFire Enterprise system that is running */
-  private String version;
-  private int refreshInterval;
-  private String id;
-
-  private Agent agent;
-  private AdminDistributedSystemJmxImpl adminDSJmx;
-
-  private NotificationForwarder forwarder;
-  private boolean isInitialized;// needs synchronization?
-
-  /**
-   * Default Constructor
-   * 
-   * @param agent Admin Agent instance
-   * @throws OperationsException if ObjectName can't be formed for this MBean
-   * @throws MBeanRegistrationException
-   * @throws AdminException
-   */
-  MemberInfoWithStatsMBean(Agent agent)
-  throws OperationsException, MBeanRegistrationException, AdminException {
-this.agent = agent;
-this.objectName = ObjectName.getInstance(MBEAN_NAME);
-this.version = GemFireVersion.getGemFireVersion();
-this.refreshInterval = -1;
-this.id = NOT_AVAILABLE_STR;
-this.forwarder = new 

[84/93] incubator-geode git commit: GEODE-288: move admin package to internal

2016-10-26 Thread klund
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/895fd144/geode-core/src/main/java/org/apache/geode/admin/internal/ManagedSystemMemberImpl.java
--
diff --git 
a/geode-core/src/main/java/org/apache/geode/admin/internal/ManagedSystemMemberImpl.java
 
b/geode-core/src/main/java/org/apache/geode/admin/internal/ManagedSystemMemberImpl.java
deleted file mode 100644
index 02e7ae4..000
--- 
a/geode-core/src/main/java/org/apache/geode/admin/internal/ManagedSystemMemberImpl.java
+++ /dev/null
@@ -1,258 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more 
contributor license
- * agreements. See the NOTICE file distributed with this work for additional 
information regarding
- * copyright ownership. The ASF licenses this file to You under the Apache 
License, Version 2.0 (the
- * "License"); you may not use this file except in compliance with the 
License. You may obtain a
- * copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software 
distributed under the License
- * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 
KIND, either express
- * or implied. See the License for the specific language governing permissions 
and limitations under
- * the License.
- */
-package org.apache.geode.admin.internal;
-
-import org.apache.geode.admin.AdminException;
-import org.apache.geode.admin.ConfigurationParameter;
-import org.apache.geode.admin.ManagedEntityConfig;
-import org.apache.geode.internal.admin.GemFireVM;
-
-import static org.apache.geode.distributed.ConfigurationProperties.LOCATORS;
-
-/**
- * A SystemMember that is also managed (or manageable) by the 
admin API.
- *
- * This class must be public so that its methods can be invoked reflectively 
(for MBean operations)
- * on instances of its subclasses.
- *
- * @since GemFire 4.0
- */
-public abstract class ManagedSystemMemberImpl extends SystemMemberImpl
-implements InternalManagedEntity {
-
-  /** Controller for starting and stopping local or remote managers */
-  protected ManagedEntityController controller;
-
-  /** The state of this managed entity (see bug 32455) */
-  private int state = UNKNOWN;
-
-  /** A lock that is obtained while this entity's state changes */
-  private final Object stateChange = new Object();
-
-  // Constructors //
-
-  /**
-   * Creates a new ManagedSystemMemberImpl that represents an 
existing member of an
-   * AdminDistributedSystem.
-   */
-  protected ManagedSystemMemberImpl(AdminDistributedSystemImpl system, 
GemFireVM vm)
-  throws AdminException {
-
-super(system, vm);
-this.controller = system.getEntityController();
-  }
-
-  /**
-   * Creates a new ManagedSystemMemberImpl that represents a 
non-existing member with
-   * the given ManagedEntityConfig that has not yet been started.
-   */
-  protected ManagedSystemMemberImpl(AdminDistributedSystemImpl system, 
ManagedEntityConfig config)
-  throws AdminException {
-
-super(system);
-this.internalId = null;
-this.id = getNewId();
-this.host = config.getHost();
-this.name = this.id;
-this.controller = system.getEntityController();
-  }
-
-  // Instance Methods //
-
-  public String getWorkingDirectory() {
-return this.getEntityConfig().getWorkingDirectory();
-  }
-
-  public void setWorkingDirectory(String workingDirectory) {
-this.getEntityConfig().setWorkingDirectory(workingDirectory);
-  }
-
-  public String getProductDirectory() {
-return this.getEntityConfig().getProductDirectory();
-  }
-
-  public void setProductDirectory(String productDirectory) {
-this.getEntityConfig().setProductDirectory(productDirectory);
-  }
-
-  @Override
-  public String getHost() {
-return this.getEntityConfig().getHost();
-  }
-
-  public int setState(int state) {
-if (this.stateChange == null) {
-  // The initial state is set in the constructor before
-  // stateChange is initialized.
-  int oldState = this.state;
-  this.state = state;
-  return oldState;
-
-} else {
-  synchronized (this.stateChange) {
-int oldState = this.state;
-this.state = state;
-
-this.stateChange.notifyAll();
-
-return oldState;
-  }
-}
-  }
-
-  /**
-   * Returns whether or not this managed system member needs to be stopped. If 
this member is
-   * stopped or is stopping, then it does not need to be stopped. Otherwise, 
it will atomically
-   * place this member in the {@link #STOPPING} state. See bug 32455.
-   */
-  protected boolean needToStop() {
-synchronized (this.stateChange) {
-  if (this.state == STOPPED || this.state == STOPPING) {
-return false;
-
-  } else {
-setState(STOPPING);
-return true;
-  }
-}
-  }
-
-  /**
-   * 

[78/93] incubator-geode git commit: GEODE-288: move admin package to internal

2016-10-26 Thread klund
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/895fd144/geode-core/src/main/java/org/apache/geode/admin/jmx/internal/GemFireHealthConfigJmxImpl.java
--
diff --git 
a/geode-core/src/main/java/org/apache/geode/admin/jmx/internal/GemFireHealthConfigJmxImpl.java
 
b/geode-core/src/main/java/org/apache/geode/admin/jmx/internal/GemFireHealthConfigJmxImpl.java
deleted file mode 100644
index 6c44811..000
--- 
a/geode-core/src/main/java/org/apache/geode/admin/jmx/internal/GemFireHealthConfigJmxImpl.java
+++ /dev/null
@@ -1,211 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more 
contributor license
- * agreements. See the NOTICE file distributed with this work for additional 
information regarding
- * copyright ownership. The ASF licenses this file to You under the Apache 
License, Version 2.0 (the
- * "License"); you may not use this file except in compliance with the 
License. You may obtain a
- * copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software 
distributed under the License
- * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 
KIND, either express
- * or implied. See the License for the specific language governing permissions 
and limitations under
- * the License.
- */
-package org.apache.geode.admin.jmx.internal;
-
-import javax.management.ObjectName;
-import javax.management.modelmbean.ModelMBean;
-
-import org.apache.geode.admin.AdminException;
-import org.apache.geode.admin.GemFireHealth;
-import org.apache.geode.admin.GemFireHealthConfig;
-import org.apache.geode.admin.internal.GemFireHealthConfigImpl;
-
-/**
- * The JMX "managed resource" that represents the configuration for the health 
of GemFire.
- * Basically, it provides the behavior of 
GemFireHealthConfigImpl, but does some JMX
- * stuff like registering beans with the agent.
- *
- * 
- *
- * Unlike other ManagedResources this class cannot simply subclass
- * GemFireHealthImpl because it instances are serialized and sent 
to other VMs. This is
- * problematic because the other VMs most likely do not have JMX classes like
- * ModelMBean on their classpaths. So, instead we delegate all of 
the
- * GemFireHealthConfig behavior to another object which IS 
serialized.
- *
- * @see GemFireHealthJmxImpl#createDistributedSystemHealthConfig
- *
- *
- * @since GemFire 3.5
- */
-@edu.umd.cs.findbugs.annotations.SuppressWarnings(
-justification = "This class is deprecated. Also, any further changes so 
close to the release is inadvisable.")
-public class GemFireHealthConfigJmxImpl
-implements GemFireHealthConfig, ManagedResource, java.io.Serializable {
-
-  private static final long serialVersionUID = 1482719647163239953L;
-
-  /** The GemFireHealth that we help configure */
-  private GemFireHealth health;
-
-  /** The name of the MBean that will manage this resource */
-  private String mbeanName;
-
-  /** The ModelMBean that is configured to manage this resource */
-  private ModelMBean modelMBean;
-
-  /** The delegate that contains the real config state */
-  private GemFireHealthConfig delegate;
-
-  /** The object name of this managed resource */
-  private ObjectName objectName;
-
-  /// Constructors ///
-
-  /**
-   * Creates a new GemFireHealthConfigJmxImpl that configures the 
health monitoring of
-   * components running on the given host.
-   */
-  GemFireHealthConfigJmxImpl(GemFireHealthJmxImpl health, String hostName) 
throws AdminException {
-
-this.delegate = new GemFireHealthConfigImpl(hostName);
-this.health = health;
-this.mbeanName = new 
StringBuffer().append(MBEAN_NAME_PREFIX).append("GemFireHealthConfig,id=")
-
.append(MBeanUtil.makeCompliantMBeanNameProperty(health.getDistributedSystem().getId()))
-.append(",host=")
-.append((hostName == null ? "default" : 
MBeanUtil.makeCompliantMBeanNameProperty(hostName)))
-.toString();
-this.objectName = MBeanUtil.createMBean(this);
-  }
-
-  // Instance Methods //
-
-  /**
-   * Applies the changes made to this config back to the health monitor.
-   *
-   * @see GemFireHealth#setDistributedSystemHealthConfig
-   */
-  public void applyChanges() {
-String hostName = this.getHostName();
-if (hostName == null) {
-  this.health.setDefaultGemFireHealthConfig(this);
-
-} else {
-  this.health.setGemFireHealthConfig(hostName, this);
-}
-  }
-
-  public String getMBeanName() {
-return this.mbeanName;
-  }
-
-  public ModelMBean getModelMBean() {
-return this.modelMBean;
-  }
-
-  public ObjectName getObjectName() {
-return this.objectName;
-  }
-
-  public void setModelMBean(ModelMBean modelMBean) {
-this.modelMBean = modelMBean;
-  }
-
-  public ManagedResourceType getManagedResourceType() 

[82/93] incubator-geode git commit: GEODE-288: move admin package to internal

2016-10-26 Thread klund
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/895fd144/geode-core/src/main/java/org/apache/geode/admin/jmx/internal/AdminDistributedSystemJmxImpl.java
--
diff --git 
a/geode-core/src/main/java/org/apache/geode/admin/jmx/internal/AdminDistributedSystemJmxImpl.java
 
b/geode-core/src/main/java/org/apache/geode/admin/jmx/internal/AdminDistributedSystemJmxImpl.java
deleted file mode 100755
index 1bfddf2..000
--- 
a/geode-core/src/main/java/org/apache/geode/admin/jmx/internal/AdminDistributedSystemJmxImpl.java
+++ /dev/null
@@ -1,2279 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more 
contributor license
- * agreements. See the NOTICE file distributed with this work for additional 
information regarding
- * copyright ownership. The ASF licenses this file to You under the Apache 
License, Version 2.0 (the
- * "License"); you may not use this file except in compliance with the 
License. You may obtain a
- * copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software 
distributed under the License
- * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 
KIND, either express
- * or implied. See the License for the specific language governing permissions 
and limitations under
- * the License.
- */
-package org.apache.geode.admin.jmx.internal;
-
-import org.apache.geode.DataSerializer;
-import org.apache.geode.SystemFailure;
-import org.apache.geode.admin.*;
-import org.apache.geode.admin.internal.AdminDistributedSystemImpl;
-import org.apache.geode.admin.internal.CacheServerConfigImpl;
-import org.apache.geode.admin.internal.DistributionLocatorImpl;
-import org.apache.geode.cache.persistence.PersistentID;
-import org.apache.geode.distributed.DistributedMember;
-import org.apache.geode.distributed.internal.DistributionConfig;
-import org.apache.geode.distributed.internal.InternalDistributedSystem;
-import 
org.apache.geode.distributed.internal.membership.InternalDistributedMember;
-import org.apache.geode.internal.Assert;
-import org.apache.geode.internal.admin.Alert;
-import org.apache.geode.internal.admin.*;
-import org.apache.geode.internal.admin.remote.UpdateAlertDefinitionMessage;
-import org.apache.geode.internal.i18n.LocalizedStrings;
-import org.apache.geode.internal.logging.InternalLogWriter;
-import org.apache.geode.internal.logging.LogService;
-import org.apache.geode.internal.logging.log4j.LocalizedMessage;
-import org.apache.logging.log4j.Logger;
-
-import javax.management.*;
-import javax.management.modelmbean.ModelMBean;
-import javax.management.openmbean.*;
-import java.io.*;
-import java.net.InetAddress;
-import java.net.UnknownHostException;
-import java.util.*;
-import java.util.concurrent.atomic.AtomicInteger;
-
-/**
- * Provides MBean support for managing a GemFire distributed system.
- * 
- * TODO: refactor to implement DistributedSystem and delegate to instance of 
DistributedSystemImpl.
- * Wrap all delegate calls w/ e.printStackTrace() since the HttpAdaptor 
devours them (what to do w/
- * template methods then?)
- *
- * @since GemFire 3.5
- */
-public class AdminDistributedSystemJmxImpl extends AdminDistributedSystemImpl
-implements ManagedResource, DistributedSystemConfig, StatAlertsAggregator {
-
-  private static final Logger logger = LogService.getLogger();
-
-  private Properties mailProps;
-
-  // The file name where the StatAlertDefinitions would be serialized
-  private String statAlertDefnSerFile = System.getProperty("user.dir");
-
-  /**
-   * Simple counter incrementing on each notification. This this currently 
resets at every restart
-   * of Agent
-   */
-  private final AtomicInteger notificationSequenceNumber = new AtomicInteger();
-
-  /**
-   * Variable to indicate if there are no Rmi clients connected.
-   */
-  private volatile boolean isRmiClientCountZero;
-
-  /**
-   * Variable to indicate if Statistics Alert definitions could be persisted 
across runs/sessions.
-   */
-  private volatile boolean canPersistStatAlertDefs = true;
-
-  /** Cache Listener to listen to Cache & Region create/destroy events */
-  private CacheAndRegionListenerImpl cacheRegionListener;
-
-  // -
-  // Constructor(s)
-  // -
-
-  /**
-   * Constructs new DistributedSystemJmxImpl and registers an MBean to 
represent it.
-   * 
-   * @param config configuration defining the JMX agent.
-   */
-  public AdminDistributedSystemJmxImpl(AgentConfigImpl config)
-  throws org.apache.geode.admin.AdminException {
-super(config);
-this.mbeanName = "GemFire:type=AdminDistributedSystem,id="
-+ MBeanUtil.makeCompliantMBeanNameProperty(getId());
-this.objectName = MBeanUtil.createMBean(this);
-

[77/93] incubator-geode git commit: GEODE-288: move admin package to internal

2016-10-26 Thread klund
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/895fd144/geode-core/src/main/java/org/apache/geode/admin/jmx/internal/MX4JModelMBean.java
--
diff --git 
a/geode-core/src/main/java/org/apache/geode/admin/jmx/internal/MX4JModelMBean.java
 
b/geode-core/src/main/java/org/apache/geode/admin/jmx/internal/MX4JModelMBean.java
deleted file mode 100755
index d3f4ab2..000
--- 
a/geode-core/src/main/java/org/apache/geode/admin/jmx/internal/MX4JModelMBean.java
+++ /dev/null
@@ -1,1232 +0,0 @@
-/*
- * Copyright (C) MX4J. All rights reserved.
- *
- * This software is distributed under the terms of the MX4J License version 
1.0. See the terms of
- * the MX4J License in the documentation provided with this software.
- */
-
-package org.apache.geode.admin.jmx.internal;
-
-import java.lang.reflect.InvocationTargetException;
-import java.lang.reflect.Method;
-import java.util.Date;
-import java.util.Iterator;
-
-import javax.management.Attribute;
-import javax.management.AttributeChangeNotification;
-import javax.management.AttributeChangeNotificationFilter;
-import javax.management.AttributeList;
-import javax.management.AttributeNotFoundException;
-import javax.management.Descriptor;
-import javax.management.InstanceNotFoundException;
-import javax.management.InvalidAttributeValueException;
-import javax.management.ListenerNotFoundException;
-import javax.management.MBeanAttributeInfo;
-import javax.management.MBeanException;
-import javax.management.MBeanInfo;
-import javax.management.MBeanNotificationInfo;
-import javax.management.MBeanOperationInfo;
-import javax.management.MBeanRegistration;
-import javax.management.MBeanRegistrationException;
-import javax.management.MBeanServer;
-import javax.management.MalformedObjectNameException;
-import javax.management.Notification;
-import javax.management.NotificationBroadcasterSupport;
-import javax.management.NotificationEmitter;
-import javax.management.NotificationFilter;
-import javax.management.NotificationListener;
-import javax.management.ObjectName;
-import javax.management.ReflectionException;
-import javax.management.RuntimeErrorException;
-import javax.management.RuntimeOperationsException;
-import javax.management.ServiceNotFoundException;
-import javax.management.loading.ClassLoaderRepository;
-import javax.management.modelmbean.InvalidTargetObjectTypeException;
-import javax.management.modelmbean.ModelMBean;
-import javax.management.modelmbean.ModelMBeanAttributeInfo;
-import javax.management.modelmbean.ModelMBeanInfo;
-import javax.management.modelmbean.ModelMBeanOperationInfo;
-
-import mx4j.ImplementationException;
-import mx4j.log.FileLogger;
-import mx4j.log.Log;
-import mx4j.log.Logger;
-import mx4j.log.MBeanLogger;
-import mx4j.persist.FilePersister;
-import mx4j.persist.MBeanPersister;
-import mx4j.persist.PersisterMBean;
-import mx4j.util.Utils;
-
-import org.apache.geode.internal.i18n.LocalizedStrings;
-
-/**
- * @author mailto:biorn_stee...@users.sourceforge.net;>Simone 
Bordet
- * @version $Revision: 1.14 $
- */
-public class MX4JModelMBean implements ModelMBean, MBeanRegistration, 
NotificationEmitter {
-  private static final String OBJECT_RESOURCE_TYPE = "ObjectReference";
-
-  private static final int ALWAYS_STALE = 1;
-  private static final int NEVER_STALE = 2;
-  private static final int STALE = 3;
-  private static final int NOT_STALE = 4;
-
-  private static final int PERSIST_NEVER = -1;
-  private static final int PERSIST_ON_TIMER = -2;
-  private static final int PERSIST_ON_UPDATE = -3;
-  private static final int PERSIST_NO_MORE_OFTEN_THAN = -4;
-
-  private MBeanServer m_mbeanServer;
-  private Object m_managedResource;
-  private boolean m_canBeRegistered;
-  private ModelMBeanInfo m_modelMBeanInfo;
-  private NotificationBroadcasterSupport m_attributeChangeBroadcaster =
-  new NotificationBroadcasterSupport();
-  private NotificationBroadcasterSupport m_generalBroadcaster =
-  new NotificationBroadcasterSupport();
-
-  public MX4JModelMBean() throws MBeanException, RuntimeOperationsException {
-try {
-  load();
-} catch (Exception x) {
-  Logger logger = getLogger();
-  
logger.warn(LocalizedStrings.MX4JModelMBean_CANNOT_RESTORE_PREVIOUSLY_SAVED_STATUS
-  .toLocalizedString(), x);
-}
-  }
-
-  public MX4JModelMBean(ModelMBeanInfo info) throws MBeanException, 
RuntimeOperationsException {
-if (info == null)
-  throw new RuntimeOperationsException(new IllegalArgumentException(
-  LocalizedStrings.MX4JModelMBean_MODELMBEANINFO_PARAMETER_CANT_BE_NULL
-  .toLocalizedString()));
-else
-  setModelMBeanInfo(info);
-  }
-
-  private Logger getLogger() {
-return Log.getLogger(getClass().getName());
-  }
-
-  public ObjectName preRegister(MBeanServer server, ObjectName name) throws 
Exception {
-if (m_canBeRegistered) {
-  m_mbeanServer = server;
-  return name;
-} 

[93/93] incubator-geode git commit: GEODE-288: apply spotless to files changed by moving admin pkg to internal

2016-10-26 Thread klund
GEODE-288: apply spotless to files changed by moving admin pkg to internal


Project: http://git-wip-us.apache.org/repos/asf/incubator-geode/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-geode/commit/a672c7d3
Tree: http://git-wip-us.apache.org/repos/asf/incubator-geode/tree/a672c7d3
Diff: http://git-wip-us.apache.org/repos/asf/incubator-geode/diff/a672c7d3

Branch: refs/heads/feature/GEODE-288
Commit: a672c7d3e61d27ac9615abbb5f9099ece48fb3ef
Parents: 895fd14
Author: Kirk Lund 
Authored: Wed Oct 26 15:46:57 2016 -0700
Committer: Kirk Lund 
Committed: Wed Oct 26 15:46:57 2016 -0700

--
 .../main/java/org/apache/geode/cache/Cache.java |  14 +-
 .../geode/distributed/DistributedSystem.java|  53 +++---
 .../internal/InternalDistributedSystem.java |   1 +
 .../apache/geode/internal/admin/GemFireVM.java  |  12 +-
 .../admin/api/AdminDistributedSystem.java   |  10 +-
 .../api/AdminDistributedSystemFactory.java  |   5 +-
 .../internal/admin/api/AdminException.java  |   2 +-
 .../geode/internal/admin/api/AlertLevel.java|   3 +-
 .../admin/api/CacheDoesNotExistException.java   |   2 +-
 .../admin/api/DistributedSystemConfig.java  |   8 +-
 .../admin/api/DistributionLocatorConfig.java|   1 +
 .../admin/api/RuntimeAdminException.java|   2 +-
 .../internal/admin/api/StatisticResource.java   |   5 +-
 .../geode/internal/admin/api/SystemMember.java  |  42 +++--
 .../api/UnmodifiableConfigurationException.java |   2 +-
 .../api/impl/AdminDistributedSystemImpl.java|  25 ++-
 .../admin/api/impl/CacheServerImpl.java |   5 +-
 .../api/impl/ConfigurationParameterImpl.java|   5 +-
 .../impl/ConfigurationParameterListener.java|   6 +-
 .../admin/api/impl/ManagedEntityConfigXml.java  |   7 +-
 .../impl/ManagedEntityConfigXmlGenerator.java   |  11 +-
 .../impl/ManagedEntityControllerFactory.java|  10 +-
 .../internal/admin/api/impl/StatisticImpl.java  |   3 +-
 .../admin/api/impl/StatisticResourceImpl.java   |  15 +-
 .../admin/api/impl/SystemMemberCacheImpl.java   |   8 +-
 .../admin/api/impl/SystemMemberImpl.java|  35 ++--
 .../admin/api/impl/SystemMemberRegionImpl.java  |   4 +-
 .../internal/admin/api/jmx/AgentConfig.java |   2 +-
 .../jmx/impl/AdminDistributedSystemJmxImpl.java |  17 +-
 .../admin/api/jmx/impl/AgentConfigImpl.java |  47 ++---
 .../internal/admin/api/jmx/impl/AgentImpl.java  |  12 +-
 .../admin/api/jmx/impl/CacheServerJmxImpl.java  |  17 +-
 .../admin/api/jmx/impl/ConfigAttributeInfo.java |   9 +-
 .../jmx/impl/ConfigurationParameterJmxImpl.java |   5 +-
 .../DistributedSystemHealthConfigJmxImpl.java   |   5 +-
 .../jmx/impl/DistributionLocatorJmxImpl.java|   6 +-
 .../admin/api/jmx/impl/GenerateMBeanHTML.java   |   3 +-
 .../internal/admin/api/jmx/impl/MBeanUtil.java  |  14 +-
 .../admin/api/jmx/impl/ManagedResourceType.java |  25 ++-
 .../api/jmx/impl/MemberInfoWithStatsMBean.java  |  10 +-
 .../api/jmx/impl/StatisticAttributeInfo.java|   9 +-
 .../api/jmx/impl/StatisticResourceJmxImpl.java  |  35 ++--
 .../impl/SystemMemberBridgeServerJmxImpl.java   |   3 +-
 .../api/jmx/impl/SystemMemberCacheJmxImpl.java  |  26 +--
 .../admin/api/jmx/impl/SystemMemberJmxImpl.java |  23 +--
 .../api/jmx/impl/SystemMemberRegionJmxImpl.java |  17 +-
 .../admin/remote/AddHealthListenerResponse.java |   6 +-
 .../internal/admin/remote/AdminRegion.java  |   2 +-
 .../remote/FetchHealthDiagnosisResponse.java|   4 +-
 .../admin/remote/HealthListenerMessage.java |   4 +-
 .../remote/RefreshMemberSnapshotRequest.java|   4 +-
 .../remote/RefreshMemberSnapshotResponse.java   |   4 +-
 .../internal/admin/remote/RemoteGemFireVM.java  |  10 +-
 .../query/dunit/QueryUsingPoolDUnitTest.java|  49 --
 .../cache/query/dunit/RemoteQueryDUnitTest.java | 176 +++
 .../admin/api/impl/HealthEvaluatorTestCase.java |   4 +-
 56 files changed, 357 insertions(+), 487 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/a672c7d3/geode-core/src/main/java/org/apache/geode/cache/Cache.java
--
diff --git a/geode-core/src/main/java/org/apache/geode/cache/Cache.java 
b/geode-core/src/main/java/org/apache/geode/cache/Cache.java
index 63e916d..2c37ace 100644
--- a/geode-core/src/main/java/org/apache/geode/cache/Cache.java
+++ b/geode-core/src/main/java/org/apache/geode/cache/Cache.java
@@ -274,14 +274,12 @@ public interface Cache extends GemFireCache {
* @since GemFire 7.0
*/
   public GatewayConflictResolver getGatewayConflictResolver();
-  
-  /**
-   * Sets whether or not this Cache resides in a
-   * long-running "cache server" VM.  A cache server may be an
-   * application VM or may be a stand-along VM launched using {@linkplain
-   * 

[88/93] incubator-geode git commit: GEODE-288: move admin package to internal

2016-10-26 Thread klund
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/895fd144/geode-core/src/main/java/org/apache/geode/admin/internal/AdminDistributedSystemImpl.java
--
diff --git 
a/geode-core/src/main/java/org/apache/geode/admin/internal/AdminDistributedSystemImpl.java
 
b/geode-core/src/main/java/org/apache/geode/admin/internal/AdminDistributedSystemImpl.java
deleted file mode 100755
index 59fce55..000
--- 
a/geode-core/src/main/java/org/apache/geode/admin/internal/AdminDistributedSystemImpl.java
+++ /dev/null
@@ -1,2400 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more 
contributor license
- * agreements. See the NOTICE file distributed with this work for additional 
information regarding
- * copyright ownership. The ASF licenses this file to You under the Apache 
License, Version 2.0 (the
- * "License"); you may not use this file except in compliance with the 
License. You may obtain a
- * copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software 
distributed under the License
- * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 
KIND, either express
- * or implied. See the License for the specific language governing permissions 
and limitations under
- * the License.
- */
-package org.apache.geode.admin.internal;
-
-import org.apache.geode.CancelException;
-import org.apache.geode.SystemFailure;
-import org.apache.geode.admin.*;
-import org.apache.geode.admin.Alert;
-import org.apache.geode.admin.AlertListener;
-import org.apache.geode.cache.persistence.PersistentID;
-import org.apache.geode.distributed.DistributedMember;
-import org.apache.geode.distributed.FutureCancelledException;
-import org.apache.geode.distributed.internal.*;
-import 
org.apache.geode.distributed.internal.membership.InternalDistributedMember;
-import org.apache.geode.internal.Assert;
-import org.apache.geode.internal.Banner;
-import org.apache.geode.internal.admin.*;
-import org.apache.geode.internal.admin.remote.*;
-import org.apache.geode.internal.cache.persistence.PersistentMemberPattern;
-import org.apache.geode.internal.i18n.LocalizedStrings;
-import org.apache.geode.internal.logging.InternalLogWriter;
-import org.apache.geode.internal.logging.LogService;
-import org.apache.geode.internal.logging.LogWriterFactory;
-import org.apache.geode.internal.logging.log4j.LocalizedMessage;
-import org.apache.geode.internal.logging.log4j.LogMarker;
-import org.apache.geode.internal.logging.log4j.LogWriterAppender;
-import org.apache.geode.internal.logging.log4j.LogWriterAppenders;
-import org.apache.geode.internal.util.concurrent.FutureResult;
-import org.apache.logging.log4j.Logger;
-
-import java.io.File;
-import java.io.IOException;
-import java.net.InetAddress;
-import java.text.SimpleDateFormat;
-import java.util.*;
-import java.util.concurrent.*;
-
-import static org.apache.geode.distributed.ConfigurationProperties.*;
-
-/**
- * Represents a GemFire distributed system for remote 
administration/management.
- *
- * @since GemFire 3.5
- */
-public class AdminDistributedSystemImpl implements 
org.apache.geode.admin.AdminDistributedSystem,
-org.apache.geode.internal.admin.JoinLeaveListener,
-org.apache.geode.internal.admin.AlertListener,
-
org.apache.geode.distributed.internal.InternalDistributedSystem.DisconnectListener
 {
-
-  private static final Logger logger = LogService.getLogger();
-
-  /** String identity of this distributed system */
-  private String id;
-
-  /** Latest alert broadcast by any system members */
-  private Alert latestAlert;
-
-  // -
-
-  /** Internal admin agent to delegate low-level work to */
-  private volatile GfManagerAgent gfManagerAgent;
-
-  /** Monitors the health of this distributed system */
-  private GemFireHealth health;
-
-  /** Set of non-Manager members in this system */
-  private final Set applicationSet = new HashSet();
-
-  /** Set of DistributionLocators for this system */
-  private final Set locatorSet = new HashSet();
-
-  /** Set of dedicated CacheServer members in this system */
-  private final Set cacheServerSet = new HashSet();
-
-  /** Configuration defining this distributed system */
-  private final DistributedSystemConfigImpl config;
-
-  /** Controller for starting and stopping managed entities */
-  private ManagedEntityController controller;
-
-  /** Log file collator for gathering and merging system member logs */
-  private LogCollator logCollator = new LogCollator();
-
-  /**
-   * The level above which alerts will be delivered to the alert listeners
-   */
-  private AlertLevel alertLevel = AlertLevel.WARNING;
-
-  /** The alert listeners registered on this distributed system. */
-  private volatile Set alertListeners = Collections.emptySet();
-  private final Object 

[86/93] incubator-geode git commit: GEODE-288: move admin package to internal

2016-10-26 Thread klund
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/895fd144/geode-core/src/main/java/org/apache/geode/admin/internal/DistributedSystemHealthEvaluator.java
--
diff --git 
a/geode-core/src/main/java/org/apache/geode/admin/internal/DistributedSystemHealthEvaluator.java
 
b/geode-core/src/main/java/org/apache/geode/admin/internal/DistributedSystemHealthEvaluator.java
deleted file mode 100644
index a352616..000
--- 
a/geode-core/src/main/java/org/apache/geode/admin/internal/DistributedSystemHealthEvaluator.java
+++ /dev/null
@@ -1,167 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more 
contributor license
- * agreements. See the NOTICE file distributed with this work for additional 
information regarding
- * copyright ownership. The ASF licenses this file to You under the Apache 
License, Version 2.0 (the
- * "License"); you may not use this file except in compliance with the 
License. You may obtain a
- * copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software 
distributed under the License
- * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 
KIND, either express
- * or implied. See the License for the specific language governing permissions 
and limitations under
- * the License.
- */
-package org.apache.geode.admin.internal;
-
-import org.apache.geode.admin.DistributedSystemHealthConfig;
-import org.apache.geode.distributed.internal.DM;
-import org.apache.geode.distributed.internal.DistributionConfig;
-import org.apache.geode.distributed.internal.DistributionManager;
-import org.apache.geode.distributed.internal.MembershipListener;
-import 
org.apache.geode.distributed.internal.membership.InternalDistributedMember;
-import org.apache.geode.internal.i18n.LocalizedStrings;
-
-import java.util.List;
-import java.util.Set;
-
-/**
- * Contains the logic for evaluating the health of an entire GemFire 
distributed system according to
- * the thresholds provided in a {@link DistributedSystemHealthConfig}.
- *
- * 
- *
- * Note that unlike other evaluators, the 
DistributedSystemHealthEvaluator resides in
- * the "administrator" VM and not in the member VMs. This is because there 
only needs to be one
- * DistributedSystemHealthEvaluator per distributed system.
- *
- *
- * @since GemFire 3.5
- */
-class DistributedSystemHealthEvaluator extends AbstractHealthEvaluator
-implements MembershipListener {
-
-  /** The config from which we get the evaluation criteria */
-  private DistributedSystemHealthConfig config;
-
-  /**
-   * The distribution manager with which this MembershipListener is registered
-   */
-  private DM dm;
-
-  /** The description of the distributed system being evaluated */
-  private String description;
-
-  /**
-   * The number of application members that have unexpectedly left since the 
previous evaluation
-   */
-  private int crashedApplications;
-
-  /// Constructors ///
-
-  /**
-   * Creates a new DistributedSystemHealthEvaluator
-   */
-  DistributedSystemHealthEvaluator(DistributedSystemHealthConfig config, DM 
dm) {
-super(null, dm);
-
-this.config = config;
-this.dm = dm;
-this.dm.addMembershipListener(this);
-
-StringBuffer sb = new StringBuffer();
-sb.append("Distributed System ");
-
-String desc = null;
-if (dm instanceof DistributionManager) {
-  desc = ((DistributionManager) dm).getDistributionConfigDescription();
-}
-
-if (desc != null) {
-  sb.append(desc);
-
-} else {
-  DistributionConfig dsc = dm.getSystem().getConfig();
-  String locators = dsc.getLocators();
-  if (locators == null || locators.equals("")) {
-sb.append("using multicast ");
-sb.append(dsc.getMcastAddress());
-sb.append(":");
-sb.append(dsc.getMcastPort());
-
-  } else {
-sb.append("using locators ");
-sb.append(locators);
-  }
-}
-
-this.description = sb.toString();
-  }
-
-   Instance Methods 
-
-  @Override
-  protected String getDescription() {
-return this.description;
-  }
-
-  /**
-   * Checks to make sure that the number of application members of the 
distributed system that have
-   * left unexpected since the last evaluation is less than the
-   * {@linkplain DistributedSystemHealthConfig#getMaxDepartedApplications 
threshold}. If not, the
-   * status is "poor" health.
-   */
-  void checkDepartedApplications(List status) {
-synchronized (this) {
-  long threshold = this.config.getMaxDepartedApplications();
-  if (this.crashedApplications > threshold) {
-String s =
-
LocalizedStrings.DistributedSystemHealth_THE_NUMBER_OF_APPLICATIONS_THAT_HAVE_LEFT_THE_DISTRIBUTED_SYSTEM_0_EXCEEDS_THE_THRESHOLD_1
-

[83/93] incubator-geode git commit: GEODE-288: move admin package to internal

2016-10-26 Thread klund
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/895fd144/geode-core/src/main/java/org/apache/geode/admin/internal/SystemMemberRegionImpl.java
--
diff --git 
a/geode-core/src/main/java/org/apache/geode/admin/internal/SystemMemberRegionImpl.java
 
b/geode-core/src/main/java/org/apache/geode/admin/internal/SystemMemberRegionImpl.java
deleted file mode 100644
index fbf0839..000
--- 
a/geode-core/src/main/java/org/apache/geode/admin/internal/SystemMemberRegionImpl.java
+++ /dev/null
@@ -1,371 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more 
contributor license
- * agreements. See the NOTICE file distributed with this work for additional 
information regarding
- * copyright ownership. The ASF licenses this file to You under the Apache 
License, Version 2.0 (the
- * "License"); you may not use this file except in compliance with the 
License. You may obtain a
- * copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software 
distributed under the License
- * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 
KIND, either express
- * or implied. See the License for the specific language governing permissions 
and limitations under
- * the License.
- */
-package org.apache.geode.admin.internal;
-
-import org.apache.geode.admin.*;
-import org.apache.geode.cache.*;
-// import org.apache.geode.internal.Assert;
-// import org.apache.geode.internal.admin.*;
-import org.apache.geode.internal.admin.remote.*;
-
-import java.io.File;
-import java.util.*;
-
-/**
- * View of a region in a GemFire system member's cache.
- *
- * @since GemFire 3.5
- */
-public class SystemMemberRegionImpl implements SystemMemberRegion {
-
-  private AdminRegion r;
-  private RegionAttributes ra;
-  private CacheStatistics rs;
-  private Set subregionNames;
-  private Set subregionFullPaths;
-  private int entryCount;
-  private int subregionCount;
-
-  /** The cache to which this region belongs */
-  private final SystemMemberCacheImpl cache;
-
-  // constructors
-  public SystemMemberRegionImpl(SystemMemberCacheImpl cache, Region r) {
-this.cache = cache;
-this.r = (AdminRegion) r;
-  }
-
-  private void refreshFields() {
-this.ra = this.r.getAttributes();
-if (getStatisticsEnabled() && !this.ra.getDataPolicy().withPartitioning()) 
{
-  this.rs = this.r.getStatistics();
-} else {
-  this.rs = null;
-}
-{ // set subregionNames
-  Set s = this.r.subregions(false);
-  Set names = new TreeSet();
-  Set paths = new TreeSet();
-  Iterator it = s.iterator();
-  while (it.hasNext()) {
-Region r = (Region) it.next();
-String name = r.getName();
-names.add(name);
-paths.add(this.getFullPath() + Region.SEPARATOR_CHAR + name);
-  }
-  this.subregionNames = names;
-  this.subregionFullPaths = paths;
-}
-try {
-  int[] sizes = this.r.sizes();
-  this.entryCount = sizes[0];
-  this.subregionCount = sizes[1];
-} catch (CacheException ignore) {
-  this.entryCount = 0;
-  this.subregionCount = 0;
-}
-  }
-
-  // attributes
-  public String getName() {
-return this.r.getName();
-  }
-
-  public String getFullPath() {
-return this.r.getFullPath();
-  }
-
-  public java.util.Set getSubregionNames() {
-return this.subregionNames;
-  }
-
-  public java.util.Set getSubregionFullPaths() {
-return this.subregionFullPaths;
-  }
-
-  public String getUserAttribute() {
-return (String) r.getUserAttribute();
-  }
-
-  public String getCacheLoader() {
-Object o = this.ra.getCacheLoader();
-if (o == null) {
-  return "";
-} else {
-  return o.toString();
-}
-  }
-
-  public String getCacheWriter() {
-Object o = this.ra.getCacheWriter();
-if (o == null) {
-  return "";
-} else {
-  return o.toString();
-}
-  }
-
-  public String getKeyConstraint() {
-Class constraint = this.ra.getKeyConstraint();
-if (constraint == null) {
-  return "";
-} else {
-  return constraint.getName();
-}
-  }
-
-  public String getValueConstraint() {
-Class constraint = this.ra.getValueConstraint();
-if (constraint == null) {
-  return "";
-} else {
-  return constraint.getName();
-}
-  }
-
-  public boolean getEarlyAck() {
-return this.ra.getEarlyAck();
-  }
-
-  public int getRegionTimeToLiveTimeLimit() {
-return this.ra.getRegionTimeToLive().getTimeout();
-  }
-
-  public ExpirationAction getRegionTimeToLiveAction() {
-return this.ra.getRegionTimeToLive().getAction();
-  }
-
-  public int getEntryTimeToLiveTimeLimit() {
-return this.ra.getEntryTimeToLive().getTimeout();
-  }
-
-  public ExpirationAction getEntryTimeToLiveAction() {
-return this.ra.getEntryTimeToLive().getAction();
-  }
-
-  public 

[79/93] incubator-geode git commit: GEODE-288: move admin package to internal

2016-10-26 Thread klund
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/895fd144/geode-core/src/main/java/org/apache/geode/admin/jmx/internal/AgentLauncher.java
--
diff --git 
a/geode-core/src/main/java/org/apache/geode/admin/jmx/internal/AgentLauncher.java
 
b/geode-core/src/main/java/org/apache/geode/admin/jmx/internal/AgentLauncher.java
deleted file mode 100644
index 6a1bd63..000
--- 
a/geode-core/src/main/java/org/apache/geode/admin/jmx/internal/AgentLauncher.java
+++ /dev/null
@@ -1,918 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more 
contributor license
- * agreements. See the NOTICE file distributed with this work for additional 
information regarding
- * copyright ownership. The ASF licenses this file to You under the Apache 
License, Version 2.0 (the
- * "License"); you may not use this file except in compliance with the 
License. You may obtain a
- * copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software 
distributed under the License
- * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 
KIND, either express
- * or implied. See the License for the specific language governing permissions 
and limitations under
- * the License.
- */
-package org.apache.geode.admin.jmx.internal;
-
-import java.io.File;
-import java.io.FileInputStream;
-import java.io.FileNotFoundException;
-import java.io.FileOutputStream;
-import java.io.IOException;
-import java.io.ObjectInputStream;
-import java.io.ObjectOutputStream;
-import java.io.PrintStream;
-import java.io.Serializable;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-import java.util.Map.Entry;
-import java.util.Properties;
-import java.util.SortedMap;
-import java.util.StringTokenizer;
-import java.util.TreeMap;
-
-import org.apache.logging.log4j.Logger;
-
-import org.apache.geode.GemFireException;
-import org.apache.geode.SystemFailure;
-import org.apache.geode.admin.AdminException;
-import org.apache.geode.admin.jmx.Agent;
-import org.apache.geode.admin.jmx.AgentConfig;
-import org.apache.geode.admin.jmx.AgentFactory;
-import org.apache.geode.distributed.internal.DistributionManager;
-import org.apache.geode.internal.OSProcess;
-import org.apache.geode.internal.PureJavaMode;
-import org.apache.geode.internal.net.SocketCreator;
-import org.apache.geode.internal.i18n.LocalizedStrings;
-import org.apache.geode.internal.logging.LogService;
-import org.apache.geode.internal.util.IOUtils;
-import org.apache.geode.internal.util.JavaCommandBuilder;
-
-/**
- * A command line utility inspired by the CacheServerLauncher 
that is responsible for
- * administering a stand-along GemFire JMX {@link Agent}.
- * 
- * 
- * @since GemFire 3.5
- */
-public class AgentLauncher {
-
-  private static final Logger logger = LogService.getLogger();
-
-  /** Should the launch command be printed? */
-  public static final boolean PRINT_LAUNCH_COMMAND =
-  Boolean.getBoolean(AgentLauncher.class.getSimpleName() + 
".PRINT_LAUNCH_COMMAND");
-
-  /* constants used to define state */
-  static final int SHUTDOWN = 0;
-  static final int STARTING = 1;
-  static final int RUNNING = 2;
-  static final int SHUTDOWN_PENDING = 3;
-  static final int SHUTDOWN_PENDING_AFTER_FAILED_STARTUP = 4;
-  static final int UNKNOWN = 6;
-
-  /** Agent configuration options */
-  static final String AGENT_PROPS = "agent-props";
-
-  /**
-   * A flag to indicate if the current log file should be kept. Used only when 
'start' is used to
-   * fork off the 'server'
-   */
-  static final String APPENDTO_LOG_FILE = "appendto-log-file";
-
-  /** optional and additional classpath entries */
-  static final String CLASSPATH = "classpath";
-
-  /** The directory argument */
-  static final String DIR = "dir";
-
-  /** Extra VM arguments */
-  static final String VMARGS = "vmargs";
-
-  /** The directory in which the agent's output resides */
-  private File workingDirectory = null;
-
-  /** The Status object for the agent */
-  private Status status = null;
-
-  /** base name for the agent to be launched */
-  private final String basename;
-
-  /** The name for the start up log file */
-  private final String startLogFileName;
-
-  /** The name of the status file */
-  private final String statusFileName;
-
-  /**
-   * Instantiates an AgentLauncher for execution and control of the GemFire 
JMX Agent process. This
-   * constructor is package private to prevent direct instantiation or 
subclassing by classes
-   * outside this package, but does allow the class to be tested as needed.
-   * 
-   * 
-   * @param basename base name for the application to be launched
-   */
-  AgentLauncher(final String basename) {
-assert basename != null : "The base name used by the AgentLauncher to 

[92/93] incubator-geode git commit: GEODE-288: apply spotless to files changed by moving admin pkg to internal

2016-10-26 Thread klund
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/a672c7d3/geode-core/src/main/java/org/apache/geode/internal/admin/api/jmx/impl/SystemMemberJmxImpl.java
--
diff --git 
a/geode-core/src/main/java/org/apache/geode/internal/admin/api/jmx/impl/SystemMemberJmxImpl.java
 
b/geode-core/src/main/java/org/apache/geode/internal/admin/api/jmx/impl/SystemMemberJmxImpl.java
index f3a0d75..2e4ddd8 100755
--- 
a/geode-core/src/main/java/org/apache/geode/internal/admin/api/jmx/impl/SystemMemberJmxImpl.java
+++ 
b/geode-core/src/main/java/org/apache/geode/internal/admin/api/jmx/impl/SystemMemberJmxImpl.java
@@ -57,9 +57,8 @@ import org.apache.geode.internal.logging.LogService;
  * @since GemFire 3.5
  *
  */
-public class SystemMemberJmxImpl 
-extends SystemMemberImpl
-implements SystemMemberJmx, javax.management.NotificationListener, 
ManagedResource {
+public class SystemMemberJmxImpl extends SystemMemberImpl
+implements SystemMemberJmx, javax.management.NotificationListener, 
ManagedResource {
 
   private static final Logger logger = LogService.getLogger();
 
@@ -89,9 +88,8 @@ implements SystemMemberJmx, 
javax.management.NotificationListener, ManagedResour
* @param system the distributed system this SystemMember is a member of
* @param application the internal admin application to delegate actual work
*/
-  public SystemMemberJmxImpl(AdminDistributedSystemJmxImpl system,
- ApplicationVM application)
-  throws AdminException {
+  public SystemMemberJmxImpl(AdminDistributedSystemJmxImpl system, 
ApplicationVM application)
+  throws AdminException {
 super(system, application);
 initializeMBean();
   }
@@ -114,10 +112,9 @@ implements SystemMemberJmx, 
javax.management.NotificationListener, ManagedResour
   }
 
   /** Create and register the MBean to manage this resource */
-  private void initializeMBean() 
-  throws AdminException {
-//initialize Managed Resources for stats & cache first.
-//initializeManagedResources();
+  private void initializeMBean() throws AdminException {
+// initialize Managed Resources for stats & cache first.
+// initializeManagedResources();
 
 this.mbeanName = new StringBuffer("GemFire.Member:id=")
 
.append(MBeanUtil.makeCompliantMBeanNameProperty(getId())).append(",type=")
@@ -299,8 +296,7 @@ implements SystemMemberJmx, 
javax.management.NotificationListener, ManagedResour
* @throws AdminException if constructing StatisticResourceJmxImpl instance 
fails
*/
   @Override
-  protected StatisticResource createStatisticResource(StatResource stat)
-throws AdminException {
+  protected StatisticResource createStatisticResource(StatResource stat) 
throws AdminException {
 StatisticResourceJmxImpl managedStatisticResource = null;
 
 synchronized (this.managedStatisticsResourcesMap) {
@@ -328,8 +324,7 @@ implements SystemMemberJmx, 
javax.management.NotificationListener, ManagedResour
* @throws AdminException if constructing SystemMemberCacheJmxImpl instance 
fails
*/
   @Override
-  protected SystemMemberCache createSystemMemberCache(GemFireVM vm)
-throws AdminException {
+  protected SystemMemberCache createSystemMemberCache(GemFireVM vm) throws 
AdminException {
 if (managedSystemMemberCache == null) {
   managedSystemMemberCache = new SystemMemberCacheJmxImpl(vm);
 }

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/a672c7d3/geode-core/src/main/java/org/apache/geode/internal/admin/api/jmx/impl/SystemMemberRegionJmxImpl.java
--
diff --git 
a/geode-core/src/main/java/org/apache/geode/internal/admin/api/jmx/impl/SystemMemberRegionJmxImpl.java
 
b/geode-core/src/main/java/org/apache/geode/internal/admin/api/jmx/impl/SystemMemberRegionJmxImpl.java
index 500f0ee..2829b98 100644
--- 
a/geode-core/src/main/java/org/apache/geode/internal/admin/api/jmx/impl/SystemMemberRegionJmxImpl.java
+++ 
b/geode-core/src/main/java/org/apache/geode/internal/admin/api/jmx/impl/SystemMemberRegionJmxImpl.java
@@ -25,14 +25,11 @@ import javax.management.ObjectName;
 import javax.management.modelmbean.ModelMBean;
 
 /**
- * MBean representation of {@link 
- * SystemMemberRegion}.
+ * MBean representation of {@link SystemMemberRegion}.
  *
  * @since GemFire 3.5
  */
-public class SystemMemberRegionJmxImpl 
-extends SystemMemberRegionImpl
-implements ManagedResource {
+public class SystemMemberRegionJmxImpl extends SystemMemberRegionImpl 
implements ManagedResource {
 
   /** The object name of this managed resource */
   private ObjectName objectName;
@@ -47,17 +44,15 @@ implements ManagedResource {
* @param cache the cache this region belongs to
* @param region internal region to delegate real work to
*/
-  public SystemMemberRegionJmxImpl(SystemMemberCacheImpl cache, 
-   

[90/93] incubator-geode git commit: GEODE-288: move admin package to internal

2016-10-26 Thread klund
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/895fd144/geode-core/src/main/java/org/apache/geode/admin/CacheVmConfig.java
--
diff --git a/geode-core/src/main/java/org/apache/geode/admin/CacheVmConfig.java 
b/geode-core/src/main/java/org/apache/geode/admin/CacheVmConfig.java
deleted file mode 100755
index 81f4a38..000
--- a/geode-core/src/main/java/org/apache/geode/admin/CacheVmConfig.java
+++ /dev/null
@@ -1,51 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more 
contributor license
- * agreements. See the NOTICE file distributed with this work for additional 
information regarding
- * copyright ownership. The ASF licenses this file to You under the Apache 
License, Version 2.0 (the
- * "License"); you may not use this file except in compliance with the 
License. You may obtain a
- * copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software 
distributed under the License
- * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 
KIND, either express
- * or implied. See the License for the specific language governing permissions 
and limitations under
- * the License.
- */
-package org.apache.geode.admin;
-
-/**
- * Configuration for a GemFire cache server VM that is managed by the 
administration API. The VM may
- * or may not be running.
- *
- * @see AdminDistributedSystem#addCacheVm()
- *
- * @since GemFire 5.7
- * @deprecated as of 7.0 use the management
- * package instead
- */
-public interface CacheVmConfig extends ManagedEntityConfig {
-  /**
-   * Returns the cache.xml declarative caching initialization 
file used to configure
-   * this cache server VM. By default, a cache server VM is started without an 
XML file.
-   */
-  public String getCacheXMLFile();
-
-  /**
-   * Sets the cache.xml declarative caching initialization file 
used to configure this
-   * cache server VM.
-   */
-  public void setCacheXMLFile(String cacheXml);
-
-  /**
-   * Returns the location(s) of user classes (such as cache loaders) required 
by the cache server
-   * VM.
-   */
-  public String getClassPath();
-
-  /**
-   * Sets the location(s) of user classes (such as cache loaders) required by 
the cache server VM.
-   */
-  public void setClassPath(String classpath);
-}

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/895fd144/geode-core/src/main/java/org/apache/geode/admin/ConfigurationParameter.java
--
diff --git 
a/geode-core/src/main/java/org/apache/geode/admin/ConfigurationParameter.java 
b/geode-core/src/main/java/org/apache/geode/admin/ConfigurationParameter.java
deleted file mode 100755
index 74e1510..000
--- 
a/geode-core/src/main/java/org/apache/geode/admin/ConfigurationParameter.java
+++ /dev/null
@@ -1,72 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more 
contributor license
- * agreements. See the NOTICE file distributed with this work for additional 
information regarding
- * copyright ownership. The ASF licenses this file to You under the Apache 
License, Version 2.0 (the
- * "License"); you may not use this file except in compliance with the 
License. You may obtain a
- * copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software 
distributed under the License
- * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 
KIND, either express
- * or implied. See the License for the specific language governing permissions 
and limitations under
- * the License.
- */
-
-package org.apache.geode.admin;
-
-/**
- * A single configuration parameter of a {@link SystemMember}.
- *
- * @since GemFire 3.5
- *
- * @deprecated as of 7.0 use the management
- * package instead
- */
-public interface ConfigurationParameter {
-
-  /** Gets the identifying name of this configuration parameter. */
-  public String getName();
-
-  /** Gets the full description of this configuration parameter */
-  public String getDescription();
-
-  /** Gets the current value */
-  public Object getValue();
-
-  /** Gets the current value as a string */
-  public String getValueAsString();
-
-  /** Gets the class type of the value */
-  public Class getValueType();
-
-  /** True if this is modifiable; false if read-only */
-  public boolean isModifiable();
-
-  /** Returns true if this config parameter uses a string array for value. */
-  public boolean isArray();
-
-  /** Returns true if this config parameter represents an InetAddress value. */
-  public boolean isInetAddress();
-
-  /** Returns true if this config parameter represents a File value. */
-  public boolean isFile();
-
-  /** Returns true if this config parameter represents an octal value. */
-  

[89/93] incubator-geode git commit: GEODE-288: move admin package to internal

2016-10-26 Thread klund
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/895fd144/geode-core/src/main/java/org/apache/geode/admin/RegionSubRegionSnapshot.java
--
diff --git 
a/geode-core/src/main/java/org/apache/geode/admin/RegionSubRegionSnapshot.java 
b/geode-core/src/main/java/org/apache/geode/admin/RegionSubRegionSnapshot.java
deleted file mode 100644
index 19f89b2..000
--- 
a/geode-core/src/main/java/org/apache/geode/admin/RegionSubRegionSnapshot.java
+++ /dev/null
@@ -1,183 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more 
contributor license
- * agreements. See the NOTICE file distributed with this work for additional 
information regarding
- * copyright ownership. The ASF licenses this file to You under the Apache 
License, Version 2.0 (the
- * "License"); you may not use this file except in compliance with the 
License. You may obtain a
- * copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software 
distributed under the License
- * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 
KIND, either express
- * or implied. See the License for the specific language governing permissions 
and limitations under
- * the License.
- */
-package org.apache.geode.admin;
-
-import java.io.DataInput;
-import java.io.DataOutput;
-import java.io.IOException;
-import java.util.HashSet;
-import java.util.Iterator;
-import java.util.Set;
-
-import org.apache.geode.DataSerializable;
-import org.apache.geode.DataSerializer;
-import org.apache.geode.cache.Region;
-import org.apache.geode.i18n.LogWriterI18n;
-import org.apache.geode.internal.cache.PartitionedRegion;
-
-/**
- * Class RegionSubRegionSnapshot provides information about 
Regions. This
- * also provides the information about sub regions This class is used by the 
monitoring tool.
- * 
- * 
- * @since GemFire 5.7
- * @deprecated as of 7.0 use the management
- * package instead
- */
-public class RegionSubRegionSnapshot implements DataSerializable {
-  private static final long serialVersionUID = -8052137675270041871L;
-
-  public RegionSubRegionSnapshot() {
-this.parent = null;
-this.subRegionSnapshots = new HashSet();
-  }
-
-  public RegionSubRegionSnapshot(Region reg) {
-this();
-this.name = reg.getName();
-if (reg instanceof PartitionedRegion) {
-  PartitionedRegion p_reg = (PartitionedRegion) reg;
-  this.entryCount = p_reg.entryCount(true);
-} else {
-  this.entryCount = reg.entrySet().size();
-}
-final LogWriterI18n logger = reg.getCache().getLoggerI18n();
-if ((logger != null) && logger.fineEnabled()) {
-  logger.fine("RegionSubRegionSnapshot Region entry count =" + 
this.entryCount + " for region ="
-  + this.name);
-}
-  }
-
-  /**
-   * add the snapshot of sub region
-   * 
-   * @param snap snapshot of sub region
-   * @return true if operation is successful
-   */
-  public boolean addSubRegion(RegionSubRegionSnapshot snap) {
-if (subRegionSnapshots.contains(snap)) {
-  return true;
-}
-
-if (subRegionSnapshots.add(snap)) {
-  snap.setParent(this);
-  return true;
-}
-
-return false;
-  }
-
-  /**
-   * @return get entry count of region
-   */
-  public final int getEntryCount() {
-return entryCount;
-  }
-
-  /**
-   * @param entryCount entry count of region
-   */
-  public final void setEntryCount(int entryCount) {
-this.entryCount = entryCount;
-  }
-
-  /**
-   * @return name of region
-   */
-  public final String getName() {
-return name;
-  }
-
-  /**
-   * @param name name of region
-   */
-  public final void setName(String name) {
-this.name = name;
-  }
-
-  /**
-   * @return subRegionSnapshots of all the sub regions
-   */
-  public final Set getSubRegionSnapshots() {
-return subRegionSnapshots;
-  }
-
-  /**
-   * @param subRegionSnapshots subRegionSnapshots of all the sub regions
-   */
-  public final void setSubRegionSnapshots(Set subRegionSnapshots) {
-this.subRegionSnapshots = subRegionSnapshots;
-  }
-
-  /**
-   * @return snapshot of parent region
-   */
-  public final RegionSubRegionSnapshot getParent() {
-return parent;
-  }
-
-  /**
-   * @param parent snapshot of parent region
-   */
-  public final void setParent(RegionSubRegionSnapshot parent) {
-this.parent = parent;
-  }
-
-  /**
-   * 
-   * @return full path of region
-   */
-  public String getFullPath() {
-return (getParent() == null ? "/" : getParent().getFullPath()) + getName() 
+ "/";
-  }
-
-  public void toData(DataOutput out) throws IOException {
-DataSerializer.writeString(this.name, out);
-out.writeInt(this.entryCount);
-DataSerializer.writeHashSet((HashSet) this.subRegionSnapshots, out);
-  }
-
-  public void fromData(DataInput in) throws IOException, 
ClassNotFoundException {
-this.name = 

[53/93] incubator-geode git commit: GEODE-288: move admin package to internal

2016-10-26 Thread klund
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/895fd144/geode-core/src/test/java/org/apache/geode/admin/internal/HealthEvaluatorTestCase.java
--
diff --git 
a/geode-core/src/test/java/org/apache/geode/admin/internal/HealthEvaluatorTestCase.java
 
b/geode-core/src/test/java/org/apache/geode/admin/internal/HealthEvaluatorTestCase.java
deleted file mode 100644
index c61cbd0..000
--- 
a/geode-core/src/test/java/org/apache/geode/admin/internal/HealthEvaluatorTestCase.java
+++ /dev/null
@@ -1,71 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more 
contributor license
- * agreements. See the NOTICE file distributed with this work for additional 
information regarding
- * copyright ownership. The ASF licenses this file to You under the Apache 
License, Version 2.0 (the
- * "License"); you may not use this file except in compliance with the 
License. You may obtain a
- * copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software 
distributed under the License
- * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 
KIND, either express
- * or implied. See the License for the specific language governing permissions 
and limitations under
- * the License.
- */
-package org.apache.geode.admin.internal;
-
-import org.apache.geode.distributed.DistributedSystem;
-import org.apache.geode.distributed.internal.InternalDistributedSystem;
-import org.junit.After;
-import org.junit.Before;
-
-import java.util.Properties;
-
-import static org.apache.geode.distributed.ConfigurationProperties.*;
-
-/**
- * Superclass of tests for the {@linkplain 
org.apache.geode.admin.internal.AbstractHealthEvaluator
- * health evaluator} classes.
- *
- *
- * @since GemFire 3.5
- */
-public abstract class HealthEvaluatorTestCase {
-
-  /** The DistributedSystem used for this test */
-  protected InternalDistributedSystem system;
-
-  /**
-   * Creates a "loner" DistributedSystem for this test.
-   */
-  @Before
-  public void setUp() {
-Properties props = getProperties();
-system = (InternalDistributedSystem) DistributedSystem.connect(props);
-  }
-
-  /**
-   * Closes the "loner" DistributedSystem
-   */
-  @After
-  public void tearDown() {
-if (this.system != null) {
-  this.system.disconnect();
-}
-
-this.system = null;
-  }
-
-  /**
-   * Creates the Properties objects used to connect to the 
distributed system.
-   */
-  protected Properties getProperties() {
-Properties props = new Properties();
-props.setProperty(MCAST_PORT, "0");
-props.setProperty(LOCATORS, "");
-props.setProperty(STATISTIC_SAMPLING_ENABLED, "true");
-
-return props;
-  }
-
-}

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/895fd144/geode-core/src/test/java/org/apache/geode/admin/internal/MemberHealthEvaluatorJUnitTest.java
--
diff --git 
a/geode-core/src/test/java/org/apache/geode/admin/internal/MemberHealthEvaluatorJUnitTest.java
 
b/geode-core/src/test/java/org/apache/geode/admin/internal/MemberHealthEvaluatorJUnitTest.java
deleted file mode 100644
index d20ce36..000
--- 
a/geode-core/src/test/java/org/apache/geode/admin/internal/MemberHealthEvaluatorJUnitTest.java
+++ /dev/null
@@ -1,96 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more 
contributor license
- * agreements. See the NOTICE file distributed with this work for additional 
information regarding
- * copyright ownership. The ASF licenses this file to You under the Apache 
License, Version 2.0 (the
- * "License"); you may not use this file except in compliance with the 
License. You may obtain a
- * copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software 
distributed under the License
- * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 
KIND, either express
- * or implied. See the License for the specific language governing permissions 
and limitations under
- * the License.
- */
-package org.apache.geode.admin.internal;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertTrue;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.junit.Test;
-import org.junit.experimental.categories.Category;
-
-import org.apache.geode.admin.GemFireHealth;
-import org.apache.geode.admin.GemFireHealthConfig;
-import org.apache.geode.internal.statistics.GemFireStatSampler;
-import org.apache.geode.internal.statistics.platform.ProcessStats;
-import org.apache.geode.internal.PureJavaMode;
-import org.apache.geode.test.junit.categories.IntegrationTest;
-
-/**
- * Contains simple tests for the {@link MemberHealthEvaluator}.
- *

[80/93] incubator-geode git commit: GEODE-288: move admin package to internal

2016-10-26 Thread klund
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/895fd144/geode-core/src/main/java/org/apache/geode/admin/jmx/internal/AgentImpl.java
--
diff --git 
a/geode-core/src/main/java/org/apache/geode/admin/jmx/internal/AgentImpl.java 
b/geode-core/src/main/java/org/apache/geode/admin/jmx/internal/AgentImpl.java
deleted file mode 100644
index e55c3f1..000
--- 
a/geode-core/src/main/java/org/apache/geode/admin/jmx/internal/AgentImpl.java
+++ /dev/null
@@ -1,1624 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more 
contributor license
- * agreements. See the NOTICE file distributed with this work for additional 
information regarding
- * copyright ownership. The ASF licenses this file to You under the Apache 
License, Version 2.0 (the
- * "License"); you may not use this file except in compliance with the 
License. You may obtain a
- * copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software 
distributed under the License
- * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 
KIND, either express
- * or implied. See the License for the specific language governing permissions 
and limitations under
- * the License.
- */
-package org.apache.geode.admin.jmx.internal;
-
-import java.io.File;
-import java.io.IOException;
-import java.rmi.server.RMIClientSocketFactory;
-import java.rmi.server.RMIServerSocketFactory;
-import java.text.MessageFormat;
-import java.util.HashMap;
-import java.util.Map;
-import java.util.Properties;
-
-import javax.management.InstanceNotFoundException;
-import javax.management.MBeanException;
-import javax.management.MBeanRegistrationException;
-import javax.management.MBeanServer;
-import javax.management.MalformedObjectNameException;
-import javax.management.Notification;
-import javax.management.NotificationFilter;
-import javax.management.NotificationListener;
-import javax.management.ObjectName;
-import javax.management.OperationsException;
-import javax.management.ReflectionException;
-import javax.management.modelmbean.ModelMBean;
-import javax.management.remote.JMXConnectionNotification;
-import javax.management.remote.JMXConnectorServer;
-import javax.management.remote.JMXConnectorServerFactory;
-import javax.management.remote.JMXServiceURL;
-import javax.management.remote.rmi.RMIConnectorServer;
-import javax.rmi.ssl.SslRMIClientSocketFactory;
-
-import mx4j.tools.adaptor.http.HttpAdaptor;
-
-import org.apache.logging.log4j.Logger;
-
-import org.apache.geode.GemFireException;
-import org.apache.geode.GemFireIOException;
-import org.apache.geode.LogWriter;
-import org.apache.geode.SystemFailure;
-import org.apache.geode.admin.AdminDistributedSystem;
-import org.apache.geode.admin.AdminException;
-import org.apache.geode.admin.jmx.Agent;
-import org.apache.geode.admin.jmx.AgentConfig;
-import org.apache.geode.admin.jmx.AgentFactory;
-import org.apache.geode.distributed.internal.DistributionManager;
-import org.apache.geode.i18n.StringId;
-import org.apache.geode.internal.Banner;
-import org.apache.geode.internal.GemFireVersion;
-import org.apache.geode.internal.admin.remote.TailLogResponse;
-import org.apache.geode.internal.i18n.LocalizedStrings;
-import org.apache.geode.internal.logging.InternalLogWriter;
-import org.apache.geode.internal.logging.LogConfig;
-import org.apache.geode.internal.logging.LogService;
-import org.apache.geode.internal.logging.LogWriterFactory;
-import org.apache.geode.internal.logging.LoggingThreadGroup;
-import org.apache.geode.internal.logging.log4j.AlertAppender;
-import org.apache.geode.internal.logging.log4j.LocalizedMessage;
-import org.apache.geode.internal.logging.log4j.LogMarker;
-import org.apache.geode.internal.logging.log4j.LogWriterAppender;
-import org.apache.geode.internal.logging.log4j.LogWriterAppenders;
-
-/**
- * The GemFire JMX Agent provides the ability to administrate one GemFire 
distributed system via
- * JMX.
- *
- * @since GemFire 3.5
- */
-public class AgentImpl implements org.apache.geode.admin.jmx.Agent,
-org.apache.geode.admin.jmx.internal.ManagedResource {
-
-  private static final Logger logger = LogService.getLogger();
-
-  /**
-   * MX4J HttpAdaptor only supports "basic" as an authentication method. 
Enabling HttpAdaptor
-   * authentication ({@link AgentConfig#HTTP_AUTHENTICATION_ENABLED_NAME}) 
causes the browser to
-   * require a login with username ({@link 
AgentConfig#HTTP_AUTHENTICATION_USER_NAME}) and password
-   * ({@link AgentConfig#HTTP_AUTHENTICATION_PASSWORD_NAME}).
-   */
-  private static final String MX4J_HTTPADAPTOR_BASIC_AUTHENTICATION = "basic";
-
-  /** JMX Service URL template for JMX/RMI Connector Server */
-  private static final String JMX_SERVICE_URL = 
"service:jmx:rmi://{0}:{1}/jndi/rmi://{2}:{3}{4}";
-
-  /**
-   * Set third-party logging configration: MX4J, 

[59/93] incubator-geode git commit: GEODE-288: move admin package to internal

2016-10-26 Thread klund
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/895fd144/geode-core/src/main/java/org/apache/geode/internal/admin/api/jmx/impl/MX4JModelMBean.java
--
diff --git 
a/geode-core/src/main/java/org/apache/geode/internal/admin/api/jmx/impl/MX4JModelMBean.java
 
b/geode-core/src/main/java/org/apache/geode/internal/admin/api/jmx/impl/MX4JModelMBean.java
new file mode 100755
index 000..2facc17
--- /dev/null
+++ 
b/geode-core/src/main/java/org/apache/geode/internal/admin/api/jmx/impl/MX4JModelMBean.java
@@ -0,0 +1,1232 @@
+/*
+ * Copyright (C) MX4J. All rights reserved.
+ *
+ * This software is distributed under the terms of the MX4J License version 
1.0. See the terms of
+ * the MX4J License in the documentation provided with this software.
+ */
+
+package org.apache.geode.internal.admin.api.jmx.impl;
+
+import java.lang.reflect.InvocationTargetException;
+import java.lang.reflect.Method;
+import java.util.Date;
+import java.util.Iterator;
+
+import javax.management.Attribute;
+import javax.management.AttributeChangeNotification;
+import javax.management.AttributeChangeNotificationFilter;
+import javax.management.AttributeList;
+import javax.management.AttributeNotFoundException;
+import javax.management.Descriptor;
+import javax.management.InstanceNotFoundException;
+import javax.management.InvalidAttributeValueException;
+import javax.management.ListenerNotFoundException;
+import javax.management.MBeanAttributeInfo;
+import javax.management.MBeanException;
+import javax.management.MBeanInfo;
+import javax.management.MBeanNotificationInfo;
+import javax.management.MBeanOperationInfo;
+import javax.management.MBeanRegistration;
+import javax.management.MBeanRegistrationException;
+import javax.management.MBeanServer;
+import javax.management.MalformedObjectNameException;
+import javax.management.Notification;
+import javax.management.NotificationBroadcasterSupport;
+import javax.management.NotificationEmitter;
+import javax.management.NotificationFilter;
+import javax.management.NotificationListener;
+import javax.management.ObjectName;
+import javax.management.ReflectionException;
+import javax.management.RuntimeErrorException;
+import javax.management.RuntimeOperationsException;
+import javax.management.ServiceNotFoundException;
+import javax.management.loading.ClassLoaderRepository;
+import javax.management.modelmbean.InvalidTargetObjectTypeException;
+import javax.management.modelmbean.ModelMBean;
+import javax.management.modelmbean.ModelMBeanAttributeInfo;
+import javax.management.modelmbean.ModelMBeanInfo;
+import javax.management.modelmbean.ModelMBeanOperationInfo;
+
+import mx4j.ImplementationException;
+import mx4j.log.FileLogger;
+import mx4j.log.Log;
+import mx4j.log.Logger;
+import mx4j.log.MBeanLogger;
+import mx4j.persist.FilePersister;
+import mx4j.persist.MBeanPersister;
+import mx4j.persist.PersisterMBean;
+import mx4j.util.Utils;
+
+import org.apache.geode.internal.i18n.LocalizedStrings;
+
+/**
+ * @author mailto:biorn_stee...@users.sourceforge.net;>Simone 
Bordet
+ * @version $Revision: 1.14 $
+ */
+public class MX4JModelMBean implements ModelMBean, MBeanRegistration, 
NotificationEmitter {
+  private static final String OBJECT_RESOURCE_TYPE = "ObjectReference";
+
+  private static final int ALWAYS_STALE = 1;
+  private static final int NEVER_STALE = 2;
+  private static final int STALE = 3;
+  private static final int NOT_STALE = 4;
+
+  private static final int PERSIST_NEVER = -1;
+  private static final int PERSIST_ON_TIMER = -2;
+  private static final int PERSIST_ON_UPDATE = -3;
+  private static final int PERSIST_NO_MORE_OFTEN_THAN = -4;
+
+  private MBeanServer m_mbeanServer;
+  private Object m_managedResource;
+  private boolean m_canBeRegistered;
+  private ModelMBeanInfo m_modelMBeanInfo;
+  private NotificationBroadcasterSupport m_attributeChangeBroadcaster =
+  new NotificationBroadcasterSupport();
+  private NotificationBroadcasterSupport m_generalBroadcaster =
+  new NotificationBroadcasterSupport();
+
+  public MX4JModelMBean() throws MBeanException, RuntimeOperationsException {
+try {
+  load();
+} catch (Exception x) {
+  Logger logger = getLogger();
+  
logger.warn(LocalizedStrings.MX4JModelMBean_CANNOT_RESTORE_PREVIOUSLY_SAVED_STATUS
+  .toLocalizedString(), x);
+}
+  }
+
+  public MX4JModelMBean(ModelMBeanInfo info) throws MBeanException, 
RuntimeOperationsException {
+if (info == null)
+  throw new RuntimeOperationsException(new IllegalArgumentException(
+  LocalizedStrings.MX4JModelMBean_MODELMBEANINFO_PARAMETER_CANT_BE_NULL
+  .toLocalizedString()));
+else
+  setModelMBeanInfo(info);
+  }
+
+  private Logger getLogger() {
+return Log.getLogger(getClass().getName());
+  }
+
+  public ObjectName preRegister(MBeanServer server, ObjectName name) throws 
Exception {
+if (m_canBeRegistered) {
+  m_mbeanServer 

[36/93] [partial] incubator-geode git commit: Added Spotless plugin to enforce formatting standards. Added Google Java Style guide formatter templates, removed existing formatter templates.

2016-10-26 Thread klund
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/8bf39571/geode-assembly/src/test/java/org/apache/geode/rest/internal/web/controllers/RestAPIsWithSSLDUnitTest.java
--
diff --git 
a/geode-assembly/src/test/java/org/apache/geode/rest/internal/web/controllers/RestAPIsWithSSLDUnitTest.java
 
b/geode-assembly/src/test/java/org/apache/geode/rest/internal/web/controllers/RestAPIsWithSSLDUnitTest.java
index fde41f1..bb13966 100644
--- 
a/geode-assembly/src/test/java/org/apache/geode/rest/internal/web/controllers/RestAPIsWithSSLDUnitTest.java
+++ 
b/geode-assembly/src/test/java/org/apache/geode/rest/internal/web/controllers/RestAPIsWithSSLDUnitTest.java
@@ -1,18 +1,16 @@
 /*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
+ * Licensed to the Apache Software Foundation (ASF) under one or more 
contributor license
+ * agreements. See the NOTICE file distributed with this work for additional 
information regarding
+ * copyright ownership. The ASF licenses this file to You under the Apache 
License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance with the 
License. You may obtain a
+ * copy of the License at
  *
- *  http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
  *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software 
distributed under the License
+ * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 
KIND, either express
+ * or implied. See the License for the specific language governing permissions 
and limitations under
+ * the License.
  */
 package org.apache.geode.rest.internal.web.controllers;
 
@@ -116,7 +114,8 @@ public class RestAPIsWithSSLDUnitTest extends 
LocatorTestBase {
   }
 
   private File findTrustedJKSWithSingleEntry() {
-return new File(TestUtil.getResourcePath(RestAPIsWithSSLDUnitTest.class, 
"/ssl/trusted.keystore"));
+return new File(
+TestUtil.getResourcePath(RestAPIsWithSSLDUnitTest.class, 
"/ssl/trusted.keystore"));
   }
 
   private File findTrustStoreJKSForPath(Properties props) {
@@ -139,12 +138,8 @@ public class RestAPIsWithSSLDUnitTest extends 
LocatorTestBase {
   }
 
   @SuppressWarnings("deprecation")
-  protected int startBridgeServer(String hostName,
-  int restServicePort,
-  final String locators,
-  final String[] regions,
-  final Properties sslProperties,
-  boolean clusterLevel) {
+  protected int startBridgeServer(String hostName, int restServicePort, final 
String locators,
+  final String[] regions, final Properties sslProperties, boolean 
clusterLevel) {
 
 Properties props = new Properties();
 props.setProperty(MCAST_PORT, "0");
@@ -189,7 +184,8 @@ public class RestAPIsWithSSLDUnitTest extends 
LocatorTestBase {
 region.put("2", new Person(102L, "Sachin", "Ramesh", "Tendulkar", new 
Date(), Gender.MALE));
 region.put("3", new Person(103L, "Saurabh", "Baburav", "Ganguly", new 
Date(), Gender.MALE));
 region.put("4", new Person(104L, "Rahul", "subrymanyam", "Dravid", new 
Date(), Gender.MALE));
-region.put("5", new Person(105L, "Jhulan", "Chidambaram", "Goswami", new 
Date(), Gender.FEMALE));
+region.put("5",
+new Person(105L, "Jhulan", "Chidambaram", "Goswami", new Date(), 
Gender.FEMALE));
 
 Map userMap = new HashMap();
 userMap.put("6", new Person(101L, "Rahul", "Rajiv", "Gndhi", new Date(), 
Gender.MALE));
@@ -198,7 +194,8 @@ public class RestAPIsWithSSLDUnitTest extends 
LocatorTestBase {
 userMap.put("9", new Person(104L, "Soniya", "Rajiv", "Gandhi", new Date(), 
Gender.FEMALE));
 userMap.put("10", new Person(104L, "Priyanka", "Robert", "Gandhi", new 
Date(), Gender.FEMALE));
 userMap.put("11", new Person(104L, "Murali", "Manohar", "Joshi", new 
Date(), Gender.MALE));
-userMap.put("12", new Person(104L, "Lalkrishna", "Parmhansh", "Advani", 
new Date(), Gender.MALE));
+userMap.put("12",
+new Person(104L, "Lalkrishna", "Parmhansh", "Advani", new Date(), 
Gender.MALE));
 userMap.put("13", new 

[46/93] [partial] incubator-geode git commit: Added Spotless plugin to enforce formatting standards. Added Google Java Style guide formatter templates, removed existing formatter templates.

2016-10-26 Thread klund
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/8bf39571/extensions/geode-modules-session/src/test/java/org/apache/geode/modules/session/internal/filter/CommonTests.java
--
diff --git 
a/extensions/geode-modules-session/src/test/java/org/apache/geode/modules/session/internal/filter/CommonTests.java
 
b/extensions/geode-modules-session/src/test/java/org/apache/geode/modules/session/internal/filter/CommonTests.java
index c1677a1..c31afc6 100644
--- 
a/extensions/geode-modules-session/src/test/java/org/apache/geode/modules/session/internal/filter/CommonTests.java
+++ 
b/extensions/geode-modules-session/src/test/java/org/apache/geode/modules/session/internal/filter/CommonTests.java
@@ -1,19 +1,17 @@
 /*
-* Licensed to the Apache Software Foundation (ASF) under one or more
-* contributor license agreements.  See the NOTICE file distributed with
-* this work for additional information regarding copyright ownership.
-* The ASF licenses this file to You under the Apache License, Version 2.0
-* (the "License"); you may not use this file except in compliance with
-* the License.  You may obtain a copy of the License at
-*
-*  http://www.apache.org/licenses/LICENSE-2.0
-*
-* Unless required by applicable law or agreed to in writing, software
-* distributed under the License is distributed on an "AS IS" BASIS,
-* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-* See the License for the specific language governing permissions and
-* limitations under the License.
-*/
+ * Licensed to the Apache Software Foundation (ASF) under one or more 
contributor license
+ * agreements. See the NOTICE file distributed with this work for additional 
information regarding
+ * copyright ownership. The ASF licenses this file to You under the Apache 
License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance with the 
License. You may obtain a
+ * copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software 
distributed under the License
+ * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 
KIND, either express
+ * or implied. See the License for the specific language governing permissions 
and limitations under
+ * the License.
+ */
 package org.apache.geode.modules.session.internal.filter;
 
 import static org.junit.Assert.*;
@@ -42,8 +40,8 @@ import org.junit.Ignore;
 import org.junit.Test;
 
 /**
- * This servlet tests the effects of the downstream SessionCachingFilter 
filter.
- * When these tests are performed, the filter would already have taken effect.
+ * This servlet tests the effects of the downstream SessionCachingFilter 
filter. When these tests
+ * are performed, the filter would already have taken effect.
  */
 public abstract class CommonTests extends BasicServletTestCaseAdapter {
 
@@ -52,10 +50,8 @@ public abstract class CommonTests extends 
BasicServletTestCaseAdapter {
   @Test
   public void testGetSession1() throws Exception {
 doFilter();
-HttpSession session1 =
-((HttpServletRequest) getFilteredRequest()).getSession();
-HttpSession session2 =
-((HttpServletRequest) getFilteredRequest()).getSession();
+HttpSession session1 = ((HttpServletRequest) 
getFilteredRequest()).getSession();
+HttpSession session2 = ((HttpServletRequest) 
getFilteredRequest()).getSession();
 
 assertSame("Session should be the same", session1, session2);
   }
@@ -84,8 +80,7 @@ public abstract class CommonTests extends 
BasicServletTestCaseAdapter {
 getFilteredRequest().setAttribute("foo", "bar");
 
 assertEquals("bar", getFilteredRequest().getAttribute("foo"));
-assertNull("Unknown attribute should be null",
-getFilteredRequest().getAttribute("baz"));
+assertNull("Unknown attribute should be null", 
getFilteredRequest().getAttribute("baz"));
   }
 
   @Test
@@ -101,8 +96,7 @@ public abstract class CommonTests extends 
BasicServletTestCaseAdapter {
 doFilter();
 
 assertEquals("bar", getFilteredRequest().getAttribute("foo"));
-assertNull("Unknown attribute should be null",
-getFilteredRequest().getAttribute("baz"));
+assertNull("Unknown attribute should be null", 
getFilteredRequest().getAttribute("baz"));
   }
 
   @Test
@@ -166,8 +160,7 @@ public abstract class CommonTests extends 
BasicServletTestCaseAdapter {
 
 
   /**
-   * Test that various methods throw the appropriate exception when the 
session is
-   * invalid.
+   * Test that various methods throw the appropriate exception when the 
session is invalid.
*/
   @Test
   public void testInvalidate1() throws Exception {
@@ -342,7 +335,9 @@ public abstract class CommonTests extends 
BasicServletTestCaseAdapter {
 doFilter();
 
 // Ugh
-MockHttpSession session = (MockHttpSession) ((GemfireHttpSession) 
((HttpServletRequest) 

[85/93] incubator-geode git commit: GEODE-288: move admin package to internal

2016-10-26 Thread klund
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/895fd144/geode-core/src/main/java/org/apache/geode/admin/internal/GemFireHealthImpl.java
--
diff --git 
a/geode-core/src/main/java/org/apache/geode/admin/internal/GemFireHealthImpl.java
 
b/geode-core/src/main/java/org/apache/geode/admin/internal/GemFireHealthImpl.java
deleted file mode 100644
index efeee66..000
--- 
a/geode-core/src/main/java/org/apache/geode/admin/internal/GemFireHealthImpl.java
+++ /dev/null
@@ -1,511 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more 
contributor license
- * agreements. See the NOTICE file distributed with this work for additional 
information regarding
- * copyright ownership. The ASF licenses this file to You under the Apache 
License, Version 2.0 (the
- * "License"); you may not use this file except in compliance with the 
License. You may obtain a
- * copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software 
distributed under the License
- * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 
KIND, either express
- * or implied. See the License for the specific language governing permissions 
and limitations under
- * the License.
- */
-package org.apache.geode.admin.internal;
-
-import org.apache.geode.CancelException;
-import org.apache.geode.admin.*;
-import org.apache.geode.internal.Assert;
-import org.apache.geode.internal.admin.*;
-import org.apache.geode.internal.i18n.LocalizedStrings;
-
-import java.net.InetAddress;
-import java.net.UnknownHostException;
-import java.util.*;
-
-/**
- * Provides the implementation of the GemFireHealth 
administration API. This class is
- * responsible for {@linkplain GemFireVM#addHealthListener sending} the {@link 
GemFireHealthConfig}s
- * to the remote member VM in which the health is calcualted.
- *
- *
- * @since GemFire 3.5
- */
-public class GemFireHealthImpl implements GemFireHealth, JoinLeaveListener, 
HealthListener {
-
-  /** The distributed system whose health is being monitored */
-  private final GfManagerAgent agent;
-
-  /** The default configuration for checking GemFire health */
-  protected GemFireHealthConfig defaultConfig;
-
-  /**
-   * Maps the name of a host to its GemFireHealthConfig. Note 
that the mappings are
-   * created lazily.
-   */
-  private final Map hostConfigs;
-
-  /**
-   * Maps the name of a host to all of the members (GemFireVMs) 
that run on that host.
-   */
-  private final Map hostMembers;
-
-  /** The members that are known to be in {@link #OKAY_HEALTH}. */
-  private Collection okayHealth;
-
-  /** The members that are known to be in {@link #POOR_HEALTH}. */
-  private Collection poorHealth;
-
-  /** The overall health of GemFire */
-  private GemFireHealth.Health overallHealth;
-
-  /** Is this GemFireHealthImpl closed? */
-  private boolean isClosed;
-
-  /**
-   * The configuration specifying how the health of the distributed system 
should be computed.
-   */
-  protected volatile DistributedSystemHealthConfig dsHealthConfig;
-
-  /** Monitors the health of the entire distributed system */
-  private DistributedSystemHealthMonitor dsHealthMonitor = null;
-
-  /**
-   * The distributed system whose health is monitored by this 
GemFireHealth.
-   */
-  private final AdminDistributedSystem system;
-
-
-  /// Constructors ///
-
-  /**
-   * Creates a new GemFireHealthImpl that monitors the health of 
member of the given
-   * distributed system.
-   */
-  protected GemFireHealthImpl(GfManagerAgent agent, AdminDistributedSystem 
system) {
-// agent.getDM().getLogger().info("Creating GemFireHealthImpl",
-// new Exception("Stack trace"));
-
-this.agent = agent;
-this.system = system;
-
-this.hostConfigs = new HashMap();
-this.hostMembers = new HashMap();
-this.okayHealth = new HashSet();
-this.poorHealth = new HashSet();
-this.overallHealth = GOOD_HEALTH;
-this.isClosed = false;
-
-GemFireVM[] apps = this.agent.listApplications();
-for (int i = 0; i < apps.length; i++) {
-  GemFireVM member = apps[i];
-  this.noteNewMember(member);
-}
-
-agent.addJoinLeaveListener(this);
-setDefaultGemFireHealthConfig(createGemFireHealthConfig(null));
-setDistributedSystemHealthConfig(createDistributedSystemHealthConfig());
-  }
-
-  @Override
-  public String toString() {
-StringBuffer sb = new StringBuffer();
-sb.append("closed=" + isClosed);
-sb.append("; hostMembers=" + hostMembers);
-sb.append("; okayHealth=" + okayHealth);
-sb.append("; poorHealth=" + poorHealth);
-sb.append("; overallHealth=" + overallHealth);
-sb.append("; diagnosis=" + getDiagnosis());
-return sb.toString();
-  }
-  // Instance Methods //
-
-  /**
-   * Returns the 

[71/93] incubator-geode git commit: GEODE-288: move admin package to internal

2016-10-26 Thread klund
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/895fd144/geode-core/src/main/java/org/apache/geode/internal/admin/api/SystemMemberCacheServer.java
--
diff --git 
a/geode-core/src/main/java/org/apache/geode/internal/admin/api/SystemMemberCacheServer.java
 
b/geode-core/src/main/java/org/apache/geode/internal/admin/api/SystemMemberCacheServer.java
new file mode 100755
index 000..ba31538
--- /dev/null
+++ 
b/geode-core/src/main/java/org/apache/geode/internal/admin/api/SystemMemberCacheServer.java
@@ -0,0 +1,308 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more 
contributor license
+ * agreements. See the NOTICE file distributed with this work for additional 
information regarding
+ * copyright ownership. The ASF licenses this file to You under the Apache 
License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance with the 
License. You may obtain a
+ * copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software 
distributed under the License
+ * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 
KIND, either express
+ * or implied. See the License for the specific language governing permissions 
and limitations under
+ * the License.
+ */
+package org.apache.geode.internal.admin.api;
+
+import org.apache.geode.cache.server.ServerLoadProbe;
+
+/**
+ * Administrative interface that represents a {@link 
org.apache.geode.cache.server.CacheServer
+ * CacheServer} that serves the contents of a system member's cache to clients.
+ *
+ * @see SystemMemberCache#addCacheServer
+ *
+ * @since GemFire 5.7
+ * @deprecated as of 7.0 use the management
+ * package instead
+ */
+public interface SystemMemberCacheServer {
+
+  /**
+   * Returns the port on which this cache server listens for clients to 
connect.
+   */
+  public int getPort();
+
+  /**
+   * Sets the port on which this cache server listens for clients to connect.
+   *
+   * @throws AdminException If this cache server is running
+   */
+  public void setPort(int port) throws AdminException;
+
+  /**
+   * Starts this cache server. Once the server is running, its configuration 
cannot be changed.
+   *
+   * @throws AdminException If an error occurs while starting the cache server
+   */
+  public void start() throws AdminException;
+
+  /**
+   * Returns whether or not this cache server is running
+   */
+  public boolean isRunning();
+
+  /**
+   * Stops this cache server. Note that the CacheServer can be 
reconfigured and
+   * restarted if desired.
+   */
+  public void stop() throws AdminException;
+
+  /**
+   * Updates the information about this cache server.
+   */
+  public void refresh();
+
+  /**
+   * Returns a string representing the ip address or host name that this 
server will listen on.
+   * 
+   * @return the ip address or host name that this server is to listen on
+   * @since GemFire 5.7
+   */
+  public String getBindAddress();
+
+  /**
+   * Sets the ip address or host name that this server is to listen on for 
client connections.
+   * 
+   * Setting a specific bind address will cause the cache server to always use 
this address and
+   * ignore any address specified by "server-bind-address" or "bind-address" 
in the
+   * gemfire.properties file (see
+   * {@link org.apache.geode.distributed.DistributedSystem} for a description 
of these properties).
+   * 
+   * A null value will be treated the same as the default "".
+   * 
+   * The default value does not override the gemfire.properties. If you wish 
to override the
+   * properties and want to have your server bind to all local addresses then 
use this string
+   * "0.0.0.0".
+   * 
+   * @param address the ip address or host name that this server is to listen 
on
+   * @throws AdminException if this cache server is running
+   * @since GemFire 5.7
+   */
+  public void setBindAddress(String address) throws AdminException;
+
+  /**
+   * Returns a string representing the ip address or host name that server 
locators will tell
+   * clients that this server is listening on.
+   * 
+   * @return the ip address or host name to give to clients so they can 
connect to this server
+   * @since GemFire 5.7
+   */
+  public String getHostnameForClients();
+
+  /**
+   * Sets the ip address or host name that this server is to listen on for 
client connections.
+   * 
+   * Setting a specific hostname-for-clients will cause server locators to use 
this value when
+   * telling clients how to connect to this server.
+   * 
+   * The default value causes the bind-address to be given to clients
+   * 
+   * A null value will be treated the same as the default "".
+   * 
+   * @param name the ip address or host name that will be given to clients so 
they can connect to
+   *this server
+   * @throws AdminException if this 

[74/93] incubator-geode git commit: GEODE-288: move admin package to internal

2016-10-26 Thread klund
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/895fd144/geode-core/src/main/java/org/apache/geode/admin/jmx/internal/package.html
--
diff --git 
a/geode-core/src/main/java/org/apache/geode/admin/jmx/internal/package.html 
b/geode-core/src/main/java/org/apache/geode/admin/jmx/internal/package.html
deleted file mode 100755
index bc2b2f2..000
--- a/geode-core/src/main/java/org/apache/geode/admin/jmx/internal/package.html
+++ /dev/null
@@ -1,166 +0,0 @@
-
-
-
-
-Contains the implementation of the external JMX APIs from
-org.apache.geode.admin.jmx.
-
-JMX Support in GemFire
-
-Our goal was to provide JMX administrative support in GemFire.  The design was 
influenced by these important factors:
-
-
-1) Requirement to not impact performance of the product
-2) Desire to introduce JMX without altering the existing product or the 
management console
-3) Similar functionality already existed in the console and the 
internal.admin pkg which the console uses
-4) Requirement to also introduce a simple and usable Admin API which or 
may not be related to JMX
-
-
-From a functional stand point, the JMX support was supposed to provide most of 
the same administrative and operational monitoring that the console already 
provides.  In some cases we limited the functionality due to security concerns 
and in others because it was hard to express the features as JMX beans.  The 
JMX Agent also provides some functionality (such as Health monitoring) that is 
not currently in the console.
-
-The Agent communicates with the distributed system using the same distribution 
manager {@link org.apache.geode.distributed.internal.DistributionManager} as 
the console uses and thus has the same requirements that determine what 
distributed system it can manage.  Although the Console currently supports 
managing multiple distributed systems, we decided that a given Agent should 
only be able to manage a single system.  We have not tested the use of more 
than one Agent for the same system, however nothing currently prohibits this.
-
-We decided to develop a simple public Admin API which in essence wraps the 
internal.admin API that the Console currently uses extensively.  The Admin API 
also contains implementations of new functionality not in internal.admin.  Our 
JMX support is an extension to this Admin API.  In an overly simplified view, 
the GemFire JMX MBeans are ModelMBeans that manage instances of the Admin API 
objects housed in the Agent's MBeanServer.
-
-The selected architecture consists of a Daemon Agent, which exists in a 
separate VM that GemFire does not depend on.  This Agent hosts an MBeanServer, 
instances of any and all MBeans registered for managing a GemFire distributed 
system, and server connectors/adaptors that various types of clients can 
connect to.
-
-The two server connectors we selected are the HttpAdaptor and the RMI 
Connector.  The HttpAdaptor provides an HTML user interface of all MBeans in 
the MBeanServer.  Although this generic UI is not as rich as an RMI client (or 
the GemFire Console) could be, it provides a functional and easy to use UI with 
no development required.  The JMX Remote specification details the standard 
connectors.  Although the HttpAdaptor is not required by this Sun spec. it is 
included in some form with all JMX implementations that I investigated.  It 
should be noted that our JMX Agent currently starts up the HttpAdaptor, but not 
the RMI Connector.  The latter is deferred as later work since some form of 
client must be developed for testing.  Further research may also uncover a 
generic, configurable open-source RMI client for JMX.  The GemFire Console 
could in theory be reworked as an RMI Connector client, but this is not 
currently planned.
-
-Two open-source JMX implementations made it to our final review for 
consideration: http://www.xmojo.org;>XMOJO and http://www.mx4j.org;>MX4J.  The decision to go with MX4J was based 
mainly on our perceptions of MX4J being more active and widespread in use.  
Additionally, XMOJO is associated with http://www.adventnet.com/;>AdventNet which produces commercial 
products.  This made MX4J seem more true to open-source and safer from 
corporate tampering.
-
-ModelMBeans are very dynamic and capable of managing aggregate resources.  Use 
of a ModelMBean entails specifying meta-data to an instance of 
javax.management.modelmbean.RequiredModelMBean.  This meta-data identifies the 
manageble resource(s) which can consist of a single object, or many objects, 
including those in one VM or in any number of distributed VMs.  We decided to 
subclass classes in the Admin API in order to massage them a little and make 
them easier to use as a managed resource by the ModelMBean.  For example, 
org.apache.geode.admin.GemFireManager represents a type of member in a GemFire 
system which manages shared memory.  When an MBean is registered for managing 
the 

[57/93] incubator-geode git commit: GEODE-288: move admin package to internal

2016-10-26 Thread klund
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/895fd144/geode-core/src/main/java/org/apache/geode/internal/admin/api/jmx/impl/StatisticAttributeInfo.java
--
diff --git 
a/geode-core/src/main/java/org/apache/geode/internal/admin/api/jmx/impl/StatisticAttributeInfo.java
 
b/geode-core/src/main/java/org/apache/geode/internal/admin/api/jmx/impl/StatisticAttributeInfo.java
new file mode 100755
index 000..1d5b9b4
--- /dev/null
+++ 
b/geode-core/src/main/java/org/apache/geode/internal/admin/api/jmx/impl/StatisticAttributeInfo.java
@@ -0,0 +1,72 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more 
contributor license
+ * agreements. See the NOTICE file distributed with this work for additional 
information regarding
+ * copyright ownership. The ASF licenses this file to You under the Apache 
License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance with the 
License. You may obtain a
+ * copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software 
distributed under the License
+ * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 
KIND, either express
+ * or implied. See the License for the specific language governing permissions 
and limitations under
+ * the License.
+ */
+package org.apache.geode.internal.admin.api.jmx.impl;
+
+import org.apache.geode.internal.admin.api.Statistic;
+import org.apache.geode.internal.Assert;
+
+import javax.management.Descriptor;
+import javax.management.modelmbean.DescriptorSupport;
+import javax.management.modelmbean.ModelMBeanAttributeInfo;
+
+/** 
+ * Subclass of AttributeInfo with {@link Statistic}
+ * added for use as the {@link 
+ * javax.management.modelmbean.ModelMBeanAttributeInfo} descriptor's 
+ * targetObject value.
+ *
+ * @since GemFire 3.5
+ *
+ */
+class StatisticAttributeInfo extends org.apache.commons.modeler.AttributeInfo {
+  private static final long serialVersionUID = 28022387514935560L;
+
+  private Statistic stat;
+
+  public StatisticAttributeInfo() {
+super();
+  }
+
+  public Statistic getStat() {
+return this.stat;
+  }
+
+  public void setStat(Statistic stat) {
+// System.out.println(">> stat = " + stat);
+Assert.assertTrue(stat != null, "Attempting to set stat to null");
+this.stat = stat;
+  }
+
+  @Override
+  public ModelMBeanAttributeInfo createAttributeInfo() {
+Descriptor desc = new DescriptorSupport(new String[] {"name=" + 
this.displayName,
+"descriptorType=attribute", "currencyTimeLimit=-1", // always stale
+"displayName=" + this.displayName, "getMethod=getValue"});
+
+Assert.assertTrue(this.stat != null, "Stat target object is null!");
+desc.setField("targetObject", this.stat);
+
+ModelMBeanAttributeInfo info = new 
ModelMBeanAttributeInfo(this.displayName, // name
+this.type, // type
+this.description, // description
+this.readable, // isReadable
+this.writeable, // isWritable
+this.is, // isIs
+desc);
+
+return info;
+  }
+}
+

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/895fd144/geode-core/src/main/java/org/apache/geode/internal/admin/api/jmx/impl/StatisticResourceJmxImpl.java
--
diff --git 
a/geode-core/src/main/java/org/apache/geode/internal/admin/api/jmx/impl/StatisticResourceJmxImpl.java
 
b/geode-core/src/main/java/org/apache/geode/internal/admin/api/jmx/impl/StatisticResourceJmxImpl.java
new file mode 100755
index 000..1d18889
--- /dev/null
+++ 
b/geode-core/src/main/java/org/apache/geode/internal/admin/api/jmx/impl/StatisticResourceJmxImpl.java
@@ -0,0 +1,347 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more 
contributor license
+ * agreements. See the NOTICE file distributed with this work for additional 
information regarding
+ * copyright ownership. The ASF licenses this file to You under the Apache 
License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance with the 
License. You may obtain a
+ * copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software 
distributed under the License
+ * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 
KIND, either express
+ * or implied. See the License for the specific language governing permissions 
and limitations under
+ * the License.
+ */
+package org.apache.geode.internal.admin.api.jmx.impl;
+
+import javax.management.Notification;
+import javax.management.ObjectName;
+import javax.management.modelmbean.ModelMBean;
+import javax.naming.OperationNotSupportedException;
+
+import org.apache.commons.modeler.ManagedBean;
+import org.apache.logging.log4j.Logger;
+
+import 

[48/93] [partial] incubator-geode git commit: Added Spotless plugin to enforce formatting standards. Added Google Java Style guide formatter templates, removed existing formatter templates.

2016-10-26 Thread klund
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/8bf39571/extensions/geode-modules-session-internal/src/main/java/org/apache/geode/modules/session/internal/filter/GemfireSessionManager.java
--
diff --git 
a/extensions/geode-modules-session-internal/src/main/java/org/apache/geode/modules/session/internal/filter/GemfireSessionManager.java
 
b/extensions/geode-modules-session-internal/src/main/java/org/apache/geode/modules/session/internal/filter/GemfireSessionManager.java
index f6378be..20cfeca 100644
--- 
a/extensions/geode-modules-session-internal/src/main/java/org/apache/geode/modules/session/internal/filter/GemfireSessionManager.java
+++ 
b/extensions/geode-modules-session-internal/src/main/java/org/apache/geode/modules/session/internal/filter/GemfireSessionManager.java
@@ -1,19 +1,17 @@
 /*
-* Licensed to the Apache Software Foundation (ASF) under one or more
-* contributor license agreements.  See the NOTICE file distributed with
-* this work for additional information regarding copyright ownership.
-* The ASF licenses this file to You under the Apache License, Version 2.0
-* (the "License"); you may not use this file except in compliance with
-* the License.  You may obtain a copy of the License at
-*
-*  http://www.apache.org/licenses/LICENSE-2.0
-*
-* Unless required by applicable law or agreed to in writing, software
-* distributed under the License is distributed on an "AS IS" BASIS,
-* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-* See the License for the specific language governing permissions and
-* limitations under the License.
-*/
+ * Licensed to the Apache Software Foundation (ASF) under one or more 
contributor license
+ * agreements. See the NOTICE file distributed with this work for additional 
information regarding
+ * copyright ownership. The ASF licenses this file to You under the Apache 
License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance with the 
License. You may obtain a
+ * copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software 
distributed under the License
+ * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 
KIND, either express
+ * or implied. See the License for the specific language governing permissions 
and limitations under
+ * the License.
+ */
 
 package org.apache.geode.modules.session.internal.filter;
 
@@ -52,8 +50,8 @@ import java.util.Map;
 import java.util.UUID;
 
 /**
- * This class implements the session management using a Gemfire 
distributedCache
- * as a persistent store for the session objects
+ * This class implements the session management using a Gemfire 
distributedCache as a persistent
+ * store for the session objects
  */
 public class GemfireSessionManager implements SessionManager {
 
@@ -89,16 +87,15 @@ public class GemfireSessionManager implements 
SessionManager {
   private boolean isStopping = false;
 
   /**
-   * Boolean indicating whether this manager is defined in the same context 
(war
-   * / classloader) as the filter.
+   * Boolean indicating whether this manager is defined in the same context 
(war / classloader) as
+   * the filter.
*/
   private boolean isolated = false;
 
   /**
* Map of wrapping GemFire session id to native session id
*/
-  private Map nativeSessionMap =
-  new HashMap();
+  private Map nativeSessionMap = new HashMap();
 
   /**
* MBean for statistics
@@ -106,9 +103,8 @@ public class GemfireSessionManager implements 
SessionManager {
   private SessionStatistics mbean;
 
   /**
-   * This CL is used to compare against the class loader of attributes getting
-   * pulled out of the cache. This variable should be set to the CL of the
-   * filter running everything.
+   * This CL is used to compare against the class loader of attributes getting 
pulled out of the
+   * cache. This variable should be set to the CL of the filter running 
everything.
*/
   private ClassLoader referenceClassLoader;
 
@@ -123,21 +119,22 @@ public class GemfireSessionManager implements 
SessionManager {
* Set up properties with default values
*/
   private TypeAwareMap properties =
-  new TypeAwareMap(CacheProperty.class) {{
-put(CacheProperty.REGION_NAME, RegionHelper.NAME + "_sessions");
-put(CacheProperty.ENABLE_GATEWAY_DELTA_REPLICATION, Boolean.FALSE);
-put(CacheProperty.ENABLE_GATEWAY_REPLICATION, Boolean.FALSE);
-put(CacheProperty.ENABLE_DEBUG_LISTENER, Boolean.FALSE);
-put(CacheProperty.STATISTICS_NAME, "gemfire_statistics");
-put(CacheProperty.SESSION_DELTA_POLICY, "delta_queued");
-put(CacheProperty.REPLICATION_TRIGGER, "set");
-/**
- * For 

[43/93] [partial] incubator-geode git commit: Added Spotless plugin to enforce formatting standards. Added Google Java Style guide formatter templates, removed existing formatter templates.

2016-10-26 Thread klund
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/8bf39571/extensions/geode-modules/src/main/java/org/apache/geode/modules/session/catalina/DeltaSessionManager.java
--
diff --git 
a/extensions/geode-modules/src/main/java/org/apache/geode/modules/session/catalina/DeltaSessionManager.java
 
b/extensions/geode-modules/src/main/java/org/apache/geode/modules/session/catalina/DeltaSessionManager.java
index 5e70c2f..edc2b7d 100644
--- 
a/extensions/geode-modules/src/main/java/org/apache/geode/modules/session/catalina/DeltaSessionManager.java
+++ 
b/extensions/geode-modules/src/main/java/org/apache/geode/modules/session/catalina/DeltaSessionManager.java
@@ -1,19 +1,17 @@
 /*
-* Licensed to the Apache Software Foundation (ASF) under one or more
-* contributor license agreements.  See the NOTICE file distributed with
-* this work for additional information regarding copyright ownership.
-* The ASF licenses this file to You under the Apache License, Version 2.0
-* (the "License"); you may not use this file except in compliance with
-* the License.  You may obtain a copy of the License at
-*
-*  http://www.apache.org/licenses/LICENSE-2.0
-*
-* Unless required by applicable law or agreed to in writing, software
-* distributed under the License is distributed on an "AS IS" BASIS,
-* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-* See the License for the specific language governing permissions and
-* limitations under the License.
-*/
+ * Licensed to the Apache Software Foundation (ASF) under one or more 
contributor license
+ * agreements. See the NOTICE file distributed with this work for additional 
information regarding
+ * copyright ownership. The ASF licenses this file to You under the Apache 
License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance with the 
License. You may obtain a
+ * copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software 
distributed under the License
+ * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 
KIND, either express
+ * or implied. See the License for the specific language governing permissions 
and limitations under
+ * the License.
+ */
 package org.apache.geode.modules.session.catalina;
 
 import org.apache.geode.cache.CacheFactory;
@@ -61,7 +59,8 @@ import java.util.concurrent.ConcurrentHashMap;
 import java.util.concurrent.atomic.AtomicBoolean;
 import java.util.concurrent.atomic.AtomicInteger;
 
-abstract public class DeltaSessionManager extends ManagerBase implements 
Lifecycle, PropertyChangeListener, SessionManager {
+abstract public class DeltaSessionManager extends ManagerBase
+implements Lifecycle, PropertyChangeListener, SessionManager {
 
   /**
* The number of rejected sessions.
@@ -104,14 +103,15 @@ abstract public class DeltaSessionManager extends 
ManagerBase implements Lifecyc
   protected static final boolean DEFAULT_PREFER_DESERIALIZED_FORM = true;
 
   /*
-   * This *MUST* only be assigned during start/startInternal otherwise it will 
be associated
-   * with the incorrect context class loader.
+   * This *MUST* only be assigned during start/startInternal otherwise it will 
be associated with
+   * the incorrect context class loader.
*/
   protected Log LOGGER;
 
   protected String regionName = DEFAULT_REGION_NAME;
 
-  protected String regionAttributesId; // the default is different for 
client-server and peer-to-peer
+  protected String regionAttributesId; // the default is different for 
client-server and
+   // peer-to-peer
 
   protected Boolean enableLocalCache; // the default is different for 
client-server and peer-to-peer
 
@@ -131,9 +131,11 @@ abstract public class DeltaSessionManager extends 
ManagerBase implements Lifecyc
 
   private final Set sessionsToTouch;
 
-  private static final long TIMER_TASK_PERIOD = 
Long.getLong("gemfiremodules.sessionTimerTaskPeriod", 1);
+  private static final long TIMER_TASK_PERIOD =
+  Long.getLong("gemfiremodules.sessionTimerTaskPeriod", 1);
 
-  private static final long TIMER_TASK_DELAY = 
Long.getLong("gemfiremodules.sessionTimerTaskDelay", 1);
+  private static final long TIMER_TASK_DELAY =
+  Long.getLong("gemfiremodules.sessionTimerTaskDelay", 1);
 
   public DeltaSessionManager() {
 // Create the set to store sessions to be touched after get attribute 
requests
@@ -197,7 +199,7 @@ abstract public class DeltaSessionManager extends 
ManagerBase implements Lifecyc
 
   @Override
   public boolean getEnableGatewayDeltaReplication() {
-//return this.enableGatewayDeltaReplication;
+// return this.enableGatewayDeltaReplication;
 return false; // disabled
   }
 
@@ -285,11 +287,11 @@ abstract public class DeltaSessionManager extends 
ManagerBase implements Lifecyc
   }
 

[64/93] incubator-geode git commit: GEODE-288: move admin package to internal

2016-10-26 Thread klund
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/895fd144/geode-core/src/main/java/org/apache/geode/internal/admin/api/jmx/impl/AdminDistributedSystemJmxImpl.java
--
diff --git 
a/geode-core/src/main/java/org/apache/geode/internal/admin/api/jmx/impl/AdminDistributedSystemJmxImpl.java
 
b/geode-core/src/main/java/org/apache/geode/internal/admin/api/jmx/impl/AdminDistributedSystemJmxImpl.java
new file mode 100755
index 000..969833d
--- /dev/null
+++ 
b/geode-core/src/main/java/org/apache/geode/internal/admin/api/jmx/impl/AdminDistributedSystemJmxImpl.java
@@ -0,0 +1,2294 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more 
contributor license
+ * agreements. See the NOTICE file distributed with this work for additional 
information regarding
+ * copyright ownership. The ASF licenses this file to You under the Apache 
License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance with the 
License. You may obtain a
+ * copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software 
distributed under the License
+ * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 
KIND, either express
+ * or implied. See the License for the specific language governing permissions 
and limitations under
+ * the License.
+ */
+package org.apache.geode.internal.admin.api.jmx.impl;
+
+import org.apache.geode.DataSerializer;
+import org.apache.geode.SystemFailure;
+import org.apache.geode.internal.admin.api.AdminException;
+import org.apache.geode.internal.admin.api.CacheServer;
+import org.apache.geode.internal.admin.api.CacheServerConfig;
+import org.apache.geode.internal.admin.api.CacheVm;
+import org.apache.geode.internal.admin.api.CacheVmConfig;
+import org.apache.geode.internal.admin.api.DistributedSystemConfig;
+import org.apache.geode.internal.admin.api.DistributionLocator;
+import org.apache.geode.internal.admin.api.DistributionLocatorConfig;
+import org.apache.geode.internal.admin.api.GemFireHealth;
+import org.apache.geode.internal.admin.api.SystemMember;
+import org.apache.geode.internal.admin.api.SystemMemberCacheEvent;
+import org.apache.geode.internal.admin.api.SystemMemberCacheListener;
+import org.apache.geode.internal.admin.api.SystemMemberRegionEvent;
+import org.apache.geode.internal.admin.api.SystemMemberType;
+import org.apache.geode.internal.admin.api.impl.AdminDistributedSystemImpl;
+import org.apache.geode.internal.admin.api.impl.CacheServerConfigImpl;
+import org.apache.geode.internal.admin.api.impl.DistributionLocatorImpl;
+import org.apache.geode.cache.persistence.PersistentID;
+import org.apache.geode.distributed.DistributedMember;
+import org.apache.geode.distributed.internal.DistributionConfig;
+import org.apache.geode.distributed.internal.InternalDistributedSystem;
+import 
org.apache.geode.distributed.internal.membership.InternalDistributedMember;
+import org.apache.geode.internal.Assert;
+import org.apache.geode.internal.admin.Alert;
+import org.apache.geode.internal.admin.*;
+import org.apache.geode.internal.admin.remote.UpdateAlertDefinitionMessage;
+import org.apache.geode.internal.i18n.LocalizedStrings;
+import org.apache.geode.internal.logging.InternalLogWriter;
+import org.apache.geode.internal.logging.LogService;
+import org.apache.geode.internal.logging.log4j.LocalizedMessage;
+import org.apache.logging.log4j.Logger;
+
+import javax.management.*;
+import javax.management.modelmbean.ModelMBean;
+import javax.management.openmbean.*;
+import java.io.*;
+import java.net.InetAddress;
+import java.net.UnknownHostException;
+import java.util.*;
+import java.util.concurrent.atomic.AtomicInteger;
+
+/**
+ * Provides MBean support for managing a GemFire distributed system.
+ * 
+ * TODO: refactor to implement DistributedSystem and delegate to instance of 
DistributedSystemImpl.
+ * Wrap all delegate calls w/ e.printStackTrace() since the HttpAdaptor 
devours them (what to do w/
+ * template methods then?)
+ *
+ * @since GemFire 3.5
+ */
+public class AdminDistributedSystemJmxImpl extends AdminDistributedSystemImpl
+implements ManagedResource, DistributedSystemConfig, StatAlertsAggregator {
+
+  private static final Logger logger = LogService.getLogger();
+
+  private Properties mailProps;
+
+  // The file name where the StatAlertDefinitions would be serialized
+  private String statAlertDefnSerFile = System.getProperty("user.dir");
+
+  /**
+   * Simple counter incrementing on each notification. This this currently 
resets at every restart
+   * of Agent
+   */
+  private final AtomicInteger notificationSequenceNumber = new AtomicInteger();
+
+  /**
+   * Variable to indicate if there are no Rmi clients connected.
+   */
+  private volatile boolean isRmiClientCountZero;
+
+  /**
+   * Variable to indicate if Statistics Alert definitions could be 

[87/93] incubator-geode git commit: GEODE-288: move admin package to internal

2016-10-26 Thread klund
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/895fd144/geode-core/src/main/java/org/apache/geode/admin/internal/BackupDataStoreResult.java
--
diff --git 
a/geode-core/src/main/java/org/apache/geode/admin/internal/BackupDataStoreResult.java
 
b/geode-core/src/main/java/org/apache/geode/admin/internal/BackupDataStoreResult.java
deleted file mode 100644
index eae674b..000
--- 
a/geode-core/src/main/java/org/apache/geode/admin/internal/BackupDataStoreResult.java
+++ /dev/null
@@ -1,48 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more 
contributor license
- * agreements. See the NOTICE file distributed with this work for additional 
information regarding
- * copyright ownership. The ASF licenses this file to You under the Apache 
License, Version 2.0 (the
- * "License"); you may not use this file except in compliance with the 
License. You may obtain a
- * copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software 
distributed under the License
- * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 
KIND, either express
- * or implied. See the License for the specific language governing permissions 
and limitations under
- * the License.
- */
-package org.apache.geode.admin.internal;
-
-import java.util.Map;
-import java.util.Set;
-
-import org.apache.geode.cache.persistence.PersistentID;
-import org.apache.geode.distributed.DistributedMember;
-
-public class BackupDataStoreResult {
-
-  private Map existingDataStores;
-
-  private Map successfulMembers;
-
-  public BackupDataStoreResult(Map 
existingDataStores,
-  Map successfulMembers) {
-this.existingDataStores = existingDataStores;
-this.successfulMembers = successfulMembers;
-  }
-
-  public Map getExistingDataStores() {
-return this.existingDataStores;
-  }
-
-  public Map getSuccessfulMembers() {
-return this.successfulMembers;
-  }
-
-  public String toString() {
-return new StringBuilder().append(getClass().getSimpleName()).append("[")
-.append("existingDataStores=").append(this.existingDataStores)
-.append("; 
successfulMembers=").append(this.successfulMembers).append("]").toString();
-  }
-}

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/895fd144/geode-core/src/main/java/org/apache/geode/admin/internal/BackupStatusImpl.java
--
diff --git 
a/geode-core/src/main/java/org/apache/geode/admin/internal/BackupStatusImpl.java
 
b/geode-core/src/main/java/org/apache/geode/admin/internal/BackupStatusImpl.java
deleted file mode 100644
index 4256c3c..000
--- 
a/geode-core/src/main/java/org/apache/geode/admin/internal/BackupStatusImpl.java
+++ /dev/null
@@ -1,59 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more 
contributor license
- * agreements. See the NOTICE file distributed with this work for additional 
information regarding
- * copyright ownership. The ASF licenses this file to You under the Apache 
License, Version 2.0 (the
- * "License"); you may not use this file except in compliance with the 
License. You may obtain a
- * copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software 
distributed under the License
- * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 
KIND, either express
- * or implied. See the License for the specific language governing permissions 
and limitations under
- * the License.
- */
-package org.apache.geode.admin.internal;
-
-import java.io.Serializable;
-import java.util.Map;
-import java.util.Set;
-
-import org.apache.geode.admin.BackupStatus;
-import org.apache.geode.cache.persistence.PersistentID;
-import org.apache.geode.distributed.DistributedMember;
-
-/**
- * Holds the result of a backup operation.
- * 
- *
- */
-public class BackupStatusImpl implements BackupStatus, Serializable {
-  private static final long serialVersionUID = 3704162840296921840L;
-
-  private Map backedUpDiskStores;
-  private Set offlineDiskStores;
-
-  public BackupStatusImpl(Map 
backedUpDiskStores,
-  Set offlineDiskStores) {
-super();
-this.backedUpDiskStores = backedUpDiskStores;
-this.offlineDiskStores = offlineDiskStores;
-  }
-
-  public Map getBackedUpDiskStores() {
-return backedUpDiskStores;
-  }
-
-  public Set getOfflineDiskStores() {
-return offlineDiskStores;
-  }
-
-  @Override
-  public String toString() {
-return "BackupStatus[backedUpDiskStores=" + backedUpDiskStores + ", 

[50/93] [partial] incubator-geode git commit: Added Spotless plugin to enforce formatting standards. Added Google Java Style guide formatter templates, removed existing formatter templates.

2016-10-26 Thread klund
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/8bf39571/build.gradle
--
diff --git a/build.gradle b/build.gradle
index bc31c92..a734e05 100755
--- a/build.gradle
+++ b/build.gradle
@@ -24,6 +24,7 @@ buildscript {
 classpath "gradle.plugin.org.nosphere.apache:creadur-rat-gradle:0.2.0"
 classpath 'com.bmuschko:gradle-nexus-plugin:2.3.1'
 classpath 'org.sonarsource.scanner.gradle:sonarqube-gradle-plugin:2.0.1'
+classpath "com.diffplug.gradle.spotless:spotless:2.2.0"
   }
 }
 
@@ -45,7 +46,7 @@ allprojects {
   // We want to see all test results.  This is equivalatent to setting 
--continue
   // on the command line.
   gradle.startParameter.continueOnFailure = true
-  
+
   repositories {
 mavenCentral()
 maven { url "http://repo.spring.io/release; }
@@ -63,7 +64,7 @@ task cleanAll(type: Delete) {
   delete rootProject.buildDir
   if (!buildRoot.isEmpty()) {
 delete buildRoot
-  }  
+  }
 }
 
 // allow external projects to override include location
@@ -84,6 +85,13 @@ apply from: "${scriptDir}/rat.gradle"
 subprojects {
   // Make sure clean task for rootProject runs last
   clean.finalizedBy rootProject.cleanAll
+
+  apply plugin: "com.diffplug.gradle.spotless"
+  spotless {
+java {
+  eclipseFormatFile 
"${rootProject.projectDir}/etc/eclipse-java-google-style.xml"
+}
+  }
 }
 
 task cleanExamples(type: GradleBuild) {

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/8bf39571/etc/eclipse-java-google-style.xml
--
diff --git a/etc/eclipse-java-google-style.xml 
b/etc/eclipse-java-google-style.xml
new file mode 100644
index 000..08d930a
--- /dev/null
+++ b/etc/eclipse-java-google-style.xml
@@ -0,0 +1,337 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/8bf39571/etc/eclipseFormatterProfile.xml
--
diff --git a/etc/eclipseFormatterProfile.xml b/etc/eclipseFormatterProfile.xml
deleted file mode 100755
index b9f8410..000
--- a/etc/eclipseFormatterProfile.xml
+++ /dev/null
@@ -1,295 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-



[65/93] incubator-geode git commit: GEODE-288: move admin package to internal

2016-10-26 Thread klund
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/895fd144/geode-core/src/main/java/org/apache/geode/internal/admin/api/impl/SystemMemberRegionImpl.java
--
diff --git 
a/geode-core/src/main/java/org/apache/geode/internal/admin/api/impl/SystemMemberRegionImpl.java
 
b/geode-core/src/main/java/org/apache/geode/internal/admin/api/impl/SystemMemberRegionImpl.java
new file mode 100644
index 000..b859ad9
--- /dev/null
+++ 
b/geode-core/src/main/java/org/apache/geode/internal/admin/api/impl/SystemMemberRegionImpl.java
@@ -0,0 +1,372 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more 
contributor license
+ * agreements. See the NOTICE file distributed with this work for additional 
information regarding
+ * copyright ownership. The ASF licenses this file to You under the Apache 
License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance with the 
License. You may obtain a
+ * copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software 
distributed under the License
+ * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 
KIND, either express
+ * or implied. See the License for the specific language governing permissions 
and limitations under
+ * the License.
+ */
+package org.apache.geode.internal.admin.api.impl;
+
+import org.apache.geode.cache.*;
+//import org.apache.geode.internal.Assert;
+//import org.apache.geode.internal.admin.*;
+import org.apache.geode.internal.admin.api.AdminException;
+import org.apache.geode.internal.admin.api.SystemMemberRegion;
+import org.apache.geode.internal.admin.remote.*;
+
+import java.io.File;
+import java.util.*;
+
+/**
+ * View of a region in a GemFire system member's cache.
+ *
+ * @since GemFire 3.5
+ */
+public class SystemMemberRegionImpl implements SystemMemberRegion {
+
+  private AdminRegion r;
+  private RegionAttributes ra;
+  private CacheStatistics rs;
+  private Set subregionNames;
+  private Set subregionFullPaths;
+  private int entryCount;
+  private int subregionCount;
+
+  /** The cache to which this region belongs */
+  private final SystemMemberCacheImpl cache;
+
+  // constructors
+  public SystemMemberRegionImpl(SystemMemberCacheImpl cache, Region r) {
+this.cache = cache;
+this.r = (AdminRegion) r;
+  }
+
+  private void refreshFields() {
+this.ra = this.r.getAttributes();
+if (getStatisticsEnabled() && !this.ra.getDataPolicy().withPartitioning()) 
{
+  this.rs = this.r.getStatistics();
+} else {
+  this.rs = null;
+}
+{ // set subregionNames
+  Set s = this.r.subregions(false);
+  Set names = new TreeSet();
+  Set paths = new TreeSet();
+  Iterator it = s.iterator();
+  while (it.hasNext()) {
+Region r = (Region) it.next();
+String name = r.getName();
+names.add(name);
+paths.add(this.getFullPath() + Region.SEPARATOR_CHAR + name);
+  }
+  this.subregionNames = names;
+  this.subregionFullPaths = paths;
+}
+try {
+  int[] sizes = this.r.sizes();
+  this.entryCount = sizes[0];
+  this.subregionCount = sizes[1];
+} catch (CacheException ignore) {
+  this.entryCount = 0;
+  this.subregionCount = 0;
+}
+  }
+
+  // attributes
+  public String getName() {
+return this.r.getName();
+  }
+
+  public String getFullPath() {
+return this.r.getFullPath();
+  }
+
+  public java.util.Set getSubregionNames() {
+return this.subregionNames;
+  }
+
+  public java.util.Set getSubregionFullPaths() {
+return this.subregionFullPaths;
+  }
+
+  public String getUserAttribute() {
+return (String) r.getUserAttribute();
+  }
+
+  public String getCacheLoader() {
+Object o = this.ra.getCacheLoader();
+if (o == null) {
+  return "";
+} else {
+  return o.toString();
+}
+  }
+
+  public String getCacheWriter() {
+Object o = this.ra.getCacheWriter();
+if (o == null) {
+  return "";
+} else {
+  return o.toString();
+}
+  }
+
+  public String getKeyConstraint() {
+Class constraint = this.ra.getKeyConstraint();
+if (constraint == null) {
+  return "";
+} else {
+  return constraint.getName();
+}
+  }
+
+  public String getValueConstraint() {
+Class constraint = this.ra.getValueConstraint();
+if (constraint == null) {
+  return "";
+} else {
+  return constraint.getName();
+}
+  }
+
+  public boolean getEarlyAck() {
+return this.ra.getEarlyAck();
+  }
+
+  public int getRegionTimeToLiveTimeLimit() {
+return this.ra.getRegionTimeToLive().getTimeout();
+  }
+
+  public ExpirationAction getRegionTimeToLiveAction() {
+return this.ra.getRegionTimeToLive().getAction();
+  }
+
+  public int getEntryTimeToLiveTimeLimit() {
+return this.ra.getEntryTimeToLive().getTimeout();
+  }
+

[49/93] [partial] incubator-geode git commit: Added Spotless plugin to enforce formatting standards. Added Google Java Style guide formatter templates, removed existing formatter templates.

2016-10-26 Thread klund
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/8bf39571/etc/intellij-java-google-style.xml
--
diff --git a/etc/intellij-java-google-style.xml 
b/etc/intellij-java-google-style.xml
new file mode 100644
index 000..22d9c23
--- /dev/null
+++ b/etc/intellij-java-google-style.xml
@@ -0,0 +1,365 @@
+
+  
+
+  
+  
+  
+  
+  
+  
+  
+  
+
+  
+  
+
+  
+  
+  
+  
+  
+  
+  
+  
+
+  
+  
+  
+  
+  
+
+  
+  
+
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+
+
+  
+  
+
+  
+  
+
+
+  
+  
+
+  
+  
+
+
+
+  
+  
+
+  
+  
+
+  
+  
+
+  
+  
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+  
+  
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+  
+  
+  
+
+  
+  
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+  
+  
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+  
+  
+  
+  
+  
+  
+  
+  
+
+  
+
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/8bf39571/etc/intellijIdeaCodeStyle.xml
--
diff --git a/etc/intellijIdeaCodeStyle.xml b/etc/intellijIdeaCodeStyle.xml
deleted file mode 100755
index 0b5c31b..000
--- a/etc/intellijIdeaCodeStyle.xml
+++ /dev/null
@@ -1,477 +0,0 @@
-
-  
-
-  
-  
-  
-  
-  
-  
-  
-  
-
-  
-  
-  
-  
-  
-  
-  
-  
-
-  
-  
-
-  
-  
-  
-  
-  
-  
-  
-  
-  
-  
-  
-
-  
-  
-  
-  
-  
-  
-  
-  
-  
-  
-  
-  
-  
-
-  
-  
-
-  
-  
-
-  
-  
-  
-
-  
-  
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-  
-  
-  
-
-
-  
-
-  
-
-  
-true
-  
-
-
-  
-true
-  
-
-
-  
-true
-  
-
-
-  
-true
-  
-
-  
-
-  
-  
-
-  
-
-  
-true
-true
-true
-true
-  
-
-  
-
-
-  
-
-  
-true
-true
-true
-true
-  
-
-  
-
-
-  
-
-  
-true
-true
-true
-true
-  
-
-  
-
-
-  
-
-  
-true
-true
-true
-true
-  
-
-  
-
-
-  
-
-  
-true
-true
-true
-true
-  
-
-  
-
-
-  
-
-  
-  

[62/93] incubator-geode git commit: GEODE-288: move admin package to internal

2016-10-26 Thread klund
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/895fd144/geode-core/src/main/java/org/apache/geode/internal/admin/api/jmx/impl/AgentImpl.java
--
diff --git 
a/geode-core/src/main/java/org/apache/geode/internal/admin/api/jmx/impl/AgentImpl.java
 
b/geode-core/src/main/java/org/apache/geode/internal/admin/api/jmx/impl/AgentImpl.java
new file mode 100644
index 000..760a5a8
--- /dev/null
+++ 
b/geode-core/src/main/java/org/apache/geode/internal/admin/api/jmx/impl/AgentImpl.java
@@ -0,0 +1,1624 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more 
contributor license
+ * agreements. See the NOTICE file distributed with this work for additional 
information regarding
+ * copyright ownership. The ASF licenses this file to You under the Apache 
License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance with the 
License. You may obtain a
+ * copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software 
distributed under the License
+ * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 
KIND, either express
+ * or implied. See the License for the specific language governing permissions 
and limitations under
+ * the License.
+ */
+package org.apache.geode.internal.admin.api.jmx.impl;
+
+import java.io.File;
+import java.io.IOException;
+import java.rmi.server.RMIClientSocketFactory;
+import java.rmi.server.RMIServerSocketFactory;
+import java.text.MessageFormat;
+import java.util.HashMap;
+import java.util.Map;
+import java.util.Properties;
+
+import javax.management.InstanceNotFoundException;
+import javax.management.MBeanException;
+import javax.management.MBeanRegistrationException;
+import javax.management.MBeanServer;
+import javax.management.MalformedObjectNameException;
+import javax.management.Notification;
+import javax.management.NotificationFilter;
+import javax.management.NotificationListener;
+import javax.management.ObjectName;
+import javax.management.OperationsException;
+import javax.management.ReflectionException;
+import javax.management.modelmbean.ModelMBean;
+import javax.management.remote.JMXConnectionNotification;
+import javax.management.remote.JMXConnectorServer;
+import javax.management.remote.JMXConnectorServerFactory;
+import javax.management.remote.JMXServiceURL;
+import javax.management.remote.rmi.RMIConnectorServer;
+import javax.rmi.ssl.SslRMIClientSocketFactory;
+
+import mx4j.tools.adaptor.http.HttpAdaptor;
+
+import org.apache.logging.log4j.Logger;
+
+import org.apache.geode.GemFireException;
+import org.apache.geode.GemFireIOException;
+import org.apache.geode.LogWriter;
+import org.apache.geode.SystemFailure;
+import org.apache.geode.internal.admin.api.AdminDistributedSystem;
+import org.apache.geode.internal.admin.api.AdminException;
+import org.apache.geode.internal.admin.api.DistributedSystemConfig;
+import org.apache.geode.internal.admin.api.jmx.Agent;
+import org.apache.geode.internal.admin.api.jmx.AgentConfig;
+import org.apache.geode.internal.admin.api.jmx.AgentFactory;
+import org.apache.geode.distributed.internal.DistributionManager;
+import org.apache.geode.i18n.StringId;
+import org.apache.geode.internal.Banner;
+import org.apache.geode.internal.GemFireVersion;
+import org.apache.geode.internal.admin.remote.TailLogResponse;
+import org.apache.geode.internal.i18n.LocalizedStrings;
+import org.apache.geode.internal.logging.InternalLogWriter;
+import org.apache.geode.internal.logging.LogConfig;
+import org.apache.geode.internal.logging.LogService;
+import org.apache.geode.internal.logging.LogWriterFactory;
+import org.apache.geode.internal.logging.LoggingThreadGroup;
+import org.apache.geode.internal.logging.log4j.AlertAppender;
+import org.apache.geode.internal.logging.log4j.LocalizedMessage;
+import org.apache.geode.internal.logging.log4j.LogMarker;
+import org.apache.geode.internal.logging.log4j.LogWriterAppender;
+import org.apache.geode.internal.logging.log4j.LogWriterAppenders;
+
+/**
+ * The GemFire JMX Agent provides the ability to administrate one GemFire 
distributed system via
+ * JMX.
+ *
+ * @since GemFire 3.5
+ */
+public class AgentImpl
+implements Agent, ManagedResource {
+
+  private static final Logger logger = LogService.getLogger();
+
+  /**
+   * MX4J HttpAdaptor only supports "basic" as an authentication method. 
Enabling HttpAdaptor
+   * authentication ({@link AgentConfig#HTTP_AUTHENTICATION_ENABLED_NAME}) 
causes the browser to
+   * require a login with username ({@link 
AgentConfig#HTTP_AUTHENTICATION_USER_NAME}) and password
+   * ({@link AgentConfig#HTTP_AUTHENTICATION_PASSWORD_NAME}).
+   */
+  private static final String MX4J_HTTPADAPTOR_BASIC_AUTHENTICATION = "basic";
+
+  /** JMX Service URL template for JMX/RMI Connector Server */
+  private static final String JMX_SERVICE_URL = 

[28/93] [partial] incubator-geode git commit: Added Spotless plugin to enforce formatting standards. Added Google Java Style guide formatter templates, removed existing formatter templates.

2016-10-26 Thread klund
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/8bf39571/geode-core/src/main/java/org/apache/geode/admin/CacheServerConfig.java
--
diff --git 
a/geode-core/src/main/java/org/apache/geode/admin/CacheServerConfig.java 
b/geode-core/src/main/java/org/apache/geode/admin/CacheServerConfig.java
index fc4ce0f..389d6bc 100644
--- a/geode-core/src/main/java/org/apache/geode/admin/CacheServerConfig.java
+++ b/geode-core/src/main/java/org/apache/geode/admin/CacheServerConfig.java
@@ -1,24 +1,22 @@
 /*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
+ * Licensed to the Apache Software Foundation (ASF) under one or more 
contributor license
+ * agreements. See the NOTICE file distributed with this work for additional 
information regarding
+ * copyright ownership. The ASF licenses this file to You under the Apache 
License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance with the 
License. You may obtain a
+ * copy of the License at
  *
- *  http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
  *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software 
distributed under the License
+ * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 
KIND, either express
+ * or implied. See the License for the specific language governing permissions 
and limitations under
+ * the License.
  */
 package org.apache.geode.admin;
 
 /**
- * Configuration for a GemFire cache server that is managed by the
- * administration API.  The cache server may or may not be running.
+ * Configuration for a GemFire cache server that is managed by the 
administration API. The cache
+ * server may or may not be running.
  *
  * @see AdminDistributedSystem#addCacheServer()
  *
@@ -28,27 +26,25 @@ package org.apache.geode.admin;
 @Deprecated
 public interface CacheServerConfig extends CacheVmConfig {
   /**
-   * Returns the cache.xml declarative caching
-   * initialization file used to configure this cache server VM.  By
-   * default, a cache server VM is started without an XML file.
+   * Returns the cache.xml declarative caching initialization 
file used to configure
+   * this cache server VM. By default, a cache server VM is started without an 
XML file.
*/
   public String getCacheXMLFile();
 
   /**
-   * Sets the cache.xml declarative caching
-   * initialization file used to configure this cache server VM.
+   * Sets the cache.xml declarative caching initialization file 
used to configure this
+   * cache server VM.
*/
   public void setCacheXMLFile(String cacheXml);
 
   /**
-   * Returns the location(s) of user classes (such as cache loaders)
-   * required by the cache server VM.
+   * Returns the location(s) of user classes (such as cache loaders) required 
by the cache server
+   * VM.
*/
   public String getClassPath();
 
   /**
-   * Sets the location(s) of user classes (such as cache loaders)
-   * required by the cache server VM.
+   * Sets the location(s) of user classes (such as cache loaders) required by 
the cache server VM.
*/
   public void setClassPath(String classpath);
 }

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/8bf39571/geode-core/src/main/java/org/apache/geode/admin/CacheVm.java
--
diff --git a/geode-core/src/main/java/org/apache/geode/admin/CacheVm.java 
b/geode-core/src/main/java/org/apache/geode/admin/CacheVm.java
index 5bfeddc..30d8701 100755
--- a/geode-core/src/main/java/org/apache/geode/admin/CacheVm.java
+++ b/geode-core/src/main/java/org/apache/geode/admin/CacheVm.java
@@ -1,33 +1,31 @@
 /*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
+ * Licensed to the Apache Software Foundation (ASF) under one or more 
contributor license
+ * agreements. See the NOTICE file 

[32/93] [partial] incubator-geode git commit: Added Spotless plugin to enforce formatting standards. Added Google Java Style guide formatter templates, removed existing formatter templates.

2016-10-26 Thread klund
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/8bf39571/geode-core/src/main/java/org/apache/geode/LogWriter.java
--
diff --git a/geode-core/src/main/java/org/apache/geode/LogWriter.java 
b/geode-core/src/main/java/org/apache/geode/LogWriter.java
index 17e23e0..242433f 100644
--- a/geode-core/src/main/java/org/apache/geode/LogWriter.java
+++ b/geode-core/src/main/java/org/apache/geode/LogWriter.java
@@ -1,18 +1,16 @@
 /*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
+ * Licensed to the Apache Software Foundation (ASF) under one or more 
contributor license
+ * agreements. See the NOTICE file distributed with this work for additional 
information regarding
+ * copyright ownership. The ASF licenses this file to You under the Apache 
License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance with the 
License. You may obtain a
+ * copy of the License at
  *
- *  http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
  *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software 
distributed under the License
+ * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 
KIND, either express
+ * or implied. See the License for the specific language governing permissions 
and limitations under
+ * the License.
  */
 
 package org.apache.geode;
@@ -23,278 +21,278 @@ import org.apache.geode.distributed.DistributedSystem;
 import org.apache.geode.i18n.LogWriterI18n;
 
 /**
-  * Defines methods available to clients that want to write a log message
-  * to their GemFire distributed system log file.
-  * 
-  * Instances of this interface can be obtained by calling
-  * {@link DistributedSystem#getLogWriter}.
-  * 
-  * For any logged message the log file will contain:
-  * 
-  *  The message's level.
-  *  The time the message was logged.
-  *  The id of the thread that logged the message.
-  *  The message itself which can be a string and/or an exception
-  *  including the exception's stack trace.
-  * 
-  * 
-  * A message always has a level.
-  * Logging levels are ordered. Enabling logging at a given level also
-  * enables logging at higher levels. The higher the level the more
-  * important and urgent the message.
-  * 
-  * The levels, in descending order, are:
-  * 
-  *  severe  (highest value) is a message level indicating a 
serious failure.
-  *   In general severe messages should describe events that
-  *   are of considerable importance and which will prevent normal program
-  *   execution. They should be reasonably intelligible to end users and
-  *   to information managers.
-  *  error  
-  *   In general error messages should describe events that
-  *   are of considerable importance but will not prevent normal program
-  *   execution. They should be reasonably intelligible to end users and
-  *   to information managers. They are weaker than severe and
-  *   stronger than warning.
-  *  warning is a message level indicating a potential 
problem.
-  *   In general warning messages should describe events that
-  *   will be of interest to end users or information managers, or which 
indicate
-  *   potential problems.
-  *  info is a message level for informational messages.
-  *   Typically info messages should be reasonably significant
-  *   and should make sense to end users and system administrators.
-  *  config is a message level for static configuration 
messages.
-  *   config messages are intended to provide a variety of static
-  *   configuration information, to assist in debugging problems that may be
-  *   associated with particular configurations.
-  *  fine is a message level providing tracing information.
-  *   In general the fine level should be used for information
-  *   that will be broadly interesting to developers. This level is for
-  *   the lowest volume, and most important, tracing messages.
-  *  finer indicates a fairly detailed tracing message.
-  *   Logging calls for entering, returning, or throwing an exception
-  *   are traced at the finer level.
-  *  finest (lowest value) indicates a highly detailed 
tracing message.
-  *   In general the finest level should be used for the most
-  *   

[68/93] incubator-geode git commit: GEODE-288: move admin package to internal

2016-10-26 Thread klund
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/895fd144/geode-core/src/main/java/org/apache/geode/internal/admin/api/impl/DistributedSystemHealthConfigImpl.java
--
diff --git 
a/geode-core/src/main/java/org/apache/geode/internal/admin/api/impl/DistributedSystemHealthConfigImpl.java
 
b/geode-core/src/main/java/org/apache/geode/internal/admin/api/impl/DistributedSystemHealthConfigImpl.java
new file mode 100644
index 000..d38d5cb
--- /dev/null
+++ 
b/geode-core/src/main/java/org/apache/geode/internal/admin/api/impl/DistributedSystemHealthConfigImpl.java
@@ -0,0 +1,53 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more 
contributor license
+ * agreements. See the NOTICE file distributed with this work for additional 
information regarding
+ * copyright ownership. The ASF licenses this file to You under the Apache 
License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance with the 
License. You may obtain a
+ * copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software 
distributed under the License
+ * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 
KIND, either express
+ * or implied. See the License for the specific language governing permissions 
and limitations under
+ * the License.
+ */
+package org.apache.geode.internal.admin.api.impl;
+
+import org.apache.geode.internal.admin.api.DistributedSystemHealthConfig;
+
+/**
+ * The implementation of DistributedSystemHealthConfig. Note that 
because it never
+ * leaves the management VM, it is not Serializable and is not 
part of the
+ * {@link GemFireHealthConfigImpl} class hierarchy.
+ *
+ *
+ * @since GemFire 3.5
+ */
+public class DistributedSystemHealthConfigImpl implements 
DistributedSystemHealthConfig {
+
+  /**
+   * The maximum number of application members that can unexceptedly leave a 
healthy the distributed
+   * system.
+   */
+  private long maxDepartedApplications = DEFAULT_MAX_DEPARTED_APPLICATIONS;
+
+  // Constructors //
+
+  /**
+   * Creates a new DistributedSystemHealthConfigImpl with the 
default configuration.
+   */
+  protected DistributedSystemHealthConfigImpl() {
+
+  }
+
+  / Instance Methods /
+
+  public long getMaxDepartedApplications() {
+return this.maxDepartedApplications;
+  }
+
+  public void setMaxDepartedApplications(long maxDepartedApplications) {
+this.maxDepartedApplications = maxDepartedApplications;
+  }
+}

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/895fd144/geode-core/src/main/java/org/apache/geode/internal/admin/api/impl/DistributedSystemHealthEvaluator.java
--
diff --git 
a/geode-core/src/main/java/org/apache/geode/internal/admin/api/impl/DistributedSystemHealthEvaluator.java
 
b/geode-core/src/main/java/org/apache/geode/internal/admin/api/impl/DistributedSystemHealthEvaluator.java
new file mode 100644
index 000..5087933
--- /dev/null
+++ 
b/geode-core/src/main/java/org/apache/geode/internal/admin/api/impl/DistributedSystemHealthEvaluator.java
@@ -0,0 +1,167 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more 
contributor license
+ * agreements. See the NOTICE file distributed with this work for additional 
information regarding
+ * copyright ownership. The ASF licenses this file to You under the Apache 
License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance with the 
License. You may obtain a
+ * copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software 
distributed under the License
+ * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 
KIND, either express
+ * or implied. See the License for the specific language governing permissions 
and limitations under
+ * the License.
+ */
+package org.apache.geode.internal.admin.api.impl;
+
+import org.apache.geode.internal.admin.api.DistributedSystemHealthConfig;
+import org.apache.geode.distributed.internal.DM;
+import org.apache.geode.distributed.internal.DistributionConfig;
+import org.apache.geode.distributed.internal.DistributionManager;
+import org.apache.geode.distributed.internal.MembershipListener;
+import 
org.apache.geode.distributed.internal.membership.InternalDistributedMember;
+import org.apache.geode.internal.i18n.LocalizedStrings;
+
+import java.util.List;
+import java.util.Set;
+
+/**
+ * Contains the logic for evaluating the health of an entire GemFire 
distributed system according to
+ * the thresholds provided in a {@link DistributedSystemHealthConfig}.
+ *
+ * 
+ *
+ * Note that unlike other evaluators, the 
DistributedSystemHealthEvaluator 

[63/93] incubator-geode git commit: GEODE-288: move admin package to internal

2016-10-26 Thread klund
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/895fd144/geode-core/src/main/java/org/apache/geode/internal/admin/api/jmx/impl/AgentConfigImpl.java
--
diff --git 
a/geode-core/src/main/java/org/apache/geode/internal/admin/api/jmx/impl/AgentConfigImpl.java
 
b/geode-core/src/main/java/org/apache/geode/internal/admin/api/jmx/impl/AgentConfigImpl.java
new file mode 100644
index 000..1ed77f3
--- /dev/null
+++ 
b/geode-core/src/main/java/org/apache/geode/internal/admin/api/jmx/impl/AgentConfigImpl.java
@@ -0,0 +1,1926 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more 
contributor license
+ * agreements. See the NOTICE file distributed with this work for additional 
information regarding
+ * copyright ownership. The ASF licenses this file to You under the Apache 
License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance with the 
License. You may obtain a
+ * copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software 
distributed under the License
+ * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 
KIND, either express
+ * or implied. See the License for the specific language governing permissions 
and limitations under
+ * the License.
+ */
+package org.apache.geode.internal.admin.api.jmx.impl;
+
+import static org.apache.geode.distributed.ConfigurationProperties.*;
+import static org.apache.geode.distributed.internal.DistributionConfig.*;
+
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.PrintWriter;
+import java.io.StringWriter;
+import java.net.InetAddress;
+import java.net.URL;
+import java.util.Enumeration;
+import java.util.Iterator;
+import java.util.Properties;
+import java.util.StringTokenizer;
+
+import org.apache.geode.GemFireIOException;
+import org.apache.geode.internal.admin.api.DistributedSystemConfig;
+import org.apache.geode.internal.admin.api.DistributionLocatorConfig;
+import org.apache.geode.internal.admin.api.impl.DistributedSystemConfigImpl;
+import org.apache.geode.internal.admin.api.impl.InetAddressUtil;
+import org.apache.geode.internal.admin.api.jmx.Agent;
+import org.apache.geode.internal.admin.api.jmx.AgentConfig;
+import org.apache.geode.internal.ClassPathLoader;
+import org.apache.geode.internal.i18n.LocalizedStrings;
+import org.apache.geode.internal.util.IOUtils;
+
+/**
+ * Provides the JMX Agent configuration properties.
+ * 
+ * Supports importing of persisted properties from an external configuration 
file.
+ * 
+ * Select values can also be overridden with command line arguments. See 
remarks on individual
+ * properties for further information.
+ * 
+ * Extends and implements DistributedSystemConfig.
+ * 
+ * @since GemFire 3.5 (in which it was named AgentConfig)
+ */
+public class AgentConfigImpl extends DistributedSystemConfigImpl implements 
AgentConfig {
+
+  // -
+  // Static class variable(s)
+  // -
+
+  /**
+   * Command-line arg to enable agent debugging
+   */
+  public static final String AGENT_DEBUG = "agent-debug";
+
+  /**
+   * The name of the "propertyFile" property. May specify as cmd-line arg
+   */
+  public static final String PROPERTY_FILE_NAME = "property-file";
+
+  /**
+   * The name of the "gfAgentPropertyFile" property, can be specified as 
System Property
+   */
+  public static final String AGENT_PROPSFILE_PROPERTY_NAME = 
"gfAgentPropertyFile";
+
+  // -
+  // DistributionLocator properties...
+  // -
+
+  /**
+   * The name of the "locator.host-" property
+   */
+  public static final String LOCATOR_HOST_NAME = "locator.host-";
+  /**
+   * The name of the "locator.port-" property
+   */
+  public static final String LOCATOR_PORT_NAME = "locator.port-";
+  /**
+   * The name of the "locator.product-directory-" property
+   */
+  public static final String LOCATOR_PRODUCT_DIRECTORY_NAME = 
"locator.product-directory-";
+  /**
+   * The name of the "locator.working-directory-" property
+   */
+  public static final String LOCATOR_WORKING_DIRECTORY_NAME = 
"locator.working-directory-";
+  /**
+   * The name of the "locator.remote-command-" property
+   */
+  public static final String LOCATOR_REMOTE_COMMAND = 
"locator.remote-command-";
+  /**
+   * The name of the "locator.bind-address-" property
+   */
+  public static final String LOCATOR_BIND_ADDRESS = "locator.bind-address-";
+  /**
+   * the properties used in configuring a locator's distributed system
+   */
+  public static final String LOCATOR_DS_PROPERTIES = 

[07/93] [partial] incubator-geode git commit: Added Spotless plugin to enforce formatting standards. Added Google Java Style guide formatter templates, removed existing formatter templates.

2016-10-26 Thread klund
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/8bf39571/geode-core/src/main/java/org/apache/geode/cache/AttributesFactory.java
--
diff --git 
a/geode-core/src/main/java/org/apache/geode/cache/AttributesFactory.java 
b/geode-core/src/main/java/org/apache/geode/cache/AttributesFactory.java
index 3418c21..1a46f24 100644
--- a/geode-core/src/main/java/org/apache/geode/cache/AttributesFactory.java
+++ b/geode-core/src/main/java/org/apache/geode/cache/AttributesFactory.java
@@ -1,18 +1,16 @@
 /*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
+ * Licensed to the Apache Software Foundation (ASF) under one or more 
contributor license
+ * agreements. See the NOTICE file distributed with this work for additional 
information regarding
+ * copyright ownership. The ASF licenses this file to You under the Apache 
License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance with the 
License. You may obtain a
+ * copy of the License at
  *
- *  http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
  *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software 
distributed under the License
+ * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 
KIND, either express
+ * or implied. See the License for the specific language governing permissions 
and limitations under
+ * the License.
  */
 
 package org.apache.geode.cache;
@@ -41,42 +39,39 @@ import 
org.apache.geode.internal.cache.UserSpecifiedRegionAttributes;
 import org.apache.geode.internal.cache.xmlcache.RegionAttributesCreation;
 import org.apache.geode.internal.i18n.LocalizedStrings;
 
-/** Creates instances of {@link RegionAttributes}. An 
AttributesFactory
- * instance maintains state for creating RegionAttributes 
instances.
- * The setter methods are used to change the settings that will be used for
- * creating the next attributes instance with the {@link #create}
- * method. If you create a factory with the default constructor, then the
- * factory is set up to create attributes with all default settings. You can
- * also create a factory by providing a RegionAttributes, which
- * will set up the new factory with the settings provided in that attributes
- * instance.
+/**
+ * Creates instances of {@link RegionAttributes}. An 
AttributesFactory instance
+ * maintains state for creating RegionAttributes instances. The 
setter methods are used
+ * to change the settings that will be used for creating the next attributes 
instance with the
+ * {@link #create} method. If you create a factory with the default 
constructor, then the factory is
+ * set up to create attributes with all default settings. You can also create 
a factory by providing
+ * a RegionAttributes, which will set up the new factory with the 
settings provided in
+ * that attributes instance.
  *
- * Once a RegionAttributes is created, it can only be modified
- * after it has been used to create a Region, and then only by
- * using an {@link AttributesMutator} obtained from the region.
+ * 
+ * Once a RegionAttributes is created, it can only be modified 
after it has been used
+ * to create a Region, and then only by using an {@link 
AttributesMutator} obtained
+ * from the region.
  *
  * Attributes
  * Callbacks
  * 
  * {@link CacheLoader} [default: null, meaning no 
loader]
- * User-implemented plug-in for loading data on cache misses.
- *{@link #setCacheLoader} {@link RegionAttributes#getCacheLoader}
- *{@link AttributesMutator#setCacheLoader}
+ * User-implemented plug-in for loading data on cache misses.
+ * {@link #setCacheLoader} {@link RegionAttributes#getCacheLoader}
+ * {@link AttributesMutator#setCacheLoader}
  *
  * {@link CacheWriter} [default: null, meaning no 
writer]
- * User-implemented plug-in for intercepting cache modifications, e.g.
- * for writing to an external data source.
- * {@link #setCacheWriter} {@link RegionAttributes#getCacheWriter}
- * {@link AttributesMutator#setCacheWriter}
+ * User-implemented plug-in for intercepting cache modifications, e.g. for 
writing to an
+ * external data source.
+ * {@link #setCacheWriter} {@link 

[22/93] [partial] incubator-geode git commit: Added Spotless plugin to enforce formatting standards. Added Google Java Style guide formatter templates, removed existing formatter templates.

2016-10-26 Thread klund
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/8bf39571/geode-core/src/main/java/org/apache/geode/admin/internal/DistributedSystemConfigImpl.java
--
diff --git 
a/geode-core/src/main/java/org/apache/geode/admin/internal/DistributedSystemConfigImpl.java
 
b/geode-core/src/main/java/org/apache/geode/admin/internal/DistributedSystemConfigImpl.java
index 6b313e2..a89d390 100755
--- 
a/geode-core/src/main/java/org/apache/geode/admin/internal/DistributedSystemConfigImpl.java
+++ 
b/geode-core/src/main/java/org/apache/geode/admin/internal/DistributedSystemConfigImpl.java
@@ -1,18 +1,16 @@
 /*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
+ * Licensed to the Apache Software Foundation (ASF) under one or more 
contributor license
+ * agreements. See the NOTICE file distributed with this work for additional 
information regarding
+ * copyright ownership. The ASF licenses this file to You under the Apache 
License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance with the 
License. You may obtain a
+ * copy of the License at
  *
- *  http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
  *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software 
distributed under the License
+ * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 
KIND, either express
+ * or implied. See the License for the specific language governing permissions 
and limitations under
+ * the License.
  */
 package org.apache.geode.admin.internal;
 
@@ -35,19 +33,15 @@ import java.util.*;
 import static org.apache.geode.distributed.ConfigurationProperties.*;
 
 /**
- * An implementation of the configuration object for an
- * AdminDistributedSystem.  After a config has been used
- * to create an AdminDistributedSystem most of the
- * configuration attributes cannot be changed.  However, some
- * operations (such as getting information about GemFire managers and
- * distribution locators) are "passed through" to the
- * AdminDistributedSystem associated with this
- * configuration object.
+ * An implementation of the configuration object for an 
AdminDistributedSystem. After a
+ * config has been used to create an AdminDistributedSystem most 
of the configuration
+ * attributes cannot be changed. However, some operations (such as getting 
information about GemFire
+ * managers and distribution locators) are "passed through" to the
+ * AdminDistributedSystem associated with this configuration 
object.
  *
  * @since GemFire 3.5
  */
-public class DistributedSystemConfigImpl
-implements DistributedSystemConfig {
+public class DistributedSystemConfigImpl implements DistributedSystemConfig {
 
   private static final Logger logger = LogService.getLogger();
 
@@ -86,8 +80,7 @@ public class DistributedSystemConfigImpl
   private Set cacheServerConfigs = new HashSet();
 
   /**
-   * Configs for the managed distribution locators in the distributed
-   * system
+   * Configs for the managed distribution locators in the distributed system
*/
   private Set locatorConfigs = new HashSet();
 
@@ -97,10 +90,10 @@ public class DistributedSystemConfigImpl
   private String systemName = DEFAULT_NAME;
 
   /**
-   * The admin distributed system object that is configured by this
-   * config object.
+   * The admin distributed system object that is configured by this config 
object.
*
-   * @since GemFire 4.0 */
+   * @since GemFire 4.0
+   */
   private AdminDistributedSystemImpl system;
 
   /**
@@ -108,27 +101,21 @@ public class DistributedSystemConfigImpl
*/
   private InternalLogWriter logWriter;
 
-  ///  Static Methods  ///
+  /// Static Methods ///
 
   /**
-   * Filters out all properties that are unique to the admin
-   * DistributedSystemConfig that are not present in the
-   * internal DistributionConfig.
+   * Filters out all properties that are unique to the admin 
DistributedSystemConfig
+   * that are not present in the internal DistributionConfig.
*
* @since GemFire 4.0
*/
-  private static Properties
-  filterOutAdminProperties(Properties props) {
+  private static 

[55/93] incubator-geode git commit: GEODE-288: move admin package to internal

2016-10-26 Thread klund
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/895fd144/geode-core/src/main/resources/org/apache/geode/admin/api/jmx/mbeans-descriptors.xml
--
diff --git 
a/geode-core/src/main/resources/org/apache/geode/admin/api/jmx/mbeans-descriptors.xml
 
b/geode-core/src/main/resources/org/apache/geode/admin/api/jmx/mbeans-descriptors.xml
new file mode 100755
index 000..1735f5f
--- /dev/null
+++ 
b/geode-core/src/main/resources/org/apache/geode/admin/api/jmx/mbeans-descriptors.xml
@@ -0,0 +1,1452 @@
+
+http://jakarta.apache.org/commons/dtds/mbeans-descriptors.dtd;>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+  
+  
+  
+  
+ 
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 
+
+
+
+
+
+
+
+  
+  
+
+
+  
+
+
+
+
+
+
+
+
+  
+
+  
+  
+  
+  
+  
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 
+
+
+
+
+
+
+
+
+
+
+
+  
+
+
+
+  
+  
gemfire.distributedsystem.member.joined
+
+
+
+  
+
+
+
+  
+  
gemfire.distributedsystem.member.left
+
+
+
+  
+
+
+
+  
+  
gemfire.distributedsystem.member.crashed
+
+
+
+  
+
+
+
+  
+  gemfire.distributedsystem.alert
+
+
+
+  
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+   
+
+  
+  
+  
+  
+
+
+
+  
+
+
+
+
+
+
+  
+
+
+
+  
+
+
+
+  
+
+
+  
+  
+
+
+
+
+   
+
+  
+
+  
+  
+  
+  
+
+
+
+
+
+
+
+
+
+
+ 
+
+
+
+
+
+  
+
+
+
+  
+  
gemfire.distributedsystem.cache.created
+
+
+
+  
+
+
+
+  
+  
gemfire.distributedsystem.cache.closed
+
+
+
+  
+
+
+
+  
+  
gemfire.distributedsystem.cache.region.created
+
+
+
+  
+
+
+
+  
+  
gemfire.distributedsystem.cache.region.lost
+
+
+
+  
+
+
+
+  
+  
gemfire.distributedsystem.cache.client.joined
+
+
+
+  
+
+
+
+  
+  
gemfire.distributedsystem.cache.client.left
+
+
+
+  
+
+
+
+  
+  
gemfire.distributedsystem.cache.client.crashed
+
+ 
+
+
+ 
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 
+
+
+
+
+
+
+
+  
+
+  
+  
+  
+  
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+  
+
+  
+  
+  
+  
+
+
+
+
+
+
+
+
+
+
+
+
+ 
+
+
+
+
+
+  
+
+
+
+  
+
+
+
+
+
+
+
+   
+  
+
+  
+  
+  
+  
+ 
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+  
+
+
+
+
+
+
+
+
+
+
+
+
+
+  
+
+  
+  
+  
+  
+ 
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+  
+
+  
+  
+  
+  
+ 
+
+
+
+
+
+
+
+
+
+
+
+   
+   
+ 
+
+
+
+
+
+
+
+
+
+  
+
+  
+  
+  
+  
+ 
+
+
+
+
+
+
+
+
+
+ 
+
+ 
+ 
+
+
+
+
+
+
+
+
+
+
+
+
+  
+
+
+
+  
+  
gemfire.distributedsystem.cache.created
+
+
+
+  
+
+
+
+  
+  
gemfire.distributedsystem.cache.closed
+
+
+
+  
+
+
+
+  
+  
gemfire.distributedsystem.cache.region.created
+
+
+
+  
+
+
+
+  
+  
gemfire.distributedsystem.cache.region.lost
+
+
+
+  
+
+
+
+  
+  
gemfire.distributedsystem.cache.client.joined
+
+
+
+  
+
+
+
+  
+  
gemfire.distributedsystem.cache.client.left
+
+
+
+  
+
+
+
+  
+  

[66/93] incubator-geode git commit: GEODE-288: move admin package to internal

2016-10-26 Thread klund
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/895fd144/geode-core/src/main/java/org/apache/geode/internal/admin/api/impl/ManagedSystemMemberImpl.java
--
diff --git 
a/geode-core/src/main/java/org/apache/geode/internal/admin/api/impl/ManagedSystemMemberImpl.java
 
b/geode-core/src/main/java/org/apache/geode/internal/admin/api/impl/ManagedSystemMemberImpl.java
new file mode 100644
index 000..abc6d01
--- /dev/null
+++ 
b/geode-core/src/main/java/org/apache/geode/internal/admin/api/impl/ManagedSystemMemberImpl.java
@@ -0,0 +1,258 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more 
contributor license
+ * agreements. See the NOTICE file distributed with this work for additional 
information regarding
+ * copyright ownership. The ASF licenses this file to You under the Apache 
License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance with the 
License. You may obtain a
+ * copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software 
distributed under the License
+ * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 
KIND, either express
+ * or implied. See the License for the specific language governing permissions 
and limitations under
+ * the License.
+ */
+package org.apache.geode.internal.admin.api.impl;
+
+import org.apache.geode.internal.admin.api.AdminException;
+import org.apache.geode.internal.admin.api.ConfigurationParameter;
+import org.apache.geode.internal.admin.api.ManagedEntityConfig;
+import org.apache.geode.internal.admin.GemFireVM;
+
+import static org.apache.geode.distributed.ConfigurationProperties.LOCATORS;
+
+/**
+ * A SystemMember that is also managed (or manageable) by the 
admin API.
+ *
+ * This class must be public so that its methods can be invoked reflectively 
(for MBean operations)
+ * on instances of its subclasses.
+ *
+ * @since GemFire 4.0
+ */
+public abstract class ManagedSystemMemberImpl extends SystemMemberImpl
+implements InternalManagedEntity {
+
+  /** Controller for starting and stopping local or remote managers */
+  protected ManagedEntityController controller;
+
+  /** The state of this managed entity (see bug 32455) */
+  private int state = UNKNOWN;
+
+  /** A lock that is obtained while this entity's state changes */
+  private final Object stateChange = new Object();
+
+  // Constructors //
+
+  /**
+   * Creates a new ManagedSystemMemberImpl that represents an 
existing member of an
+   * AdminDistributedSystem.
+   */
+  protected ManagedSystemMemberImpl(AdminDistributedSystemImpl system, 
GemFireVM vm)
+  throws AdminException {
+
+super(system, vm);
+this.controller = system.getEntityController();
+  }
+
+  /**
+   * Creates a new ManagedSystemMemberImpl that represents a 
non-existing member with
+   * the given ManagedEntityConfig that has not yet been started.
+   */
+  protected ManagedSystemMemberImpl(AdminDistributedSystemImpl system, 
ManagedEntityConfig config)
+  throws AdminException {
+
+super(system);
+this.internalId = null;
+this.id = getNewId();
+this.host = config.getHost();
+this.name = this.id;
+this.controller = system.getEntityController();
+  }
+
+  // Instance Methods //
+
+  public String getWorkingDirectory() {
+return this.getEntityConfig().getWorkingDirectory();
+  }
+
+  public void setWorkingDirectory(String workingDirectory) {
+this.getEntityConfig().setWorkingDirectory(workingDirectory);
+  }
+
+  public String getProductDirectory() {
+return this.getEntityConfig().getProductDirectory();
+  }
+
+  public void setProductDirectory(String productDirectory) {
+this.getEntityConfig().setProductDirectory(productDirectory);
+  }
+
+  @Override
+  public String getHost() {
+return this.getEntityConfig().getHost();
+  }
+
+  public int setState(int state) {
+if (this.stateChange == null) {
+  // The initial state is set in the constructor before
+  // stateChange is initialized.
+  int oldState = this.state;
+  this.state = state;
+  return oldState;
+
+} else {
+  synchronized (this.stateChange) {
+int oldState = this.state;
+this.state = state;
+
+this.stateChange.notifyAll();
+
+return oldState;
+  }
+}
+  }
+
+  /**
+   * Returns whether or not this managed system member needs to be stopped. If 
this member is
+   * stopped or is stopping, then it does not need to be stopped. Otherwise, 
it will atomically
+   * place this member in the {@link #STOPPING} state. See bug 32455.
+   */
+  protected boolean needToStop() {
+synchronized (this.stateChange) {
+  if (this.state == STOPPED || this.state == STOPPING) {
+return false;
+
+  } else {
+

[75/93] incubator-geode git commit: GEODE-288: move admin package to internal

2016-10-26 Thread klund
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/895fd144/geode-core/src/main/java/org/apache/geode/admin/jmx/internal/StatisticAttributeInfo.java
--
diff --git 
a/geode-core/src/main/java/org/apache/geode/admin/jmx/internal/StatisticAttributeInfo.java
 
b/geode-core/src/main/java/org/apache/geode/admin/jmx/internal/StatisticAttributeInfo.java
deleted file mode 100755
index c257ad5..000
--- 
a/geode-core/src/main/java/org/apache/geode/admin/jmx/internal/StatisticAttributeInfo.java
+++ /dev/null
@@ -1,71 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more 
contributor license
- * agreements. See the NOTICE file distributed with this work for additional 
information regarding
- * copyright ownership. The ASF licenses this file to You under the Apache 
License, Version 2.0 (the
- * "License"); you may not use this file except in compliance with the 
License. You may obtain a
- * copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software 
distributed under the License
- * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 
KIND, either express
- * or implied. See the License for the specific language governing permissions 
and limitations under
- * the License.
- */
-package org.apache.geode.admin.jmx.internal;
-
-import org.apache.geode.admin.Statistic;
-import org.apache.geode.internal.Assert;
-
-import javax.management.Descriptor;
-import javax.management.modelmbean.DescriptorSupport;
-import javax.management.modelmbean.ModelMBeanAttributeInfo;
-
-/**
- * Subclass of AttributeInfo with {@link org.apache.geode.admin.Statistic} 
added for use as the
- * {@link javax.management.modelmbean.ModelMBeanAttributeInfo} descriptor's 
targetObject
- * value.
- *
- * @since GemFire 3.5
- *
- */
-class StatisticAttributeInfo extends org.apache.commons.modeler.AttributeInfo {
-  private static final long serialVersionUID = 28022387514935560L;
-
-  private Statistic stat;
-
-  public StatisticAttributeInfo() {
-super();
-  }
-
-  public Statistic getStat() {
-return this.stat;
-  }
-
-  public void setStat(Statistic stat) {
-// System.out.println(">> stat = " + stat);
-Assert.assertTrue(stat != null, "Attempting to set stat to null");
-this.stat = stat;
-  }
-
-  @Override
-  public ModelMBeanAttributeInfo createAttributeInfo() {
-Descriptor desc = new DescriptorSupport(new String[] {"name=" + 
this.displayName,
-"descriptorType=attribute", "currencyTimeLimit=-1", // always stale
-"displayName=" + this.displayName, "getMethod=getValue"});
-
-Assert.assertTrue(this.stat != null, "Stat target object is null!");
-desc.setField("targetObject", this.stat);
-
-ModelMBeanAttributeInfo info = new 
ModelMBeanAttributeInfo(this.displayName, // name
-this.type, // type
-this.description, // description
-this.readable, // isReadable
-this.writeable, // isWritable
-this.is, // isIs
-desc);
-
-return info;
-  }
-}
-

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/895fd144/geode-core/src/main/java/org/apache/geode/admin/jmx/internal/StatisticResourceJmxImpl.java
--
diff --git 
a/geode-core/src/main/java/org/apache/geode/admin/jmx/internal/StatisticResourceJmxImpl.java
 
b/geode-core/src/main/java/org/apache/geode/admin/jmx/internal/StatisticResourceJmxImpl.java
deleted file mode 100755
index 4f46d5a..000
--- 
a/geode-core/src/main/java/org/apache/geode/admin/jmx/internal/StatisticResourceJmxImpl.java
+++ /dev/null
@@ -1,344 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more 
contributor license
- * agreements. See the NOTICE file distributed with this work for additional 
information regarding
- * copyright ownership. The ASF licenses this file to You under the Apache 
License, Version 2.0 (the
- * "License"); you may not use this file except in compliance with the 
License. You may obtain a
- * copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software 
distributed under the License
- * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 
KIND, either express
- * or implied. See the License for the specific language governing permissions 
and limitations under
- * the License.
- */
-package org.apache.geode.admin.jmx.internal;
-
-import javax.management.Notification;
-import javax.management.ObjectName;
-import javax.management.modelmbean.ModelMBean;
-import javax.naming.OperationNotSupportedException;
-
-import org.apache.commons.modeler.ManagedBean;
-import org.apache.logging.log4j.Logger;
-
-import org.apache.geode.CancelException;
-import org.apache.geode.LogWriter;
-import 

[34/93] [partial] incubator-geode git commit: Added Spotless plugin to enforce formatting standards. Added Google Java Style guide formatter templates, removed existing formatter templates.

2016-10-26 Thread klund
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/8bf39571/geode-core/src/main/java/org/apache/geode/DataSerializer.java
--
diff --git a/geode-core/src/main/java/org/apache/geode/DataSerializer.java 
b/geode-core/src/main/java/org/apache/geode/DataSerializer.java
index 09b6ced..29b20a2 100644
--- a/geode-core/src/main/java/org/apache/geode/DataSerializer.java
+++ b/geode-core/src/main/java/org/apache/geode/DataSerializer.java
@@ -1,18 +1,16 @@
 /*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
+ * Licensed to the Apache Software Foundation (ASF) under one or more 
contributor license
+ * agreements. See the NOTICE file distributed with this work for additional 
information regarding
+ * copyright ownership. The ASF licenses this file to You under the Apache 
License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance with the 
License. You may obtain a
+ * copy of the License at
  *
- *  http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
  *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software 
distributed under the License
+ * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 
KIND, either express
+ * or implied. See the License for the specific language governing permissions 
and limitations under
+ * the License.
  */
 package org.apache.geode;
 
@@ -69,63 +67,54 @@ import org.apache.geode.internal.offheap.StoredObject;
 import org.apache.geode.pdx.PdxInstance;
 
 /**
- * Provides static helper methods for reading and writing
- * non-primitive data when working with a {@link DataSerializable}.
- * For instance, classes that implement DataSerializable
- * can use the DataSerializer in their
- * toData and fromData methods:
+ * Provides static helper methods for reading and writing non-primitive data 
when working with a
+ * {@link DataSerializable}. For instance, classes that implement 
DataSerializable can
+ * use the DataSerializer in their toData and 
fromData
+ * methods:
  *
- * 
+ * 
  *
  * 
-public class Employee implements DataSerializable {
-  private int id;
-  private String name;
-  private Date birthday;
-  private Company employer;
-
-  public void toData(DataOutput out) throws IOException {
-out.writeInt(this.id);
-out.writeUTF(this.name);
-DataSerializer.writeDate(this.birthday, out);
-DataSerializer.writeObject(this.employer, out);
-  }
-
-  public void fromData(DataInput in)
-throws IOException, ClassNotFoundException {
-
-this.id = in.readInt();
-this.name = in.readUTF();
-this.birthday = DataSerializer.readDate(in);
-this.employer = (Company) DataSerializer.readObject(in);
-  }
-}
-
+ * public class Employee implements DataSerializable {
+ *   private int id;
+ *   private String name;
+ *   private Date birthday;
+ *   private Company employer;
+ * 
+ *   public void toData(DataOutput out) throws IOException {
+ * out.writeInt(this.id);
+ * out.writeUTF(this.name);
+ * DataSerializer.writeDate(this.birthday, out);
+ * DataSerializer.writeObject(this.employer, out);
+ *   }
+ * 
+ *   public void fromData(DataInput in) throws IOException, 
ClassNotFoundException {
+ * 
+ * this.id = in.readInt();
+ * this.name = in.readUTF();
+ * this.birthday = DataSerializer.readDate(in);
+ * this.employer = (Company) DataSerializer.readObject(in);
+ *   }
+ * }
+ * 
  * 
  *
  * 
  *
- * Instances of DataSerializer are used to data serialize
- * objects (such as instances of standard Java classes or third-party
- * classes for which the source code is not available) that do not
- * implement the DataSerializable interface.
+ * Instances of DataSerializer are used to data serialize objects 
(such as instances of
+ * standard Java classes or third-party classes for which the source code is 
not available) that do
+ * not implement the DataSerializable interface.
  *
  * 
  *
- * The following DataSerializer data serializes instances
- * of Company.  In order for the data serialization
- * framework to consult this custom serializer, it must be {@linkplain
- * #register(Class) registered} with the framework.
+ * The following DataSerializer data 

[91/93] incubator-geode git commit: GEODE-288: move admin package to internal

2016-10-26 Thread klund
GEODE-288: move admin package to internal


Project: http://git-wip-us.apache.org/repos/asf/incubator-geode/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-geode/commit/895fd144
Tree: http://git-wip-us.apache.org/repos/asf/incubator-geode/tree/895fd144
Diff: http://git-wip-us.apache.org/repos/asf/incubator-geode/diff/895fd144

Branch: refs/heads/feature/GEODE-288
Commit: 895fd144e6a322e09267c68d41116736345882aa
Parents: 8bf3957
Author: Kirk Lund 
Authored: Wed Oct 26 15:10:49 2016 -0700
Committer: Kirk Lund 
Committed: Wed Oct 26 15:16:54 2016 -0700

--
 geode-core/build.gradle |1 -
 .../java/org/apache/geode/DataSerializer.java   |2 +-
 .../org/apache/geode/admin/AdminConfig.java |  148 --
 .../geode/admin/AdminDistributedSystem.java |  434 
 .../admin/AdminDistributedSystemFactory.java|  148 --
 .../org/apache/geode/admin/AdminException.java  |   81 -
 .../apache/geode/admin/AdminXmlException.java   |   44 -
 .../main/java/org/apache/geode/admin/Alert.java |   53 -
 .../java/org/apache/geode/admin/AlertLevel.java |  168 --
 .../org/apache/geode/admin/AlertListener.java   |   30 -
 .../org/apache/geode/admin/BackupStatus.java|   46 -
 .../geode/admin/CacheDoesNotExistException.java |   80 -
 .../apache/geode/admin/CacheHealthConfig.java   |  151 --
 .../org/apache/geode/admin/CacheServer.java |   43 -
 .../apache/geode/admin/CacheServerConfig.java   |   50 -
 .../java/org/apache/geode/admin/CacheVm.java|   35 -
 .../org/apache/geode/admin/CacheVmConfig.java   |   51 -
 .../geode/admin/ConfigurationParameter.java |   72 -
 .../geode/admin/DistributedSystemConfig.java|  626 -
 .../admin/DistributedSystemHealthConfig.java|   74 -
 .../apache/geode/admin/DistributionLocator.java |   45 -
 .../geode/admin/DistributionLocatorConfig.java  |   81 -
 .../org/apache/geode/admin/GemFireHealth.java   |  209 --
 .../apache/geode/admin/GemFireHealthConfig.java |   54 -
 .../apache/geode/admin/GemFireMemberStatus.java |  670 -
 .../org/apache/geode/admin/ManagedEntity.java   |  100 -
 .../apache/geode/admin/ManagedEntityConfig.java |   88 -
 .../apache/geode/admin/MemberHealthConfig.java  |  142 -
 .../admin/OperationCancelledException.java  |   47 -
 .../geode/admin/RegionNotFoundException.java|   39 -
 .../geode/admin/RegionSubRegionSnapshot.java|  183 --
 .../geode/admin/RuntimeAdminException.java  |   48 -
 .../java/org/apache/geode/admin/Statistic.java  |   64 -
 .../apache/geode/admin/StatisticResource.java   |   82 -
 .../org/apache/geode/admin/SystemMember.java|  145 --
 .../geode/admin/SystemMemberBridgeServer.java   |  307 ---
 .../apache/geode/admin/SystemMemberCache.java   |  183 --
 .../geode/admin/SystemMemberCacheEvent.java |   33 -
 .../geode/admin/SystemMemberCacheListener.java  |   76 -
 .../geode/admin/SystemMemberCacheServer.java|  308 ---
 .../apache/geode/admin/SystemMemberRegion.java  |  314 ---
 .../geode/admin/SystemMemberRegionEvent.java|   31 -
 .../apache/geode/admin/SystemMemberType.java|  150 --
 .../geode/admin/SystemMembershipEvent.java  |   42 -
 .../geode/admin/SystemMembershipListener.java   |   59 -
 .../UnmodifiableConfigurationException.java |   81 -
 .../admin/internal/AbstractHealthEvaluator.java |  170 --
 .../internal/AdminDistributedSystemImpl.java| 2400 -
 .../admin/internal/BackupDataStoreHelper.java   |   74 -
 .../admin/internal/BackupDataStoreResult.java   |   48 -
 .../geode/admin/internal/BackupStatusImpl.java  |   59 -
 .../admin/internal/CacheHealthConfigImpl.java   |   91 -
 .../admin/internal/CacheHealthEvaluator.java|  306 ---
 .../admin/internal/CacheServerConfigImpl.java   |  133 -
 .../geode/admin/internal/CacheServerImpl.java   |  190 --
 .../internal/ConfigurationParameterImpl.java|  282 --
 .../ConfigurationParameterListener.java |   30 -
 .../DisabledManagedEntityController.java|   94 -
 .../internal/DistributedSystemConfigImpl.java   | 1109 
 .../DistributedSystemHealthConfigImpl.java  |   53 -
 .../DistributedSystemHealthEvaluator.java   |  167 --
 .../DistributedSystemHealthMonitor.java |  461 
 .../internal/DistributionLocatorConfigImpl.java |  187 --
 .../admin/internal/DistributionLocatorImpl.java |  329 ---
 .../EnabledManagedEntityController.java |  385 ---
 .../admin/internal/FinishBackupRequest.java |  173 --
 .../admin/internal/FinishBackupResponse.java|   76 -
 .../admin/internal/FlushToDiskRequest.java  |   94 -
 .../admin/internal/FlushToDiskResponse.java |   43 -
 .../admin/internal/GemFireHealthConfigImpl.java |   80 -
 .../admin/internal/GemFireHealthEvaluator.java  |  182 --
 .../geode/admin/internal/GemFireHealthImpl.java |  511 
 .../geode/admin/internal/InetAddressUtil.java   |  201 --
 

[58/93] incubator-geode git commit: GEODE-288: move admin package to internal

2016-10-26 Thread klund
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/895fd144/geode-core/src/main/java/org/apache/geode/internal/admin/api/jmx/impl/MemberInfoWithStatsMBean.java
--
diff --git 
a/geode-core/src/main/java/org/apache/geode/internal/admin/api/jmx/impl/MemberInfoWithStatsMBean.java
 
b/geode-core/src/main/java/org/apache/geode/internal/admin/api/jmx/impl/MemberInfoWithStatsMBean.java
new file mode 100644
index 000..44c9795
--- /dev/null
+++ 
b/geode-core/src/main/java/org/apache/geode/internal/admin/api/jmx/impl/MemberInfoWithStatsMBean.java
@@ -0,0 +1,1355 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more 
contributor license
+ * agreements. See the NOTICE file distributed with this work for additional 
information regarding
+ * copyright ownership. The ASF licenses this file to You under the Apache 
License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance with the 
License. You may obtain a
+ * copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software 
distributed under the License
+ * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 
KIND, either express
+ * or implied. See the License for the specific language governing permissions 
and limitations under
+ * the License.
+ */
+package org.apache.geode.internal.admin.api.jmx.impl;
+
+import static org.apache.geode.distributed.ConfigurationProperties.*;
+
+import org.apache.geode.internal.admin.api.AdminDistributedSystem;
+import org.apache.geode.internal.admin.api.AdminException;
+import org.apache.geode.internal.admin.api.CacheVm;
+import org.apache.geode.internal.admin.api.ConfigurationParameter;
+import org.apache.geode.internal.admin.api.GemFireMemberStatus;
+import org.apache.geode.internal.admin.api.RegionSubRegionSnapshot;
+import org.apache.geode.internal.admin.api.StatisticResource;
+import org.apache.geode.internal.admin.api.SystemMember;
+import org.apache.geode.internal.admin.api.SystemMemberCacheServer;
+import org.apache.geode.internal.admin.api.jmx.Agent;
+import org.apache.geode.cache.InterestPolicy;
+import org.apache.geode.cache.SubscriptionAttributes;
+import org.apache.geode.distributed.internal.DistributionConfig;
+import org.apache.geode.internal.GemFireVersion;
+import org.apache.geode.internal.admin.remote.ClientHealthStats;
+import org.apache.geode.internal.i18n.LocalizedStrings;
+import org.apache.geode.internal.logging.LogService;
+import org.apache.geode.internal.logging.log4j.LocalizedMessage;
+import mx4j.AbstractDynamicMBean;
+import org.apache.logging.log4j.Logger;
+
+import javax.management.*;
+import java.net.InetAddress;
+import java.text.MessageFormat;
+import java.util.*;
+import java.util.concurrent.atomic.AtomicLong;
+
+/**
+ * This class uses the JMX Attributes/Operations that use (return/throw) 
GemFire types. This is the
+ * single MBean accessible with ObjectName string {@link 
MemberInfoWithStatsMBean#MBEAN_NAME}}. This
+ * MBean can be used to retrieve the all member details as plain java types.
+ * 
+ * This MBean also acts as a Notification Hub for all the Notifications that 
are defined for Admin
+ * Distributed System.
+ * 
+ * 
+ * @since GemFire 6.5
+ */
+public class MemberInfoWithStatsMBean extends AbstractDynamicMBean implements 
NotificationEmitter {
+  private static final Logger logger = LogService.getLogger();
+
+  /* constants defining max no of attributes/operations/notifications */
+  private static final int MAX_ATTRIBUTES_COUNT = 3;
+  private static final int MAX_OPERATIONS_COUNT = 3;
+  private static final int MAX_NOTIFICATIONS_COUNT = 9;
+
+  private static final String NOT_AVAILABLE_STR = "N/A";
+  private static final String NOT_AVAILABLE = null;
+  private static final Number NOT_AVAILABLE_NUMBER = null;
+
+  /*
+   * String constant used for a region that is used on admin side just as a 
root for rootRegions
+   * defined on the member
+   */
+  private static final String PLACE_HOLDER_ROOT_REGION = "/Root/";
+
+  /* String that are used to form QueryExp/ObjectName for querying MBeanServer 
*/
+  private static final String REGION_QUERY_EXPRESSION = 
"*GemFire.Cache*:*,owner={0},type=Region";
+  private static final String STATS_QUERY_EXPRESSION = 
"*GemFire.Statistic*:*,source={0},name={1}";
+
+  /** mbean name string for this MBean */
+  /* default */static final String MBEAN_NAME = 
"GemFire:type=MemberInfoWithStatsMBean";
+
+  /** ObjectName handle for this MBean */
+  private ObjectName objectName;
+
+  /** version of the GemFire Enterprise system that is running */
+  private Stringversion;
+  private int   refreshInterval;
+  private Stringid;
+  
+  private Agent agent;
+  private AdminDistributedSystemJmxImpl adminDSJmx;
+
+  private 

[40/93] [partial] incubator-geode git commit: Added Spotless plugin to enforce formatting standards. Added Google Java Style guide formatter templates, removed existing formatter templates.

2016-10-26 Thread klund
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/8bf39571/geode-assembly/src/test/java/org/apache/geode/management/internal/cli/commands/LauncherLifecycleCommandsJUnitTest.java
--
diff --git 
a/geode-assembly/src/test/java/org/apache/geode/management/internal/cli/commands/LauncherLifecycleCommandsJUnitTest.java
 
b/geode-assembly/src/test/java/org/apache/geode/management/internal/cli/commands/LauncherLifecycleCommandsJUnitTest.java
index 7d280c9..8ac5dd5 100755
--- 
a/geode-assembly/src/test/java/org/apache/geode/management/internal/cli/commands/LauncherLifecycleCommandsJUnitTest.java
+++ 
b/geode-assembly/src/test/java/org/apache/geode/management/internal/cli/commands/LauncherLifecycleCommandsJUnitTest.java
@@ -1,18 +1,16 @@
 /*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
+ * Licensed to the Apache Software Foundation (ASF) under one or more 
contributor license
+ * agreements. See the NOTICE file distributed with this work for additional 
information regarding
+ * copyright ownership. The ASF licenses this file to You under the Apache 
License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance with the 
License. You may obtain a
+ * copy of the License at
  *
- *  http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
  *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software 
distributed under the License
+ * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 
KIND, either express
+ * or implied. See the License for the specific language governing permissions 
and limitations under
+ * the License.
  */
 package org.apache.geode.management.internal.cli.commands;
 
@@ -44,8 +42,8 @@ import 
org.apache.geode.management.internal.cli.i18n.CliStrings;
 import org.apache.geode.test.junit.categories.UnitTest;
 
 /**
- * The LauncherLifecycleCommandsJUnitTest class is a test suite of test cases 
testing the contract and functionality of
- * the lifecycle launcher GemFire shell (Gfsh) commands.
+ * The LauncherLifecycleCommandsJUnitTest class is a test suite of test cases 
testing the contract
+ * and functionality of the lifecycle launcher GemFire shell (Gfsh) commands.
  *
  * @see 
org.apache.geode.management.internal.cli.commands.LauncherLifecycleCommands
  * @see org.junit.Assert
@@ -86,7 +84,8 @@ public class LauncherLifecycleCommandsJUnitTest {
 
 assertTrue(commandLine.isEmpty());
 
-getLauncherLifecycleCommands().addGemFirePropertyFile(commandLine, 
"/path/to/gemfire.properties");
+getLauncherLifecycleCommands().addGemFirePropertyFile(commandLine,
+"/path/to/gemfire.properties");
 
 assertFalse(commandLine.isEmpty());
 
assertTrue(commandLine.contains("-DgemfirePropertyFile=/path/to/gemfire.properties"));
@@ -119,10 +118,12 @@ public class LauncherLifecycleCommandsJUnitTest {
   final String propertyValue = gemfireProperties.getProperty(propertyName);
   if (StringUtils.isBlank(propertyValue)) {
 for (final String systemProperty : commandLine) {
-  assertFalse(systemProperty.startsWith("-D" + 
DistributionConfig.GEMFIRE_PREFIX + "".concat(propertyName).concat("=")));
+  assertFalse(systemProperty.startsWith(
+  "-D" + DistributionConfig.GEMFIRE_PREFIX + 
"".concat(propertyName).concat("=")));
 }
   } else {
-assertTrue(commandLine.contains("-D" + 
DistributionConfig.GEMFIRE_PREFIX + 
"".concat(propertyName).concat("=").concat(propertyValue)));
+assertTrue(commandLine.contains("-D" + 
DistributionConfig.GEMFIRE_PREFIX
++ "".concat(propertyName).concat("=").concat(propertyValue)));
   }
 }
   }
@@ -147,7 +148,7 @@ public class LauncherLifecycleCommandsJUnitTest {
 gemfireProperties.setProperty(NAME, "machine");
 
 gemfireProperties.setProperty(START_DEV_REST_API, "true");
-gemfireProperties.setProperty(HTTP_SERVICE_PORT,  "8080");
+gemfireProperties.setProperty(HTTP_SERVICE_PORT, "8080");
 gemfireProperties.setProperty(HTTP_SERVICE_BIND_ADDRESS, "localhost");
 
 
@@ -160,10 +161,12 @@ public class LauncherLifecycleCommandsJUnitTest {
   final String propertyValue = 

[81/93] incubator-geode git commit: GEODE-288: move admin package to internal

2016-10-26 Thread klund
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/895fd144/geode-core/src/main/java/org/apache/geode/admin/jmx/internal/AgentConfigImpl.java
--
diff --git 
a/geode-core/src/main/java/org/apache/geode/admin/jmx/internal/AgentConfigImpl.java
 
b/geode-core/src/main/java/org/apache/geode/admin/jmx/internal/AgentConfigImpl.java
deleted file mode 100644
index 4e53b07..000
--- 
a/geode-core/src/main/java/org/apache/geode/admin/jmx/internal/AgentConfigImpl.java
+++ /dev/null
@@ -1,1915 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more 
contributor license
- * agreements. See the NOTICE file distributed with this work for additional 
information regarding
- * copyright ownership. The ASF licenses this file to You under the Apache 
License, Version 2.0 (the
- * "License"); you may not use this file except in compliance with the 
License. You may obtain a
- * copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software 
distributed under the License
- * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 
KIND, either express
- * or implied. See the License for the specific language governing permissions 
and limitations under
- * the License.
- */
-package org.apache.geode.admin.jmx.internal;
-
-import static org.apache.geode.distributed.ConfigurationProperties.*;
-import static org.apache.geode.distributed.internal.DistributionConfig.*;
-
-import java.io.File;
-import java.io.FileInputStream;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.PrintWriter;
-import java.io.StringWriter;
-import java.net.InetAddress;
-import java.net.URL;
-import java.util.Enumeration;
-import java.util.Iterator;
-import java.util.Properties;
-import java.util.StringTokenizer;
-
-import org.apache.geode.GemFireIOException;
-import org.apache.geode.admin.DistributedSystemConfig;
-import org.apache.geode.admin.DistributionLocatorConfig;
-import org.apache.geode.admin.internal.DistributedSystemConfigImpl;
-import org.apache.geode.admin.internal.InetAddressUtil;
-import org.apache.geode.admin.jmx.Agent;
-import org.apache.geode.admin.jmx.AgentConfig;
-import org.apache.geode.internal.ClassPathLoader;
-import org.apache.geode.internal.i18n.LocalizedStrings;
-import org.apache.geode.internal.util.IOUtils;
-
-/**
- * Provides the JMX Agent configuration properties.
- * 
- * Supports importing of persisted properties from an external configuration 
file.
- * 
- * Select values can also be overridden with command line arguments. See 
remarks on individual
- * properties for further information.
- * 
- * Extends and implements DistributedSystemConfig.
- * 
- * @since GemFire 3.5 (in which it was named AgentConfig)
- */
-public class AgentConfigImpl extends DistributedSystemConfigImpl implements 
AgentConfig {
-
-  // -
-  // Static class variable(s)
-  // -
-
-  /**
-   * Command-line arg to enable agent debugging
-   */
-  public static final String AGENT_DEBUG = "agent-debug";
-
-  /**
-   * The name of the "propertyFile" property. May specify as cmd-line arg
-   */
-  public static final String PROPERTY_FILE_NAME = "property-file";
-
-  /**
-   * The name of the "gfAgentPropertyFile" property, can be specified as 
System Property
-   */
-  public static final String AGENT_PROPSFILE_PROPERTY_NAME = 
"gfAgentPropertyFile";
-
-  // -
-  // DistributionLocator properties...
-  // -
-
-  /**
-   * The name of the "locator.host-" property
-   */
-  public static final String LOCATOR_HOST_NAME = "locator.host-";
-  /**
-   * The name of the "locator.port-" property
-   */
-  public static final String LOCATOR_PORT_NAME = "locator.port-";
-  /**
-   * The name of the "locator.product-directory-" property
-   */
-  public static final String LOCATOR_PRODUCT_DIRECTORY_NAME = 
"locator.product-directory-";
-  /**
-   * The name of the "locator.working-directory-" property
-   */
-  public static final String LOCATOR_WORKING_DIRECTORY_NAME = 
"locator.working-directory-";
-  /**
-   * The name of the "locator.remote-command-" property
-   */
-  public static final String LOCATOR_REMOTE_COMMAND = 
"locator.remote-command-";
-  /**
-   * The name of the "locator.bind-address-" property
-   */
-  public static final String LOCATOR_BIND_ADDRESS = "locator.bind-address-";
-  /**
-   * the properties used in configuring a locator's distributed system
-   */
-  public static final String LOCATOR_DS_PROPERTIES = "locator.ds-properties";
-
-  /**
-   * The default log file for stand-alone JMX agents
-   */
-  /* package scope */
-  

[42/93] [partial] incubator-geode git commit: Added Spotless plugin to enforce formatting standards. Added Google Java Style guide formatter templates, removed existing formatter templates.

2016-10-26 Thread klund
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/8bf39571/extensions/geode-modules/src/main/java/org/apache/geode/modules/util/CreateRegionFunction.java
--
diff --git 
a/extensions/geode-modules/src/main/java/org/apache/geode/modules/util/CreateRegionFunction.java
 
b/extensions/geode-modules/src/main/java/org/apache/geode/modules/util/CreateRegionFunction.java
index 21d11d9..4e9e9fd 100644
--- 
a/extensions/geode-modules/src/main/java/org/apache/geode/modules/util/CreateRegionFunction.java
+++ 
b/extensions/geode-modules/src/main/java/org/apache/geode/modules/util/CreateRegionFunction.java
@@ -1,19 +1,17 @@
 /*
-* Licensed to the Apache Software Foundation (ASF) under one or more
-* contributor license agreements.  See the NOTICE file distributed with
-* this work for additional information regarding copyright ownership.
-* The ASF licenses this file to You under the Apache License, Version 2.0
-* (the "License"); you may not use this file except in compliance with
-* the License.  You may obtain a copy of the License at
-*
-*  http://www.apache.org/licenses/LICENSE-2.0
-*
-* Unless required by applicable law or agreed to in writing, software
-* distributed under the License is distributed on an "AS IS" BASIS,
-* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-* See the License for the specific language governing permissions and
-* limitations under the License.
-*/
+ * Licensed to the Apache Software Foundation (ASF) under one or more 
contributor license
+ * agreements. See the NOTICE file distributed with this work for additional 
information regarding
+ * copyright ownership. The ASF licenses this file to You under the Apache 
License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance with the 
License. You may obtain a
+ * copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software 
distributed under the License
+ * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 
KIND, either express
+ * or implied. See the License for the specific language governing permissions 
and limitations under
+ * the License.
+ */
 package org.apache.geode.modules.util;
 
 import java.io.File;
@@ -54,9 +52,11 @@ public class CreateRegionFunction implements Function, 
Declarable {
 
   public static final String ID = "create-region-function";
 
-  private static final boolean DUMP_SESSION_CACHE_XML = 
Boolean.getBoolean("gemfiremodules.dumpSessionCacheXml");
+  private static final boolean DUMP_SESSION_CACHE_XML =
+  Boolean.getBoolean("gemfiremodules.dumpSessionCacheXml");
 
-  private static final String REGION_CONFIGURATION_METADATA_REGION = 
"__regionConfigurationMetadata";
+  private static final String REGION_CONFIGURATION_METADATA_REGION =
+  "__regionConfigurationMetadata";
 
   public CreateRegionFunction() {
 this(CacheFactory.getAnyInstance());
@@ -106,7 +106,8 @@ public class CreateRegionFunction implements Function, 
Declarable {
 RegionHelper.validateRegion(this.cache, configuration, region);
   } catch (Exception e) {
 if (!e.getMessage()
-
.equals(LocalizedStrings.RegionAttributesCreation_CACHELISTENERS_ARE_NOT_THE_SAME.toLocalizedString()))
 {
+
.equals(LocalizedStrings.RegionAttributesCreation_CACHELISTENERS_ARE_NOT_THE_SAME
+.toLocalizedString())) {
   this.cache.getLogger().warning(e);
 }
 status = RegionStatus.INVALID;
@@ -131,8 +132,7 @@ public class CreateRegionFunction implements Function, 
Declarable {
 return true;
   }
 
-  public void init(Properties properties) {
-  }
+  public void init(Properties properties) {}
 
   private RegionStatus createRegion(RegionConfiguration configuration) {
 // Get a distributed lock
@@ -150,7 +150,8 @@ public class CreateRegionFunction implements Function, 
Declarable {
   dml.lockInterruptibly();
   if (this.cache.getLogger().fineEnabled()) {
 end = System.currentTimeMillis();
-this.cache.getLogger().fine(this + ": Obtained lock on " + dml + " in 
" + (end - start) + " ms");
+this.cache.getLogger()
+.fine(this + ": Obtained lock on " + dml + " in " + (end - start) 
+ " ms");
   }
 
   // Attempt to get the region again after the lock has been obtained
@@ -183,7 +184,8 @@ public class CreateRegionFunction implements Function, 
Declarable {
   RegionHelper.validateRegion(this.cache, configuration, region);
 } catch (Exception e) {
   if (!e.getMessage()
-  
.equals(LocalizedStrings.RegionAttributesCreation_CACHELISTENERS_ARE_NOT_THE_SAME.toLocalizedString()))
 {
+  
.equals(LocalizedStrings.RegionAttributesCreation_CACHELISTENERS_ARE_NOT_THE_SAME
+  .toLocalizedString())) {
 

[70/93] incubator-geode git commit: GEODE-288: move admin package to internal

2016-10-26 Thread klund
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/895fd144/geode-core/src/main/java/org/apache/geode/internal/admin/api/impl/AdminDistributedSystemImpl.java
--
diff --git 
a/geode-core/src/main/java/org/apache/geode/internal/admin/api/impl/AdminDistributedSystemImpl.java
 
b/geode-core/src/main/java/org/apache/geode/internal/admin/api/impl/AdminDistributedSystemImpl.java
new file mode 100755
index 000..ae8dbb5
--- /dev/null
+++ 
b/geode-core/src/main/java/org/apache/geode/internal/admin/api/impl/AdminDistributedSystemImpl.java
@@ -0,0 +1,2423 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more 
contributor license
+ * agreements. See the NOTICE file distributed with this work for additional 
information regarding
+ * copyright ownership. The ASF licenses this file to You under the Apache 
License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance with the 
License. You may obtain a
+ * copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software 
distributed under the License
+ * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 
KIND, either express
+ * or implied. See the License for the specific language governing permissions 
and limitations under
+ * the License.
+ */
+package org.apache.geode.internal.admin.api.impl;
+
+import org.apache.geode.CancelException;
+import org.apache.geode.SystemFailure;
+import org.apache.geode.internal.admin.api.AdminException;
+import org.apache.geode.internal.admin.api.Alert;
+import org.apache.geode.internal.admin.api.AlertLevel;
+import org.apache.geode.internal.admin.api.AlertListener;
+import org.apache.geode.cache.persistence.PersistentID;
+import org.apache.geode.distributed.DistributedMember;
+import org.apache.geode.distributed.FutureCancelledException;
+import org.apache.geode.distributed.internal.*;
+import 
org.apache.geode.distributed.internal.membership.InternalDistributedMember;
+import org.apache.geode.internal.Assert;
+import org.apache.geode.internal.Banner;
+import org.apache.geode.internal.admin.*;
+import org.apache.geode.internal.admin.api.AdminDistributedSystem;
+import org.apache.geode.internal.admin.api.BackupStatus;
+import org.apache.geode.internal.admin.api.CacheServer;
+import org.apache.geode.internal.admin.api.CacheServerConfig;
+import org.apache.geode.internal.admin.api.CacheVm;
+import org.apache.geode.internal.admin.api.ConfigurationParameter;
+import org.apache.geode.internal.admin.api.DistributedSystemConfig;
+import org.apache.geode.internal.admin.api.DistributionLocator;
+import org.apache.geode.internal.admin.api.DistributionLocatorConfig;
+import org.apache.geode.internal.admin.api.GemFireHealth;
+import org.apache.geode.internal.admin.api.ManagedEntity;
+import org.apache.geode.internal.admin.api.ManagedEntityConfig;
+import org.apache.geode.internal.admin.api.OperationCancelledException;
+import org.apache.geode.internal.admin.api.RuntimeAdminException;
+import org.apache.geode.internal.admin.api.SystemMember;
+import org.apache.geode.internal.admin.api.SystemMemberCacheListener;
+import org.apache.geode.internal.admin.api.SystemMembershipEvent;
+import org.apache.geode.internal.admin.api.SystemMembershipListener;
+import org.apache.geode.internal.admin.remote.*;
+import org.apache.geode.internal.cache.persistence.PersistentMemberPattern;
+import org.apache.geode.internal.i18n.LocalizedStrings;
+import org.apache.geode.internal.logging.InternalLogWriter;
+import org.apache.geode.internal.logging.LogService;
+import org.apache.geode.internal.logging.LogWriterFactory;
+import org.apache.geode.internal.logging.log4j.LocalizedMessage;
+import org.apache.geode.internal.logging.log4j.LogMarker;
+import org.apache.geode.internal.logging.log4j.LogWriterAppender;
+import org.apache.geode.internal.logging.log4j.LogWriterAppenders;
+import org.apache.geode.internal.util.concurrent.FutureResult;
+import org.apache.logging.log4j.Logger;
+
+import java.io.File;
+import java.io.IOException;
+import java.net.InetAddress;
+import java.text.SimpleDateFormat;
+import java.util.*;
+import java.util.concurrent.*;
+
+import static org.apache.geode.distributed.ConfigurationProperties.*;
+
+/**
+ * Represents a GemFire distributed system for remote 
administration/management.
+ *
+ * @since GemFire 3.5
+ */
+public class AdminDistributedSystemImpl
+implements AdminDistributedSystem,
+   org.apache.geode.internal.admin.JoinLeaveListener,
+   org.apache.geode.internal.admin.AlertListener,
+   
org.apache.geode.distributed.internal.InternalDistributedSystem.DisconnectListener
 {
+
+  private static final Logger logger = LogService.getLogger();
+
+  /** String identity of this distributed system */
+  private String id;
+
+  /** Latest alert broadcast by any system members */
+  

[73/93] incubator-geode git commit: GEODE-288: move admin package to internal

2016-10-26 Thread klund
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/895fd144/geode-core/src/main/java/org/apache/geode/internal/admin/api/AlertLevel.java
--
diff --git 
a/geode-core/src/main/java/org/apache/geode/internal/admin/api/AlertLevel.java 
b/geode-core/src/main/java/org/apache/geode/internal/admin/api/AlertLevel.java
new file mode 100755
index 000..93c0bbd
--- /dev/null
+++ 
b/geode-core/src/main/java/org/apache/geode/internal/admin/api/AlertLevel.java
@@ -0,0 +1,169 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more 
contributor license
+ * agreements. See the NOTICE file distributed with this work for additional 
information regarding
+ * copyright ownership. The ASF licenses this file to You under the Apache 
License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance with the 
License. You may obtain a
+ * copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software 
distributed under the License
+ * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 
KIND, either express
+ * or implied. See the License for the specific language governing permissions 
and limitations under
+ * the License.
+ */
+package org.apache.geode.internal.admin.api;
+
+import org.apache.geode.internal.admin.Alert;
+import org.apache.geode.internal.i18n.LocalizedStrings;
+
+/**
+ * Type-safe enumeration for {@link org.apache.geode.internal.admin.api.Alert
+ * Alert} level.
+ *
+ * @since GemFire 3.5
+ * @deprecated as of 7.0 use the management
+ * package instead
+ */
+public class AlertLevel implements java.io.Serializable {
+  private static final long serialVersionUID = -4752438966587392126L;
+
+  public static final AlertLevel WARNING = new AlertLevel(Alert.WARNING, 
"WARNING");
+  public static final AlertLevel ERROR = new AlertLevel(Alert.ERROR, "ERROR");
+  public static final AlertLevel SEVERE = new AlertLevel(Alert.SEVERE, 
"SEVERE");
+
+  public static final AlertLevel OFF = new AlertLevel(Alert.OFF, "OFF");
+
+  /** The severity level of this AlertLevel. Greater is more severe. */
+  private final transient int severity;
+
+  /** The name of this AlertLevel. */
+  private final transient String name;
+
+  // The 4 declarations below are necessary for serialization
+  /** int used as ordinal to represent this AlertLevel */
+  public final int ordinal = nextOrdinal++;
+
+  private static int nextOrdinal = 0;
+
+  private static final AlertLevel[] VALUES = {WARNING, ERROR, SEVERE, OFF};
+
+  private Object readResolve() throws java.io.ObjectStreamException {
+return VALUES[ordinal]; // Canonicalize
+  }
+
+  /** Creates a new instance of AlertLevel. */
+  private AlertLevel(int severity, String name) {
+this.severity = severity;
+this.name = name;
+  }
+
+  /** Return the AlertLevel represented by specified ordinal */
+  public static AlertLevel fromOrdinal(int ordinal) {
+return VALUES[ordinal];
+  }
+
+  /**
+   * Returns the AlertLevel for the given severity
+   *
+   * @throws IllegalArgumentException If there is no alert level with the given
+   * severity
+   */
+  public static AlertLevel forSeverity(int severity) {
+switch (severity) {
+  case Alert.WARNING:
+return AlertLevel.WARNING;
+  case Alert.ERROR:
+return AlertLevel.ERROR;
+  case Alert.SEVERE:
+return AlertLevel.SEVERE;
+  case Alert.OFF:
+return AlertLevel.OFF;
+  default:
+throw new 
IllegalArgumentException(LocalizedStrings.AlertLevel_UNKNOWN_ALERT_SEVERITY_0
+.toLocalizedString(Integer.valueOf(severity)));
+}
+  }
+
+  /**
+   * Returns the AlertLevel with the given name
+   *
+   * @throws IllegalArgumentException If there is no alert level named 
name
+   */
+  public static AlertLevel forName(String name) {
+for (int i = 0; i < VALUES.length; i++) {
+  AlertLevel level = VALUES[i];
+  if (level.getName().equalsIgnoreCase(name)) {
+return level;
+  }
+}
+
+throw new IllegalArgumentException(
+
LocalizedStrings.AlertLevel_THERE_IS_NO_ALERT_LEVEL_0.toLocalizedString(name));
+  }
+
+  public int getSeverity() {
+return this.severity;
+  }
+
+  public String getName() {
+return this.name;
+  }
+
+  public static AlertLevel[] values() {
+return VALUES;
+  }
+
+  /**
+   * Returns a string representation for this alert level.
+   *
+   * @return the name of this alert level
+   */
+  @Override
+  public String toString() {
+return this.name /* + "=" + this.severity */;
+  }
+
+  /**
+   * Indicates whether some other object is "equal to" this one.
+   *
+   * @param other the reference object with which to compare.
+   * @return true if this object is the same as the obj argument; false 
otherwise.
+   */
+  @Override
+  public boolean 

[45/93] [partial] incubator-geode git commit: Added Spotless plugin to enforce formatting standards. Added Google Java Style guide formatter templates, removed existing formatter templates.

2016-10-26 Thread klund
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/8bf39571/extensions/geode-modules-session/src/test/java/org/apache/geode/modules/session/junit/PerTestClassLoaderRunner.java
--
diff --git 
a/extensions/geode-modules-session/src/test/java/org/apache/geode/modules/session/junit/PerTestClassLoaderRunner.java
 
b/extensions/geode-modules-session/src/test/java/org/apache/geode/modules/session/junit/PerTestClassLoaderRunner.java
index e2f7f51..cb0465d 100644
--- 
a/extensions/geode-modules-session/src/test/java/org/apache/geode/modules/session/junit/PerTestClassLoaderRunner.java
+++ 
b/extensions/geode-modules-session/src/test/java/org/apache/geode/modules/session/junit/PerTestClassLoaderRunner.java
@@ -1,37 +1,33 @@
 /*
-* Licensed to the Apache Software Foundation (ASF) under one or more
-* contributor license agreements.  See the NOTICE file distributed with
-* this work for additional information regarding copyright ownership.
-* The ASF licenses this file to You under the Apache License, Version 2.0
-* (the "License"); you may not use this file except in compliance with
-* the License.  You may obtain a copy of the License at
-*
-*  http://www.apache.org/licenses/LICENSE-2.0
-*
-* Unless required by applicable law or agreed to in writing, software
-* distributed under the License is distributed on an "AS IS" BASIS,
-* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-* See the License for the specific language governing permissions and
-* limitations under the License.
-*/
+ * Licensed to the Apache Software Foundation (ASF) under one or more 
contributor license
+ * agreements. See the NOTICE file distributed with this work for additional 
information regarding
+ * copyright ownership. The ASF licenses this file to You under the Apache 
License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance with the 
License. You may obtain a
+ * copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software 
distributed under the License
+ * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 
KIND, either express
+ * or implied. See the License for the specific language governing permissions 
and limitations under
+ * the License.
+ */
 
 package org.apache.geode.modules.session.junit;
 
 /**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to you under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
+ * Licensed to the Apache Software Foundation (ASF) under one or more 
contributor license
+ * agreements. See the NOTICE file distributed with this work for additional 
information regarding
+ * copyright ownership. The ASF licenses this file to you under the Apache 
License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance with the 
License. You may obtain a
+ * copy of the License at
  * 
  * http://www.apache.org/licenses/LICENSE-2.0
  * 
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software 
distributed under the License
+ * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 
KIND, either express
+ * or implied. See the License for the specific language governing permissions 
and limitations under
+ * the License.
  */
 
 import org.junit.After;
@@ -57,8 +53,7 @@ import java.util.StringTokenizer;
 import java.util.logging.Logger;
 
 public class PerTestClassLoaderRunner extends NamedRunner {
-  private static final Logger LOGGER = Logger
-  .getLogger(PerTestClassLoaderRunner.class.getName());
+  private static final Logger LOGGER = 
Logger.getLogger(PerTestClassLoaderRunner.class.getName());
 
   // The classpath is needed because the custom class loader looks there to 
find the classes.
   private static String classPath;
@@ -93,8 +88,7 @@ public class PerTestClassLoaderRunner extends NamedRunner {
*
* @throws ClassNotFoundException the class not found exception
*/
-  private void loadClassesWithCustomClassLoader()
-  throws ClassNotFoundException {
+  private void loadClassesWithCustomClassLoader() throws 
ClassNotFoundException {
 String classPath = System.getProperty("java.class.path");
 StringTokenizer st = new StringTokenizer(classPath, 

[44/93] [partial] incubator-geode git commit: Added Spotless plugin to enforce formatting standards. Added Google Java Style guide formatter templates, removed existing formatter templates.

2016-10-26 Thread klund
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/8bf39571/extensions/geode-modules/src/main/java/org/apache/geode/modules/gatewaydelta/GatewayDeltaForwarderCacheListener.java
--
diff --git 
a/extensions/geode-modules/src/main/java/org/apache/geode/modules/gatewaydelta/GatewayDeltaForwarderCacheListener.java
 
b/extensions/geode-modules/src/main/java/org/apache/geode/modules/gatewaydelta/GatewayDeltaForwarderCacheListener.java
index aa8ad99..a276728 100644
--- 
a/extensions/geode-modules/src/main/java/org/apache/geode/modules/gatewaydelta/GatewayDeltaForwarderCacheListener.java
+++ 
b/extensions/geode-modules/src/main/java/org/apache/geode/modules/gatewaydelta/GatewayDeltaForwarderCacheListener.java
@@ -1,19 +1,17 @@
 /*
-* Licensed to the Apache Software Foundation (ASF) under one or more
-* contributor license agreements.  See the NOTICE file distributed with
-* this work for additional information regarding copyright ownership.
-* The ASF licenses this file to You under the Apache License, Version 2.0
-* (the "License"); you may not use this file except in compliance with
-* the License.  You may obtain a copy of the License at
-*
-*  http://www.apache.org/licenses/LICENSE-2.0
-*
-* Unless required by applicable law or agreed to in writing, software
-* distributed under the License is distributed on an "AS IS" BASIS,
-* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-* See the License for the specific language governing permissions and
-* limitations under the License.
-*/
+ * Licensed to the Apache Software Foundation (ASF) under one or more 
contributor license
+ * agreements. See the NOTICE file distributed with this work for additional 
information regarding
+ * copyright ownership. The ASF licenses this file to You under the Apache 
License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance with the 
License. You may obtain a
+ * copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software 
distributed under the License
+ * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 
KIND, either express
+ * or implied. See the License for the specific language governing permissions 
and limitations under
+ * the License.
+ */
 package org.apache.geode.modules.gatewaydelta;
 
 import org.apache.geode.cache.Cache;
@@ -33,7 +31,8 @@ import org.apache.geode.internal.cache.LocalRegion;
 
 import java.util.Properties;
 
-public class GatewayDeltaForwarderCacheListener extends 
CacheListenerAdapter implements Declarable {
+public class GatewayDeltaForwarderCacheListener extends 
CacheListenerAdapter
+implements Declarable {
 
   private final Cache cache;
 
@@ -55,9 +54,7 @@ public class GatewayDeltaForwarderCacheListener extends 
CacheListenerAdapter")
-.append(event.getNewValue())
+.append(event.getKey()).append("->").append(event.getNewValue())
 .append(" that originated in the local site. Sending it to the 
remote site.");
 this.cache.getLogger().fine(builder.toString());
   }
@@ -67,12 +64,12 @@ public class GatewayDeltaForwarderCacheListener extends 
CacheListenerAdapter")
-.append(event.getNewValue())
+.append(event.getKey()).append("->").append(event.getNewValue())
 .append(" that originated in the remote site.");
 this.cache.getLogger().fine(builder.toString());
   }
@@ -90,16 +85,14 @@ public class GatewayDeltaForwarderCacheListener extends 
CacheListenerAdapter event) {
-//System.out.println("GatewayDeltaForwarderCacheListener.afterUpdate: " + 
event);
+// System.out.println("GatewayDeltaForwarderCacheListener.afterUpdate: " + 
event);
 // If the event is from the local site, create an 'update' event and send 
it to the
 // gateway delta region
 if (event.getCallbackArgument() == null) {
   if (this.cache.getLogger().fineEnabled()) {
 StringBuilder builder = new StringBuilder();
 builder.append("GatewayDeltaForwarderCacheListener: Received update 
event for ")
-.append(event.getKey())
-.append("->")
-.append(event.getNewValue())
+.append(event.getKey()).append("->").append(event.getNewValue())
 .append(" that originated in the local site. Sending it to the 
remote site.");
 this.cache.getLogger().fine(builder.toString());
   }
@@ -114,9 +107,7 @@ public class GatewayDeltaForwarderCacheListener extends 
CacheListenerAdapter")
-.append(event.getNewValue())
+.append(event.getKey()).append("->").append(event.getNewValue())
 .append(" that originated in the remote site.");
 this.cache.getLogger().fine(builder.toString());
   }
@@ -130,16 +121,15 @@ public class 

[29/93] [partial] incubator-geode git commit: Added Spotless plugin to enforce formatting standards. Added Google Java Style guide formatter templates, removed existing formatter templates.

2016-10-26 Thread klund
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/8bf39571/geode-core/src/main/java/org/apache/geode/admin/AdminDistributedSystem.java
--
diff --git 
a/geode-core/src/main/java/org/apache/geode/admin/AdminDistributedSystem.java 
b/geode-core/src/main/java/org/apache/geode/admin/AdminDistributedSystem.java
index 982c4f1..cd4dc7e 100755
--- 
a/geode-core/src/main/java/org/apache/geode/admin/AdminDistributedSystem.java
+++ 
b/geode-core/src/main/java/org/apache/geode/admin/AdminDistributedSystem.java
@@ -1,18 +1,16 @@
 /*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
+ * Licensed to the Apache Software Foundation (ASF) under one or more 
contributor license
+ * agreements. See the NOTICE file distributed with this work for additional 
information regarding
+ * copyright ownership. The ASF licenses this file to You under the Apache 
License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance with the 
License. You may obtain a
+ * copy of the License at
  *
- *  http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
  *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software 
distributed under the License
+ * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 
KIND, either express
+ * or implied. See the License for the specific language governing permissions 
and limitations under
+ * the License.
  */
 package org.apache.geode.admin;
 
@@ -28,87 +26,81 @@ import java.util.Set;
 import java.util.UUID;
 
 /**
- * Administrative interface for managing an entire GemFire distributed
- * system.  This interface should not be confused with {@link
- * org.apache.geode.distributed.DistributedSystem
- * DistributedSystem} that represents a connection to a GemFire
- * distributed system.
+ * Administrative interface for managing an entire GemFire distributed system. 
This interface should
+ * not be confused with {@link org.apache.geode.distributed.DistributedSystem 
DistributedSystem}
+ * that represents a connection to a GemFire distributed system.
  *
  * @see AdminDistributedSystemFactory
  *
- * @since GemFire 3.5
- * @deprecated as of 7.0 use the management
 package instead
+ * @since GemFire 3.5
+ * @deprecated as of 7.0 use the management
+ * package instead
  */
 public interface AdminDistributedSystem {
-   
+
   /**
* Retrieves the unique id for this system.
*/
   public String getId();
-  
+
   /**
-   * Retrieves display friendly name for this system.  If this administrative
-   * VM defined an optional name for its connection to the distributed system,
-   * that name will be returned.  Otherwise the returned value will be {@link
-   * org.apache.geode.admin.AdminDistributedSystem#getId}.
+   * Retrieves display friendly name for this system. If this administrative 
VM defined an optional
+   * name for its connection to the distributed system, that name will be 
returned. Otherwise the
+   * returned value will be {@link 
org.apache.geode.admin.AdminDistributedSystem#getId}.
*/
   public String getName();
-  
+
   /**
-   * Retrieves the remote command and formatting this system should use to 
-   * access and/or manipulate resources on remote machines.
+   * Retrieves the remote command and formatting this system should use to 
access and/or manipulate
+   * resources on remote machines.
*/
   public String getRemoteCommand();
 
   /**
-   * Sets the remote command and formatting this system should use to access 
-   * and/or manipulate resources on remote machines.
+   * Sets the remote command and formatting this system should use to access 
and/or manipulate
+   * resources on remote machines.
*/
   public void setRemoteCommand(String remoteCommand);
 
   /**
-   * Sets the lowest level of alert that should be delivered to the
-   * {@link AlertListener}s registered on this
-   * AdminDistributedSystem.  The default level is {@link
-   * AlertLevel#WARNING}. 
+   * Sets the lowest level of alert that should be delivered to the {@link 
AlertListener}s
+   * registered on this AdminDistributedSystem. The default level 
is
+   * {@link AlertLevel#WARNING}.
*/
   public void 

[17/93] [partial] incubator-geode git commit: Added Spotless plugin to enforce formatting standards. Added Google Java Style guide formatter templates, removed existing formatter templates.

2016-10-26 Thread klund
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/8bf39571/geode-core/src/main/java/org/apache/geode/admin/jmx/internal/AdminDistributedSystemJmxImpl.java
--
diff --git 
a/geode-core/src/main/java/org/apache/geode/admin/jmx/internal/AdminDistributedSystemJmxImpl.java
 
b/geode-core/src/main/java/org/apache/geode/admin/jmx/internal/AdminDistributedSystemJmxImpl.java
index 5ff4bfa..1bfddf2 100755
--- 
a/geode-core/src/main/java/org/apache/geode/admin/jmx/internal/AdminDistributedSystemJmxImpl.java
+++ 
b/geode-core/src/main/java/org/apache/geode/admin/jmx/internal/AdminDistributedSystemJmxImpl.java
@@ -1,18 +1,16 @@
 /*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
+ * Licensed to the Apache Software Foundation (ASF) under one or more 
contributor license
+ * agreements. See the NOTICE file distributed with this work for additional 
information regarding
+ * copyright ownership. The ASF licenses this file to You under the Apache 
License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance with the 
License. You may obtain a
+ * copy of the License at
  *
- *  http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
  *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software 
distributed under the License
+ * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 
KIND, either express
+ * or implied. See the License for the specific language governing permissions 
and limitations under
+ * the License.
  */
 package org.apache.geode.admin.jmx.internal;
 
@@ -49,26 +47,25 @@ import java.util.concurrent.atomic.AtomicInteger;
 /**
  * Provides MBean support for managing a GemFire distributed system.
  * 
- * TODO: refactor to implement DistributedSystem and delegate to instance of
- * DistributedSystemImpl. Wrap all delegate calls w/ e.printStackTrace() since 
- * the HttpAdaptor devours them (what to do w/ template methods then?)
+ * TODO: refactor to implement DistributedSystem and delegate to instance of 
DistributedSystemImpl.
+ * Wrap all delegate calls w/ e.printStackTrace() since the HttpAdaptor 
devours them (what to do w/
+ * template methods then?)
  *
- * @since GemFire 3.5
+ * @since GemFire 3.5
  */
-public class AdminDistributedSystemJmxImpl 
-  extends AdminDistributedSystemImpl
-  implements ManagedResource, DistributedSystemConfig, 
StatAlertsAggregator {
+public class AdminDistributedSystemJmxImpl extends AdminDistributedSystemImpl
+implements ManagedResource, DistributedSystemConfig, StatAlertsAggregator {
 
   private static final Logger logger = LogService.getLogger();
-  
+
   private Properties mailProps;
 
   // The file name where the StatAlertDefinitions would be serialized
   private String statAlertDefnSerFile = System.getProperty("user.dir");
-  
-  /** 
-   * Simple counter incrementing on each notification.  This this currently 
-   * resets at every restart of Agent
+
+  /**
+   * Simple counter incrementing on each notification. This this currently 
resets at every restart
+   * of Agent
*/
   private final AtomicInteger notificationSequenceNumber = new AtomicInteger();
 
@@ -78,8 +75,7 @@ public class AdminDistributedSystemJmxImpl
   private volatile boolean isRmiClientCountZero;
 
   /**
-   * Variable to indicate if Statistics Alert definitions could be persisted 
-   * across runs/sessions.
+   * Variable to indicate if Statistics Alert definitions could be persisted 
across runs/sessions.
*/
   private volatile boolean canPersistStatAlertDefs = true;
 
@@ -87,15 +83,13 @@ public class AdminDistributedSystemJmxImpl
   private CacheAndRegionListenerImpl cacheRegionListener;
 
   // -
-  //   Constructor(s)
+  // Constructor(s)
   // -
-  
+
   /**
-   * Constructs new DistributedSystemJmxImpl and registers an MBean to 
represent
-   * it.
+   * Constructs new DistributedSystemJmxImpl and registers an MBean to 
represent it.
* 
-   * @param config
-   *  configuration defining the JMX agent.
+   * @param config 

[61/93] incubator-geode git commit: GEODE-288: move admin package to internal

2016-10-26 Thread klund
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/895fd144/geode-core/src/main/java/org/apache/geode/internal/admin/api/jmx/impl/AgentLauncher.java
--
diff --git 
a/geode-core/src/main/java/org/apache/geode/internal/admin/api/jmx/impl/AgentLauncher.java
 
b/geode-core/src/main/java/org/apache/geode/internal/admin/api/jmx/impl/AgentLauncher.java
new file mode 100644
index 000..932fe21
--- /dev/null
+++ 
b/geode-core/src/main/java/org/apache/geode/internal/admin/api/jmx/impl/AgentLauncher.java
@@ -0,0 +1,918 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more 
contributor license
+ * agreements. See the NOTICE file distributed with this work for additional 
information regarding
+ * copyright ownership. The ASF licenses this file to You under the Apache 
License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance with the 
License. You may obtain a
+ * copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software 
distributed under the License
+ * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 
KIND, either express
+ * or implied. See the License for the specific language governing permissions 
and limitations under
+ * the License.
+ */
+package org.apache.geode.internal.admin.api.jmx.impl;
+
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.FileNotFoundException;
+import java.io.FileOutputStream;
+import java.io.IOException;
+import java.io.ObjectInputStream;
+import java.io.ObjectOutputStream;
+import java.io.PrintStream;
+import java.io.Serializable;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
+import java.util.Map.Entry;
+import java.util.Properties;
+import java.util.SortedMap;
+import java.util.StringTokenizer;
+import java.util.TreeMap;
+
+import org.apache.logging.log4j.Logger;
+
+import org.apache.geode.GemFireException;
+import org.apache.geode.SystemFailure;
+import org.apache.geode.internal.admin.api.AdminException;
+import org.apache.geode.internal.admin.api.jmx.Agent;
+import org.apache.geode.internal.admin.api.jmx.AgentConfig;
+import org.apache.geode.internal.admin.api.jmx.AgentFactory;
+import org.apache.geode.distributed.internal.DistributionManager;
+import org.apache.geode.internal.OSProcess;
+import org.apache.geode.internal.PureJavaMode;
+import org.apache.geode.internal.net.SocketCreator;
+import org.apache.geode.internal.i18n.LocalizedStrings;
+import org.apache.geode.internal.logging.LogService;
+import org.apache.geode.internal.util.IOUtils;
+import org.apache.geode.internal.util.JavaCommandBuilder;
+
+/**
+ * A command line utility inspired by the CacheServerLauncher 
that is responsible for
+ * administering a stand-along GemFire JMX {@link Agent}.
+ * 
+ * 
+ * @since GemFire 3.5
+ */
+public class AgentLauncher {
+
+  private static final Logger logger = LogService.getLogger();
+
+  /** Should the launch command be printed? */
+  public static final boolean PRINT_LAUNCH_COMMAND =
+  Boolean.getBoolean(AgentLauncher.class.getSimpleName() + 
".PRINT_LAUNCH_COMMAND");
+
+  /* constants used to define state */
+  static final int SHUTDOWN = 0;
+  static final int STARTING = 1;
+  static final int RUNNING = 2;
+  static final int SHUTDOWN_PENDING = 3;
+  static final int SHUTDOWN_PENDING_AFTER_FAILED_STARTUP = 4;
+  static final int UNKNOWN = 6;
+
+  /** Agent configuration options */
+  static final String AGENT_PROPS = "agent-props";
+
+  /**
+   * A flag to indicate if the current log file should be kept. Used only when 
'start' is used to
+   * fork off the 'server'
+   */
+  static final String APPENDTO_LOG_FILE = "appendto-log-file";
+
+  /** optional and additional classpath entries */
+  static final String CLASSPATH = "classpath";
+
+  /** The directory argument */
+  static final String DIR = "dir";
+
+  /** Extra VM arguments */
+  static final String VMARGS = "vmargs";
+
+  /** The directory in which the agent's output resides */
+  private File workingDirectory = null;
+
+  /** The Status object for the agent */
+  private Status status = null;
+
+  /** base name for the agent to be launched */
+  private final String basename;
+
+  /** The name for the start up log file */
+  private final String startLogFileName;
+
+  /** The name of the status file */
+  private final String statusFileName;
+
+  /**
+   * Instantiates an AgentLauncher for execution and control of the GemFire 
JMX Agent process. This
+   * constructor is package private to prevent direct instantiation or 
subclassing by classes
+   * outside this package, but does allow the class to be tested as needed.
+   * 
+   * 
+   * @param basename base name for the application to be launched
+   */
+  AgentLauncher(final 

[10/93] [partial] incubator-geode git commit: Added Spotless plugin to enforce formatting standards. Added Google Java Style guide formatter templates, removed existing formatter templates.

2016-10-26 Thread klund
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/8bf39571/geode-core/src/main/java/org/apache/geode/admin/jmx/internal/MemberInfoWithStatsMBean.java
--
diff --git 
a/geode-core/src/main/java/org/apache/geode/admin/jmx/internal/MemberInfoWithStatsMBean.java
 
b/geode-core/src/main/java/org/apache/geode/admin/jmx/internal/MemberInfoWithStatsMBean.java
index ac75f38..40a514a 100644
--- 
a/geode-core/src/main/java/org/apache/geode/admin/jmx/internal/MemberInfoWithStatsMBean.java
+++ 
b/geode-core/src/main/java/org/apache/geode/admin/jmx/internal/MemberInfoWithStatsMBean.java
@@ -1,18 +1,16 @@
 /*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
+ * Licensed to the Apache Software Foundation (ASF) under one or more 
contributor license
+ * agreements. See the NOTICE file distributed with this work for additional 
information regarding
+ * copyright ownership. The ASF licenses this file to You under the Apache 
License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance with the 
License. You may obtain a
+ * copy of the License at
  *
- *  http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
  *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software 
distributed under the License
+ * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 
KIND, either express
+ * or implied. See the License for the specific language governing permissions 
and limitations under
+ * the License.
  */
 package org.apache.geode.admin.jmx.internal;
 
@@ -38,215 +36,208 @@ import java.util.*;
 import java.util.concurrent.atomic.AtomicLong;
 
 /**
- * This class uses the JMX Attributes/Operations that use (return/throw) 
- * GemFire types. This is the single MBean accessible with ObjectName string
- * {@link MemberInfoWithStatsMBean#MBEAN_NAME}}. This MBean can be used to 
- * retrieve the all member details as plain java types.
+ * This class uses the JMX Attributes/Operations that use (return/throw) 
GemFire types. This is the
+ * single MBean accessible with ObjectName string {@link 
MemberInfoWithStatsMBean#MBEAN_NAME}}. This
+ * MBean can be used to retrieve the all member details as plain java types.
  * 
- * This MBean also acts as a Notification Hub for all the Notifications that 
are 
- * defined for Admin Distributed System. 
+ * This MBean also acts as a Notification Hub for all the Notifications that 
are defined for Admin
+ * Distributed System.
  * 
  * 
  * @since GemFire 6.5
  */
-public class MemberInfoWithStatsMBean extends AbstractDynamicMBean 
- implements NotificationEmitter {
+public class MemberInfoWithStatsMBean extends AbstractDynamicMBean implements 
NotificationEmitter {
   private static final Logger logger = LogService.getLogger();
-  
+
   /* constants defining max no of attributes/operations/notifications */
-  private static final int MAX_ATTRIBUTES_COUNT= 3;
-  private static final int MAX_OPERATIONS_COUNT= 3;
+  private static final int MAX_ATTRIBUTES_COUNT = 3;
+  private static final int MAX_OPERATIONS_COUNT = 3;
   private static final int MAX_NOTIFICATIONS_COUNT = 9;
-  
+
   private static final String NOT_AVAILABLE_STR = "N/A";
   private static final String NOT_AVAILABLE = null;
   private static final Number NOT_AVAILABLE_NUMBER = null;
 
-  /* String constant used for a region that is used on admin side just as a 
root 
-   * for rootRegions defined on the member */
+  /*
+   * String constant used for a region that is used on admin side just as a 
root for rootRegions
+   * defined on the member
+   */
   private static final String PLACE_HOLDER_ROOT_REGION = "/Root/";
 
   /* String that are used to form QueryExp/ObjectName for querying MBeanServer 
*/
-  private static final String REGION_QUERY_EXPRESSION = 
"*GemFire.Cache*:*,owner={0},type=Region";  
-  private static final String STATS_QUERY_EXPRESSION  = 
"*GemFire.Statistic*:*,source={0},name={1}";
-  
+  private static final String REGION_QUERY_EXPRESSION = 
"*GemFire.Cache*:*,owner={0},type=Region";
+  private static final String STATS_QUERY_EXPRESSION = 
"*GemFire.Statistic*:*,source={0},name={1}";
+
   /** mbean name 

[30/93] [partial] incubator-geode git commit: Added Spotless plugin to enforce formatting standards. Added Google Java Style guide formatter templates, removed existing formatter templates.

2016-10-26 Thread klund
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/8bf39571/geode-core/src/main/java/org/apache/geode/SystemFailure.java
--
diff --git a/geode-core/src/main/java/org/apache/geode/SystemFailure.java 
b/geode-core/src/main/java/org/apache/geode/SystemFailure.java
index 8acf473..99b0671 100644
--- a/geode-core/src/main/java/org/apache/geode/SystemFailure.java
+++ b/geode-core/src/main/java/org/apache/geode/SystemFailure.java
@@ -1,18 +1,16 @@
 /*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
+ * Licensed to the Apache Software Foundation (ASF) under one or more 
contributor license
+ * agreements. See the NOTICE file distributed with this work for additional 
information regarding
+ * copyright ownership. The ASF licenses this file to You under the Apache 
License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance with the 
License. You may obtain a
+ * copy of the License at
  *
- *  http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
  *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software 
distributed under the License
+ * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 
KIND, either express
+ * or implied. See the License for the specific language governing permissions 
and limitations under
+ * the License.
  */
 /**
  * 
@@ -28,97 +26,76 @@ import org.apache.geode.internal.i18n.LocalizedStrings;
 /**
  * Catches and responds to JVM failure
  * 
- * This class represents a catastrophic failure of the system,
- * especially the Java virtual machine.  Any class may,
- * at any time, indicate that a system failure has occurred by calling
- * {@link #initiateFailure(Error)} (or, less commonly,
- * {@link #setFailure(Error)}).
+ * This class represents a catastrophic failure of the system, especially the 
Java virtual machine.
+ * Any class may, at any time, indicate that a system failure has occurred by 
calling
+ * {@link #initiateFailure(Error)} (or, less commonly, {@link 
#setFailure(Error)}).
  * 
- * In practice, the most common type of failure that is likely to be
- * reported by an otherwise healthy JVM is {@link OutOfMemoryError}.  However,
- * GemFire will report any occurrence of {@link VirtualMachineError} as
- * a JVM failure.
+ * In practice, the most common type of failure that is likely to be reported 
by an otherwise
+ * healthy JVM is {@link OutOfMemoryError}. However, GemFire will report any 
occurrence of
+ * {@link VirtualMachineError} as a JVM failure.
  * 
- * When a failure is reported, you must assume that the JVM has broken 
- * its fundamental execution contract with your application. 
- * No programming invariant can be assumed to be true, and your 
+ * When a failure is reported, you must assume that the JVM has broken its 
fundamental execution
+ * contract with your application. No programming invariant can be 
assumed to be true, and your
  * entire application must be regarded as corrupted.
- * Failure Hooks
- * GemFire uses this class to disable its distributed system (group
- * communication) and any open caches.  It also provides a hook for you
- * to respond to after GemFire disables itself.
- * Failure WatchDog
- * When {@link #startThreads()} is called, a "watchdog" {@link Thread} is 
started that 
- * periodically checks to see if system corruption has been reported.  When 
- * system corruption is detected, this thread proceeds to:
+ * Failure Hooks GemFire uses this class to disable its distributed 
system (group
+ * communication) and any open caches. It also provides a hook for you to 
respond to after GemFire
+ * disables itself.
+ * Failure WatchDog When {@link #startThreads()} is called, a 
"watchdog" {@link Thread} is
+ * started that periodically checks to see if system corruption has been 
reported. When system
+ * corruption is detected, this thread proceeds to:
  * 
  * 
- * 
- * Close GemFire -- Group communication is ceased (this cache
- * member recuses itself from the distributed system) and the cache
- * is further poisoned (it is pointless to try to cleanly close it at this
- * point.).
+ * Close GemFire -- Group communication is ceased (this cache 
member recuses 

[60/93] incubator-geode git commit: GEODE-288: move admin package to internal

2016-10-26 Thread klund
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/895fd144/geode-core/src/main/java/org/apache/geode/internal/admin/api/jmx/impl/GemFireHealthConfigJmxImpl.java
--
diff --git 
a/geode-core/src/main/java/org/apache/geode/internal/admin/api/jmx/impl/GemFireHealthConfigJmxImpl.java
 
b/geode-core/src/main/java/org/apache/geode/internal/admin/api/jmx/impl/GemFireHealthConfigJmxImpl.java
new file mode 100644
index 000..23e9038
--- /dev/null
+++ 
b/geode-core/src/main/java/org/apache/geode/internal/admin/api/jmx/impl/GemFireHealthConfigJmxImpl.java
@@ -0,0 +1,211 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more 
contributor license
+ * agreements. See the NOTICE file distributed with this work for additional 
information regarding
+ * copyright ownership. The ASF licenses this file to You under the Apache 
License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance with the 
License. You may obtain a
+ * copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software 
distributed under the License
+ * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 
KIND, either express
+ * or implied. See the License for the specific language governing permissions 
and limitations under
+ * the License.
+ */
+package org.apache.geode.internal.admin.api.jmx.impl;
+
+import javax.management.ObjectName;
+import javax.management.modelmbean.ModelMBean;
+
+import org.apache.geode.internal.admin.api.AdminException;
+import org.apache.geode.internal.admin.api.GemFireHealth;
+import org.apache.geode.internal.admin.api.GemFireHealthConfig;
+import org.apache.geode.internal.admin.api.impl.GemFireHealthConfigImpl;
+
+/**
+ * The JMX "managed resource" that represents the configuration for the health 
of GemFire.
+ * Basically, it provides the behavior of 
GemFireHealthConfigImpl, but does some JMX
+ * stuff like registering beans with the agent.
+ *
+ * 
+ *
+ * Unlike other ManagedResources this class cannot simply subclass
+ * GemFireHealthImpl because it instances are serialized and sent 
to other VMs. This is
+ * problematic because the other VMs most likely do not have JMX classes like
+ * ModelMBean on their classpaths. So, instead we delegate all of 
the
+ * GemFireHealthConfig behavior to another object which IS 
serialized.
+ *
+ * @see GemFireHealthJmxImpl#createDistributedSystemHealthConfig
+ *
+ *
+ * @since GemFire 3.5
+ */
+@edu.umd.cs.findbugs.annotations.SuppressWarnings(
+justification = "This class is deprecated. Also, any further changes so 
close to the release is inadvisable.")
+public class GemFireHealthConfigJmxImpl
+implements GemFireHealthConfig, ManagedResource, java.io.Serializable {
+
+  private static final long serialVersionUID = 1482719647163239953L;
+
+  /** The GemFireHealth that we help configure */
+  private GemFireHealth health;
+
+  /** The name of the MBean that will manage this resource */
+  private String mbeanName;
+
+  /** The ModelMBean that is configured to manage this resource */
+  private ModelMBean modelMBean;
+
+  /** The delegate that contains the real config state */
+  private GemFireHealthConfig delegate;
+
+  /** The object name of this managed resource */
+  private ObjectName objectName;
+
+  /// Constructors ///
+
+  /**
+   * Creates a new GemFireHealthConfigJmxImpl that configures the 
health monitoring of
+   * components running on the given host.
+   */
+  GemFireHealthConfigJmxImpl(GemFireHealthJmxImpl health, String hostName) 
throws AdminException {
+
+this.delegate = new GemFireHealthConfigImpl(hostName);
+this.health = health;
+this.mbeanName = new 
StringBuffer().append(MBEAN_NAME_PREFIX).append("GemFireHealthConfig,id=")
+
.append(MBeanUtil.makeCompliantMBeanNameProperty(health.getDistributedSystem().getId()))
+.append(",host=")
+.append((hostName == null ? "default" : 
MBeanUtil.makeCompliantMBeanNameProperty(hostName)))
+.toString();
+this.objectName = MBeanUtil.createMBean(this);
+  }
+
+  // Instance Methods //
+
+  /**
+   * Applies the changes made to this config back to the health monitor.
+   *
+   * @see GemFireHealth#setDistributedSystemHealthConfig
+   */
+  public void applyChanges() {
+String hostName = this.getHostName();
+if (hostName == null) {
+  this.health.setDefaultGemFireHealthConfig(this);
+
+} else {
+  this.health.setGemFireHealthConfig(hostName, this);
+}
+  }
+
+  public String getMBeanName() {
+return this.mbeanName;
+  }
+
+  public ModelMBean getModelMBean() {
+return this.modelMBean;
+  }
+
+  public ObjectName getObjectName() {
+return this.objectName;
+  }
+
+  public void setModelMBean(ModelMBean modelMBean) {
+

[52/93] incubator-geode git commit: GEODE-288: move admin package to internal

2016-10-26 Thread klund
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/895fd144/geode-core/src/test/resources/org/apache/geode/codeAnalysis/sanctionedSerializables.txt
--
diff --git 
a/geode-core/src/test/resources/org/apache/geode/codeAnalysis/sanctionedSerializables.txt
 
b/geode-core/src/test/resources/org/apache/geode/codeAnalysis/sanctionedSerializables.txt
index 03bb3ea..8625afa 100644
--- 
a/geode-core/src/test/resources/org/apache/geode/codeAnalysis/sanctionedSerializables.txt
+++ 
b/geode-core/src/test/resources/org/apache/geode/codeAnalysis/sanctionedSerializables.txt
@@ -25,32 +25,6 @@ org/apache/geode/ToDataException,true,-2329606027453879918
 org/apache/geode/UncreatedSystemException,true,5424354567878425435
 org/apache/geode/UnmodifiableException,true,-1043243260052395455
 org/apache/geode/UnstartedSystemException,true,-4285897556527521788
-org/apache/geode/admin/AdminException,true,879398950879472021
-org/apache/geode/admin/AdminXmlException,true,-6848726449157550169
-org/apache/geode/admin/AlertLevel,true,-4752438966587392126,ordinal:int
-org/apache/geode/admin/CacheDoesNotExistException,true,-1639933911265729978
-org/apache/geode/admin/GemFireHealth$Health,true,3039539430412151801,healthString:java/lang/String
-org/apache/geode/admin/GemFireMemberStatus,true,3389997790525991310,_bindAddress:java/lang/String,_clientHealthStats:java/util/Map,_clientHostNames:java/util/Map,_clientQueueSizes:java/util/Map,_connectedClients:java/util/Set,_connectedIncomingGateways:java/util/Map,_connectedPeers:java/util/Set,_connectedServers:java/util/Set,_freeHeapSize:long,_gatewayHubStatus:java/lang/Object,_gatewayQueueSizes:java/util/Map,_hostAddress:java/net/InetAddress,_isClient:boolean,_isConnected:boolean,_isGatewayHub:boolean,_isLocator:boolean,_isPrimaryGatewayHub:boolean,_isServer:boolean,_locators:java/lang/String,_maximumHeapSize:long,_mcastAddress:java/net/InetAddress,_mcastPort:int,_memberId:java/io/Serializable,_memberName:java/lang/String,_outgoingGateways:java/util/Map,_regionStatuses:java/util/Map,_serverPort:int,_unconnectedServers:java/util/Set,upTime:long
-org/apache/geode/admin/OperationCancelledException,true,5474068770227602546
-org/apache/geode/admin/RegionNotFoundException,true,1758668137691463909
-org/apache/geode/admin/RuntimeAdminException,true,-7512771113818634005
-org/apache/geode/admin/SystemMemberType,true,3284366994485749302,ordinal:int
-org/apache/geode/admin/UnmodifiableConfigurationException,true,-7653547392992060646
-org/apache/geode/admin/internal/BackupStatusImpl,true,3704162840296921840,backedUpDiskStores:java/util/Map,offlineDiskStores:java/util/Set
-org/apache/geode/admin/internal/CacheHealthConfigImpl,false,maxEventQueueSize:long,maxLoadTime:long,maxNetSearchTime:long,minHitRatio:double
-org/apache/geode/admin/internal/GemFireHealthConfigImpl,true,-6797673296902808018,hostName:java/lang/String,interval:int
-org/apache/geode/admin/internal/MemberHealthConfigImpl,true,3966032573073580490,maxMessageQueueSize:long,maxReplyTimeouts:long,maxRetransmissionRatio:double,maxVMProcessSize:long
-org/apache/geode/admin/internal/StatisticImpl,true,3899296873901634399,internalStat:org/apache/geode/internal/admin/Stat
-org/apache/geode/admin/jmx/internal/AgentImpl$StartupException,true,6614145962199330348
-org/apache/geode/admin/jmx/internal/AgentLauncher$Status,true,-7758402454664266174,baseName:java/lang/String,exception:java/lang/Throwable,msg:java/lang/String,pid:int,state:int
-org/apache/geode/admin/jmx/internal/ConfigAttributeInfo,true,-1918437700841687078,config:org/apache/geode/admin/jmx/internal/ConfigurationParameterJmxImpl
-org/apache/geode/admin/jmx/internal/ConfigurationParameterJmxImpl,true,-7822171853906772375,deserialized:boolean
-org/apache/geode/admin/jmx/internal/ConnectionNotificationFilterImpl,true,1
-org/apache/geode/admin/jmx/internal/DynamicManagedBean,true,4051924500150228160
-org/apache/geode/admin/jmx/internal/GemFireHealthConfigJmxImpl,true,1482719647163239953,delegate:org/apache/geode/admin/GemFireHealthConfig,health:org/apache/geode/admin/GemFireHealth,mbeanName:java/lang/String,modelMBean:javax/management/modelmbean/ModelMBean,objectName:javax/management/ObjectName
-org/apache/geode/admin/jmx/internal/ManagedResourceType,true,3752874768667480449,ordinal:int
-org/apache/geode/admin/jmx/internal/RefreshNotificationType,true,4376763592395613794,ordinal:int
-org/apache/geode/admin/jmx/internal/StatisticAttributeInfo,true,28022387514935560,stat:org/apache/geode/admin/Statistic
 

[33/93] [partial] incubator-geode git commit: Added Spotless plugin to enforce formatting standards. Added Google Java Style guide formatter templates, removed existing formatter templates.

2016-10-26 Thread klund
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/8bf39571/geode-core/src/main/java/org/apache/geode/Delta.java
--
diff --git a/geode-core/src/main/java/org/apache/geode/Delta.java 
b/geode-core/src/main/java/org/apache/geode/Delta.java
index de3ef98..a474981 100755
--- a/geode-core/src/main/java/org/apache/geode/Delta.java
+++ b/geode-core/src/main/java/org/apache/geode/Delta.java
@@ -1,18 +1,16 @@
 /*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
+ * Licensed to the Apache Software Foundation (ASF) under one or more 
contributor license
+ * agreements. See the NOTICE file distributed with this work for additional 
information regarding
+ * copyright ownership. The ASF licenses this file to You under the Apache 
License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance with the 
License. You may obtain a
+ * copy of the License at
  *
- *  http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
  *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software 
distributed under the License
+ * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 
KIND, either express
+ * or implied. See the License for the specific language governing permissions 
and limitations under
+ * the License.
  */
 package org.apache.geode;
 
@@ -22,12 +20,11 @@ import java.io.IOException;
 
 
 /**
- * This interface defines a contract between the application and GemFire that
- * allows GemFire to determine whether an application object contains a delta,
- * allows GemFire to extract the delta from an application object, and generate
- * a new application object by applying a delta to an existing application
- * object. The difference in object state is contained in the {@link 
DataOutput}
- * and {@link DataInput} parameters.
+ * This interface defines a contract between the application and GemFire that 
allows GemFire to
+ * determine whether an application object contains a delta, allows GemFire to 
extract the delta
+ * from an application object, and generate a new application object by 
applying a delta to an
+ * existing application object. The difference in object state is contained in 
the
+ * {@link DataOutput} and {@link DataInput} parameters.
  * 
  * @since GemFire 6.1
  * 
@@ -40,10 +37,9 @@ public interface Delta {
   boolean hasDelta();
 
   /**
-   * This method is invoked on an application object at the delta sender, if
-   * GemFire determines the presence of a delta by calling
-   * {@link Delta#hasDelta()} on the object. The delta is written to the
-   * {@link DataOutput} object provided by GemFire.
+   * This method is invoked on an application object at the delta sender, if 
GemFire determines the
+   * presence of a delta by calling {@link Delta#hasDelta()} on the object. 
The delta is written to
+   * the {@link DataOutput} object provided by GemFire.
* 
* Any delta state should be reset in this method.
* 
@@ -53,11 +49,10 @@ public interface Delta {
 
 
   /**
-   * This method is invoked on an existing application object when an update is
-   * received as a delta. This method throws an {@link InvalidDeltaException}
-   * when the delta in the {@link DataInput} cannot be applied to the object.
-   * GemFire automatically handles an {@link InvalidDeltaException} by
-   * reattempting the update by sending the full application object.
+   * This method is invoked on an existing application object when an update 
is received as a delta.
+   * This method throws an {@link InvalidDeltaException} when the delta in the 
{@link DataInput}
+   * cannot be applied to the object. GemFire automatically handles an {@link 
InvalidDeltaException}
+   * by reattempting the update by sending the full application object.
* 
* @throws IOException
* @throws InvalidDeltaException

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/8bf39571/geode-core/src/main/java/org/apache/geode/DeltaSerializationException.java
--
diff --git 
a/geode-core/src/main/java/org/apache/geode/DeltaSerializationException.java 

[69/93] incubator-geode git commit: GEODE-288: move admin package to internal

2016-10-26 Thread klund
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/895fd144/geode-core/src/main/java/org/apache/geode/internal/admin/api/impl/BackupDataStoreHelper.java
--
diff --git 
a/geode-core/src/main/java/org/apache/geode/internal/admin/api/impl/BackupDataStoreHelper.java
 
b/geode-core/src/main/java/org/apache/geode/internal/admin/api/impl/BackupDataStoreHelper.java
new file mode 100644
index 000..bf2d484
--- /dev/null
+++ 
b/geode-core/src/main/java/org/apache/geode/internal/admin/api/impl/BackupDataStoreHelper.java
@@ -0,0 +1,74 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more 
contributor license
+ * agreements. See the NOTICE file distributed with this work for additional 
information regarding
+ * copyright ownership. The ASF licenses this file to You under the Apache 
License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance with the 
License. You may obtain a
+ * copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software 
distributed under the License
+ * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 
KIND, either express
+ * or implied. See the License for the specific language governing permissions 
and limitations under
+ * the License.
+ */
+package org.apache.geode.internal.admin.api.impl;
+
+import java.io.File;
+import java.util.Map;
+import java.util.Set;
+
+import org.apache.geode.cache.persistence.PersistentID;
+import org.apache.geode.distributed.DistributedLockService;
+import org.apache.geode.distributed.DistributedMember;
+import org.apache.geode.distributed.internal.DM;
+import org.apache.geode.internal.Assert;
+
+public class BackupDataStoreHelper {
+
+  public static String LOCK_SERVICE_NAME = 
BackupDataStoreHelper.class.getSimpleName();
+
+  private static String LOCK_NAME = LOCK_SERVICE_NAME + "_token";
+
+  private static Object LOCK_SYNC = new Object();
+
+  @SuppressWarnings("rawtypes")
+  public static BackupDataStoreResult backupAllMembers(DM dm, Set recipients, 
File targetDir,
+  File baselineDir) {
+FlushToDiskRequest.send(dm, recipients);
+
+boolean abort = true;
+Map successfulMembers;
+Map existingDataStores;
+try {
+  existingDataStores = PrepareBackupRequest.send(dm, recipients);
+  abort = false;
+} finally {
+  successfulMembers = FinishBackupRequest.send(dm, recipients, targetDir, 
baselineDir, abort);
+}
+return new BackupDataStoreResult(existingDataStores, successfulMembers);
+  }
+
+  private static DistributedLockService getLockService(DM dm) {
+DistributedLockService dls = 
DistributedLockService.getServiceNamed(LOCK_SERVICE_NAME);
+if (dls == null) {
+  synchronized (LOCK_SYNC) {
+dls = DistributedLockService.getServiceNamed(LOCK_SERVICE_NAME);
+if (dls == null) {
+  // Create the DistributedLockService
+  dls = DistributedLockService.create(LOCK_SERVICE_NAME, 
dm.getSystem());
+}
+  }
+}
+Assert.assertTrue(dls != null);
+return dls;
+  }
+
+  public static boolean obtainLock(DM dm) {
+return getLockService(dm).lock(LOCK_NAME, 0, -1);
+  }
+
+  public static void releaseLock(DM dm) {
+getLockService(dm).unlock(LOCK_NAME);
+  }
+}

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/895fd144/geode-core/src/main/java/org/apache/geode/internal/admin/api/impl/BackupDataStoreResult.java
--
diff --git 
a/geode-core/src/main/java/org/apache/geode/internal/admin/api/impl/BackupDataStoreResult.java
 
b/geode-core/src/main/java/org/apache/geode/internal/admin/api/impl/BackupDataStoreResult.java
new file mode 100644
index 000..b61e5c8
--- /dev/null
+++ 
b/geode-core/src/main/java/org/apache/geode/internal/admin/api/impl/BackupDataStoreResult.java
@@ -0,0 +1,48 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more 
contributor license
+ * agreements. See the NOTICE file distributed with this work for additional 
information regarding
+ * copyright ownership. The ASF licenses this file to You under the Apache 
License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance with the 
License. You may obtain a
+ * copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software 
distributed under the License
+ * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 
KIND, either express
+ * or implied. See the License for the specific language governing permissions 
and limitations under
+ * the License.
+ */
+package org.apache.geode.internal.admin.api.impl;
+
+import java.util.Map;
+import java.util.Set;
+
+import 

[39/93] [partial] incubator-geode git commit: Added Spotless plugin to enforce formatting standards. Added Google Java Style guide formatter templates, removed existing formatter templates.

2016-10-26 Thread klund
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/8bf39571/geode-assembly/src/test/java/org/apache/geode/rest/internal/web/controllers/Customer.java
--
diff --git 
a/geode-assembly/src/test/java/org/apache/geode/rest/internal/web/controllers/Customer.java
 
b/geode-assembly/src/test/java/org/apache/geode/rest/internal/web/controllers/Customer.java
index 801c5a7..263e6c7 100644
--- 
a/geode-assembly/src/test/java/org/apache/geode/rest/internal/web/controllers/Customer.java
+++ 
b/geode-assembly/src/test/java/org/apache/geode/rest/internal/web/controllers/Customer.java
@@ -1,18 +1,16 @@
 /*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
+ * Licensed to the Apache Software Foundation (ASF) under one or more 
contributor license
+ * agreements. See the NOTICE file distributed with this work for additional 
information regarding
+ * copyright ownership. The ASF licenses this file to You under the Apache 
License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance with the 
License. You may obtain a
+ * copy of the License at
  *
- *  http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
  *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software 
distributed under the License
+ * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 
KIND, either express
+ * or implied. See the License for the specific language governing permissions 
and limitations under
+ * the License.
  */
 package org.apache.geode.rest.internal.web.controllers;
 
@@ -22,6 +20,7 @@ import org.apache.geode.internal.lang.ObjectUtils;
 /**
  * The Customer class models a customer entity.
  * 
+ * 
  * @since GemFire 8.0
  */
 
@@ -31,8 +30,7 @@ public class Customer implements Serializable {
   private String firstName;
   private String lastName;
 
-  public Customer() {
-  }
+  public Customer() {}
 
   public Customer(final Long custId) {
 this.customerId = custId;
@@ -81,8 +79,8 @@ public class Customer implements Serializable {
 final Customer that = (Customer) obj;
 
 return (ObjectUtils.equals(this.getCustomerId(), that.getCustomerId())
-&& ObjectUtils.equals(this.getLastName(), that.getLastName()) && 
ObjectUtils
-  .equals(this.getFirstName(), that.getFirstName()));
+&& ObjectUtils.equals(this.getLastName(), that.getLastName())
+&& ObjectUtils.equals(this.getFirstName(), that.getFirstName()));
   }
 
   @Override

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/8bf39571/geode-assembly/src/test/java/org/apache/geode/rest/internal/web/controllers/DateTimeUtils.java
--
diff --git 
a/geode-assembly/src/test/java/org/apache/geode/rest/internal/web/controllers/DateTimeUtils.java
 
b/geode-assembly/src/test/java/org/apache/geode/rest/internal/web/controllers/DateTimeUtils.java
index 1467821..2701608 100644
--- 
a/geode-assembly/src/test/java/org/apache/geode/rest/internal/web/controllers/DateTimeUtils.java
+++ 
b/geode-assembly/src/test/java/org/apache/geode/rest/internal/web/controllers/DateTimeUtils.java
@@ -1,18 +1,16 @@
 /*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
+ * Licensed to the Apache Software Foundation (ASF) under one or more 
contributor license
+ * agreements. See the NOTICE file distributed with this work for additional 
information regarding
+ * copyright ownership. The ASF licenses this file to You under the Apache 
License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance with the 
License. You may obtain a
+ * copy of the License at
  *
- *  http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
  *
- * Unless required by applicable law or agreed to in writing, software
- * distributed 

[12/93] [partial] incubator-geode git commit: Added Spotless plugin to enforce formatting standards. Added Google Java Style guide formatter templates, removed existing formatter templates.

2016-10-26 Thread klund
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/8bf39571/geode-core/src/main/java/org/apache/geode/admin/jmx/internal/MX4JModelMBean.java
--
diff --git 
a/geode-core/src/main/java/org/apache/geode/admin/jmx/internal/MX4JModelMBean.java
 
b/geode-core/src/main/java/org/apache/geode/admin/jmx/internal/MX4JModelMBean.java
index 81f543d..d3f4ab2 100755
--- 
a/geode-core/src/main/java/org/apache/geode/admin/jmx/internal/MX4JModelMBean.java
+++ 
b/geode-core/src/main/java/org/apache/geode/admin/jmx/internal/MX4JModelMBean.java
@@ -1,9 +1,8 @@
 /*
- * Copyright (C) MX4J.
- * All rights reserved.
+ * Copyright (C) MX4J. All rights reserved.
  *
- * This software is distributed under the terms of the MX4J License version 
1.0.
- * See the terms of the MX4J License in the documentation provided with this 
software.
+ * This software is distributed under the terms of the MX4J License version 
1.0. See the terms of
+ * the MX4J License in the documentation provided with this software.
  */
 
 package org.apache.geode.admin.jmx.internal;
@@ -64,1176 +63,1170 @@ import org.apache.geode.internal.i18n.LocalizedStrings;
  * @author mailto:biorn_stee...@users.sourceforge.net;>Simone 
Bordet
  * @version $Revision: 1.14 $
  */
-public class MX4JModelMBean implements ModelMBean, MBeanRegistration, 
NotificationEmitter
-{
-   private static final String OBJECT_RESOURCE_TYPE = "ObjectReference";
-
-   private static final int ALWAYS_STALE = 1;
-   private static final int NEVER_STALE = 2;
-   private static final int STALE = 3;
-   private static final int NOT_STALE = 4;
-
-   private static final int PERSIST_NEVER = -1;
-   private static final int PERSIST_ON_TIMER = -2;
-   private static final int PERSIST_ON_UPDATE = -3;
-   private static final int PERSIST_NO_MORE_OFTEN_THAN = -4;
-
-   private MBeanServer m_mbeanServer;
-   private Object m_managedResource;
-   private boolean m_canBeRegistered;
-   private ModelMBeanInfo m_modelMBeanInfo;
-   private NotificationBroadcasterSupport m_attributeChangeBroadcaster = new 
NotificationBroadcasterSupport();
-   private NotificationBroadcasterSupport m_generalBroadcaster = new 
NotificationBroadcasterSupport();
-
-   public MX4JModelMBean() throws MBeanException, RuntimeOperationsException
-   {
-  try
-  {
- load();
+public class MX4JModelMBean implements ModelMBean, MBeanRegistration, 
NotificationEmitter {
+  private static final String OBJECT_RESOURCE_TYPE = "ObjectReference";
+
+  private static final int ALWAYS_STALE = 1;
+  private static final int NEVER_STALE = 2;
+  private static final int STALE = 3;
+  private static final int NOT_STALE = 4;
+
+  private static final int PERSIST_NEVER = -1;
+  private static final int PERSIST_ON_TIMER = -2;
+  private static final int PERSIST_ON_UPDATE = -3;
+  private static final int PERSIST_NO_MORE_OFTEN_THAN = -4;
+
+  private MBeanServer m_mbeanServer;
+  private Object m_managedResource;
+  private boolean m_canBeRegistered;
+  private ModelMBeanInfo m_modelMBeanInfo;
+  private NotificationBroadcasterSupport m_attributeChangeBroadcaster =
+  new NotificationBroadcasterSupport();
+  private NotificationBroadcasterSupport m_generalBroadcaster =
+  new NotificationBroadcasterSupport();
+
+  public MX4JModelMBean() throws MBeanException, RuntimeOperationsException {
+try {
+  load();
+} catch (Exception x) {
+  Logger logger = getLogger();
+  
logger.warn(LocalizedStrings.MX4JModelMBean_CANNOT_RESTORE_PREVIOUSLY_SAVED_STATUS
+  .toLocalizedString(), x);
+}
+  }
+
+  public MX4JModelMBean(ModelMBeanInfo info) throws MBeanException, 
RuntimeOperationsException {
+if (info == null)
+  throw new RuntimeOperationsException(new IllegalArgumentException(
+  LocalizedStrings.MX4JModelMBean_MODELMBEANINFO_PARAMETER_CANT_BE_NULL
+  .toLocalizedString()));
+else
+  setModelMBeanInfo(info);
+  }
+
+  private Logger getLogger() {
+return Log.getLogger(getClass().getName());
+  }
+
+  public ObjectName preRegister(MBeanServer server, ObjectName name) throws 
Exception {
+if (m_canBeRegistered) {
+  m_mbeanServer = server;
+  return name;
+} else {
+  throw new MBeanRegistrationException(new IllegalStateException(
+  
LocalizedStrings.MX4JModelMBean_MODELMBEAN_CANNOT_BE_REGISTERED_UNTIL_SETMODELMBEANINFO_HAS_BEEN_CALLED
+  .toLocalizedString()));
+}
+  }
+
+  public void postRegister(Boolean registrationDone) {
+if (!registrationDone.booleanValue())
+  clear();
+  }
+
+  public void preDeregister() throws Exception {}
+
+  public void postDeregister() {
+clear();
+  }
+
+  private void clear() {
+m_mbeanServer = null;
+m_managedResource = null;
+m_modelMBeanInfo = null;
+m_generalBroadcaster = null;
+m_attributeChangeBroadcaster = null;
+// PENDING: also remove generic listeners, attribute change 

[35/93] [partial] incubator-geode git commit: Added Spotless plugin to enforce formatting standards. Added Google Java Style guide formatter templates, removed existing formatter templates.

2016-10-26 Thread klund
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/8bf39571/geode-core/src/main/java/org/apache/geode/CancelCriterion.java
--
diff --git a/geode-core/src/main/java/org/apache/geode/CancelCriterion.java 
b/geode-core/src/main/java/org/apache/geode/CancelCriterion.java
index f0eb160..e4f9a41 100644
--- a/geode-core/src/main/java/org/apache/geode/CancelCriterion.java
+++ b/geode-core/src/main/java/org/apache/geode/CancelCriterion.java
@@ -1,32 +1,29 @@
 /*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
+ * Licensed to the Apache Software Foundation (ASF) under one or more 
contributor license
+ * agreements. See the NOTICE file distributed with this work for additional 
information regarding
+ * copyright ownership. The ASF licenses this file to You under the Apache 
License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance with the 
License. You may obtain a
+ * copy of the License at
  *
- *  http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
  *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software 
distributed under the License
+ * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 
KIND, either express
+ * or implied. See the License for the specific language governing permissions 
and limitations under
+ * the License.
  */
 package org.apache.geode;
 
 /**
  * Abstract cancellation proxy for cancelling an operation, esp. a thread.
  * 
- * Creators of services or threads should implement a subclass of 
CancelCriterion,
- * and implement the two methods - cancelInProgress, and 
generateCancelledException(e).
+ * Creators of services or threads should implement a subclass of 
CancelCriterion, and implement the
+ * two methods - cancelInProgress, and generateCancelledException(e).
  * 
  * Code inside the service can check to see if the service is cancelled by 
calling
- * {@link #checkCancelInProgress(Throwable)}. Generally the pattern is to check
- * before performing an operation, check if the service is canceled before 
propgrating 
- * an exception futher up the stack, and check for cancelation inside a long 
loop.
- * Eg.
+ * {@link #checkCancelInProgress(Throwable)}. Generally the pattern is to 
check before performing an
+ * operation, check if the service is canceled before propgrating an exception 
futher up the stack,
+ * and check for cancelation inside a long loop. Eg.
  * 
  * 
  * while(true) {
@@ -43,25 +40,25 @@ package org.apache.geode;
  * @see CancelException
  * @since GemFire 5.1
  */
-public abstract class CancelCriterion
-{
-  
+public abstract class CancelCriterion {
+
   /**
-   * Indicate if the service is in the progress of being cancelled.  The
-   * typical use of this is to indicate, in the case of an {@link 
InterruptedException},
-   * that the current operation should be cancelled.
-   * @return null if the service is not shutting down, or a message that can 
be used to
-   * construct an exception indicating the service is shut down.
+   * Indicate if the service is in the progress of being cancelled. The 
typical use of this is to
+   * indicate, in the case of an {@link InterruptedException}, that the 
current operation should be
+   * cancelled.
+   * 
+   * @return null if the service is not shutting down, or a message that can 
be used to construct an
+   * exception indicating the service is shut down.
*/
   public abstract String cancelInProgress();
-//import org.apache.geode.distributed.internal.DistributionManager;
-//* 
-//* In particular, a {@link DistributionManager} returns a non-null result 
if
-//* message distribution has been terminated.
-  
+  // import org.apache.geode.distributed.internal.DistributionManager;
+  // * 
+  // * In particular, a {@link DistributionManager} returns a non-null result 
if
+  // * message distribution has been terminated.
+
   /**
-   * Use this utility  function in your implementation of cancelInProgress()
-   * and cancelled() to indicate a system failure
+   * Use this utility function in your implementation of cancelInProgress() 
and cancelled() to
+   * indicate a system failure
* 
* @return failure string 

[01/93] [partial] incubator-geode git commit: Added Spotless plugin to enforce formatting standards. Added Google Java Style guide formatter templates, removed existing formatter templates. [Forced Up

2016-10-26 Thread klund
Repository: incubator-geode
Updated Branches:
  refs/heads/feature/GEODE-288 096b622d9 -> a672c7d3e (forced update)


http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/8bf39571/geode-core/src/main/java/org/apache/geode/cache/EntryNotFoundInRegion.java
--
diff --git 
a/geode-core/src/main/java/org/apache/geode/cache/EntryNotFoundInRegion.java 
b/geode-core/src/main/java/org/apache/geode/cache/EntryNotFoundInRegion.java
index 17105b1..ad0f516 100644
--- a/geode-core/src/main/java/org/apache/geode/cache/EntryNotFoundInRegion.java
+++ b/geode-core/src/main/java/org/apache/geode/cache/EntryNotFoundInRegion.java
@@ -1,18 +1,16 @@
 /*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
+ * Licensed to the Apache Software Foundation (ASF) under one or more 
contributor license
+ * agreements. See the NOTICE file distributed with this work for additional 
information regarding
+ * copyright ownership. The ASF licenses this file to You under the Apache 
License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance with the 
License. You may obtain a
+ * copy of the License at
  *
- *  http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
  *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software 
distributed under the License
+ * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 
KIND, either express
+ * or implied. See the License for the specific language governing permissions 
and limitations under
+ * the License.
  */
 package org.apache.geode.cache;
 
@@ -29,22 +27,26 @@ public class EntryNotFoundInRegion extends GemFireException 
{
 
   /**
* Generates an {@link InternalGemFireError}
+   * 
* @param msg the detail message
* @deprecated Do not create instances of this class.
*/
   @Deprecated
   public EntryNotFoundInRegion(String msg) {
-throw new 
InternalGemFireError(LocalizedStrings.EntryNotFoundInRegion_THIS_CLASS_IS_DEPRECATED.toLocalizedString());
+throw new InternalGemFireError(
+
LocalizedStrings.EntryNotFoundInRegion_THIS_CLASS_IS_DEPRECATED.toLocalizedString());
   }
 
   /**
* Generates an {@link InternalGemFireError}
+   * 
* @param msg the detail message
* @param cause the causal Throwable
* @deprecated do not create instances of this class.
*/
   @Deprecated
   public EntryNotFoundInRegion(String msg, Throwable cause) {
-throw new 
InternalGemFireError(LocalizedStrings.EntryNotFoundInRegion_THIS_CLASS_IS_DEPRECATED.toLocalizedString());
+throw new InternalGemFireError(
+
LocalizedStrings.EntryNotFoundInRegion_THIS_CLASS_IS_DEPRECATED.toLocalizedString());
   }
 }



[37/93] [partial] incubator-geode git commit: Added Spotless plugin to enforce formatting standards. Added Google Java Style guide formatter templates, removed existing formatter templates.

2016-10-26 Thread klund
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/8bf39571/geode-assembly/src/test/java/org/apache/geode/rest/internal/web/controllers/RestAPIsQueryAndFEJUnitTest.java
--
diff --git 
a/geode-assembly/src/test/java/org/apache/geode/rest/internal/web/controllers/RestAPIsQueryAndFEJUnitTest.java
 
b/geode-assembly/src/test/java/org/apache/geode/rest/internal/web/controllers/RestAPIsQueryAndFEJUnitTest.java
index 390f12d..5397b95 100644
--- 
a/geode-assembly/src/test/java/org/apache/geode/rest/internal/web/controllers/RestAPIsQueryAndFEJUnitTest.java
+++ 
b/geode-assembly/src/test/java/org/apache/geode/rest/internal/web/controllers/RestAPIsQueryAndFEJUnitTest.java
@@ -1,18 +1,16 @@
 /*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
+ * Licensed to the Apache Software Foundation (ASF) under one or more 
contributor license
+ * agreements. See the NOTICE file distributed with this work for additional 
information regarding
+ * copyright ownership. The ASF licenses this file to You under the Apache 
License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance with the 
License. You may obtain a
+ * copy of the License at
  *
- *  http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
  *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software 
distributed under the License
+ * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 
KIND, either express
+ * or implied. See the License for the specific language governing permissions 
and limitations under
+ * the License.
  */
 package org.apache.geode.rest.internal.web.controllers;
 
@@ -76,611 +74,252 @@ public class RestAPIsQueryAndFEJUnitTest {
   private Cache c;
 
   private String hostName;
-  
+
   private String baseURL;
-  
+
   private int restServicePort;
-  
+
   private final String CUSTOMER_REGION = "customers";
-  
+
   private final String ITEM_REGION = "items";
   private final String ORDER_REGION = "orders";
   private final String PRIMITIVE_KV_STORE_REGION = "primitiveKVStore";
   private final String UNKNOWN_REGION = "unknown_region";
   private final String EMPTY_REGION = "empty_region";
-  
+
   private Map queryResultByIndex;
- 
+
   private final String ORDER1_AS_JSON = "{"
   + "\"@type\": \"org.apache.geode.rest.internal.web.controllers.Order\","
   + "\"purchaseOrderNo\": 111," + "\"customerId\": 101,"
-  + "\"description\": \"Purchase order for company - A\"," + 
"\"orderDate\": \"01/10/2014\"," + "\"deliveryDate\": \"01/20/2014\","
-  + "\"contact\": \"Nilkanthkumar N Patel\","
+  + "\"description\": \"Purchase order for company - A\"," + 
"\"orderDate\": \"01/10/2014\","
+  + "\"deliveryDate\": \"01/20/2014\"," + "\"contact\": \"Nilkanthkumar N 
Patel\","
   + "\"email\": \"npa...@pivotal.io\"," + "\"phone\": \"020-2048096\"," + 
"\"totalPrice\": 205,"
-  + "\"items\":" + "[" + "{" + "\"itemNo\": 1,"
-  + "\"description\": \"Product-1\"," + "\"quantity\": 5,"
-  + "\"unitPrice\": 10," + "\"totalPrice\": 50" + "}," + "{"
-  + "\"itemNo\": 1," + "\"description\": \"Product-2\","
-  + "\"quantity\": 10," + "\"unitPrice\": 15.5," + "\"totalPrice\": 155"
-  + "}" + "]" + "}";
-  
+  + "\"items\":" + "[" + "{" + "\"itemNo\": 1," + "\"description\": 
\"Product-1\","
+  + "\"quantity\": 5," + "\"unitPrice\": 10," + "\"totalPrice\": 50" + 
"}," + "{"
+  + "\"itemNo\": 1," + "\"description\": \"Product-2\"," + "\"quantity\": 
10,"
+  + "\"unitPrice\": 15.5," + "\"totalPrice\": 155" + "}" + "]" + "}";
+
   private final String MALFORMED_JSON = "{"
   + "\"@type\" \"org.apache.geode.rest.internal.web.controllers.Order\","
   + "\"purchaseOrderNo\": 111," + "\"customerId\": 101,"
-  + "\"description\": \"Purchase order for company - A\"," + 
"\"orderDate\": \"01/10/2014\"," + "\"deliveryDate\": \"01/20/2014\","
-  + "\"contact\": \"Nilkanthkumar N Patel\","
+  + "\"description\": \"Purchase order for company - A\"," + 
"\"orderDate\": \"01/10/2014\","
+  + "\"deliveryDate\": \"01/20/2014\"," + "\"contact\": \"Nilkanthkumar N 
Patel\","
   + "\"email\": 

[13/93] [partial] incubator-geode git commit: Added Spotless plugin to enforce formatting standards. Added Google Java Style guide formatter templates, removed existing formatter templates.

2016-10-26 Thread klund
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/8bf39571/geode-core/src/main/java/org/apache/geode/admin/jmx/internal/DistributionLocatorJmxImpl.java
--
diff --git 
a/geode-core/src/main/java/org/apache/geode/admin/jmx/internal/DistributionLocatorJmxImpl.java
 
b/geode-core/src/main/java/org/apache/geode/admin/jmx/internal/DistributionLocatorJmxImpl.java
index ad60682..65c2477 100755
--- 
a/geode-core/src/main/java/org/apache/geode/admin/jmx/internal/DistributionLocatorJmxImpl.java
+++ 
b/geode-core/src/main/java/org/apache/geode/admin/jmx/internal/DistributionLocatorJmxImpl.java
@@ -1,81 +1,78 @@
 /*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
+ * Licensed to the Apache Software Foundation (ASF) under one or more 
contributor license
+ * agreements. See the NOTICE file distributed with this work for additional 
information regarding
+ * copyright ownership. The ASF licenses this file to You under the Apache 
License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance with the 
License. You may obtain a
+ * copy of the License at
  *
- *  http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
  *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software 
distributed under the License
+ * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 
KIND, either express
+ * or implied. See the License for the specific language governing permissions 
and limitations under
+ * the License.
  */
 package org.apache.geode.admin.jmx.internal;
 
-//import org.apache.geode.admin.AdminException;
-//import org.apache.geode.admin.DistributionLocator;
+// import org.apache.geode.admin.AdminException;
+// import org.apache.geode.admin.DistributionLocator;
 import org.apache.geode.admin.DistributionLocatorConfig;
 import org.apache.geode.admin.internal.AdminDistributedSystemImpl;
 import org.apache.geode.internal.i18n.LocalizedStrings;
-//import org.apache.geode.internal.Assert;
-
-//import org.apache.commons.modeler.ManagedBean;
-//import org.apache.commons.modeler.AttributeInfo;
-
-//import java.util.Date;
-//import java.util.Set;
-
-//import javax.management.Attribute;
-//import javax.management.AttributeList;
-//import javax.management.Descriptor;
-//import javax.management.JMException;
-//import javax.management.MBeanServer;
-//import javax.management.MalformedObjectNameException;
-//import javax.management.Notification;
-//import javax.management.NotificationListener;
+// import org.apache.geode.internal.Assert;
+
+// import org.apache.commons.modeler.ManagedBean;
+// import org.apache.commons.modeler.AttributeInfo;
+
+// import java.util.Date;
+// import java.util.Set;
+
+// import javax.management.Attribute;
+// import javax.management.AttributeList;
+// import javax.management.Descriptor;
+// import javax.management.JMException;
+// import javax.management.MBeanServer;
+// import javax.management.MalformedObjectNameException;
+// import javax.management.Notification;
+// import javax.management.NotificationListener;
 import javax.management.ObjectName;
-//import javax.management.modelmbean.DescriptorSupport;
+// import javax.management.modelmbean.DescriptorSupport;
 import javax.management.modelmbean.ModelMBean;
-//import javax.management.modelmbean.ModelMBeanAttributeInfo;
+// import javax.management.modelmbean.ModelMBeanAttributeInfo;
 
 /**
  * Provides MBean support for managing a distribution locator.
  *
  */
-public class DistributionLocatorJmxImpl 
-extends org.apache.geode.admin.internal.DistributionLocatorImpl
-implements org.apache.geode.admin.jmx.internal.ManagedResource,
-   DistributionLocatorConfig {
+public class DistributionLocatorJmxImpl
+extends org.apache.geode.admin.internal.DistributionLocatorImpl
+implements org.apache.geode.admin.jmx.internal.ManagedResource, 
DistributionLocatorConfig {
 
   /** The JMX object name of this managed resource */
   private ObjectName objectName;
 
   // -
-  //   Constructor(s)
+  // Constructor(s)
   // -
-  
+
   /**
-   * 

[06/93] [partial] incubator-geode git commit: Added Spotless plugin to enforce formatting standards. Added Google Java Style guide formatter templates, removed existing formatter templates.

2016-10-26 Thread klund
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/8bf39571/geode-core/src/main/java/org/apache/geode/cache/AttributesMutator.java
--
diff --git 
a/geode-core/src/main/java/org/apache/geode/cache/AttributesMutator.java 
b/geode-core/src/main/java/org/apache/geode/cache/AttributesMutator.java
index d3aaf9c..51301bc 100644
--- a/geode-core/src/main/java/org/apache/geode/cache/AttributesMutator.java
+++ b/geode-core/src/main/java/org/apache/geode/cache/AttributesMutator.java
@@ -1,32 +1,28 @@
 /*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
+ * Licensed to the Apache Software Foundation (ASF) under one or more 
contributor license
+ * agreements. See the NOTICE file distributed with this work for additional 
information regarding
+ * copyright ownership. The ASF licenses this file to You under the Apache 
License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance with the 
License. You may obtain a
+ * copy of the License at
  *
- *  http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
  *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software 
distributed under the License
+ * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 
KIND, either express
+ * or implied. See the License for the specific language governing permissions 
and limitations under
+ * the License.
  */
 
 package org.apache.geode.cache;
 
 
 /**
- * Supports modification of certain region attributes after the region has been
- * created. It is recommended that the attributes be completely initialized
- * using an {@link AttributesFactory} before creating the region instead of
- * using an AttributesMutator after region creation. This will
- * avoid a potential performance penalty due to the additional
- * network traffic.
- *
- * The setter methods all return the previous value of the attribute. 
+ * Supports modification of certain region attributes after the region has 
been created. It is
+ * recommended that the attributes be completely initialized using an {@link 
AttributesFactory}
+ * before creating the region instead of using an 
AttributesMutator after region
+ * creation. This will avoid a potential performance penalty due to the 
additional network traffic.
+ * 
+ * The setter methods all return the previous value of the attribute.
  *
  *
  *
@@ -35,176 +31,195 @@ package org.apache.geode.cache;
  * @see AttributesFactory
  * @since GemFire 3.0
  */
-public interface AttributesMutator {
-  
-  /** Returns the Region whose attributes this mutator affects.
+public interface AttributesMutator {
+
+  /**
+   * Returns the Region whose attributes this mutator affects.
+   * 
* @return the Region this mutator affects
*/
-  public Region getRegion();
-  
-  /** Changes the timeToLive expiration attributes for the region as a whole
+  public Region getRegion();
+
+  /**
+   * Changes the timeToLive expiration attributes for the region as a whole
*
* @param timeToLive the expiration attributes for the region timeToLive
* @return the previous value of region timeToLive
-   * @throws IllegalArgumentException if timeToLive is null or if the
-   * ExpirationAction is LOCAL_INVALIDATE and the region is
-   * {@link DataPolicy#withReplication replicated}
+   * @throws IllegalArgumentException if timeToLive is null or if the 
ExpirationAction is
+   * LOCAL_INVALIDATE and the region is {@link 
DataPolicy#withReplication replicated}
* @throws IllegalStateException if statistics are disabled for this region.
*/
   public ExpirationAttributes setRegionTimeToLive(ExpirationAttributes 
timeToLive);
-  
-  /** Changes the idleTimeout expiration attributes for the region as a whole.
-   * Resets the {@link CacheStatistics#getLastAccessedTime} for the region.
+
+  /**
+   * Changes the idleTimeout expiration attributes for the region as a whole. 
Resets the
+   * {@link CacheStatistics#getLastAccessedTime} for the region.
*
* @param idleTimeout the ExpirationAttributes for this region idleTimeout
* @return the previous value of region idleTimeout
-   * @throws IllegalArgumentException if idleTimeout is 

[24/93] [partial] incubator-geode git commit: Added Spotless plugin to enforce formatting standards. Added Google Java Style guide formatter templates, removed existing formatter templates.

2016-10-26 Thread klund
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/8bf39571/geode-core/src/main/java/org/apache/geode/admin/internal/AdminDistributedSystemImpl.java
--
diff --git 
a/geode-core/src/main/java/org/apache/geode/admin/internal/AdminDistributedSystemImpl.java
 
b/geode-core/src/main/java/org/apache/geode/admin/internal/AdminDistributedSystemImpl.java
index aba79d2..59fce55 100755
--- 
a/geode-core/src/main/java/org/apache/geode/admin/internal/AdminDistributedSystemImpl.java
+++ 
b/geode-core/src/main/java/org/apache/geode/admin/internal/AdminDistributedSystemImpl.java
@@ -1,18 +1,16 @@
 /*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
+ * Licensed to the Apache Software Foundation (ASF) under one or more 
contributor license
+ * agreements. See the NOTICE file distributed with this work for additional 
information regarding
+ * copyright ownership. The ASF licenses this file to You under the Apache 
License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance with the 
License. You may obtain a
+ * copy of the License at
  *
- *  http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
  *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software 
distributed under the License
+ * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 
KIND, either express
+ * or implied. See the License for the specific language governing permissions 
and limitations under
+ * the License.
  */
 package org.apache.geode.admin.internal;
 
@@ -54,22 +52,21 @@ import static 
org.apache.geode.distributed.ConfigurationProperties.*;
 /**
  * Represents a GemFire distributed system for remote 
administration/management.
  *
- * @since GemFire 3.5
+ * @since GemFire 3.5
  */
-public class AdminDistributedSystemImpl
-implements org.apache.geode.admin.AdminDistributedSystem,
-   org.apache.geode.internal.admin.JoinLeaveListener,
-   org.apache.geode.internal.admin.AlertListener,
-   
org.apache.geode.distributed.internal.InternalDistributedSystem.DisconnectListener
 {
+public class AdminDistributedSystemImpl implements 
org.apache.geode.admin.AdminDistributedSystem,
+org.apache.geode.internal.admin.JoinLeaveListener,
+org.apache.geode.internal.admin.AlertListener,
+
org.apache.geode.distributed.internal.InternalDistributedSystem.DisconnectListener
 {
 
   private static final Logger logger = LogService.getLogger();
-  
+
   /** String identity of this distributed system */
   private String id;
-  
+
   /** Latest alert broadcast by any system members */
   private Alert latestAlert;
-  
+
   // -
 
   /** Internal admin agent to delegate low-level work to */
@@ -80,7 +77,7 @@ implements org.apache.geode.admin.AdminDistributedSystem,
 
   /** Set of non-Manager members in this system */
   private final Set applicationSet = new HashSet();
-  
+
   /** Set of DistributionLocators for this system */
   private final Set locatorSet = new HashSet();
 
@@ -89,70 +86,69 @@ implements org.apache.geode.admin.AdminDistributedSystem,
 
   /** Configuration defining this distributed system */
   private final DistributedSystemConfigImpl config;
-  
+
   /** Controller for starting and stopping managed entities */
   private ManagedEntityController controller;
-  
+
   /** Log file collator for gathering and merging system member logs */
   private LogCollator logCollator = new LogCollator();
-  
-  /** The level above which alerts will be delivered to the alert
-   * listeners */
+
+  /**
+   * The level above which alerts will be delivered to the alert listeners
+   */
   private AlertLevel alertLevel = AlertLevel.WARNING;
 
   /** The alert listeners registered on this distributed system. */
   private volatile Set alertListeners = Collections.emptySet();
   private final Object alertLock = new Object();
-  
+
   private LogWriterAppender logWriterAppender;
-  
+
   private InternalLogWriter logWriter;
-  
+
   /** The membership listeners registered on this distributed system */
   private volatile Set membershipListeners = Collections.EMPTY_SET;
   private final Object 

[14/93] [partial] incubator-geode git commit: Added Spotless plugin to enforce formatting standards. Added Google Java Style guide formatter templates, removed existing formatter templates.

2016-10-26 Thread klund
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/8bf39571/geode-core/src/main/java/org/apache/geode/admin/jmx/internal/AgentLauncher.java
--
diff --git 
a/geode-core/src/main/java/org/apache/geode/admin/jmx/internal/AgentLauncher.java
 
b/geode-core/src/main/java/org/apache/geode/admin/jmx/internal/AgentLauncher.java
index b87792d..6a1bd63 100644
--- 
a/geode-core/src/main/java/org/apache/geode/admin/jmx/internal/AgentLauncher.java
+++ 
b/geode-core/src/main/java/org/apache/geode/admin/jmx/internal/AgentLauncher.java
@@ -1,18 +1,16 @@
 /*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
+ * Licensed to the Apache Software Foundation (ASF) under one or more 
contributor license
+ * agreements. See the NOTICE file distributed with this work for additional 
information regarding
+ * copyright ownership. The ASF licenses this file to You under the Apache 
License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance with the 
License. You may obtain a
+ * copy of the License at
  *
- *  http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
  *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software 
distributed under the License
+ * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 
KIND, either express
+ * or implied. See the License for the specific language governing permissions 
and limitations under
+ * the License.
  */
 package org.apache.geode.admin.jmx.internal;
 
@@ -55,18 +53,19 @@ import org.apache.geode.internal.util.IOUtils;
 import org.apache.geode.internal.util.JavaCommandBuilder;
 
 /**
- * A command line utility inspired by the CacheServerLauncher 
that is responsible for administering
- * a stand-along GemFire JMX {@link Agent}.
+ * A command line utility inspired by the CacheServerLauncher 
that is responsible for
+ * administering a stand-along GemFire JMX {@link Agent}.
  * 
+ * 
  * @since GemFire 3.5
  */
 public class AgentLauncher {
 
   private static final Logger logger = LogService.getLogger();
-  
+
   /** Should the launch command be printed? */
-  public static final boolean PRINT_LAUNCH_COMMAND = 
Boolean.getBoolean(AgentLauncher.class.getSimpleName()
-  + ".PRINT_LAUNCH_COMMAND");
+  public static final boolean PRINT_LAUNCH_COMMAND =
+  Boolean.getBoolean(AgentLauncher.class.getSimpleName() + 
".PRINT_LAUNCH_COMMAND");
 
   /* constants used to define state */
   static final int SHUTDOWN = 0;
@@ -79,7 +78,10 @@ public class AgentLauncher {
   /** Agent configuration options */
   static final String AGENT_PROPS = "agent-props";
 
-  /** A flag to indicate if the current log file should be kept. Used only 
when 'start' is used to fork off the 'server' */
+  /**
+   * A flag to indicate if the current log file should be kept. Used only when 
'start' is used to
+   * fork off the 'server'
+   */
   static final String APPENDTO_LOG_FILE = "appendto-log-file";
 
   /** optional and additional classpath entries */
@@ -107,10 +109,11 @@ public class AgentLauncher {
   private final String statusFileName;
 
   /**
-   * Instantiates an AgentLauncher for execution and control of the GemFire 
JMX Agent process.  This constructor is
-   * package private to prevent direct instantiation or subclassing by classes 
outside this package, but does allow
-   * the class to be tested as needed.
+   * Instantiates an AgentLauncher for execution and control of the GemFire 
JMX Agent process. This
+   * constructor is package private to prevent direct instantiation or 
subclassing by classes
+   * outside this package, but does allow the class to be tested as needed.
* 
+   * 
* @param basename base name for the application to be launched
*/
   AgentLauncher(final String basename) {
@@ -135,15 +138,17 @@ public class AgentLauncher {
 SortedMap map = new TreeMap();
 
 int maxLength = 0;
-for (Iterator iter = props.keySet().iterator(); iter.hasNext(); ) {
+for (Iterator iter = props.keySet().iterator(); iter.hasNext();) {
   String prop = (String) iter.next();
   int length = prop.length();
   if (length > maxLength) {
 maxLength = length;

[47/93] [partial] incubator-geode git commit: Added Spotless plugin to enforce formatting standards. Added Google Java Style guide formatter templates, removed existing formatter templates.

2016-10-26 Thread klund
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/8bf39571/extensions/geode-modules-session/src/main/java/org/apache/geode/modules/session/filter/SessionCachingFilter.java
--
diff --git 
a/extensions/geode-modules-session/src/main/java/org/apache/geode/modules/session/filter/SessionCachingFilter.java
 
b/extensions/geode-modules-session/src/main/java/org/apache/geode/modules/session/filter/SessionCachingFilter.java
index ed1ffab..71aa768 100644
--- 
a/extensions/geode-modules-session/src/main/java/org/apache/geode/modules/session/filter/SessionCachingFilter.java
+++ 
b/extensions/geode-modules-session/src/main/java/org/apache/geode/modules/session/filter/SessionCachingFilter.java
@@ -1,19 +1,17 @@
 /*
-* Licensed to the Apache Software Foundation (ASF) under one or more
-* contributor license agreements.  See the NOTICE file distributed with
-* this work for additional information regarding copyright ownership.
-* The ASF licenses this file to You under the Apache License, Version 2.0
-* (the "License"); you may not use this file except in compliance with
-* the License.  You may obtain a copy of the License at
-*
-*  http://www.apache.org/licenses/LICENSE-2.0
-*
-* Unless required by applicable law or agreed to in writing, software
-* distributed under the License is distributed on an "AS IS" BASIS,
-* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-* See the License for the specific language governing permissions and
-* limitations under the License.
-*/
+ * Licensed to the Apache Software Foundation (ASF) under one or more 
contributor license
+ * agreements. See the NOTICE file distributed with this work for additional 
information regarding
+ * copyright ownership. The ASF licenses this file to You under the Apache 
License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance with the 
License. You may obtain a
+ * copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software 
distributed under the License
+ * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 
KIND, either express
+ * or implied. See the License for the specific language governing permissions 
and limitations under
+ * the License.
+ */
 
 package org.apache.geode.modules.session.filter;
 
@@ -36,51 +34,48 @@ import java.util.concurrent.CountDownLatch;
 import java.util.concurrent.atomic.AtomicInteger;
 
 /**
- * Primary class which orchestrates everything. This is the class which gets
- * configured in the web.xml.
+ * Primary class which orchestrates everything. This is the class which gets 
configured in the
+ * web.xml.
  */
 public class SessionCachingFilter implements Filter {
 
   /**
* Logger instance
*/
-  private static final Logger LOG =
-  LoggerFactory.getLogger(SessionCachingFilter.class.getName());
+  private static final Logger LOG = 
LoggerFactory.getLogger(SessionCachingFilter.class.getName());
 
   /**
-   * The filter configuration object we are associated with.  If this value is
-   * null, this filter instance is not currently configured.
+   * The filter configuration object we are associated with. If this value is 
null, this filter
+   * instance is not currently configured.
*/
   private FilterConfig filterConfig = null;
 
   /**
-   * Some containers will want to instantiate multiple instances of this 
filter,
-   * but we only need one SessionManager
+   * Some containers will want to instantiate multiple instances of this 
filter, but we only need
+   * one SessionManager
*/
   private static SessionManager manager = null;
 
   /**
* Can be overridden during testing.
*/
-  private static AtomicInteger started =
-  new AtomicInteger(
-  Integer.getInteger(DistributionConfig.GEMFIRE_PREFIX + 
"override.session.manager.count", 1));
+  private static AtomicInteger started = new AtomicInteger(
+  Integer.getInteger(DistributionConfig.GEMFIRE_PREFIX + 
"override.session.manager.count", 1));
 
-  private static int percentInactiveTimeTriggerRebuild =
-  Integer.getInteger(DistributionConfig.GEMFIRE_PREFIX + 
"session.inactive.trigger.rebuild", 80);
+  private static int percentInactiveTimeTriggerRebuild = Integer
+  .getInteger(DistributionConfig.GEMFIRE_PREFIX + 
"session.inactive.trigger.rebuild", 80);
 
   /**
-   * This latch ensures that at least one thread/instance has fired up the
-   * session manager before any other threads complete the init method.
+   * This latch ensures that at least one thread/instance has fired up the 
session manager before
+   * any other threads complete the init method.
*/
   private static CountDownLatch startingLatch = new CountDownLatch(1);
 
   /**
-   * This request wrapper class extends the support class
-   * HttpServletRequestWrapper, which implements all the methods 

[38/93] [partial] incubator-geode git commit: Added Spotless plugin to enforce formatting standards. Added Google Java Style guide formatter templates, removed existing formatter templates.

2016-10-26 Thread klund
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/8bf39571/geode-assembly/src/test/java/org/apache/geode/rest/internal/web/controllers/RestAPIsAndInterOpsDUnitTest.java
--
diff --git 
a/geode-assembly/src/test/java/org/apache/geode/rest/internal/web/controllers/RestAPIsAndInterOpsDUnitTest.java
 
b/geode-assembly/src/test/java/org/apache/geode/rest/internal/web/controllers/RestAPIsAndInterOpsDUnitTest.java
index 0299615..c90a7a4 100644
--- 
a/geode-assembly/src/test/java/org/apache/geode/rest/internal/web/controllers/RestAPIsAndInterOpsDUnitTest.java
+++ 
b/geode-assembly/src/test/java/org/apache/geode/rest/internal/web/controllers/RestAPIsAndInterOpsDUnitTest.java
@@ -1,18 +1,16 @@
 /*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
+ * Licensed to the Apache Software Foundation (ASF) under one or more 
contributor license
+ * agreements. See the NOTICE file distributed with this work for additional 
information regarding
+ * copyright ownership. The ASF licenses this file to You under the Apache 
License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance with the 
License. You may obtain a
+ * copy of the License at
  *
- *  http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
  *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software 
distributed under the License
+ * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 
KIND, either express
+ * or implied. See the License for the specific language governing permissions 
and limitations under
+ * the License.
  */
 package org.apache.geode.rest.internal.web.controllers;
 
@@ -100,91 +98,75 @@ public class RestAPIsAndInterOpsDUnitTest extends 
LocatorTestBase {
 
   public static final String PEOPLE_REGION_NAME = "People";
 
-  //private static RestTemplate restTemplate;
-
-  private static final String findAllPeopleQuery = 
"/queries?id=findAllPeople=SELECT%20*%20FROM%20/People";
-  private static final String findPeopleByGenderQuery = 
"/queries?id=filterByGender=SELECT%20*%20from%20/People%20where%20gender=$1";
-  private static final String findPeopleByLastNameQuery = 
"/queries?id=filterByLastName=SELECT%20*%20from%20/People%20where%20lastName=$1";
-
-  private static final String[] PARAM_QUERY_IDS_ARRAY = { "findAllPeople",
-  "filterByGender", "filterByLastName" };
-
-  final static String QUERY_ARGS = "["
-  + "{"
-  + "\"@type\": \"string\","
-  + "\"@value\": \"Patel\""
-  + "}"
-  + "]";
-
-  final static String PERSON_AS_JSON_CAS = "{"
-  + "\"@old\" :"
-  + "{"
-  + "\"@type\": \"org.apache.geode.rest.internal.web.controllers.Person\","
-  + "\"id\": 101," + " \"firstName\": \"Mithali\","
-  + " \"middleName\": \"Dorai\"," + " \"lastName\": \"Raj\","
-  + " \"birthDate\": \"12/04/1982\"," + "\"gender\": \"FEMALE\""
-  + "},"
-  + "\"@new\" :"
-  + "{"
-  + "\"@type\": \"org.apache.geode.rest.internal.web.controllers.Person\","
-  + "\"id\": 1101," + " \"firstName\": \"Virat\","
-  + " \"middleName\": \"Premkumar\"," + " \"lastName\": \"Kohli\","
-  + " \"birthDate\": \"08/11/1988\"," + "\"gender\": \"MALE\""
-  + "}"
-  + "}";
-
-  final static String PERSON_AS_JSON_REPLACE = "{"
-  + "\"@type\": \"org.apache.geode.rest.internal.web.controllers.Person\","
-  + "\"id\": 501," + " \"firstName\": \"Barack\","
-  + " \"middleName\": \"Hussein\"," + " \"lastName\": \"Obama\","
-  + " \"birthDate\": \"04/08/1961\"," + "\"gender\": \"MALE\""
-  + "}";
+  // private static RestTemplate restTemplate;
+
+  private static final String findAllPeopleQuery =
+  "/queries?id=findAllPeople=SELECT%20*%20FROM%20/People";
+  private static final String findPeopleByGenderQuery =
+  
"/queries?id=filterByGender=SELECT%20*%20from%20/People%20where%20gender=$1";
+  private static final String findPeopleByLastNameQuery =
+  
"/queries?id=filterByLastName=SELECT%20*%20from%20/People%20where%20lastName=$1";
+
+  private static final String[] PARAM_QUERY_IDS_ARRAY =
+  {"findAllPeople", "filterByGender", "filterByLastName"};
+
+  final static String QUERY_ARGS =
+  "[" + 

[21/93] [partial] incubator-geode git commit: Added Spotless plugin to enforce formatting standards. Added Google Java Style guide formatter templates, removed existing formatter templates.

2016-10-26 Thread klund
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/8bf39571/geode-core/src/main/java/org/apache/geode/admin/internal/EnabledManagedEntityController.java
--
diff --git 
a/geode-core/src/main/java/org/apache/geode/admin/internal/EnabledManagedEntityController.java
 
b/geode-core/src/main/java/org/apache/geode/admin/internal/EnabledManagedEntityController.java
index 20871d8..59e8386 100755
--- 
a/geode-core/src/main/java/org/apache/geode/admin/internal/EnabledManagedEntityController.java
+++ 
b/geode-core/src/main/java/org/apache/geode/admin/internal/EnabledManagedEntityController.java
@@ -1,18 +1,16 @@
 /*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
+ * Licensed to the Apache Software Foundation (ASF) under one or more 
contributor license
+ * agreements. See the NOTICE file distributed with this work for additional 
information regarding
+ * copyright ownership. The ASF licenses this file to You under the Apache 
License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance with the 
License. You may obtain a
+ * copy of the License at
  *
- *  http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
  *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software 
distributed under the License
+ * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 
KIND, either express
+ * or implied. See the License for the specific language governing permissions 
and limitations under
+ * the License.
  */
 package org.apache.geode.admin.internal;
 
@@ -35,35 +33,28 @@ import java.util.Properties;
 import static org.apache.geode.distributed.ConfigurationProperties.*;
 
 /**
- * Implements the actual administration (starting, stopping, etc.) of
- * GemFire {@link ManagedEntity}s.  It {@link Runtime#exec(java.lang.String) 
executes}
- * commands to administer the entities based on information provided
- * by the {@link InternalManagedEntity} object.  Note that it does not
- * use SystemAdmin to manage "local" entities; it always
- * execs the scripts.
+ * Implements the actual administration (starting, stopping, etc.) of GemFire
+ * {@link ManagedEntity}s. It {@link Runtime#exec(java.lang.String) executes} 
commands to administer
+ * the entities based on information provided by the {@link 
InternalManagedEntity} object. Note that
+ * it does not use SystemAdmin to manage "local" entities; it 
always execs the scripts.
  *
  * 
  *
- * This class is a refactoring of Systemcontroller,
- * RemoteCommand, and LocatorRemoteCommand.
+ * This class is a refactoring of Systemcontroller, 
RemoteCommand, and
+ * LocatorRemoteCommand.
  *
  * @since GemFire 4.0
  */
 class EnabledManagedEntityController implements ManagedEntityController {
   private static final Logger logger = LogService.getLogger();
 
-//  /** A lock to ensure that only entity is managed at a time.  See bug
-//   * 31374. */
-//  private static Object startStopLock = new Object();
+  // /** A lock to ensure that only entity is managed at a time. See bug
+  // * 31374. */
+  // private static Object startStopLock = new Object();
 
   /** Known strings found in output indicating error. */
-  private static final String[] ERROR_OUTPUTS = new String[] {
-"No such file or directory",
-"The system cannot find the file specified.",
-"Access is denied.",
-"cannot open",
-"ERROR"
-  };
+  private static final String[] ERROR_OUTPUTS = new String[] {"No such file or 
directory",
+  "The system cannot find the file specified.", "Access is denied.", 
"cannot open", "ERROR"};
 
   /** Token in command prefix to be replaced with actual HOST */
   private static final String HOST = "{HOST}";
@@ -71,39 +62,41 @@ class EnabledManagedEntityController implements 
ManagedEntityController {
   /** Token in command prefix to be replaced with actual execution CMD */
   private static final String CMD = "{CMD}";
 
-  //  Instance Fields  //
+  // Instance Fields //
 
-  /** The thread group in which threads launched by this system
-   * controller reside. */
+  /**
+   * The thread group in which threads launched by 

[09/93] [partial] incubator-geode git commit: Added Spotless plugin to enforce formatting standards. Added Google Java Style guide formatter templates, removed existing formatter templates.

2016-10-26 Thread klund
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/8bf39571/geode-core/src/main/java/org/apache/geode/admin/jmx/internal/RMIRegistryService.java
--
diff --git 
a/geode-core/src/main/java/org/apache/geode/admin/jmx/internal/RMIRegistryService.java
 
b/geode-core/src/main/java/org/apache/geode/admin/jmx/internal/RMIRegistryService.java
index 6bf240f..1ba6b84 100644
--- 
a/geode-core/src/main/java/org/apache/geode/admin/jmx/internal/RMIRegistryService.java
+++ 
b/geode-core/src/main/java/org/apache/geode/admin/jmx/internal/RMIRegistryService.java
@@ -1,18 +1,16 @@
 /*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
+ * Licensed to the Apache Software Foundation (ASF) under one or more 
contributor license
+ * agreements. See the NOTICE file distributed with this work for additional 
information regarding
+ * copyright ownership. The ASF licenses this file to You under the Apache 
License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance with the 
License. You may obtain a
+ * copy of the License at
  *
- *  http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
  *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software 
distributed under the License
+ * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 
KIND, either express
+ * or implied. See the License for the specific language governing permissions 
and limitations under
+ * the License.
  */
 package org.apache.geode.admin.jmx.internal;
 
@@ -45,36 +43,31 @@ public class RMIRegistryService implements 
RMIRegistryServiceMBean {
   private boolean isRunning;
 
   /**
-   * Constructor to configure RMI Registry to start using default RMI Registry 
-   * port: {@link Registry#REGISTRY_PORT}
+   * Constructor to configure RMI Registry to start using default RMI Registry 
port:
+   * {@link Registry#REGISTRY_PORT}
*/
   public RMIRegistryService() {
 this(Registry.REGISTRY_PORT);
   }
 
   /**
-   * Constructor to configure RMI Registry to start using given RMI Registry
-   * port.
+   * Constructor to configure RMI Registry to start using given RMI Registry 
port.
* 
-   * @param port
-   *  to run RMI Registry on
+   * @param port to run RMI Registry on
*/
   public RMIRegistryService(int port) {
 setPort(port);
   }
 
   /**
-   * Constructor to configure RMI Registry to start using given RMI Registry
-   * port & host bind address.
+   * Constructor to configure RMI Registry to start using given RMI Registry 
port & host bind
+   * address.
* 
-   * @param host
-   *  to bind RMI Registry to
-   * @param port
-   *  to run RMI Registry on
+   * @param host to bind RMI Registry to
+   * @param port to run RMI Registry on
* 
-   * @throws UnknownHostException
-   *   if IP Address can not be resolved for the given host string 
while
-   *   creating the RMIServerSocketFactory
+   * @throws UnknownHostException if IP Address can not be resolved for the 
given host string while
+   * creating the RMIServerSocketFactory
*/
   public RMIRegistryService(String host, int port) throws UnknownHostException 
{
 setPort(port);
@@ -83,7 +76,7 @@ public class RMIRegistryService implements 
RMIRegistryServiceMBean {
   ssf = new RMIServerSocketFactoryImpl(host);
 }
   }
-  
+
   /**
* Returns the host on which rmiregistry listens for incoming connections
*
@@ -96,16 +89,15 @@ public class RMIRegistryService implements 
RMIRegistryServiceMBean {
   /**
* Sets the host on which rmiregistry listens for incoming connections
* 
-   * @param host
-   *  the host on which rmiregistry listens for incoming connections
+   * @param host the host on which rmiregistry listens for incoming connections
*/
   protected void setHost(String host) {
-if (isRunning()) { 
+if (isRunning()) {
   throw new IllegalStateException("RMIRegistryService is running, cannot 
change the host");
 }
 this.host = host;
   }
-  
+
   /**
* Returns the port on which rmiregistry listens for incoming connections
* 
@@ -118,11 +110,10 @@ public class RMIRegistryService implements 

[26/93] [partial] incubator-geode git commit: Added Spotless plugin to enforce formatting standards. Added Google Java Style guide formatter templates, removed existing formatter templates.

2016-10-26 Thread klund
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/8bf39571/geode-core/src/main/java/org/apache/geode/admin/SystemMemberBridgeServer.java
--
diff --git 
a/geode-core/src/main/java/org/apache/geode/admin/SystemMemberBridgeServer.java 
b/geode-core/src/main/java/org/apache/geode/admin/SystemMemberBridgeServer.java
index 71fb7e1..7a1fb1a 100644
--- 
a/geode-core/src/main/java/org/apache/geode/admin/SystemMemberBridgeServer.java
+++ 
b/geode-core/src/main/java/org/apache/geode/admin/SystemMemberBridgeServer.java
@@ -1,26 +1,24 @@
 /*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
+ * Licensed to the Apache Software Foundation (ASF) under one or more 
contributor license
+ * agreements. See the NOTICE file distributed with this work for additional 
information regarding
+ * copyright ownership. The ASF licenses this file to You under the Apache 
License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance with the 
License. You may obtain a
+ * copy of the License at
  *
- *  http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
  *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software 
distributed under the License
+ * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 
KIND, either express
+ * or implied. See the License for the specific language governing permissions 
and limitations under
+ * the License.
  */
 package org.apache.geode.admin;
 
 import org.apache.geode.cache.server.ServerLoadProbe;
 
 /**
- * Administrative interface that represents a CacheServer that
- * serves the contents of a system member's cache. 
+ * Administrative interface that represents a CacheServer that serves the 
contents of a system
+ * member's cache.
  *
  * @see SystemMemberCache#addCacheServer
  *
@@ -30,39 +28,33 @@ import org.apache.geode.cache.server.ServerLoadProbe;
 @Deprecated
 public interface SystemMemberBridgeServer {
 
-  /** 
-   * Returns the port on which this bridge server listens for bridge
-   * clients to connect.
+  /**
+   * Returns the port on which this bridge server listens for bridge clients 
to connect.
*/
   public int getPort();
 
   /**
-   * Sets the port on which this bridge server listens for bridge
-   * clients to connect.
+   * Sets the port on which this bridge server listens for bridge clients to 
connect.
*
-   * @throws AdminException
-   * If this bridge server is running
+   * @throws AdminException If this bridge server is running
*/
   public void setPort(int port) throws AdminException;
 
   /**
-   * Starts this bridge server.  Once the server is running, its
-   * configuration cannot be changed.
+   * Starts this bridge server. Once the server is running, its configuration 
cannot be changed.
*
-   * @throws AdminException
-   * If an error occurs while starting the bridge server
+   * @throws AdminException If an error occurs while starting the bridge server
*/
   public void start() throws AdminException;
 
-  /** 
+  /**
* Returns whether or not this bridge server is running
*/
   public boolean isRunning();
 
   /**
-   * Stops this bridge server.  Note that the
-   * BridgeServer can be reconfigured and restarted if
-   * desired.
+   * Stops this bridge server. Note that the BridgeServer can be 
reconfigured and
+   * restarted if desired.
*/
   public void stop() throws AdminException;
 
@@ -72,80 +64,87 @@ public interface SystemMemberBridgeServer {
   public void refresh();
 
   /**
-   * Returns a string representing the ip address or host name that this server
-   * will listen on.
+   * Returns a string representing the ip address or host name that this 
server will listen on.
+   * 
* @return the ip address or host name that this server is to listen on
* @since GemFire 5.7
*/
   public String getBindAddress();
+
   /**
-   * Sets the ip address or host name that this server is to listen on for
-   * client connections.
-   * Setting a specific bind address will cause the bridge server to always
-   * use this address and ignore any address specified by "server-bind-address"
-   * or "bind-address" in the gemfire.properties file
-  

[23/93] [partial] incubator-geode git commit: Added Spotless plugin to enforce formatting standards. Added Google Java Style guide formatter templates, removed existing formatter templates.

2016-10-26 Thread klund
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/8bf39571/geode-core/src/main/java/org/apache/geode/admin/internal/BackupDataStoreHelper.java
--
diff --git 
a/geode-core/src/main/java/org/apache/geode/admin/internal/BackupDataStoreHelper.java
 
b/geode-core/src/main/java/org/apache/geode/admin/internal/BackupDataStoreHelper.java
index 0d68f02..551aaa1 100644
--- 
a/geode-core/src/main/java/org/apache/geode/admin/internal/BackupDataStoreHelper.java
+++ 
b/geode-core/src/main/java/org/apache/geode/admin/internal/BackupDataStoreHelper.java
@@ -1,18 +1,16 @@
 /*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
+ * Licensed to the Apache Software Foundation (ASF) under one or more 
contributor license
+ * agreements. See the NOTICE file distributed with this work for additional 
information regarding
+ * copyright ownership. The ASF licenses this file to You under the Apache 
License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance with the 
License. You may obtain a
+ * copy of the License at
  *
- *  http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
  *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software 
distributed under the License
+ * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 
KIND, either express
+ * or implied. See the License for the specific language governing permissions 
and limitations under
+ * the License.
  */
 package org.apache.geode.admin.internal;
 
@@ -31,15 +29,15 @@ public class BackupDataStoreHelper {
   public static String LOCK_SERVICE_NAME = 
BackupDataStoreHelper.class.getSimpleName();
 
   private static String LOCK_NAME = LOCK_SERVICE_NAME + "_token";
-  
+
   private static Object LOCK_SYNC = new Object();
 
   @SuppressWarnings("rawtypes")
-  public static BackupDataStoreResult backupAllMembers(
-  DM dm, Set recipients, File targetDir, File baselineDir) {
+  public static BackupDataStoreResult backupAllMembers(DM dm, Set recipients, 
File targetDir,
+  File baselineDir) {
 FlushToDiskRequest.send(dm, recipients);
 
-boolean abort= true;
+boolean abort = true;
 Map successfulMembers;
 Map existingDataStores;
 try {
@@ -50,7 +48,7 @@ public class BackupDataStoreHelper {
 }
 return new BackupDataStoreResult(existingDataStores, successfulMembers);
   }
-  
+
   private static DistributedLockService getLockService(DM dm) {
 DistributedLockService dls = 
DistributedLockService.getServiceNamed(LOCK_SERVICE_NAME);
 if (dls == null) {
@@ -65,11 +63,11 @@ public class BackupDataStoreHelper {
 Assert.assertTrue(dls != null);
 return dls;
   }
-  
+
   public static boolean obtainLock(DM dm) {
 return getLockService(dm).lock(LOCK_NAME, 0, -1);
   }
-  
+
   public static void releaseLock(DM dm) {
 getLockService(dm).unlock(LOCK_NAME);
   }

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/8bf39571/geode-core/src/main/java/org/apache/geode/admin/internal/BackupDataStoreResult.java
--
diff --git 
a/geode-core/src/main/java/org/apache/geode/admin/internal/BackupDataStoreResult.java
 
b/geode-core/src/main/java/org/apache/geode/admin/internal/BackupDataStoreResult.java
index b2a201d..eae674b 100644
--- 
a/geode-core/src/main/java/org/apache/geode/admin/internal/BackupDataStoreResult.java
+++ 
b/geode-core/src/main/java/org/apache/geode/admin/internal/BackupDataStoreResult.java
@@ -1,18 +1,16 @@
 /*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
+ * Licensed to the Apache Software Foundation (ASF) under one or more 
contributor license
+ * agreements. See the NOTICE file distributed with this work for additional 
information regarding
+ * 

[19/93] [partial] incubator-geode git commit: Added Spotless plugin to enforce formatting standards. Added Google Java Style guide formatter templates, removed existing formatter templates.

2016-10-26 Thread klund
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/8bf39571/geode-core/src/main/java/org/apache/geode/admin/internal/MemberHealthEvaluator.java
--
diff --git 
a/geode-core/src/main/java/org/apache/geode/admin/internal/MemberHealthEvaluator.java
 
b/geode-core/src/main/java/org/apache/geode/admin/internal/MemberHealthEvaluator.java
index 6c76f69..951b364 100644
--- 
a/geode-core/src/main/java/org/apache/geode/admin/internal/MemberHealthEvaluator.java
+++ 
b/geode-core/src/main/java/org/apache/geode/admin/internal/MemberHealthEvaluator.java
@@ -1,18 +1,16 @@
 /*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
+ * Licensed to the Apache Software Foundation (ASF) under one or more 
contributor license
+ * agreements. See the NOTICE file distributed with this work for additional 
information regarding
+ * copyright ownership. The ASF licenses this file to You under the Apache 
License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance with the 
License. You may obtain a
+ * copy of the License at
  *
- *  http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
  *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software 
distributed under the License
+ * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 
KIND, either express
+ * or implied. See the License for the specific language governing permissions 
and limitations under
+ * the License.
  */
 package org.apache.geode.admin.internal;
 
@@ -30,9 +28,8 @@ import 
org.apache.geode.internal.statistics.platform.ProcessStats;
 import java.util.*;
 
 /**
- * Contains the logic for evaluating the health of a GemFire
- * distributed system member according to the thresholds provided in a
- * {@link MemberHealthConfig}.  
+ * Contains the logic for evaluating the health of a GemFire distributed 
system member according to
+ * the thresholds provided in a {@link MemberHealthConfig}.
  *
  * @see VMStats
  * @see ProcessStats
@@ -52,8 +49,8 @@ class MemberHealthEvaluator extends AbstractHealthEvaluator {
   /** The description of the member being evaluated */
   private String description;
 
-//  /** Statistics about this VM (may be null) */
-//  private VMStatsContract vmStats;
+  // /** Statistics about this VM (may be null) */
+  // private VMStatsContract vmStats;
 
   /** Statistics about this process (may be null) */
   private ProcessStats processStats;
@@ -64,13 +61,12 @@ class MemberHealthEvaluator extends AbstractHealthEvaluator 
{
   /** The previous value of the reply timeouts stat */
   private long prevReplyTimeouts;
 
-  //  Constructors  //
+  // Constructors //
 
   /**
* Creates a new MemberHealthEvaluator
*/
-  MemberHealthEvaluator(GemFireHealthConfig config,
-DM dm) {
+  MemberHealthEvaluator(GemFireHealthConfig config, DM dm) {
 super(config, dm);
 
 this.config = config;
@@ -79,12 +75,12 @@ class MemberHealthEvaluator extends AbstractHealthEvaluator 
{
 GemFireStatSampler sampler = system.getStatSampler();
 if (sampler != null) {
   // Sampling is enabled
-//  this.vmStats = sampler.getVMStats();
+  // this.vmStats = sampler.getVMStats();
   this.processStats = sampler.getProcessStats();
 }
 
 this.dmStats = dm.getStats();
-
+
 StringBuffer sb = new StringBuffer();
 sb.append("Application VM member ");
 sb.append(dm.getId());
@@ -96,7 +92,7 @@ class MemberHealthEvaluator extends AbstractHealthEvaluator {
 this.description = sb.toString();
   }
 
-    Instance Methods  
+   Instance Methods 
 
   @Override
   protected String getDescription() {
@@ -104,10 +100,9 @@ class MemberHealthEvaluator extends 
AbstractHealthEvaluator {
   }
 
   /**
-   * Checks to make sure that the {@linkplain
-   * ProcessStats#getProcessSize VM's process size} is less than the
-   * {@linkplain MemberHealthConfig#getMaxVMProcessSize threshold}.
-   * If not, the status is "okay" health.
+   * Checks to make sure that the {@linkplain 

[15/93] [partial] incubator-geode git commit: Added Spotless plugin to enforce formatting standards. Added Google Java Style guide formatter templates, removed existing formatter templates.

2016-10-26 Thread klund
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/8bf39571/geode-core/src/main/java/org/apache/geode/admin/jmx/internal/AgentImpl.java
--
diff --git 
a/geode-core/src/main/java/org/apache/geode/admin/jmx/internal/AgentImpl.java 
b/geode-core/src/main/java/org/apache/geode/admin/jmx/internal/AgentImpl.java
index 37e7eea..e55c3f1 100644
--- 
a/geode-core/src/main/java/org/apache/geode/admin/jmx/internal/AgentImpl.java
+++ 
b/geode-core/src/main/java/org/apache/geode/admin/jmx/internal/AgentImpl.java
@@ -1,18 +1,16 @@
 /*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
+ * Licensed to the Apache Software Foundation (ASF) under one or more 
contributor license
+ * agreements. See the NOTICE file distributed with this work for additional 
information regarding
+ * copyright ownership. The ASF licenses this file to You under the Apache 
License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance with the 
License. You may obtain a
+ * copy of the License at
  *
- *  http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
  *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software 
distributed under the License
+ * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 
KIND, either express
+ * or implied. See the License for the specific language governing permissions 
and limitations under
+ * the License.
  */
 package org.apache.geode.admin.jmx.internal;
 
@@ -75,30 +73,26 @@ import 
org.apache.geode.internal.logging.log4j.LogWriterAppender;
 import org.apache.geode.internal.logging.log4j.LogWriterAppenders;
 
 /**
- * The GemFire JMX Agent provides the ability to administrate one GemFire
- * distributed system via JMX.
+ * The GemFire JMX Agent provides the ability to administrate one GemFire 
distributed system via
+ * JMX.
  *
- * @since GemFire 3.5
+ * @since GemFire 3.5
  */
-public class AgentImpl
-implements org.apache.geode.admin.jmx.Agent,
-   org.apache.geode.admin.jmx.internal.ManagedResource {
+public class AgentImpl implements org.apache.geode.admin.jmx.Agent,
+org.apache.geode.admin.jmx.internal.ManagedResource {
 
   private static final Logger logger = LogService.getLogger();
-  
+
   /**
-   * MX4J HttpAdaptor only supports "basic" as an authentication method.
-   * Enabling HttpAdaptor authentication ({@link
-   * AgentConfig#HTTP_AUTHENTICATION_ENABLED_NAME}) causes the browser to
-   * require a login with username ({@link
-   * AgentConfig#HTTP_AUTHENTICATION_USER_NAME}) and password ({@link
-   * AgentConfig#HTTP_AUTHENTICATION_PASSWORD_NAME}).
+   * MX4J HttpAdaptor only supports "basic" as an authentication method. 
Enabling HttpAdaptor
+   * authentication ({@link AgentConfig#HTTP_AUTHENTICATION_ENABLED_NAME}) 
causes the browser to
+   * require a login with username ({@link 
AgentConfig#HTTP_AUTHENTICATION_USER_NAME}) and password
+   * ({@link AgentConfig#HTTP_AUTHENTICATION_PASSWORD_NAME}).
*/
   private static final String MX4J_HTTPADAPTOR_BASIC_AUTHENTICATION = "basic";
 
   /** JMX Service URL template for JMX/RMI Connector Server */
-  private static final String JMX_SERVICE_URL =
-  
"service:jmx:rmi://{0}:{1}/jndi/rmi://{2}:{3}{4}";
+  private static final String JMX_SERVICE_URL = 
"service:jmx:rmi://{0}:{1}/jndi/rmi://{2}:{3}{4}";
 
   /**
* Set third-party logging configration: MX4J, Jakarta Commons-Logging.
@@ -108,7 +102,7 @@ implements org.apache.geode.admin.jmx.Agent,
 String commonsLog = System.getProperty("org.apache.commons.logging.log");
 if (commonsLog == null || commonsLog.length() == 0) {
   System.setProperty("org.apache.commons.logging.log",
- "org.apache.commons.logging.impl.SimpleLog");
+  "org.apache.commons.logging.impl.SimpleLog");
 }
   }
 
@@ -118,26 +112,24 @@ implements org.apache.geode.admin.jmx.Agent,
   if (Boolean.getBoolean("gfAgentDebug")) {
 mx4j.log.Log.setDefaultPriority(mx4j.log.Logger.TRACE); // .DEBUG
   }
-}
-catch (VirtualMachineError err) {
+} catch (VirtualMachineError err) {
   SystemFailure.initiateFailure(err);
-  // If this ever 

[18/93] [partial] incubator-geode git commit: Added Spotless plugin to enforce formatting standards. Added Google Java Style guide formatter templates, removed existing formatter templates.

2016-10-26 Thread klund
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/8bf39571/geode-core/src/main/java/org/apache/geode/admin/internal/SystemMemberRegionEventImpl.java
--
diff --git 
a/geode-core/src/main/java/org/apache/geode/admin/internal/SystemMemberRegionEventImpl.java
 
b/geode-core/src/main/java/org/apache/geode/admin/internal/SystemMemberRegionEventImpl.java
index c59e049..74115bb 100644
--- 
a/geode-core/src/main/java/org/apache/geode/admin/internal/SystemMemberRegionEventImpl.java
+++ 
b/geode-core/src/main/java/org/apache/geode/admin/internal/SystemMemberRegionEventImpl.java
@@ -1,18 +1,16 @@
 /*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
+ * Licensed to the Apache Software Foundation (ASF) under one or more 
contributor license
+ * agreements. See the NOTICE file distributed with this work for additional 
information regarding
+ * copyright ownership. The ASF licenses this file to You under the Apache 
License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance with the 
License. You may obtain a
+ * copy of the License at
  *
- *  http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
  *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software 
distributed under the License
+ * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 
KIND, either express
+ * or implied. See the License for the specific language governing permissions 
and limitations under
+ * the License.
  */
 package org.apache.geode.admin.internal;
 
@@ -21,34 +19,30 @@ import org.apache.geode.distributed.DistributedMember;
 import org.apache.geode.cache.Operation;
 
 /**
- * An event that describes an operation on a region.
- * Instances of this are delivered to a {@link SystemMemberCacheListener} when 
a
- * a region comes or goes.
+ * An event that describes an operation on a region. Instances of this are 
delivered to a
+ * {@link SystemMemberCacheListener} when a a region comes or goes.
  *
  * @since GemFire 5.0
  */
-public class SystemMemberRegionEventImpl
-  extends SystemMemberCacheEventImpl
-  implements SystemMemberRegionEvent
-{
+public class SystemMemberRegionEventImpl extends SystemMemberCacheEventImpl
+implements SystemMemberRegionEvent {
 
-  /** 
-   * The path of region created/destroyed 
+  /**
+   * The path of region created/destroyed
*/
   private final String regionPath;
 
-  ///  Constructors  ///
+  /// Constructors ///
 
   /**
-   * Creates a new SystemMemberRegionEvent for the member
-   * with the given id.
+   * Creates a new SystemMemberRegionEvent for the member with 
the given id.
*/
   protected SystemMemberRegionEventImpl(DistributedMember id, Operation op, 
String regionPath) {
 super(id, op);
 this.regionPath = regionPath;
   }
 
-  /  Instance Methods  /
+  / Instance Methods /
 
   public String getRegionPath() {
 return this.regionPath;

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/8bf39571/geode-core/src/main/java/org/apache/geode/admin/internal/SystemMemberRegionImpl.java
--
diff --git 
a/geode-core/src/main/java/org/apache/geode/admin/internal/SystemMemberRegionImpl.java
 
b/geode-core/src/main/java/org/apache/geode/admin/internal/SystemMemberRegionImpl.java
index 9e8f392..fbf0839 100644
--- 
a/geode-core/src/main/java/org/apache/geode/admin/internal/SystemMemberRegionImpl.java
+++ 
b/geode-core/src/main/java/org/apache/geode/admin/internal/SystemMemberRegionImpl.java
@@ -1,25 +1,23 @@
 /*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
+ * Licensed to the Apache Software Foundation (ASF) under 

[27/93] [partial] incubator-geode git commit: Added Spotless plugin to enforce formatting standards. Added Google Java Style guide formatter templates, removed existing formatter templates.

2016-10-26 Thread klund
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/8bf39571/geode-core/src/main/java/org/apache/geode/admin/GemFireMemberStatus.java
--
diff --git 
a/geode-core/src/main/java/org/apache/geode/admin/GemFireMemberStatus.java 
b/geode-core/src/main/java/org/apache/geode/admin/GemFireMemberStatus.java
index b785125..5b4e59e 100755
--- a/geode-core/src/main/java/org/apache/geode/admin/GemFireMemberStatus.java
+++ b/geode-core/src/main/java/org/apache/geode/admin/GemFireMemberStatus.java
@@ -1,18 +1,16 @@
 /*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
+ * Licensed to the Apache Software Foundation (ASF) under one or more 
contributor license
+ * agreements. See the NOTICE file distributed with this work for additional 
information regarding
+ * copyright ownership. The ASF licenses this file to You under the Apache 
License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance with the 
License. You may obtain a
+ * copy of the License at
  *
- *  http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
  *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software 
distributed under the License
+ * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 
KIND, either express
+ * or implied. See the License for the specific language governing permissions 
and limitations under
+ * the License.
  */
 package org.apache.geode.admin;
 
@@ -39,10 +37,12 @@ import java.net.InetAddress;
 import java.util.*;
 
 /**
- * Class GemFireMemberStatus provides the status of a specific
- * GemFire member VM. This VM can be a peer, a client, a server and/or a
- * gateway.
- * @deprecated as of 7.0 use the management
 package instead
+ * Class GemFireMemberStatus provides the status of a specific 
GemFire member VM. This
+ * VM can be a peer, a client, a server and/or a gateway.
+ * 
+ * @deprecated as of 7.0 use the management
+ * package instead
  */
 public class GemFireMemberStatus implements Serializable {
   private static final long serialVersionUID = 3389997790525991310L;
@@ -69,7 +69,7 @@ public class GemFireMemberStatus implements Serializable {
 
   protected boolean _isPrimaryGatewayHub;
 
-  protected Object/*GatewayHubStatus*/ _gatewayHubStatus;
+  protected Object/* GatewayHubStatus */ _gatewayHubStatus;
 
   protected boolean _isConnected;
   protected Serializable _memberId;
@@ -96,11 +96,11 @@ public class GemFireMemberStatus implements Serializable {
 
   protected long _maximumHeapSize;
   protected long _freeHeapSize;
-  
+
   protected long upTime = -1;
 
   protected transient final Cache cache;
-  
+
   public GemFireMemberStatus() {
 this(null);
   }
@@ -124,6 +124,7 @@ public class GemFireMemberStatus implements Serializable {
 
   /**
* Returns whether this member is a client to a cache server
+   * 
* @return whether this member is a client to a cache server
*/
   public boolean getIsClient() {
@@ -132,8 +133,8 @@ public class GemFireMemberStatus implements Serializable {
 
   /**
* Sets whether this member is a client to a cache server
-   * @param isClient Boolean defining whether this member is a client to a
-   * cache server
+   * 
+   * @param isClient Boolean defining whether this member is a client to a 
cache server
*/
   protected void setIsClient(boolean isClient) {
 this._isClient = isClient;
@@ -141,6 +142,7 @@ public class GemFireMemberStatus implements Serializable {
 
   /**
* Returns whether this member is a cache server
+   * 
* @return whether this member is a cache server
*/
   public boolean getIsServer() {
@@ -149,6 +151,7 @@ public class GemFireMemberStatus implements Serializable {
 
   /**
* Sets whether this member is a cache server
+   * 
* @param isServer Boolean defining whether this member is a cache server
*/
   protected void setIsServer(boolean isServer) {
@@ -156,15 +159,16 @@ public class GemFireMemberStatus implements Serializable {
   }
 
   public int getServerPort() {
- return this._serverPort;
+return this._serverPort;
   }
-  
+
   protected void setServerPort(int port) {
- this._serverPort = port;
+

[11/93] [partial] incubator-geode git commit: Added Spotless plugin to enforce formatting standards. Added Google Java Style guide formatter templates, removed existing formatter templates.

2016-10-26 Thread klund
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/8bf39571/geode-core/src/main/java/org/apache/geode/admin/jmx/internal/MX4JServerSocketFactory.java
--
diff --git 
a/geode-core/src/main/java/org/apache/geode/admin/jmx/internal/MX4JServerSocketFactory.java
 
b/geode-core/src/main/java/org/apache/geode/admin/jmx/internal/MX4JServerSocketFactory.java
index 474f8dd..e799279 100644
--- 
a/geode-core/src/main/java/org/apache/geode/admin/jmx/internal/MX4JServerSocketFactory.java
+++ 
b/geode-core/src/main/java/org/apache/geode/admin/jmx/internal/MX4JServerSocketFactory.java
@@ -1,18 +1,16 @@
 /*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
+ * Licensed to the Apache Software Foundation (ASF) under one or more 
contributor license
+ * agreements. See the NOTICE file distributed with this work for additional 
information regarding
+ * copyright ownership. The ASF licenses this file to You under the Apache 
License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance with the 
License. You may obtain a
+ * copy of the License at
  *
- *  http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
  *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software 
distributed under the License
+ * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 
KIND, either express
+ * or implied. See the License for the specific language governing permissions 
and limitations under
+ * the License.
  */
 package org.apache.geode.admin.jmx.internal;
 
@@ -32,129 +30,107 @@ import java.util.Properties;
 /**
  * Creates ServerSockets for JMX adaptors.
  * 
- * The interface {@link mx4j.tools.adaptor.AdaptorServerSocketFactory} is
- * implemented in order to support securing of {@link 
- * mx4j.tools.adaptor.http.HttpAdaptor}.
+ * The interface {@link mx4j.tools.adaptor.AdaptorServerSocketFactory} is 
implemented in order to
+ * support securing of {@link mx4j.tools.adaptor.http.HttpAdaptor}.
  * 
- * The interface {@link java.rmi.server.RMIServerSocketFactory} is implemented
- * to support the securing of {@link 
- * javax.management.remote.JMXConnectorServer}.  See {@link
- * javax.management.remote.rmi.RMIConnectorServer} for the actual subclass that
- * is used for the JMX RMI adaptor.
+ * The interface {@link java.rmi.server.RMIServerSocketFactory} is implemented 
to support the
+ * securing of {@link javax.management.remote.JMXConnectorServer}. See
+ * {@link javax.management.remote.rmi.RMIConnectorServer} for the actual 
subclass that is used for
+ * the JMX RMI adaptor.
  * 
  * Complete info on JSSE, including debugging, can be found at
  * http://java.sun.com/j2se/1.4.2/docs/guide/security/jsse/JSSERefGuide.html;>
  * 
http://java.sun.com/j2se/1.4.2/docs/guide/security/jsse/JSSERefGuide.html
  *
- * @since GemFire 3.5 (old name was SSLAdaptorServerSocketFactory)
+ * @since GemFire 3.5 (old name was SSLAdaptorServerSocketFactory)
  */
-public class MX4JServerSocketFactory 
-implements mx4j.tools.adaptor.AdaptorServerSocketFactory,
-   java.rmi.server.RMIServerSocketFactory {
+public class MX4JServerSocketFactory implements 
mx4j.tools.adaptor.AdaptorServerSocketFactory,
+java.rmi.server.RMIServerSocketFactory {
 
   private static final Logger logger = LogService.getLogger();
-  
+
   private static final int DEFAULT_BACKLOG = 50;
-  
+
   private final SocketCreator socketCreator;
   private String bindAddress = DistributedSystemConfig.DEFAULT_BIND_ADDRESS;
   private int backlog = DEFAULT_BACKLOG;
-  
+
   /**
* Constructs new instance of MX4JServerSocketFactory.
* 
-   * @param useSSL
-   *  true if ssl is to be enabled
-   * @param needClientAuth
-   *  true if client authentication is required
-   * @param protocols
-   *  space-delimited list of ssl protocols to use
-   * @param ciphers
-   *  space-delimited list of ssl ciphers to use
-   * @param gfsecurityProps
-   *  vendor properties passed in through gfsecurity.properties
+   * @param useSSL true if ssl is to be enabled
+   * @param needClientAuth true if client authentication is required
+   * @param protocols space-delimited list of 

[31/93] [partial] incubator-geode git commit: Added Spotless plugin to enforce formatting standards. Added Google Java Style guide formatter templates, removed existing formatter templates.

2016-10-26 Thread klund
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/8bf39571/geode-core/src/main/java/org/apache/geode/StatisticsFactory.java
--
diff --git a/geode-core/src/main/java/org/apache/geode/StatisticsFactory.java 
b/geode-core/src/main/java/org/apache/geode/StatisticsFactory.java
index 4fe13ee..8056b73 100644
--- a/geode-core/src/main/java/org/apache/geode/StatisticsFactory.java
+++ b/geode-core/src/main/java/org/apache/geode/StatisticsFactory.java
@@ -1,49 +1,43 @@
 /*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
+ * Licensed to the Apache Software Foundation (ASF) under one or more 
contributor license
+ * agreements. See the NOTICE file distributed with this work for additional 
information regarding
+ * copyright ownership. The ASF licenses this file to You under the Apache 
License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance with the 
License. You may obtain a
+ * copy of the License at
  *
- *  http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
  *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software 
distributed under the License
+ * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 
KIND, either express
+ * or implied. See the License for the specific language governing permissions 
and limitations under
+ * the License.
  */
 package org.apache.geode;
 
-//import org.apache.geode.distributed.DistributedSystem;
-//import org.apache.geode.internal.statistics.StatArchiveFormat;
-//import java.io.IOException;
-//import java.io.Reader;
+// import org.apache.geode.distributed.DistributedSystem;
+// import org.apache.geode.internal.statistics.StatArchiveFormat;
+// import java.io.IOException;
+// import java.io.Reader;
 
 /**
- * Instances of this interface provide methods that create instances
- * of {@link Statistics}.
- * It can also be used to create instances of {@link StatisticDescriptor}
- * and {@link StatisticsType} because it implements {@link 
StatisticsTypeFactory}.
- * {@link
- * org.apache.geode.distributed.DistributedSystem} is the only
- * instance of this interface.
+ * Instances of this interface provide methods that create instances of {@link 
Statistics}. It can
+ * also be used to create instances of {@link StatisticDescriptor} and {@link 
StatisticsType}
+ * because it implements {@link StatisticsTypeFactory}.
+ * {@link org.apache.geode.distributed.DistributedSystem} is the only instance 
of this interface.
  *
  * 
  *
- * A StatisticsFactory can create a {@link
- * StatisticDescriptor statistic} of three numeric types:
- * int, long, and double.  A
- * statistic (StatisticDescriptor) can either be a
- * gauge meaning that its value can increase and decrease or a
- * counter meaning that its value is strictly increasing.
- * Marking a statistic as a counter allows statistic display tools
- * to properly display a statistics whose value "wraps around" (that
- * is, exceeds its maximum value).
+ * A StatisticsFactory can create a {@link StatisticDescriptor 
statistic} of three
+ * numeric types: int, long, and 
double. A statistic
+ * (StatisticDescriptor) can either be a gauge meaning 
that its value can
+ * increase and decrease or a counter meaning that its value is 
strictly increasing. Marking
+ * a statistic as a counter allows statistic display tools to properly display 
a statistics whose
+ * value "wraps around" (that is, exceeds its maximum value).
+ * 
+ * 
+ * The following code is an example of how to create a type using the api. In 
this example the type
+ * has two stats whose values always increase:
  * 
- * The following code is an example of how to create a type using the api.
- * In this example the type has two stats whose values always increase:
  * 
 StatisticsFactory f = ...;
 StatisticsType t = f.createType(
@@ -62,13 +56,16 @@ package org.apache.geode;
 this.sampleCountId = this.samplerStats.nameToId("sampleCount");
 this.sampleTimeId = this.samplerStats.nameToId("sampleTime");
  * 
+ * 
  * Later on the stat ids can be used to increment the stats:
+ * 
  * 
-this.samplerStats.incInt(this.sampleCountId, 1);
-

[05/93] [partial] incubator-geode git commit: Added Spotless plugin to enforce formatting standards. Added Google Java Style guide formatter templates, removed existing formatter templates.

2016-10-26 Thread klund
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/8bf39571/geode-core/src/main/java/org/apache/geode/cache/CacheFactory.java
--
diff --git a/geode-core/src/main/java/org/apache/geode/cache/CacheFactory.java 
b/geode-core/src/main/java/org/apache/geode/cache/CacheFactory.java
index 6d3fd4b..b62feac 100644
--- a/geode-core/src/main/java/org/apache/geode/cache/CacheFactory.java
+++ b/geode-core/src/main/java/org/apache/geode/cache/CacheFactory.java
@@ -1,18 +1,16 @@
 /*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
+ * Licensed to the Apache Software Foundation (ASF) under one or more 
contributor license
+ * agreements. See the NOTICE file distributed with this work for additional 
information regarding
+ * copyright ownership. The ASF licenses this file to You under the Apache 
License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance with the 
License. You may obtain a
+ * copy of the License at
  *
- *  http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
  *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software 
distributed under the License
+ * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 
KIND, either express
+ * or implied. See the License for the specific language governing permissions 
and limitations under
+ * the License.
  */
 
 package org.apache.geode.cache;
@@ -33,28 +31,38 @@ import org.apache.geode.pdx.PdxSerializer;
 
 
 /**
- * Factory class used to create the singleton {@link Cache cache} and connect 
to the GemFire singleton {@link DistributedSystem distributed system}. If the 
application wants to connect to GemFire as a client it should use {@link 
org.apache.geode.cache.client.ClientCacheFactory} instead.
- Once the factory has been configured using its {@link #set(String, 
String)} method you produce a {@link Cache} by calling the {@link #create()} 
method.
+ * Factory class used to create the singleton {@link Cache cache} and connect 
to the GemFire
+ * singleton {@link DistributedSystem distributed system}. If the application 
wants to connect to
+ * GemFire as a client it should use {@link 
org.apache.geode.cache.client.ClientCacheFactory}
+ * instead.
+ * 
+ * Once the factory has been configured using its {@link #set(String, String)} 
method you produce a
+ * {@link Cache} by calling the {@link #create()} method.
  * 
  * To get the existing unclosed singleton cache instance call {@link 
#getAnyInstance}.
  * 
- * If an instance of {@link DistributedSystem} already exists when this factory
- * creates a cache, that instance will be used if it is compatible with this 
factory.
-
-The following examples illustrate bootstrapping the cache using region 
shortcuts:
-
-Example 1: Create a cache and a replicate region named customers.
-
-  Cache c = new CacheFactory().create();
-  Region r = c.createRegionFactory(REPLICATE).create("customers");
-
-Example 2: Create a cache and a partition region with redundancy
-
-  Cache c = new CacheFactory().create();
-  Region r = c.createRegionFactory(PARTITION_REDUNDANT).create("customers");
-
-Example 3: Construct the  cache region declaratively in cache.xml
-
+ * If an instance of {@link DistributedSystem} already exists when this 
factory creates a cache,
+ * that instance will be used if it is compatible with this factory.
+ * 
+ * The following examples illustrate bootstrapping the cache using region 
shortcuts:
+ * 
+ * Example 1: Create a cache and a replicate region named customers.
+ * 
+ * 
+ * Cache c = new CacheFactory().create();
+ * Region r = c.createRegionFactory(REPLICATE).create("customers");
+ * 
+ * 
+ * Example 2: Create a cache and a partition region with redundancy
+ * 
+ * 
+ * Cache c = new CacheFactory().create();
+ * Region r = c.createRegionFactory(PARTITION_REDUNDANT).create("customers");
+ * 
+ * 
+ * Example 3: Construct the cache region declaratively in cache.xml
+ * 
+ * 
   !DOCTYPE cache PUBLIC
 "-//GemStone Systems, Inc.//GemFire Declarative Caching 8.0//EN"
 "http://www.gemstone.com/dtd/cache8_0.dtd;>
@@ -63,17 +71,19 @@ Example 3: Construct the  cache region declaratively in 
cache.xml
   !-- you can override 

[25/93] [partial] incubator-geode git commit: Added Spotless plugin to enforce formatting standards. Added Google Java Style guide formatter templates, removed existing formatter templates.

2016-10-26 Thread klund
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/8bf39571/geode-core/src/main/java/org/apache/geode/admin/SystemMembershipListener.java
--
diff --git 
a/geode-core/src/main/java/org/apache/geode/admin/SystemMembershipListener.java 
b/geode-core/src/main/java/org/apache/geode/admin/SystemMembershipListener.java
index b1d6afe..eed5578 100644
--- 
a/geode-core/src/main/java/org/apache/geode/admin/SystemMembershipListener.java
+++ 
b/geode-core/src/main/java/org/apache/geode/admin/SystemMembershipListener.java
@@ -1,29 +1,29 @@
 /*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
+ * Licensed to the Apache Software Foundation (ASF) under one or more 
contributor license
+ * agreements. See the NOTICE file distributed with this work for additional 
information regarding
+ * copyright ownership. The ASF licenses this file to You under the Apache 
License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance with the 
License. You may obtain a
+ * copy of the License at
  *
- *  http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
  *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software 
distributed under the License
+ * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 
KIND, either express
+ * or implied. See the License for the specific language governing permissions 
and limitations under
+ * the License.
  */
 package org.apache.geode.admin;
 
 /**
- * A listener whose callback methods are invoked when members join or
- * leave the GemFire distributed system.
+ * A listener whose callback methods are invoked when members join or leave 
the GemFire distributed
+ * system.
  *
  * @see AdminDistributedSystem#addMembershipListener
  *
  * @since GemFire 3.5
- * @deprecated as of 7.0 use the management
 package instead
+ * @deprecated as of 7.0 use the management
+ * package instead
  */
 public interface SystemMembershipListener {
 
@@ -33,29 +33,27 @@ public interface SystemMembershipListener {
   public void memberJoined(SystemMembershipEvent event);
 
   /**
-   * Invoked when a member has gracefully left the distributed system.  This
-   * occurs when the member took action to remove itself from the distributed
-   * system.
+   * Invoked when a member has gracefully left the distributed system. This 
occurs when the member
+   * took action to remove itself from the distributed system.
*/
   public void memberLeft(SystemMembershipEvent event);
 
   /**
-   * Invoked when a member has unexpectedly left the distributed
-   * system.  This occurs when a member is forcibly removed from the
-   * distributed system by another process, such as from
-   *  failure 
detection, or
-   * 
-   * network partition detection processing.
+   * Invoked when a member has unexpectedly left the distributed system. This 
occurs when a member
+   * is forcibly removed from the distributed system by another process, such 
as from  failure 
detection, or  
network
+   * partition detection processing.
*/
   public void memberCrashed(SystemMembershipEvent event);
 
-//   /**
-//* Invoked when a member broadcasts an informational message.
-//*
-//* @see org.apache.geode.distributed.DistributedSystem#fireInfoEvent
-//*
-//* @since GemFire 4.0
-//*/
-//   public void memberInfo(SystemMembershipEvent event);
+  // /**
+  // * Invoked when a member broadcasts an informational message.
+  // *
+  // * @see org.apache.geode.distributed.DistributedSystem#fireInfoEvent
+  // *
+  // * @since GemFire 4.0
+  // */
+  // public void memberInfo(SystemMembershipEvent event);
 
 }

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/8bf39571/geode-core/src/main/java/org/apache/geode/admin/UnmodifiableConfigurationException.java
--
diff --git 
a/geode-core/src/main/java/org/apache/geode/admin/UnmodifiableConfigurationException.java
 
b/geode-core/src/main/java/org/apache/geode/admin/UnmodifiableConfigurationException.java
index e89fc96..758dbd7 100755
--- 
a/geode-core/src/main/java/org/apache/geode/admin/UnmodifiableConfigurationException.java
+++ 

[08/93] [partial] incubator-geode git commit: Added Spotless plugin to enforce formatting standards. Added Google Java Style guide formatter templates, removed existing formatter templates.

2016-10-26 Thread klund
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/8bf39571/geode-core/src/main/java/org/apache/geode/admin/jmx/internal/SystemMemberJmx.java
--
diff --git 
a/geode-core/src/main/java/org/apache/geode/admin/jmx/internal/SystemMemberJmx.java
 
b/geode-core/src/main/java/org/apache/geode/admin/jmx/internal/SystemMemberJmx.java
index dd52a4e..06b0be9 100644
--- 
a/geode-core/src/main/java/org/apache/geode/admin/jmx/internal/SystemMemberJmx.java
+++ 
b/geode-core/src/main/java/org/apache/geode/admin/jmx/internal/SystemMemberJmx.java
@@ -1,18 +1,16 @@
 /*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
+ * Licensed to the Apache Software Foundation (ASF) under one or more 
contributor license
+ * agreements. See the NOTICE file distributed with this work for additional 
information regarding
+ * copyright ownership. The ASF licenses this file to You under the Apache 
License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance with the 
License. You may obtain a
+ * copy of the License at
  *
- *  http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
  *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software 
distributed under the License
+ * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 
KIND, either express
+ * or implied. See the License for the specific language governing permissions 
and limitations under
+ * the License.
  */
 package org.apache.geode.admin.jmx.internal;
 
@@ -32,46 +30,42 @@ import javax.naming.OperationNotSupportedException;
 import java.util.concurrent.atomic.AtomicInteger;
 
 /**
- * Defines methods that all SystemMember MBeans should
- * implement.
+ * Defines methods that all SystemMember MBeans should implement.
  *
  * @since GemFire 4.0
  */
-public interface SystemMemberJmx
-  extends SystemMember, NotificationListener {
-  /** 
-   * Notification type for indicating a cache got created on a member of this 
-   * distributed system.
+public interface SystemMemberJmx extends SystemMember, NotificationListener {
+  /**
+   * Notification type for indicating a cache got created on a member of this 
distributed system.
*/
   public static final String NOTIF_CACHE_CREATED =
   DistributionConfig.GEMFIRE_PREFIX + "distributedsystem.cache.created";
-  /** 
-   * Notification type for indicating a cache is closed on a member of this 
-   * distributed system.
+  /**
+   * Notification type for indicating a cache is closed on a member of this 
distributed system.
*/
   public static final String NOTIF_CACHE_CLOSED =
   DistributionConfig.GEMFIRE_PREFIX + "distributedsystem.cache.closed";
-  /** 
-   * Notification type for indicating a region is created in a cache on a 
member 
-   * of this distributed system.
+  /**
+   * Notification type for indicating a region is created in a cache on a 
member of this distributed
+   * system.
*/
   public static final String NOTIF_REGION_CREATED =
   DistributionConfig.GEMFIRE_PREFIX + 
"distributedsystem.cache.region.created";
-  /** 
-   * Notification type for indicating a region was removed from a cache on a 
-   * member of this distributed system.
+  /**
+   * Notification type for indicating a region was removed from a cache on a 
member of this
+   * distributed system.
*/
   public static final String NOTIF_REGION_LOST =
   DistributionConfig.GEMFIRE_PREFIX + 
"distributedsystem.cache.region.lost";
-  
+
   /** Notification type for indicating client joined */
   public static final String NOTIF_CLIENT_JOINED =
   DistributionConfig.GEMFIRE_PREFIX + 
"distributedsystem.cache.client.joined";
-  
+
   /** Notification type for indicating client left */
   public static final String NOTIF_CLIENT_LEFT =
   DistributionConfig.GEMFIRE_PREFIX + 
"distributedsystem.cache.client.left";
-  
+
   /** Notification type for indicating client crashed */
   public static final String NOTIF_CLIENT_CRASHED =
   DistributionConfig.GEMFIRE_PREFIX + 
"distributedsystem.cache.client.crashed";
@@ -84,61 +78,54 @@ public interface SystemMemberJmx
   public int getRefreshInterval();
 
   /**
-   * RefreshInterval is now set only through the 

[16/93] [partial] incubator-geode git commit: Added Spotless plugin to enforce formatting standards. Added Google Java Style guide formatter templates, removed existing formatter templates.

2016-10-26 Thread klund
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/8bf39571/geode-core/src/main/java/org/apache/geode/admin/jmx/internal/AgentConfigImpl.java
--
diff --git 
a/geode-core/src/main/java/org/apache/geode/admin/jmx/internal/AgentConfigImpl.java
 
b/geode-core/src/main/java/org/apache/geode/admin/jmx/internal/AgentConfigImpl.java
index 07a95df..4e53b07 100644
--- 
a/geode-core/src/main/java/org/apache/geode/admin/jmx/internal/AgentConfigImpl.java
+++ 
b/geode-core/src/main/java/org/apache/geode/admin/jmx/internal/AgentConfigImpl.java
@@ -1,18 +1,16 @@
 /*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
+ * Licensed to the Apache Software Foundation (ASF) under one or more 
contributor license
+ * agreements. See the NOTICE file distributed with this work for additional 
information regarding
+ * copyright ownership. The ASF licenses this file to You under the Apache 
License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance with the 
License. You may obtain a
+ * copy of the License at
  *
- *  http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
  *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software 
distributed under the License
+ * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 
KIND, either express
+ * or implied. See the License for the specific language governing permissions 
and limitations under
+ * the License.
  */
 package org.apache.geode.admin.jmx.internal;
 
@@ -46,19 +44,19 @@ import org.apache.geode.internal.util.IOUtils;
 /**
  * Provides the JMX Agent configuration properties.
  * 
- * Supports importing of persisted properties from an external configuration
- * file.
+ * Supports importing of persisted properties from an external configuration 
file.
  * 
- * Select values can also be overridden with command line arguments.  See
- * remarks on individual properties for further information.
+ * Select values can also be overridden with command line arguments. See 
remarks on individual
+ * properties for further information.
  * 
  * Extends and implements DistributedSystemConfig.
- * @since GemFire 3.5 (in which it was named AgentConfig)
+ * 
+ * @since GemFire 3.5 (in which it was named AgentConfig)
  */
 public class AgentConfigImpl extends DistributedSystemConfigImpl implements 
AgentConfig {
 
   // -
-  //   Static class variable(s)
+  // Static class variable(s)
   // -
 
   /**
@@ -77,7 +75,7 @@ public class AgentConfigImpl extends 
DistributedSystemConfigImpl implements Agen
   public static final String AGENT_PROPSFILE_PROPERTY_NAME = 
"gfAgentPropertyFile";
 
   // -
-  //   DistributionLocator properties...
+  // DistributionLocator properties...
   // -
 
   /**
@@ -112,44 +110,42 @@ public class AgentConfigImpl extends 
DistributedSystemConfigImpl implements Agen
   /**
* The default log file for stand-alone JMX agents
*/
-  /*package scope*/
+  /* package scope */
   static final String DEFAULT_LOG_FILE = "agent.log";
 
   /**
* The default startup log file to be used by agent launcher
*/
-  /*package scope*/
+  /* package scope */
   static final String DEFAULT_STARTUP_LOG_FILE = "start_agent.log";
 
   private static String OBFUSCATED_STRING = "";
 
-  //  Static Methods  //
+  // Static Methods //
 
   /**
-   * The propertyFile is the name of the property file that will
-   * be loaded on startup of the Agent.
+   * The propertyFile is the name of the property file that will 
be loaded on startup
+   * of the Agent.
* 
* The file will be searched for, in order, in the following directories:
* 
-   *  the current directory
-   *  the home directory
-   *  the class path
+   * the current directory
+   * the home directory
+   * the class path
* 
* Only the first file found will be 

[20/93] [partial] incubator-geode git commit: Added Spotless plugin to enforce formatting standards. Added Google Java Style guide formatter templates, removed existing formatter templates.

2016-10-26 Thread klund
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/8bf39571/geode-core/src/main/java/org/apache/geode/admin/internal/LogCollator.java
--
diff --git 
a/geode-core/src/main/java/org/apache/geode/admin/internal/LogCollator.java 
b/geode-core/src/main/java/org/apache/geode/admin/internal/LogCollator.java
index 6a183c5..83aa440 100755
--- a/geode-core/src/main/java/org/apache/geode/admin/internal/LogCollator.java
+++ b/geode-core/src/main/java/org/apache/geode/admin/internal/LogCollator.java
@@ -1,18 +1,16 @@
 /*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
+ * Licensed to the Apache Software Foundation (ASF) under one or more 
contributor license
+ * agreements. See the NOTICE file distributed with this work for additional 
information regarding
+ * copyright ownership. The ASF licenses this file to You under the Apache 
License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance with the 
License. You may obtain a
+ * copy of the License at
  *
- *  http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
  *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software 
distributed under the License
+ * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 
KIND, either express
+ * or implied. See the License for the specific language governing permissions 
and limitations under
+ * the License.
  */
 
 package org.apache.geode.admin.internal;
@@ -23,20 +21,19 @@ import org.apache.geode.internal.admin.ApplicationVM;
 import org.apache.geode.internal.logging.MergeLogFiles;
 
 import java.io.ByteArrayInputStream;
-import java.io.InputStream;  
-import java.io.PrintWriter;  
-import java.io.StringWriter;  
+import java.io.InputStream;
+import java.io.PrintWriter;
+import java.io.StringWriter;
 import java.util.ArrayList;
 import java.util.List;
 
 public class LogCollator {
-  
+
   private GfManagerAgent system;
   private List logTails;
-
-  public LogCollator() {
-  }
-  
+
+  public LogCollator() {}
+
   public String collateLogs(GfManagerAgent system) {
 try {
   if (system == null) {
@@ -47,15 +44,14 @@ public class LogCollator {
   gatherActiveLogs();
   gatherInactiveLogs();
   return mergeLogs();
-}
-finally {
+} finally {
   this.system = null;
   this.logTails = null;
 }
   }
 
   // -
-  
+
   private String mergeLogs() {
 // combine logs...
 InputStream[] logFiles = new InputStream[this.logTails.size()];
@@ -65,14 +61,13 @@ public class LogCollator {
   logFiles[i] = new ByteArrayInputStream(loglet.tail.getBytes());
   logFileNames[i] = loglet.name;
 }
-
+
 // delegate to MergeLogFiles...
 StringWriter writer = new StringWriter();
 PrintWriter mergedLog = new PrintWriter(writer);
 if (!MergeLogFiles.mergeLogFiles(logFiles, logFileNames, mergedLog)) {
   return writer.toString();
-} 
-else {
+} else {
   return "";
 }
   }
@@ -83,27 +78,17 @@ public class LogCollator {
   addLogFrom(runningsApps[i]);
 }
   }
-  
+
   private void gatherInactiveLogs() {
-/* not yet supported
-if (useStopped) {
-  LogViewHelper helper = new LogViewHelper();
-  for (Iterator iter = stoppedNodes.iterator(); iter.hasNext(); ) {
-Object adminEntity = iter.next();
-helper.setAdminEntity(adminEntity);
-try {
-  if (helper.logViewAvailable()) {
-String[] logs = helper.getSystemLogs();
-addTail(allTails, logs, adminEntity.toString());
-  }
-} catch (Exception e) {
-  Service.getService().reportSystemError(e);
-}
-  }
-}
-*/
+/*
+ * not yet supported if (useStopped) { LogViewHelper helper = new 
LogViewHelper(); for
+ * (Iterator iter = stoppedNodes.iterator(); iter.hasNext(); ) { Object 
adminEntity =
+ * iter.next(); helper.setAdminEntity(adminEntity); try { if 
(helper.logViewAvailable()) {
+ * String[] logs = helper.getSystemLogs(); addTail(allTails, logs, 
adminEntity.toString()); } }
+ * catch (Exception e) { 

[02/93] [partial] incubator-geode git commit: Added Spotless plugin to enforce formatting standards. Added Google Java Style guide formatter templates, removed existing formatter templates.

2016-10-26 Thread klund
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/8bf39571/geode-core/src/main/java/org/apache/geode/cache/DynamicRegionFactory.java
--
diff --git 
a/geode-core/src/main/java/org/apache/geode/cache/DynamicRegionFactory.java 
b/geode-core/src/main/java/org/apache/geode/cache/DynamicRegionFactory.java
index a4d84a6..57a1a46 100644
--- a/geode-core/src/main/java/org/apache/geode/cache/DynamicRegionFactory.java
+++ b/geode-core/src/main/java/org/apache/geode/cache/DynamicRegionFactory.java
@@ -1,18 +1,16 @@
 /*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
+ * Licensed to the Apache Software Foundation (ASF) under one or more 
contributor license
+ * agreements. See the NOTICE file distributed with this work for additional 
information regarding
+ * copyright ownership. The ASF licenses this file to You under the Apache 
License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance with the 
License. You may obtain a
+ * copy of the License at
  *
- *  http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
  *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software 
distributed under the License
+ * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 
KIND, either express
+ * or implied. See the License for the specific language governing permissions 
and limitations under
+ * the License.
  */
 
 package org.apache.geode.cache;
@@ -53,97 +51,100 @@ import org.apache.geode.security.GemFireSecurityException;
 
 
 /**
- * DynamicRegionFactory provides a distributed region creation service. 
- * Any other member of the GemFire DistributedSystem that has created 
- * an instance of this class will automatically instantiate regions created
- * through the factory from anywhere else in the DistributedSystem.
- * 
+ * DynamicRegionFactory provides a distributed region creation service. Any 
other member of the
+ * GemFire DistributedSystem that has created an instance of this class will 
automatically
+ * instantiate regions created through the factory from anywhere else in the 
DistributedSystem.
+ * 
+ * 
  * Instructions for Use:
  * 
- *  If your application is a client in a client/server installation,
- * either specify the pool name in the
- * {@link DynamicRegionFactory.Config} you'll use to create a
- * DynamicRegionFactory or specify it
- * in a dynamic-region-factory element in your cache.xml.
+ * If your application is a client in a client/server installation, either 
specify the pool name
+ * in the {@link DynamicRegionFactory.Config} you'll use to create a 
DynamicRegionFactory or
+ * specify it in a dynamic-region-factory element in your cache.xml.
  *
- *  Before you've created a GemFire Cache in your application, add a
- * line of code as follows:
- *   DynamicRegionFactory factory = DynamicRegionFactory.get();
- *  factory.open(config);
- *   DynamicRegionFactory myFactoryHandle = 
DynamicRegionFactory.get().open(config);
+ * Before you've created a GemFire Cache in your application, add a line 
of code as follows:
+ * 
+ * 
+ *   DynamicRegionFactory factory = DynamicRegionFactory.get();
+ *  factory.open(config);
+ * 
+ * 
+ * 
+ *   DynamicRegionFactory myFactoryHandle = 
DynamicRegionFactory.get().open(config);
+ * 
+ * 
  * or just use a dynamic-region-factory element in the cache.xml.
  *
- *  Create the GemFire Cache.  During cache creation, the list of dynamic 
Regions will either be discovered
- * by recovering
- * their names from disk (see {@link 
DynamicRegionFactory.Config#persistBackup}) or from other members of the
- * distributed system.
- * These dynamic Regions will be created before Cache creation completes.
+ * Create the GemFire Cache. During cache creation, the list of dynamic 
Regions will either be
+ * discovered by recovering their names from disk (see
+ * {@link DynamicRegionFactory.Config#persistBackup}) or from other members of 
the distributed
+ * system. These dynamic Regions will be created before Cache creation 
completes.
  *
- *  Thereafter, when you want to create dynamic distributed Regions,
- * create them using the {@link #createDynamicRegion}.  Regions created with 
the factory will
- * 

[03/93] [partial] incubator-geode git commit: Added Spotless plugin to enforce formatting standards. Added Google Java Style guide formatter templates, removed existing formatter templates.

2016-10-26 Thread klund
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/8bf39571/geode-core/src/main/java/org/apache/geode/cache/DiskStoreFactory.java
--
diff --git 
a/geode-core/src/main/java/org/apache/geode/cache/DiskStoreFactory.java 
b/geode-core/src/main/java/org/apache/geode/cache/DiskStoreFactory.java
index 3956682..a21dd8a 100755
--- a/geode-core/src/main/java/org/apache/geode/cache/DiskStoreFactory.java
+++ b/geode-core/src/main/java/org/apache/geode/cache/DiskStoreFactory.java
@@ -1,18 +1,16 @@
 /*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
+ * Licensed to the Apache Software Foundation (ASF) under one or more 
contributor license
+ * agreements. See the NOTICE file distributed with this work for additional 
information regarding
+ * copyright ownership. The ASF licenses this file to You under the Apache 
License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance with the 
License. You may obtain a
+ * copy of the License at
  *
- *  http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
  *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software 
distributed under the License
+ * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 
KIND, either express
+ * or implied. See the License for the specific language governing permissions 
and limitations under
+ * the License.
  */
 package org.apache.geode.cache;
 
@@ -21,132 +19,151 @@ import 
org.apache.geode.distributed.internal.DistributionConfig;
 import java.io.File;
 
 /**
- * Factory for creating instances of {@link DiskStore}.
- * To get an instance of this factory call {@link 
Cache#createDiskStoreFactory}.
- * If all you want to do is find an existing disk store see {@link 
Cache#findDiskStore}.
+ * Factory for creating instances of {@link DiskStore}. To get an instance of 
this factory call
+ * {@link Cache#createDiskStoreFactory}. If all you want to do is find an 
existing disk store see
+ * {@link Cache#findDiskStore}.
  * 
- * To use this factory configure it with the set methods and then
- * call {@link #create} to produce a disk store instance.
+ * To use this factory configure it with the set methods and then 
call {@link #create}
+ * to produce a disk store instance.
  * 
  * @since GemFire 6.5
  */
-public interface DiskStoreFactory
-{
+public interface DiskStoreFactory {
   /**
-   * The name of the default disk store is "DEFAULT".
-   * This name can be used to redefine the default disk store.
-   * Regions that have not had their disk-store-name set will
-   * use this disk store.
+   * The name of the default disk store is "DEFAULT". This name can be used to 
redefine the default
+   * disk store. Regions that have not had their disk-store-name set will use 
this disk store.
*/
   public static final String DEFAULT_DISK_STORE_NAME = "DEFAULT";
   /**
-   * The default setting for auto compaction. 
-   * Current value: true.
+   * The default setting for auto compaction.
+   * 
+   * Current value: true.
*/
   public static final boolean DEFAULT_AUTO_COMPACT = true;
-  
+
   /**
* The default compaction threshold.
-   * Current value: 50.
+   * 
+   * Current value: 50.
*/
   public static final int DEFAULT_COMPACTION_THRESHOLD = 50;
 
   /**
* The default value of the allow force compaction attribute.
-   * Current value: false.
+   * 
+   * Current value: false.
*/
   public static final boolean DEFAULT_ALLOW_FORCE_COMPACTION = false;
 
   /**
* The default maximum oplog file size in megabytes.
-   * Current value: 1024 which is one gigabyte.
+   * 
+   * Current value: 1024 which is one gigabyte.
*/
-  public static final long DEFAULT_MAX_OPLOG_SIZE = 
Long.getLong(DistributionConfig.GEMFIRE_PREFIX + "DEFAULT_MAX_OPLOG_SIZE", 
1024L)
-  .longValue(); // 1024 == 1 GB; // sys prop used by dunit and junit
+  public static final long DEFAULT_MAX_OPLOG_SIZE =
+  Long.getLong(DistributionConfig.GEMFIRE_PREFIX + 
"DEFAULT_MAX_OPLOG_SIZE", 1024L).longValue(); // 1024
+   
  // ==
+

incubator-geode git commit: GEODE-17: Fix a logical bug that prevents customers to set both Peer and Client authenticator

2016-10-26 Thread jinmeiliao
Repository: incubator-geode
Updated Branches:
  refs/heads/develop f02ea36f2 -> 477806af4


GEODE-17: Fix a logical bug that prevents customers to set both Peer and Client 
authenticator


Project: http://git-wip-us.apache.org/repos/asf/incubator-geode/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-geode/commit/477806af
Tree: http://git-wip-us.apache.org/repos/asf/incubator-geode/tree/477806af
Diff: http://git-wip-us.apache.org/repos/asf/incubator-geode/diff/477806af

Branch: refs/heads/develop
Commit: 477806af481fd3228a691edfd8e6edac5f90f851
Parents: f02ea36
Author: Jinmei Liao 
Authored: Wed Oct 26 10:40:10 2016 -0700
Committer: Jinmei Liao 
Committed: Wed Oct 26 15:29:21 2016 -0700

--
 .../security/IntegratedSecurityService.java | 51 ++--
 .../security/IntegratedSecurityServiceTest.java | 30 +---
 2 files changed, 48 insertions(+), 33 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/477806af/geode-core/src/main/java/org/apache/geode/internal/security/IntegratedSecurityService.java
--
diff --git 
a/geode-core/src/main/java/org/apache/geode/internal/security/IntegratedSecurityService.java
 
b/geode-core/src/main/java/org/apache/geode/internal/security/IntegratedSecurityService.java
index 9f4697f..8fc0f11 100644
--- 
a/geode-core/src/main/java/org/apache/geode/internal/security/IntegratedSecurityService.java
+++ 
b/geode-core/src/main/java/org/apache/geode/internal/security/IntegratedSecurityService.java
@@ -14,29 +14,14 @@
  */
 package org.apache.geode.internal.security;
 
-import static org.apache.geode.distributed.ConfigurationProperties.*;
-
-import java.io.IOException;
-import java.io.Serializable;
-import java.security.AccessController;
-import java.util.Properties;
-import java.util.Set;
-import java.util.concurrent.Callable;
+import static 
org.apache.geode.distributed.ConfigurationProperties.SECURITY_CLIENT_AUTHENTICATOR;
+import static 
org.apache.geode.distributed.ConfigurationProperties.SECURITY_MANAGER;
+import static 
org.apache.geode.distributed.ConfigurationProperties.SECURITY_PEER_AUTHENTICATOR;
+import static 
org.apache.geode.distributed.ConfigurationProperties.SECURITY_POST_PROCESSOR;
+import static 
org.apache.geode.distributed.ConfigurationProperties.SECURITY_SHIRO_INIT;
 
 import org.apache.commons.lang.SerializationException;
 import org.apache.commons.lang.StringUtils;
-import org.apache.logging.log4j.Logger;
-import org.apache.shiro.SecurityUtils;
-import org.apache.shiro.ShiroException;
-import org.apache.shiro.config.Ini.Section;
-import org.apache.shiro.config.IniSecurityManagerFactory;
-import org.apache.shiro.mgt.DefaultSecurityManager;
-import org.apache.shiro.realm.Realm;
-import org.apache.shiro.subject.Subject;
-import org.apache.shiro.subject.support.SubjectThreadState;
-import org.apache.shiro.util.ThreadContext;
-import org.apache.shiro.util.ThreadState;
-
 import org.apache.geode.GemFireIOException;
 import org.apache.geode.internal.cache.EntryEventImpl;
 import org.apache.geode.internal.logging.LogService;
@@ -54,6 +39,24 @@ import org.apache.geode.security.ResourcePermission;
 import org.apache.geode.security.ResourcePermission.Operation;
 import org.apache.geode.security.ResourcePermission.Resource;
 import org.apache.geode.security.SecurityManager;
+import org.apache.logging.log4j.Logger;
+import org.apache.shiro.SecurityUtils;
+import org.apache.shiro.ShiroException;
+import org.apache.shiro.config.Ini.Section;
+import org.apache.shiro.config.IniSecurityManagerFactory;
+import org.apache.shiro.mgt.DefaultSecurityManager;
+import org.apache.shiro.realm.Realm;
+import org.apache.shiro.subject.Subject;
+import org.apache.shiro.subject.support.SubjectThreadState;
+import org.apache.shiro.util.ThreadContext;
+import org.apache.shiro.util.ThreadState;
+
+import java.io.IOException;
+import java.io.Serializable;
+import java.security.AccessController;
+import java.util.Properties;
+import java.util.Set;
+import java.util.concurrent.Callable;
 
 public class IntegratedSecurityService implements SecurityService {
 
@@ -325,14 +328,10 @@ public class IntegratedSecurityService implements 
SecurityService {
   org.apache.shiro.mgt.SecurityManager shiroManager = new 
DefaultSecurityManager(realm);
   SecurityUtils.setSecurityManager(shiroManager);
   isIntegratedSecurity = true;
-} else if (!StringUtils.isBlank(clientAuthenticatorConfig)) {
-  isClientAuthenticator = true;
-} else if (!StringUtils.isBlank(peerAuthenticatorConfig)) {
-  isPeerAuthenticator = true;
 } else {
   isIntegratedSecurity = false;
-  isClientAuthenticator = false;
-  isPeerAuthenticator = false;
+  isClientAuthenticator = 

[42/42] incubator-geode git commit: GEODE-288: move admin package to internal

2016-10-26 Thread klund
GEODE-288: move admin package to internal


Project: http://git-wip-us.apache.org/repos/asf/incubator-geode/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-geode/commit/096b622d
Tree: http://git-wip-us.apache.org/repos/asf/incubator-geode/tree/096b622d
Diff: http://git-wip-us.apache.org/repos/asf/incubator-geode/diff/096b622d

Branch: refs/heads/feature/GEODE-288
Commit: 096b622d909e8292228668f83946c7154c521953
Parents: 56917a2
Author: Kirk Lund 
Authored: Wed Oct 26 15:10:49 2016 -0700
Committer: Kirk Lund 
Committed: Wed Oct 26 15:10:49 2016 -0700

--
 geode-core/build.gradle |1 -
 .../java/org/apache/geode/DataSerializer.java   |2 +-
 .../org/apache/geode/admin/AdminConfig.java |  156 --
 .../geode/admin/AdminDistributedSystem.java |  477 
 .../admin/AdminDistributedSystemFactory.java|  161 --
 .../org/apache/geode/admin/AdminException.java  |   89 -
 .../apache/geode/admin/AdminXmlException.java   |   47 -
 .../main/java/org/apache/geode/admin/Alert.java |   55 -
 .../java/org/apache/geode/admin/AlertLevel.java |  172 --
 .../org/apache/geode/admin/AlertListener.java   |   30 -
 .../org/apache/geode/admin/BackupStatus.java|   48 -
 .../geode/admin/CacheDoesNotExistException.java |   86 -
 .../apache/geode/admin/CacheHealthConfig.java   |  156 --
 .../org/apache/geode/admin/CacheServer.java |   45 -
 .../apache/geode/admin/CacheServerConfig.java   |   54 -
 .../java/org/apache/geode/admin/CacheVm.java|   37 -
 .../org/apache/geode/admin/CacheVmConfig.java   |   53 -
 .../geode/admin/ConfigurationParameter.java |   73 -
 .../geode/admin/DistributedSystemConfig.java|  642 -
 .../admin/DistributedSystemHealthConfig.java|   76 -
 .../apache/geode/admin/DistributionLocator.java |   46 -
 .../geode/admin/DistributionLocatorConfig.java  |   89 -
 .../org/apache/geode/admin/GemFireHealth.java   |  233 --
 .../apache/geode/admin/GemFireHealthConfig.java |   57 -
 .../apache/geode/admin/GemFireMemberStatus.java |  698 -
 .../org/apache/geode/admin/ManagedEntity.java   |  124 -
 .../apache/geode/admin/ManagedEntityConfig.java |   99 -
 .../apache/geode/admin/MemberHealthConfig.java  |  141 -
 .../admin/OperationCancelledException.java  |   48 -
 .../geode/admin/RegionNotFoundException.java|   39 -
 .../geode/admin/RegionSubRegionSnapshot.java|  192 --
 .../geode/admin/RuntimeAdminException.java  |   49 -
 .../java/org/apache/geode/admin/Statistic.java  |   65 -
 .../apache/geode/admin/StatisticResource.java   |   85 -
 .../org/apache/geode/admin/SystemMember.java|  147 --
 .../geode/admin/SystemMemberBridgeServer.java   |  308 ---
 .../apache/geode/admin/SystemMemberCache.java   |  204 --
 .../geode/admin/SystemMemberCacheEvent.java |   33 -
 .../geode/admin/SystemMemberCacheListener.java  |   72 -
 .../geode/admin/SystemMemberCacheServer.java|  308 ---
 .../apache/geode/admin/SystemMemberRegion.java  |  321 ---
 .../geode/admin/SystemMemberRegionEvent.java|   32 -
 .../apache/geode/admin/SystemMemberType.java|  145 -
 .../geode/admin/SystemMembershipEvent.java  |   40 -
 .../geode/admin/SystemMembershipListener.java   |   61 -
 .../UnmodifiableConfigurationException.java |   88 -
 .../admin/internal/AbstractHealthEvaluator.java |  184 --
 .../internal/AdminDistributedSystemImpl.java| 2476 -
 .../admin/internal/BackupDataStoreHelper.java   |   76 -
 .../admin/internal/BackupDataStoreResult.java   |   57 -
 .../geode/admin/internal/BackupStatusImpl.java  |   61 -
 .../admin/internal/CacheHealthConfigImpl.java   |   91 -
 .../admin/internal/CacheHealthEvaluator.java|  323 ---
 .../admin/internal/CacheServerConfigImpl.java   |  136 -
 .../geode/admin/internal/CacheServerImpl.java   |  199 --
 .../internal/ConfigurationParameterImpl.java|  280 --
 .../ConfigurationParameterListener.java |   34 -
 .../DisabledManagedEntityController.java|   91 -
 .../internal/DistributedSystemConfigImpl.java   | 1130 
 .../DistributedSystemHealthConfigImpl.java  |   58 -
 .../DistributedSystemHealthEvaluator.java   |  172 --
 .../DistributedSystemHealthMonitor.java |  436 ---
 .../internal/DistributionLocatorConfigImpl.java |  192 --
 .../admin/internal/DistributionLocatorImpl.java |  336 ---
 .../EnabledManagedEntityController.java |  411 ---
 .../admin/internal/FinishBackupRequest.java |  171 --
 .../admin/internal/FinishBackupResponse.java|   78 -
 .../admin/internal/FlushToDiskRequest.java  |   97 -
 .../admin/internal/FlushToDiskResponse.java |   45 -
 .../admin/internal/GemFireHealthConfigImpl.java |   83 -
 .../admin/internal/GemFireHealthEvaluator.java  |  187 --
 .../geode/admin/internal/GemFireHealthImpl.java |  535 
 .../geode/admin/internal/InetAddressUtil.java   |  209 --
 

[17/42] incubator-geode git commit: GEODE-288: move admin package to internal

2016-10-26 Thread klund
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/096b622d/geode-core/src/main/java/org/apache/geode/internal/admin/api/impl/EnabledManagedEntityController.java
--
diff --git 
a/geode-core/src/main/java/org/apache/geode/internal/admin/api/impl/EnabledManagedEntityController.java
 
b/geode-core/src/main/java/org/apache/geode/internal/admin/api/impl/EnabledManagedEntityController.java
new file mode 100755
index 000..aae8b2f
--- /dev/null
+++ 
b/geode-core/src/main/java/org/apache/geode/internal/admin/api/impl/EnabledManagedEntityController.java
@@ -0,0 +1,411 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.geode.internal.admin.api.impl;
+
+import org.apache.geode.internal.admin.api.AdminDistributedSystem;
+import org.apache.geode.internal.admin.api.DistributedSystemConfig;
+import org.apache.geode.internal.admin.api.ManagedEntity;
+import org.apache.geode.internal.admin.api.ManagedEntityConfig;
+import org.apache.geode.distributed.internal.DistributionConfig;
+import org.apache.geode.internal.ProcessOutputReader;
+import org.apache.geode.internal.i18n.LocalizedStrings;
+import org.apache.geode.internal.logging.LogService;
+import org.apache.geode.internal.logging.LoggingThreadGroup;
+import org.apache.geode.internal.logging.log4j.LocalizedMessage;
+import org.apache.logging.log4j.Logger;
+
+import java.io.File;
+import java.util.Iterator;
+import java.util.Properties;
+
+import static org.apache.geode.distributed.ConfigurationProperties.*;
+
+/**
+ * Implements the actual administration (starting, stopping, etc.) of
+ * GemFire {@link ManagedEntity}s.  It {@link Runtime#exec(java.lang.String) 
executes}
+ * commands to administer the entities based on information provided
+ * by the {@link InternalManagedEntity} object.  Note that it does not
+ * use SystemAdmin to manage "local" entities; it always
+ * execs the scripts.
+ *
+ * 
+ *
+ * This class is a refactoring of Systemcontroller,
+ * RemoteCommand, and LocatorRemoteCommand.
+ *
+ * @since GemFire 4.0
+ */
+class EnabledManagedEntityController implements ManagedEntityController {
+  private static final Logger logger = LogService.getLogger();
+
+//  /** A lock to ensure that only entity is managed at a time.  See bug
+//   * 31374. */
+//  private static Object startStopLock = new Object();
+
+  /** Known strings found in output indicating error. */
+  private static final String[] ERROR_OUTPUTS = new String[] {
+"No such file or directory",
+"The system cannot find the file specified.",
+"Access is denied.",
+"cannot open",
+"ERROR"
+  };
+
+  /** Token in command prefix to be replaced with actual HOST */
+  private static final String HOST = "{HOST}";
+
+  /** Token in command prefix to be replaced with actual execution CMD */
+  private static final String CMD = "{CMD}";
+
+  //  Instance Fields  //
+
+  /** The thread group in which threads launched by this system
+   * controller reside. */
+  private final ThreadGroup threadGroup;
+
+  /** System to which the managed entities belong */
+  private final AdminDistributedSystem system;
+
+  ///  Constructors  ///
+
+  /**
+   * Creates a new ManagedEntityController for entities
+   * in the given distributed system.
+   */
+  EnabledManagedEntityController(AdminDistributedSystem system) {
+this.system = system;
+this.threadGroup =
+  LoggingThreadGroup.createThreadGroup("ManagedEntityController threads", 
logger);
+  }
+
+  /  Instance Methods  /
+
+  /**
+   * Returns true if the output string
+   * contains a known error message.
+   */
+  private boolean outputIsError(String output) {
+if (output == null) return false;
+boolean error = false;
+for (int i = 0; i < ERROR_OUTPUTS.length; i++) {
+  error = output.indexOf(ERROR_OUTPUTS[i]) > -1;
+  if (error) return error;
+}
+return error;
+  }
+
+  /**
+   * Executes a command using {@link Runtime#exec(java.lang.String)}.
+   *
+   * @param command
+   *The full command to remotely execute
+   *
+   * 

[19/42] incubator-geode git commit: GEODE-288: move admin package to internal

2016-10-26 Thread klund
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/096b622d/geode-core/src/main/java/org/apache/geode/internal/admin/api/impl/BackupDataStoreHelper.java
--
diff --git 
a/geode-core/src/main/java/org/apache/geode/internal/admin/api/impl/BackupDataStoreHelper.java
 
b/geode-core/src/main/java/org/apache/geode/internal/admin/api/impl/BackupDataStoreHelper.java
new file mode 100644
index 000..8410d9b
--- /dev/null
+++ 
b/geode-core/src/main/java/org/apache/geode/internal/admin/api/impl/BackupDataStoreHelper.java
@@ -0,0 +1,76 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.geode.internal.admin.api.impl;
+
+import java.io.File;
+import java.util.Map;
+import java.util.Set;
+
+import org.apache.geode.cache.persistence.PersistentID;
+import org.apache.geode.distributed.DistributedLockService;
+import org.apache.geode.distributed.DistributedMember;
+import org.apache.geode.distributed.internal.DM;
+import org.apache.geode.internal.Assert;
+
+public class BackupDataStoreHelper {
+
+  public static String LOCK_SERVICE_NAME = 
BackupDataStoreHelper.class.getSimpleName();
+
+  private static String LOCK_NAME = LOCK_SERVICE_NAME + "_token";
+  
+  private static Object LOCK_SYNC = new Object();
+
+  @SuppressWarnings("rawtypes")
+  public static BackupDataStoreResult backupAllMembers(
+  DM dm, Set recipients, File targetDir, File baselineDir) {
+FlushToDiskRequest.send(dm, recipients);
+
+boolean abort= true;
+Map successfulMembers;
+Map existingDataStores;
+try {
+  existingDataStores = PrepareBackupRequest.send(dm, recipients);
+  abort = false;
+} finally {
+  successfulMembers = FinishBackupRequest.send(dm, recipients, targetDir, 
baselineDir, abort);
+}
+return new BackupDataStoreResult(existingDataStores, successfulMembers);
+  }
+  
+  private static DistributedLockService getLockService(DM dm) {
+DistributedLockService dls = 
DistributedLockService.getServiceNamed(LOCK_SERVICE_NAME);
+if (dls == null) {
+  synchronized (LOCK_SYNC) {
+dls = DistributedLockService.getServiceNamed(LOCK_SERVICE_NAME);
+if (dls == null) {
+  // Create the DistributedLockService
+  dls = DistributedLockService.create(LOCK_SERVICE_NAME, 
dm.getSystem());
+}
+  }
+}
+Assert.assertTrue(dls != null);
+return dls;
+  }
+  
+  public static boolean obtainLock(DM dm) {
+return getLockService(dm).lock(LOCK_NAME, 0, -1);
+  }
+  
+  public static void releaseLock(DM dm) {
+getLockService(dm).unlock(LOCK_NAME);
+  }
+}

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/096b622d/geode-core/src/main/java/org/apache/geode/internal/admin/api/impl/BackupDataStoreResult.java
--
diff --git 
a/geode-core/src/main/java/org/apache/geode/internal/admin/api/impl/BackupDataStoreResult.java
 
b/geode-core/src/main/java/org/apache/geode/internal/admin/api/impl/BackupDataStoreResult.java
new file mode 100644
index 000..ae425d2
--- /dev/null
+++ 
b/geode-core/src/main/java/org/apache/geode/internal/admin/api/impl/BackupDataStoreResult.java
@@ -0,0 +1,57 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.geode.internal.admin.api.impl;
+
+import java.util.Map;
+import 

[15/42] incubator-geode git commit: GEODE-288: move admin package to internal

2016-10-26 Thread klund
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/096b622d/geode-core/src/main/java/org/apache/geode/internal/admin/api/impl/SystemMemberBridgeServerImpl.java
--
diff --git 
a/geode-core/src/main/java/org/apache/geode/internal/admin/api/impl/SystemMemberBridgeServerImpl.java
 
b/geode-core/src/main/java/org/apache/geode/internal/admin/api/impl/SystemMemberBridgeServerImpl.java
new file mode 100644
index 000..48f432f
--- /dev/null
+++ 
b/geode-core/src/main/java/org/apache/geode/internal/admin/api/impl/SystemMemberBridgeServerImpl.java
@@ -0,0 +1,233 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.geode.internal.admin.api.impl;
+
+import java.io.Serializable;
+
+import org.apache.geode.InternalGemFireException;
+import org.apache.geode.internal.admin.api.AdminException;
+import org.apache.geode.internal.admin.api.SystemMemberBridgeServer;
+import org.apache.geode.internal.admin.api.SystemMemberCacheServer;
+import org.apache.geode.cache.server.ServerLoadProbe;
+import org.apache.geode.internal.admin.*;
+import org.apache.geode.internal.i18n.LocalizedStrings;
+
+/**
+ * Implementation of an object used for managing cache servers.
+ *
+ * @since GemFire 4.0
+ */
+public class SystemMemberBridgeServerImpl
+  implements SystemMemberCacheServer, SystemMemberBridgeServer {
+
+  /** The VM in which the bridge server resides */
+  private final GemFireVM vm;
+
+  /** The cache server by this bridge server */
+  private CacheInfo cache;
+
+  /** Information about the bridge server */
+  private AdminBridgeServer bridgeInfo;
+
+  /  Constructors  /
+
+  /**
+   * Creates a new SystemMemberBridgeServerImpl that
+   * administers the given bridge server in the given VM.
+   */
+  protected SystemMemberBridgeServerImpl(SystemMemberCacheImpl cache,
+ AdminBridgeServer bridgeInfo)
+ 
+throws AdminException {
+
+this.vm = cache.getVM();
+this.cache = cache.getCacheInfo();
+this.bridgeInfo = bridgeInfo;
+  }
+
+    Instance Methods  
+
+  /**
+   * Throws an AdminException if this bridge server is
+   * running.
+   */
+  private void checkRunning() throws AdminException {
+if (this.isRunning()) {
+  throw new 
AdminException(LocalizedStrings.SystemMemberBridgeServerImpl_CANNOT_CHANGE_THE_CONFIGURATION_OF_A_RUNNING_BRIDGE_SERVER.toLocalizedString());
+}
+  }
+
+  public int getPort() {
+return this.bridgeInfo.getPort();
+  }
+
+  public void setPort(int port) throws AdminException {
+checkRunning();
+this.bridgeInfo.setPort(port);
+  }
+
+  public void start() throws AdminException {
+this.vm.startBridgeServer(this.cache, this.bridgeInfo);
+  }
+
+  public boolean isRunning() {
+return this.bridgeInfo.isRunning();
+  }
+
+  public void stop() throws AdminException {
+this.vm.stopBridgeServer(this.cache, this.bridgeInfo);
+  }
+
+  /**
+   * Returns the VM-unique id of this bridge server
+   */
+  protected int getBridgeId() {
+return this.bridgeInfo.getId();
+  }
+
+  public void refresh() {
+try {
+  this.bridgeInfo =
+this.vm.getBridgeInfo(this.cache, this.bridgeInfo.getId());
+
+} catch (AdminException ex) {
+  throw new 
InternalGemFireException(LocalizedStrings.SystemMemberBridgeServerImpl_UNEXPECTED_EXCEPTION_WHILE_REFRESHING.toLocalizedString(),
 ex);
+}
+  }
+
+  public String getBindAddress() {
+return this.bridgeInfo.getBindAddress();
+  }
+
+  public void setBindAddress(String address) throws AdminException {
+checkRunning();
+this.bridgeInfo.setBindAddress(address);
+  }
+
+  public String getHostnameForClients() {
+return this.bridgeInfo.getHostnameForClients();
+  }
+
+  public void setHostnameForClients(String name) throws AdminException {
+checkRunning();
+this.bridgeInfo.setHostnameForClients(name);
+  }
+
+  public void setNotifyBySubscription(boolean b) throws AdminException {
+checkRunning();
+this.bridgeInfo.setNotifyBySubscription(b);
+  }
+
+  public boolean 

[40/42] incubator-geode git commit: GEODE-288: move admin package to internal

2016-10-26 Thread klund
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/096b622d/geode-core/src/main/java/org/apache/geode/admin/RegionNotFoundException.java
--
diff --git 
a/geode-core/src/main/java/org/apache/geode/admin/RegionNotFoundException.java 
b/geode-core/src/main/java/org/apache/geode/admin/RegionNotFoundException.java
deleted file mode 100644
index 29dfa98..000
--- 
a/geode-core/src/main/java/org/apache/geode/admin/RegionNotFoundException.java
+++ /dev/null
@@ -1,39 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *  http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.geode.admin;
-
-//import org.apache.geode.cache.CacheException;
-import org.apache.geode.cache.CacheRuntimeException;
-
-/**
- * Thrown by the administration API when the region administered by a
- * {@link SystemMemberRegion} has been closed or destroyed in system
- * member. 
- * Also thrown by {@link 
org.apache.geode.DataSerializer#readRegion(java.io.DataInput)}
- * if the named region no longer exists.
- *
- * @since GemFire 3.5
- * @deprecated as of 7.0 use the management
 package instead
- */
-public class RegionNotFoundException extends CacheRuntimeException {
-private static final long serialVersionUID = 1758668137691463909L;
-
-  public RegionNotFoundException(String message) {
-super(message);
-  }
-  
-}

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/096b622d/geode-core/src/main/java/org/apache/geode/admin/RegionSubRegionSnapshot.java
--
diff --git 
a/geode-core/src/main/java/org/apache/geode/admin/RegionSubRegionSnapshot.java 
b/geode-core/src/main/java/org/apache/geode/admin/RegionSubRegionSnapshot.java
deleted file mode 100644
index 1945566..000
--- 
a/geode-core/src/main/java/org/apache/geode/admin/RegionSubRegionSnapshot.java
+++ /dev/null
@@ -1,192 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *  http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.geode.admin;
-
-import java.io.DataInput;
-import java.io.DataOutput;
-import java.io.IOException;
-import java.util.HashSet;
-import java.util.Iterator;
-import java.util.Set;
-
-import org.apache.geode.DataSerializable;
-import org.apache.geode.DataSerializer;
-import org.apache.geode.cache.Region;
-import org.apache.geode.i18n.LogWriterI18n;
-import org.apache.geode.internal.cache.PartitionedRegion;
-
-/**
- * Class RegionSubRegionSnapshot provides information about
- * Regions. This also provides the information about sub regions
- * This class is used by the monitoring tool.
- * 
- * 
- * @since GemFire 5.7
- * @deprecated as of 7.0 use the management
 package instead
- */
-public class RegionSubRegionSnapshot implements DataSerializable {
-  private static final long serialVersionUID = -8052137675270041871L;
-  public RegionSubRegionSnapshot() {
-this.parent = null;
-this.subRegionSnapshots = new HashSet();
-  }
-
-  public RegionSubRegionSnapshot(Region reg) {
-this();
-this.name = reg.getName();
-if (reg instanceof PartitionedRegion) {
-  PartitionedRegion p_reg = (PartitionedRegion)reg;
-  this.entryCount = p_reg.entryCount(true);
-}
-else {
-  this.entryCount = reg.entrySet().size();
-}
-final LogWriterI18n logger = reg.getCache().getLoggerI18n();
-if((logger != null) && logger.fineEnabled()) {
-  logger.fine(
-"RegionSubRegionSnapshot Region entry count =" + this.entryCount
-+ " 

[25/42] incubator-geode git commit: GEODE-288: move admin package to internal

2016-10-26 Thread klund
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/096b622d/geode-core/src/main/java/org/apache/geode/admin/jmx/internal/StatAlertsAggregator.java
--
diff --git 
a/geode-core/src/main/java/org/apache/geode/admin/jmx/internal/StatAlertsAggregator.java
 
b/geode-core/src/main/java/org/apache/geode/admin/jmx/internal/StatAlertsAggregator.java
deleted file mode 100644
index b80b18b..000
--- 
a/geode-core/src/main/java/org/apache/geode/admin/jmx/internal/StatAlertsAggregator.java
+++ /dev/null
@@ -1,124 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *  http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.geode.admin.jmx.internal;
-
-import org.apache.geode.internal.admin.GemFireVM;
-import org.apache.geode.internal.admin.StatAlert;
-import org.apache.geode.internal.admin.StatAlertDefinition;
-
-/**
- * This interface represents an Aggregator entity and resides in JMXAgent.
- * Responsibilities are as follows:
- * 
- *  set AlertsManager in the newly joined members
- *  create/update/remove alert
- *  manage refresh interval
- *  process notification from members
- *  Aggregate stats & make available for clients thro' JMXAgent
- * 
- * 
- */
-public interface StatAlertsAggregator {
-
-  /**
-   * This method can be used to get an alert definition.
-   * 
-   * @param alertDefinition
-   *StatAlertDefinition to retrieve
-   * @return StatAlertDefinition
-   */
-  public StatAlertDefinition getAlertDefinition(
-  StatAlertDefinition alertDefinition);
-
-  /**
-   * This method can be used to retrieve all available stat alert definitions.
-   * 
-   * @return An array of all available StatAlertDefinition objects
-   */
-  public StatAlertDefinition[] getAllStatAlertDefinitions();
-
-  /**
-   * This method can be used to update alert definition for the Stat mentioned.
-   * This method should update the collection maintained at the aggregator and
-   * should notify members for the newly added alert definitions.
-   * 
-   * A new alert definition will be created if matching one not found.
-   * 
-   * @param alertDefinition
-   *alertDefinition to be updated
-   */
-  public void updateAlertDefinition(StatAlertDefinition alertDefinition);
-
-  /**
-   * This method can be used to remove alert definition for the Stat mentioned.
-   * 
-   * This method should update the collection maintained at the aggregator and
-   * should notify members for the newly added alert definitions.
-   * 
-   * @param defId
-   *id of the alert definition to be removed
-   */
-  public void removeAlertDefinition(Integer defId);
-
-  /**
-   * Convenience method to check whether an alert definition is created.
-   * 
-   * @param alert
-   *alert definition to check whether already created
-   * @return true if the alert definition is already created, false otherwise
-   */
-  public boolean isAlertDefinitionCreated(StatAlertDefinition alert);
-
-  /**
-   * This method can be used to set the AlertManager for the newly joined 
member
-   * VM.
-   * 
-   * @param memberVM
-   *Member VM to set AlertsManager for
-   */
-  public void setAlertsManager(GemFireVM memberVM);
-
-  /**
-   * Returns the refresh interval for the Stats in seconds.
-   * 
-   * @return refresh interval for the Stats(in seconds)
-   */
-  public int getRefreshIntervalForStatAlerts();
-
-  /**
-   * This method is used to set the refresh interval for the Stats Alerts in
-   * seconds
-   * 
-   * @param refreshInterval
-   *refresh interval for the Stats(in seconds)
-   */
-  public void setRefreshIntervalForStatAlerts(int refreshInterval);
-
-  /**
-   * This method can be used to process the notifications sent by the 
member(s).
-   * Actual aggregation of stats can occur here. The array contains alert
-   * objects with alert def. ID & value. AlertHelper class can be used to
-   * retrieve the corresponding alert definition.
-   * 
-   * @param alerts
-   *array of Alert class(contains alert def. ID & value)
-   * @param remoteVM
-   */
-  public void processNotifications(StatAlert[] alerts, GemFireVM remoteVM);
-
-  public void 

[32/42] incubator-geode git commit: GEODE-288: move admin package to internal

2016-10-26 Thread klund
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/096b622d/geode-core/src/main/java/org/apache/geode/admin/jmx/internal/AdminDistributedSystemJmxImpl.java
--
diff --git 
a/geode-core/src/main/java/org/apache/geode/admin/jmx/internal/AdminDistributedSystemJmxImpl.java
 
b/geode-core/src/main/java/org/apache/geode/admin/jmx/internal/AdminDistributedSystemJmxImpl.java
deleted file mode 100755
index 5ff4bfa..000
--- 
a/geode-core/src/main/java/org/apache/geode/admin/jmx/internal/AdminDistributedSystemJmxImpl.java
+++ /dev/null
@@ -1,2291 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *  http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.geode.admin.jmx.internal;
-
-import org.apache.geode.DataSerializer;
-import org.apache.geode.SystemFailure;
-import org.apache.geode.admin.*;
-import org.apache.geode.admin.internal.AdminDistributedSystemImpl;
-import org.apache.geode.admin.internal.CacheServerConfigImpl;
-import org.apache.geode.admin.internal.DistributionLocatorImpl;
-import org.apache.geode.cache.persistence.PersistentID;
-import org.apache.geode.distributed.DistributedMember;
-import org.apache.geode.distributed.internal.DistributionConfig;
-import org.apache.geode.distributed.internal.InternalDistributedSystem;
-import 
org.apache.geode.distributed.internal.membership.InternalDistributedMember;
-import org.apache.geode.internal.Assert;
-import org.apache.geode.internal.admin.Alert;
-import org.apache.geode.internal.admin.*;
-import org.apache.geode.internal.admin.remote.UpdateAlertDefinitionMessage;
-import org.apache.geode.internal.i18n.LocalizedStrings;
-import org.apache.geode.internal.logging.InternalLogWriter;
-import org.apache.geode.internal.logging.LogService;
-import org.apache.geode.internal.logging.log4j.LocalizedMessage;
-import org.apache.logging.log4j.Logger;
-
-import javax.management.*;
-import javax.management.modelmbean.ModelMBean;
-import javax.management.openmbean.*;
-import java.io.*;
-import java.net.InetAddress;
-import java.net.UnknownHostException;
-import java.util.*;
-import java.util.concurrent.atomic.AtomicInteger;
-
-/**
- * Provides MBean support for managing a GemFire distributed system.
- * 
- * TODO: refactor to implement DistributedSystem and delegate to instance of
- * DistributedSystemImpl. Wrap all delegate calls w/ e.printStackTrace() since 
- * the HttpAdaptor devours them (what to do w/ template methods then?)
- *
- * @since GemFire 3.5
- */
-public class AdminDistributedSystemJmxImpl 
-  extends AdminDistributedSystemImpl
-  implements ManagedResource, DistributedSystemConfig, 
StatAlertsAggregator {
-
-  private static final Logger logger = LogService.getLogger();
-  
-  private Properties mailProps;
-
-  // The file name where the StatAlertDefinitions would be serialized
-  private String statAlertDefnSerFile = System.getProperty("user.dir");
-  
-  /** 
-   * Simple counter incrementing on each notification.  This this currently 
-   * resets at every restart of Agent
-   */
-  private final AtomicInteger notificationSequenceNumber = new AtomicInteger();
-
-  /**
-   * Variable to indicate if there are no Rmi clients connected.
-   */
-  private volatile boolean isRmiClientCountZero;
-
-  /**
-   * Variable to indicate if Statistics Alert definitions could be persisted 
-   * across runs/sessions.
-   */
-  private volatile boolean canPersistStatAlertDefs = true;
-
-  /** Cache Listener to listen to Cache & Region create/destroy events */
-  private CacheAndRegionListenerImpl cacheRegionListener;
-
-  // -
-  //   Constructor(s)
-  // -
-  
-  /**
-   * Constructs new DistributedSystemJmxImpl and registers an MBean to 
represent
-   * it.
-   * 
-   * @param config
-   *  configuration defining the JMX agent.
-   */
-  public AdminDistributedSystemJmxImpl(AgentConfigImpl config)
-  throws org.apache.geode.admin.AdminException {
-super(config);
-this.mbeanName = "GemFire:type=AdminDistributedSystem,id="
-+ 

[38/42] incubator-geode git commit: GEODE-288: move admin package to internal

2016-10-26 Thread klund
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/096b622d/geode-core/src/main/java/org/apache/geode/admin/internal/AdminDistributedSystemImpl.java
--
diff --git 
a/geode-core/src/main/java/org/apache/geode/admin/internal/AdminDistributedSystemImpl.java
 
b/geode-core/src/main/java/org/apache/geode/admin/internal/AdminDistributedSystemImpl.java
deleted file mode 100755
index aba79d2..000
--- 
a/geode-core/src/main/java/org/apache/geode/admin/internal/AdminDistributedSystemImpl.java
+++ /dev/null
@@ -1,2476 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *  http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.geode.admin.internal;
-
-import org.apache.geode.CancelException;
-import org.apache.geode.SystemFailure;
-import org.apache.geode.admin.*;
-import org.apache.geode.admin.Alert;
-import org.apache.geode.admin.AlertListener;
-import org.apache.geode.cache.persistence.PersistentID;
-import org.apache.geode.distributed.DistributedMember;
-import org.apache.geode.distributed.FutureCancelledException;
-import org.apache.geode.distributed.internal.*;
-import 
org.apache.geode.distributed.internal.membership.InternalDistributedMember;
-import org.apache.geode.internal.Assert;
-import org.apache.geode.internal.Banner;
-import org.apache.geode.internal.admin.*;
-import org.apache.geode.internal.admin.remote.*;
-import org.apache.geode.internal.cache.persistence.PersistentMemberPattern;
-import org.apache.geode.internal.i18n.LocalizedStrings;
-import org.apache.geode.internal.logging.InternalLogWriter;
-import org.apache.geode.internal.logging.LogService;
-import org.apache.geode.internal.logging.LogWriterFactory;
-import org.apache.geode.internal.logging.log4j.LocalizedMessage;
-import org.apache.geode.internal.logging.log4j.LogMarker;
-import org.apache.geode.internal.logging.log4j.LogWriterAppender;
-import org.apache.geode.internal.logging.log4j.LogWriterAppenders;
-import org.apache.geode.internal.util.concurrent.FutureResult;
-import org.apache.logging.log4j.Logger;
-
-import java.io.File;
-import java.io.IOException;
-import java.net.InetAddress;
-import java.text.SimpleDateFormat;
-import java.util.*;
-import java.util.concurrent.*;
-
-import static org.apache.geode.distributed.ConfigurationProperties.*;
-
-/**
- * Represents a GemFire distributed system for remote 
administration/management.
- *
- * @since GemFire 3.5
- */
-public class AdminDistributedSystemImpl
-implements org.apache.geode.admin.AdminDistributedSystem,
-   org.apache.geode.internal.admin.JoinLeaveListener,
-   org.apache.geode.internal.admin.AlertListener,
-   
org.apache.geode.distributed.internal.InternalDistributedSystem.DisconnectListener
 {
-
-  private static final Logger logger = LogService.getLogger();
-  
-  /** String identity of this distributed system */
-  private String id;
-  
-  /** Latest alert broadcast by any system members */
-  private Alert latestAlert;
-  
-  // -
-
-  /** Internal admin agent to delegate low-level work to */
-  private volatile GfManagerAgent gfManagerAgent;
-
-  /** Monitors the health of this distributed system */
-  private GemFireHealth health;
-
-  /** Set of non-Manager members in this system */
-  private final Set applicationSet = new HashSet();
-  
-  /** Set of DistributionLocators for this system */
-  private final Set locatorSet = new HashSet();
-
-  /** Set of dedicated CacheServer members in this system */
-  private final Set cacheServerSet = new HashSet();
-
-  /** Configuration defining this distributed system */
-  private final DistributedSystemConfigImpl config;
-  
-  /** Controller for starting and stopping managed entities */
-  private ManagedEntityController controller;
-  
-  /** Log file collator for gathering and merging system member logs */
-  private LogCollator logCollator = new LogCollator();
-  
-  /** The level above which alerts will be delivered to the alert
-   * listeners */
-  private AlertLevel alertLevel = AlertLevel.WARNING;
-
-  /** The alert listeners registered on this distributed system. */
-  private volatile Set alertListeners = 

[16/42] incubator-geode git commit: GEODE-288: move admin package to internal

2016-10-26 Thread klund
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/096b622d/geode-core/src/main/java/org/apache/geode/internal/admin/api/impl/ManagedEntityConfigXml.java
--
diff --git 
a/geode-core/src/main/java/org/apache/geode/internal/admin/api/impl/ManagedEntityConfigXml.java
 
b/geode-core/src/main/java/org/apache/geode/internal/admin/api/impl/ManagedEntityConfigXml.java
new file mode 100644
index 000..3b56342
--- /dev/null
+++ 
b/geode-core/src/main/java/org/apache/geode/internal/admin/api/impl/ManagedEntityConfigXml.java
@@ -0,0 +1,171 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.geode.internal.admin.api.impl;
+
+import org.apache.geode.distributed.ConfigurationProperties;
+import org.apache.geode.internal.ClassPathLoader;
+import org.apache.geode.internal.admin.api.DistributedSystemConfig;
+import org.apache.geode.internal.i18n.LocalizedStrings;
+import org.xml.sax.*;
+
+import java.io.InputStream;
+
+/**
+ * The abstract superclass of classes that convert XML into a {@link
+ * DistributedSystemConfig} and vice versa.
+ * It provides helper methods and constants.
+ *
+ * @since GemFire 4.0
+ */
+abstract class ManagedEntityConfigXml implements EntityResolver, ErrorHandler {
+
+  /** The location of the DTD file */
+  protected static final String DTD_LOCATION =
+"/org/apache/geode/internal/admin/doc-files/ds5_0.dtd";
+
+  /** The URL for the DTD */
+  protected static final String SYSTEM_ID =
+"http://www.gemstone.com/dtd/ds5_0.dtd;;
+
+  /** The public ID for the DTD */
+  protected static final String PUBLIC_ID = 
+"-//GemStone Systems, Inc.//GemFire Distributed System 5.0//EN";
+
+  /** The name of the distributed-system element. */
+  public static final String DISTRIBUTED_SYSTEM =
+"distributed-system";
+
+  /** The name of the id attribute. */
+  public static final String ID = "id";
+
+  /** The name of the disable-tcp attribute. */
+  public static final String DISABLE_TCP = "disable-tcp";
+
+  /** The name of the remote-command element. */
+  public static final String REMOTE_COMMAND = "remote-command";
+
+  /** The name of the locators element. */
+  public static final String LOCATORS = ConfigurationProperties.LOCATORS;
+
+  /** The name of the ssl element. */
+  public static final String SSL = "ssl";
+
+  /** The name of the cache-server element */
+  public static final String CACHE_SERVER = "cache-server";
+
+  /** The name of the multicast element */
+  public static final String MULTICAST = "multicast";
+
+  /** The name of the locator element */
+  public static final String LOCATOR = "locator";
+
+  /** The name of the port attribute */
+  public static final String PORT = "port";
+
+  /** The name of the address attribute */
+  public static final String ADDRESS = "address";
+
+  /** The name of the host element. */
+  public static final String HOST = "host";
+
+  /** The name of the working-directory element */
+  public static final String WORKING_DIRECTORY = "working-directory";
+
+  /** The name of the product-directory element */
+  public static final String PRODUCT_DIRECTORY = "product-directory";
+
+  /** The name of the protocols element */
+  public static final String PROTOCOLS = "protocols";
+
+  /** The name of the ciphers element */
+  public static final String CIPHERS = "ciphers";
+
+  /** The name of the property element */
+  public static final String PROPERTY = "property";
+
+  /** Name of the authentication-required attribute */
+  public static final String AUTHENTICATION_REQUIRED =
+"authentication-required";
+
+  /** The name of the key element */
+  public static final String KEY = "key";
+
+  /** The name of the value element */
+  public static final String VALUE = "value";
+  
+  /** The name of the classpath element */
+  public static final String CLASSPATH = "classpath";
+
+  ///  Instance Methods  ///
+
+  /**
+   * Given a public id, attempt to resolve it to a DTD.  Returns an
+   * InputSoure for the DTD.
+   */
+  public InputSource resolveEntity(String publicId, String systemId) 
+throws SAXException {
+
+if (publicId == null || 

[35/42] incubator-geode git commit: GEODE-288: move admin package to internal

2016-10-26 Thread klund
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/096b622d/geode-core/src/main/java/org/apache/geode/admin/internal/GemFireHealthImpl.java
--
diff --git 
a/geode-core/src/main/java/org/apache/geode/admin/internal/GemFireHealthImpl.java
 
b/geode-core/src/main/java/org/apache/geode/admin/internal/GemFireHealthImpl.java
deleted file mode 100644
index f944482..000
--- 
a/geode-core/src/main/java/org/apache/geode/admin/internal/GemFireHealthImpl.java
+++ /dev/null
@@ -1,535 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *  http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.geode.admin.internal;
-
-import org.apache.geode.CancelException;
-import org.apache.geode.admin.*;
-import org.apache.geode.internal.Assert;
-import org.apache.geode.internal.admin.*;
-import org.apache.geode.internal.i18n.LocalizedStrings;
-
-import java.net.InetAddress;
-import java.net.UnknownHostException;
-import java.util.*;
-
-/**
- * Provides the implementation of the GemFireHealth
- * administration API.  This class is responsible for {@linkplain
- * GemFireVM#addHealthListener sending} the {@link
- * GemFireHealthConfig}s to the remote member VM in which the health
- * is calcualted.
- *
- *
- * @since GemFire 3.5
- */
-public class GemFireHealthImpl
-  implements GemFireHealth, JoinLeaveListener, HealthListener {
-
-  /** The distributed system whose health is being monitored */
-  private final GfManagerAgent agent;
-
-  /** The default configuration for checking GemFire health */
-  protected GemFireHealthConfig defaultConfig;
-
-  /** Maps the name of a host to its GemFireHealthConfig.
-   * Note that the mappings are created lazily. */
-  private final Map hostConfigs;
-
-  /** Maps the name of a host to all of the members
-   * (GemFireVMs) that run on that host. */
-  private final Map hostMembers;
-
-  /** The members that are known to be in {@link #OKAY_HEALTH}. */
-  private Collection okayHealth;
-
-  /** The members that are known to be in {@link #POOR_HEALTH}. */
-  private Collection poorHealth;
-
-  /** The overall health of GemFire */
-  private GemFireHealth.Health overallHealth;
-
-  /** Is this GemFireHealthImpl closed? */
-  private boolean isClosed;
-
-  /** The configuration specifying how the health of the distributed
-   * system should be computed.  */
-  protected volatile DistributedSystemHealthConfig dsHealthConfig;
-
-  /** Monitors the health of the entire distributed system */
-  private DistributedSystemHealthMonitor dsHealthMonitor = null;
-
-  /** The distributed system whose health is monitored by this
-   * GemFireHealth. */
-  private final AdminDistributedSystem system;
-
-  
-  ///  Constructors  ///
-
-  /**
-   * Creates a new GemFireHealthImpl that monitors the
-   * health of member of the given distributed system.
-   */
-  protected GemFireHealthImpl(GfManagerAgent agent,
-  AdminDistributedSystem system) {
-// agent.getDM().getLogger().info("Creating GemFireHealthImpl",
-//new Exception("Stack trace"));
-
-this.agent = agent;
-this.system = system;
-
-this.hostConfigs = new HashMap();
-this.hostMembers = new HashMap();
-this.okayHealth = new HashSet();
-this.poorHealth = new HashSet();
-this.overallHealth = GOOD_HEALTH;
-this.isClosed = false;
-
-GemFireVM[] apps = this.agent.listApplications();
-for (int i = 0; i < apps.length; i++) {
-  GemFireVM member = apps[i];
-  this.noteNewMember(member);
-}
-
-agent.addJoinLeaveListener(this);
-setDefaultGemFireHealthConfig(createGemFireHealthConfig(null));
-setDistributedSystemHealthConfig(createDistributedSystemHealthConfig());
-  }
-
-  @Override
-  public String toString() {
-StringBuffer sb = new StringBuffer();
-sb.append("closed=" + isClosed);
-sb.append("; hostMembers=" + hostMembers);
-sb.append("; okayHealth=" + okayHealth);
-sb.append("; poorHealth=" + poorHealth);
-sb.append("; overallHealth=" + overallHealth);
-sb.append("; diagnosis=" + getDiagnosis());
-return sb.toString();
-  }
-  //  Instance 

[27/42] incubator-geode git commit: GEODE-288: move admin package to internal

2016-10-26 Thread klund
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/096b622d/geode-core/src/main/java/org/apache/geode/admin/jmx/internal/MX4JModelMBean.java
--
diff --git 
a/geode-core/src/main/java/org/apache/geode/admin/jmx/internal/MX4JModelMBean.java
 
b/geode-core/src/main/java/org/apache/geode/admin/jmx/internal/MX4JModelMBean.java
deleted file mode 100755
index 81f543d..000
--- 
a/geode-core/src/main/java/org/apache/geode/admin/jmx/internal/MX4JModelMBean.java
+++ /dev/null
@@ -1,1239 +0,0 @@
-/*
- * Copyright (C) MX4J.
- * All rights reserved.
- *
- * This software is distributed under the terms of the MX4J License version 
1.0.
- * See the terms of the MX4J License in the documentation provided with this 
software.
- */
-
-package org.apache.geode.admin.jmx.internal;
-
-import java.lang.reflect.InvocationTargetException;
-import java.lang.reflect.Method;
-import java.util.Date;
-import java.util.Iterator;
-
-import javax.management.Attribute;
-import javax.management.AttributeChangeNotification;
-import javax.management.AttributeChangeNotificationFilter;
-import javax.management.AttributeList;
-import javax.management.AttributeNotFoundException;
-import javax.management.Descriptor;
-import javax.management.InstanceNotFoundException;
-import javax.management.InvalidAttributeValueException;
-import javax.management.ListenerNotFoundException;
-import javax.management.MBeanAttributeInfo;
-import javax.management.MBeanException;
-import javax.management.MBeanInfo;
-import javax.management.MBeanNotificationInfo;
-import javax.management.MBeanOperationInfo;
-import javax.management.MBeanRegistration;
-import javax.management.MBeanRegistrationException;
-import javax.management.MBeanServer;
-import javax.management.MalformedObjectNameException;
-import javax.management.Notification;
-import javax.management.NotificationBroadcasterSupport;
-import javax.management.NotificationEmitter;
-import javax.management.NotificationFilter;
-import javax.management.NotificationListener;
-import javax.management.ObjectName;
-import javax.management.ReflectionException;
-import javax.management.RuntimeErrorException;
-import javax.management.RuntimeOperationsException;
-import javax.management.ServiceNotFoundException;
-import javax.management.loading.ClassLoaderRepository;
-import javax.management.modelmbean.InvalidTargetObjectTypeException;
-import javax.management.modelmbean.ModelMBean;
-import javax.management.modelmbean.ModelMBeanAttributeInfo;
-import javax.management.modelmbean.ModelMBeanInfo;
-import javax.management.modelmbean.ModelMBeanOperationInfo;
-
-import mx4j.ImplementationException;
-import mx4j.log.FileLogger;
-import mx4j.log.Log;
-import mx4j.log.Logger;
-import mx4j.log.MBeanLogger;
-import mx4j.persist.FilePersister;
-import mx4j.persist.MBeanPersister;
-import mx4j.persist.PersisterMBean;
-import mx4j.util.Utils;
-
-import org.apache.geode.internal.i18n.LocalizedStrings;
-
-/**
- * @author mailto:biorn_stee...@users.sourceforge.net;>Simone 
Bordet
- * @version $Revision: 1.14 $
- */
-public class MX4JModelMBean implements ModelMBean, MBeanRegistration, 
NotificationEmitter
-{
-   private static final String OBJECT_RESOURCE_TYPE = "ObjectReference";
-
-   private static final int ALWAYS_STALE = 1;
-   private static final int NEVER_STALE = 2;
-   private static final int STALE = 3;
-   private static final int NOT_STALE = 4;
-
-   private static final int PERSIST_NEVER = -1;
-   private static final int PERSIST_ON_TIMER = -2;
-   private static final int PERSIST_ON_UPDATE = -3;
-   private static final int PERSIST_NO_MORE_OFTEN_THAN = -4;
-
-   private MBeanServer m_mbeanServer;
-   private Object m_managedResource;
-   private boolean m_canBeRegistered;
-   private ModelMBeanInfo m_modelMBeanInfo;
-   private NotificationBroadcasterSupport m_attributeChangeBroadcaster = new 
NotificationBroadcasterSupport();
-   private NotificationBroadcasterSupport m_generalBroadcaster = new 
NotificationBroadcasterSupport();
-
-   public MX4JModelMBean() throws MBeanException, RuntimeOperationsException
-   {
-  try
-  {
- load();
-  }
-  catch (Exception x)
-  {
- Logger logger = getLogger();
- 
logger.warn(LocalizedStrings.MX4JModelMBean_CANNOT_RESTORE_PREVIOUSLY_SAVED_STATUS.toLocalizedString(),
 x);
-  }
-   }
-
-   public MX4JModelMBean(ModelMBeanInfo info) throws MBeanException, 
RuntimeOperationsException
-   {
-  if (info == null)
- throw new RuntimeOperationsException(new 
IllegalArgumentException(LocalizedStrings.MX4JModelMBean_MODELMBEANINFO_PARAMETER_CANT_BE_NULL.toLocalizedString()));
-  else
- setModelMBeanInfo(info);
-   }
-
-   private Logger getLogger()
-   {
-  return Log.getLogger(getClass().getName());
-   }
-
-   public ObjectName preRegister(MBeanServer server, ObjectName name) throws 
Exception
-   {
-  if (m_canBeRegistered)
-  {
- 

[01/42] incubator-geode git commit: GEODE-288: move admin package to internal [Forced Update!]

2016-10-26 Thread klund
Repository: incubator-geode
Updated Branches:
  refs/heads/feature/GEODE-288 3bd8ef7fb -> 096b622d9 (forced update)


http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/096b622d/geode-core/src/test/resources/org/apache/geode/codeAnalysis/sanctionedSerializables.txt
--
diff --git 
a/geode-core/src/test/resources/org/apache/geode/codeAnalysis/sanctionedSerializables.txt
 
b/geode-core/src/test/resources/org/apache/geode/codeAnalysis/sanctionedSerializables.txt
index 03bb3ea..8625afa 100644
--- 
a/geode-core/src/test/resources/org/apache/geode/codeAnalysis/sanctionedSerializables.txt
+++ 
b/geode-core/src/test/resources/org/apache/geode/codeAnalysis/sanctionedSerializables.txt
@@ -25,32 +25,6 @@ org/apache/geode/ToDataException,true,-2329606027453879918
 org/apache/geode/UncreatedSystemException,true,5424354567878425435
 org/apache/geode/UnmodifiableException,true,-1043243260052395455
 org/apache/geode/UnstartedSystemException,true,-4285897556527521788
-org/apache/geode/admin/AdminException,true,879398950879472021
-org/apache/geode/admin/AdminXmlException,true,-6848726449157550169
-org/apache/geode/admin/AlertLevel,true,-4752438966587392126,ordinal:int
-org/apache/geode/admin/CacheDoesNotExistException,true,-1639933911265729978
-org/apache/geode/admin/GemFireHealth$Health,true,3039539430412151801,healthString:java/lang/String
-org/apache/geode/admin/GemFireMemberStatus,true,3389997790525991310,_bindAddress:java/lang/String,_clientHealthStats:java/util/Map,_clientHostNames:java/util/Map,_clientQueueSizes:java/util/Map,_connectedClients:java/util/Set,_connectedIncomingGateways:java/util/Map,_connectedPeers:java/util/Set,_connectedServers:java/util/Set,_freeHeapSize:long,_gatewayHubStatus:java/lang/Object,_gatewayQueueSizes:java/util/Map,_hostAddress:java/net/InetAddress,_isClient:boolean,_isConnected:boolean,_isGatewayHub:boolean,_isLocator:boolean,_isPrimaryGatewayHub:boolean,_isServer:boolean,_locators:java/lang/String,_maximumHeapSize:long,_mcastAddress:java/net/InetAddress,_mcastPort:int,_memberId:java/io/Serializable,_memberName:java/lang/String,_outgoingGateways:java/util/Map,_regionStatuses:java/util/Map,_serverPort:int,_unconnectedServers:java/util/Set,upTime:long
-org/apache/geode/admin/OperationCancelledException,true,5474068770227602546
-org/apache/geode/admin/RegionNotFoundException,true,1758668137691463909
-org/apache/geode/admin/RuntimeAdminException,true,-7512771113818634005
-org/apache/geode/admin/SystemMemberType,true,3284366994485749302,ordinal:int
-org/apache/geode/admin/UnmodifiableConfigurationException,true,-7653547392992060646
-org/apache/geode/admin/internal/BackupStatusImpl,true,3704162840296921840,backedUpDiskStores:java/util/Map,offlineDiskStores:java/util/Set
-org/apache/geode/admin/internal/CacheHealthConfigImpl,false,maxEventQueueSize:long,maxLoadTime:long,maxNetSearchTime:long,minHitRatio:double
-org/apache/geode/admin/internal/GemFireHealthConfigImpl,true,-6797673296902808018,hostName:java/lang/String,interval:int
-org/apache/geode/admin/internal/MemberHealthConfigImpl,true,3966032573073580490,maxMessageQueueSize:long,maxReplyTimeouts:long,maxRetransmissionRatio:double,maxVMProcessSize:long
-org/apache/geode/admin/internal/StatisticImpl,true,3899296873901634399,internalStat:org/apache/geode/internal/admin/Stat
-org/apache/geode/admin/jmx/internal/AgentImpl$StartupException,true,6614145962199330348
-org/apache/geode/admin/jmx/internal/AgentLauncher$Status,true,-7758402454664266174,baseName:java/lang/String,exception:java/lang/Throwable,msg:java/lang/String,pid:int,state:int
-org/apache/geode/admin/jmx/internal/ConfigAttributeInfo,true,-1918437700841687078,config:org/apache/geode/admin/jmx/internal/ConfigurationParameterJmxImpl
-org/apache/geode/admin/jmx/internal/ConfigurationParameterJmxImpl,true,-7822171853906772375,deserialized:boolean
-org/apache/geode/admin/jmx/internal/ConnectionNotificationFilterImpl,true,1
-org/apache/geode/admin/jmx/internal/DynamicManagedBean,true,4051924500150228160
-org/apache/geode/admin/jmx/internal/GemFireHealthConfigJmxImpl,true,1482719647163239953,delegate:org/apache/geode/admin/GemFireHealthConfig,health:org/apache/geode/admin/GemFireHealth,mbeanName:java/lang/String,modelMBean:javax/management/modelmbean/ModelMBean,objectName:javax/management/ObjectName
-org/apache/geode/admin/jmx/internal/ManagedResourceType,true,3752874768667480449,ordinal:int
-org/apache/geode/admin/jmx/internal/RefreshNotificationType,true,4376763592395613794,ordinal:int
-org/apache/geode/admin/jmx/internal/StatisticAttributeInfo,true,28022387514935560,stat:org/apache/geode/admin/Statistic
 

[26/42] incubator-geode git commit: GEODE-288: move admin package to internal

2016-10-26 Thread klund
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/096b622d/geode-core/src/main/java/org/apache/geode/admin/jmx/internal/MemberInfoWithStatsMBean.java
--
diff --git 
a/geode-core/src/main/java/org/apache/geode/admin/jmx/internal/MemberInfoWithStatsMBean.java
 
b/geode-core/src/main/java/org/apache/geode/admin/jmx/internal/MemberInfoWithStatsMBean.java
deleted file mode 100644
index ac75f38..000
--- 
a/geode-core/src/main/java/org/apache/geode/admin/jmx/internal/MemberInfoWithStatsMBean.java
+++ /dev/null
@@ -1,1352 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *  http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.geode.admin.jmx.internal;
-
-import static org.apache.geode.distributed.ConfigurationProperties.*;
-
-import org.apache.geode.admin.*;
-import org.apache.geode.admin.jmx.Agent;
-import org.apache.geode.cache.InterestPolicy;
-import org.apache.geode.cache.SubscriptionAttributes;
-import org.apache.geode.distributed.internal.DistributionConfig;
-import org.apache.geode.internal.GemFireVersion;
-import org.apache.geode.internal.admin.remote.ClientHealthStats;
-import org.apache.geode.internal.i18n.LocalizedStrings;
-import org.apache.geode.internal.logging.LogService;
-import org.apache.geode.internal.logging.log4j.LocalizedMessage;
-import mx4j.AbstractDynamicMBean;
-import org.apache.logging.log4j.Logger;
-
-import javax.management.*;
-import java.net.InetAddress;
-import java.text.MessageFormat;
-import java.util.*;
-import java.util.concurrent.atomic.AtomicLong;
-
-/**
- * This class uses the JMX Attributes/Operations that use (return/throw) 
- * GemFire types. This is the single MBean accessible with ObjectName string
- * {@link MemberInfoWithStatsMBean#MBEAN_NAME}}. This MBean can be used to 
- * retrieve the all member details as plain java types.
- * 
- * This MBean also acts as a Notification Hub for all the Notifications that 
are 
- * defined for Admin Distributed System. 
- * 
- * 
- * @since GemFire 6.5
- */
-public class MemberInfoWithStatsMBean extends AbstractDynamicMBean 
- implements NotificationEmitter {
-  private static final Logger logger = LogService.getLogger();
-  
-  /* constants defining max no of attributes/operations/notifications */
-  private static final int MAX_ATTRIBUTES_COUNT= 3;
-  private static final int MAX_OPERATIONS_COUNT= 3;
-  private static final int MAX_NOTIFICATIONS_COUNT = 9;
-  
-  private static final String NOT_AVAILABLE_STR = "N/A";
-  private static final String NOT_AVAILABLE = null;
-  private static final Number NOT_AVAILABLE_NUMBER = null;
-
-  /* String constant used for a region that is used on admin side just as a 
root 
-   * for rootRegions defined on the member */
-  private static final String PLACE_HOLDER_ROOT_REGION = "/Root/";
-
-  /* String that are used to form QueryExp/ObjectName for querying MBeanServer 
*/
-  private static final String REGION_QUERY_EXPRESSION = 
"*GemFire.Cache*:*,owner={0},type=Region";  
-  private static final String STATS_QUERY_EXPRESSION  = 
"*GemFire.Statistic*:*,source={0},name={1}";
-  
-  /** mbean name string for this MBean */
-  /*default*/static final String  MBEAN_NAME = 
"GemFire:type=MemberInfoWithStatsMBean";
-
-  /** ObjectName handle for this MBean */
-  private ObjectName objectName;
-  
-  /** version of the GemFire Enterprise system that is running */
-  private Stringversion;
-  private int   refreshInterval;
-  private Stringid;
-  
-  private Agent agent;
-  private AdminDistributedSystemJmxImpl adminDSJmx;
-  
-  private NotificationForwarder forwarder;
-  private boolean   isInitialized;//needs synchronization?
-
-  /**
-   * Default Constructor
-   * 
-   * @param agent Admin Agent instance
-   * @throws OperationsException if ObjectName can't be formed for this MBean
-   * @throws MBeanRegistrationException 
-   * @throws AdminException 
-   */
-  MemberInfoWithStatsMBean(Agent agent) throws OperationsException, 
MBeanRegistrationException, AdminException {
-this.agent   = agent;
-this.objectName  

  1   2   3   >