[29/50] [abbrv] incubator-geode git commit: GEODE-288: move admin packages to internal
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b6c305f8/geode-core/src/main/java/org/apache/geode/internal/admin/api/GemFireMemberStatus.java -- diff --git a/geode-core/src/main/java/org/apache/geode/internal/admin/api/GemFireMemberStatus.java b/geode-core/src/main/java/org/apache/geode/internal/admin/api/GemFireMemberStatus.java new file mode 100755 index 000..6bac386 --- /dev/null +++ b/geode-core/src/main/java/org/apache/geode/internal/admin/api/GemFireMemberStatus.java @@ -0,0 +1,670 @@ +/* + * 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.Cache; +import org.apache.geode.cache.Region; +import org.apache.geode.cache.client.PoolManager; +import org.apache.geode.cache.server.CacheServer; +import org.apache.geode.distributed.DistributedSystem; +import org.apache.geode.distributed.Locator; +import org.apache.geode.distributed.internal.DM; +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.net.SocketCreator; +import org.apache.geode.internal.admin.ClientHealthMonitoringRegion; +import org.apache.geode.internal.admin.remote.ClientHealthStats; +import org.apache.geode.internal.cache.*; +import org.apache.geode.internal.cache.tier.InternalClientMembership; +import org.apache.geode.internal.cache.tier.sockets.ClientProxyMembershipID; + +import java.io.IOException; +import java.io.Serializable; +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 + */ +public class GemFireMemberStatus implements Serializable { + private static final long serialVersionUID = 3389997790525991310L; + + /** + * Notifies whether this member is a client to a cache server. + */ + protected boolean _isClient; + + /** + * Notifies whether this member is a cache server. + */ + protected boolean _isServer; + + /** + * Notifies whether this member is a hub for WAN gateways. + */ + protected boolean _isGatewayHub; + + /** + * Notifies whether this member is a locator. + */ + protected boolean _isLocator; + + protected boolean _isPrimaryGatewayHub; + + protected Object/* GatewayHubStatus */ _gatewayHubStatus; + + protected boolean _isConnected; + protected Serializable _memberId; + protected Set _connectedPeers; + protected Set _connectedServers; + protected Set _unconnectedServers; + protected Set _connectedClients; + protected Map _connectedIncomingGateways; + protected Map _outgoingGateways; + + protected Map _clientHostNames; + protected Map _clientQueueSizes; + protected Map _gatewayQueueSizes; + protected Map _regionStatuses; + protected Map _clientHealthStats; + + protected String _memberName; + protected int _mcastPort; + protected int _serverPort; + protected InetAddress _mcastAddress; + protected String _bindAddress; + protected String _locators; + protected InetAddress _hostAddress; + + protected long _maximumHeapSize; + protected long _freeHeapSize; + + protected long upTime = -1; + + protected transient final Cache cache; + + public GemFireMemberStatus() { +this(null); + } + + public GemFireMemberStatus(Cache cache) { +this.cache = cache; +DistributedSystem ds = null; +if (cache != null) { + ds = cache.getDistributedSystem(); +} +initialize(ds); + } + + public boolean getIsConnected() { +return this._isConnected; + } + + protected void setIsConnected(boolean isConnected) { +this._isConnected = isConnected; + } + + /** + * 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() { +return this._isClient; + } + + /** + * Sets whether this member is a client to a cache server +
[29/50] [abbrv] incubator-geode git commit: GEODE-288: move admin packages to internal
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/6bb27bf1/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
[29/50] [abbrv] incubator-geode git commit: GEODE-288: move admin packages to internal
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/20a32286/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..ef0012f --- /dev/null +++ b/geode-core/src/main/java/org/apache/geode/internal/admin/api/impl/AdminDistributedSystemImpl.java @@ -0,0 +1,2418 @@ +/* + * 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 */ + private Alert