1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-08-03 14:25:37 +02:00

[225507][api][breaking] RSE dstore API leaks non-API types

This commit is contained in:
David McKnight 2008-04-03 14:05:59 +00:00
parent d4e117da9d
commit db203efc29
14 changed files with 106 additions and 44 deletions

View file

@ -17,6 +17,7 @@
* Martin Oberhuber (Wind River) - [219260][dstore][regression] Cannot connect to dstore daemon
* David McKnight (IBM) [220123][dstore] Configurable timeout on irresponsiveness
* David McKnight (IBM) - [220892][dstore] Backward compatibility: Server and Daemon should support old clients
* David McKnight (IBM) - [225507][api][breaking] RSE dstore API leaks non-API types
*******************************************************************************/
package org.eclipse.dstore.core.client;
@ -45,8 +46,11 @@ import org.eclipse.dstore.core.model.DataStore;
import org.eclipse.dstore.core.model.DataStoreAttributes;
import org.eclipse.dstore.core.model.IDataStoreCompatibilityHandler;
import org.eclipse.dstore.core.model.IDataStoreConstants;
import org.eclipse.dstore.core.model.IExternalLoader;
import org.eclipse.dstore.core.model.ISSLProperties;
import org.eclipse.dstore.core.server.ServerLauncher;
import org.eclipse.dstore.core.util.ssl.IDataStoreTrustManager;
import org.eclipse.dstore.extra.IDomainNotifier;
import org.eclipse.dstore.internal.core.client.ClientAttributes;
import org.eclipse.dstore.internal.core.client.ClientCommandHandler;
import org.eclipse.dstore.internal.core.client.ClientReceiver;
@ -59,6 +63,7 @@ import org.eclipse.dstore.internal.core.util.ssl.DataStoreTrustManager;
import org.eclipse.dstore.internal.extra.DomainNotifier;
/**
* ClientConnection provides the standard means of creating a new connection to
* a DataStore.
@ -85,7 +90,7 @@ public class ClientConnection
private boolean _isConnected = false;
private boolean _isRemote = false;
private DataStore _dataStore;
private DomainNotifier _domainNotifier;
private IDomainNotifier _domainNotifier;
private Sender _sender;
private ClientReceiver _receiver;
private ClientUpdateHandler _updateHandler;
@ -144,7 +149,7 @@ public class ClientConnection
* @param name an identifier for this connection
* @param notifier the notifier used to keep the user interface in synch with the DataStore
*/
public ClientConnection(String name, DomainNotifier notifier)
public ClientConnection(String name, IDomainNotifier notifier)
{
_domainNotifier = notifier;
_name = name;
@ -158,7 +163,7 @@ public class ClientConnection
* @param notifier the notifier used to keep the user interface in synch with the DataStore
* @param initialSize the number of elements to preallocate in the DataStore
*/
public ClientConnection(String name, DomainNotifier notifier, int initialSize)
public ClientConnection(String name, IDomainNotifier notifier, int initialSize)
{
_domainNotifier = notifier;
_name = name;
@ -214,7 +219,7 @@ public class ClientConnection
*
* @param loader the loader
*/
public void addLoader(ExternalLoader loader)
public void addLoader(IExternalLoader loader)
{
if (_loaders == null)
{
@ -420,7 +425,7 @@ public class ClientConnection
return connect(launchStatus.getTicket());
}
public DataStoreTrustManager getTrustManager()
public IDataStoreTrustManager getTrustManager()
{
if (_trustManager == null)
{
@ -464,7 +469,7 @@ public class ClientConnection
{
String location = _dataStore.getKeyStoreLocation();
String pw = _dataStore.getKeyStorePassword();
DataStoreTrustManager mgr = getTrustManager();
IDataStoreTrustManager mgr = getTrustManager();
SSLContext context = DStoreSSLContext.getClientSSLContext(location, pw, mgr);
SSLSocketFactory factory = context.getSocketFactory();
@ -731,7 +736,7 @@ public class ClientConnection
{
String location = _dataStore.getKeyStoreLocation();
String pw = _dataStore.getKeyStorePassword();
DataStoreTrustManager mgr = getTrustManager();
IDataStoreTrustManager mgr = getTrustManager();
SSLContext context = DStoreSSLContext.getClientSSLContext(location, pw, mgr);
try

View file

@ -11,17 +11,20 @@
*
* Contributors:
* Noriaki Takatsu (IBM) [220126] [dstore][api][breaking] Single process server for multiple clients
* Jacob Garcowski (IBM) [225175] [dstore] [dstore] error handling change for Client
* David McKnight (IBM) - [225507][api][breaking] RSE dstore API leaks non-API types
*******************************************************************************/
package org.eclipse.dstore.core.model;
import org.eclipse.dstore.core.server.IServerLogger;
import org.eclipse.dstore.core.server.ServerReceiver;
public class Client
{
public String _userid;
private IServerLogger _logger;
protected ServerReceiver _receiver;
public void setUserid(String userid)
{
@ -48,5 +51,15 @@ public class Client
return System.getProperty(key);
}
public void disconnectServerReceiver()
{
if (_receiver != null)
_receiver.finish();
}
public void setServerReceiver(ServerReceiver receiver)
{
_receiver = receiver;
}
}

View file

@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright (c) 2002, 2007 IBM Corporation and others.
* Copyright (c) 2002, 2008 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@ -12,7 +12,7 @@
* Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
*
* Contributors:
* {Name} (company) - description of contribution.
* David McKnight (IBM) - [225507][api][breaking] RSE dstore API leaks non-API types
*******************************************************************************/
package org.eclipse.dstore.core.model;
@ -20,7 +20,7 @@ package org.eclipse.dstore.core.model;
import java.util.ArrayList;
import org.eclipse.dstore.core.java.IRemoteClassInstance;
import org.eclipse.dstore.internal.core.util.CommandGenerator;
import org.eclipse.dstore.core.util.CommandGenerator;
/**
* <p>

View file

@ -19,6 +19,7 @@
* David McKnight (IBM) - [222168][dstore] Buffer in DataElement is not sent
* Noriaki Takatsu (IBM) - [220126] [dstore][api][breaking] Single process server for multiple clients
* David McKnight (IBM) [224906] [dstore] changes for getting properties and doing exit due to single-process capability
* David McKnight (IBM) - [225507][api][breaking] RSE dstore API leaks non-API types
*******************************************************************************/
package org.eclipse.dstore.core.model;
@ -55,10 +56,8 @@ import org.eclipse.dstore.internal.core.client.ClientCommandHandler;
import org.eclipse.dstore.internal.core.model.DefaultByteConverter;
import org.eclipse.dstore.internal.core.server.ServerUpdateHandler;
import org.eclipse.dstore.internal.core.util.DataElementRemover;
import org.eclipse.dstore.internal.core.util.ExternalLoader;
import org.eclipse.dstore.internal.core.util.XMLgenerator;
import org.eclipse.dstore.internal.core.util.XMLparser;
import org.eclipse.dstore.internal.extra.DomainNotifier;
/**
* <code>DataStore</code> is the heart of the <code>DataStore</code> Distributed Tooling Framework.
@ -70,7 +69,7 @@ import org.eclipse.dstore.internal.extra.DomainNotifier;
* handler is responsible for sending commands, in the form of <code>DataElement</code> trees, to the appropriate
* implementer, either directly to the miner, or indirectly over the communication layer through a server
* <code>DataStore</code>. The update handler is responsible for notifying listeners about changes in the
* <code>DataStore</code>, either directly via a <code>DomainNotifier</code> or indirectly over the communication
* <code>DataStore</code>, either directly via a <code>IDomainNotifier</code> or indirectly over the communication
* layer through a client <code>DataStore</code>.
* </p>
*
@ -103,7 +102,7 @@ public final class DataStore
private ByteStreamHandlerRegistry _byteStreamHandlerRegistry;
private ClassByteStreamHandlerRegistry _classbyteStreamHandlerRegistry;
private DomainNotifier _domainNotifier;
private IDomainNotifier _domainNotifier;
private ArrayList _loaders;
private ArrayList _minersLocations;
@ -208,7 +207,7 @@ public final class DataStore
* @param updateHandler the DataStore's handler for doing updates
* @param domainNotifier the domain notifier
*/
public DataStore(DataStoreAttributes attributes, CommandHandler commandHandler, UpdateHandler updateHandler, DomainNotifier domainNotifier)
public DataStore(DataStoreAttributes attributes, CommandHandler commandHandler, UpdateHandler updateHandler, IDomainNotifier domainNotifier)
{
_dataStoreAttributes = attributes;
_commandHandler = commandHandler;
@ -231,7 +230,7 @@ public final class DataStore
* @param domainNotifier the domain notifier
* @param initialSize the initialNumber of preallocated <code>DataElement</code>s
*/
public DataStore(DataStoreAttributes attributes, CommandHandler commandHandler, UpdateHandler updateHandler, DomainNotifier domainNotifier, int initialSize)
public DataStore(DataStoreAttributes attributes, CommandHandler commandHandler, UpdateHandler updateHandler, IDomainNotifier domainNotifier, int initialSize)
{
_dataStoreAttributes = attributes;
_commandHandler = commandHandler;
@ -301,7 +300,7 @@ public final class DataStore
*
* @param loader the loader for the miners this <code>DataStore</code> will be using
*/
public void addLoader(ExternalLoader loader)
public void addLoader(IExternalLoader loader)
{
if (_loaders == null)
{
@ -416,11 +415,11 @@ public final class DataStore
}
/**
* Sets the <code>DataStore</code>'s DomainNotifier
* Sets the <code>DataStore</code>'s IDomainNotifier
*
* @param domainNotifier the domainNotifier
*/
public void setDomainNotifier(DomainNotifier domainNotifier)
public void setDomainNotifier(IDomainNotifier domainNotifier)
{
_domainNotifier = domainNotifier;
}

View file

@ -16,9 +16,11 @@
* David McKnight (IBM) [220892][dstore] Backward compatibility: Server and Daemon should support old clients
* Noriaki Takatsu (IBM) - [220126] [dstore][api][breaking] Single process server for multiple clients
* David McKnight (IBM) [224906] [dstore] changes for getting properties and doing exit due to single-process capability
* Jacob Garcowski (IBM) [225175] [dstore] error handling change for Client
* David McKnight (IBM) - [225507][api][breaking] RSE dstore API leaks non-API types
*******************************************************************************/
package org.eclipse.dstore.internal.core.server;
package org.eclipse.dstore.core.server;
import java.io.BufferedWriter;
import java.io.IOException;
@ -40,7 +42,11 @@ import org.eclipse.dstore.core.model.DataElement;
import org.eclipse.dstore.core.model.DataStore;
import org.eclipse.dstore.core.model.DataStoreAttributes;
import org.eclipse.dstore.core.model.ISSLProperties;
import org.eclipse.dstore.core.server.SystemServiceManager;
import org.eclipse.dstore.internal.core.server.ServerAttributes;
import org.eclipse.dstore.internal.core.server.ServerCommandHandler;
import org.eclipse.dstore.internal.core.server.ServerReturnCodes;
import org.eclipse.dstore.internal.core.server.ServerSSLProperties;
import org.eclipse.dstore.internal.core.server.ServerUpdateHandler;
import org.eclipse.dstore.internal.core.util.ExternalLoader;
import org.eclipse.dstore.internal.core.util.Sender;
import org.eclipse.dstore.internal.core.util.ssl.DStoreSSLContext;
@ -220,6 +226,9 @@ public class ConnectionEstablisher
ServerReceiver receiver = new ServerReceiver(newSocket, this);
_dataStore.addDataStorePreferenceListener(receiver);
if (_dataStore.getClient() != null)
_dataStore.getClient().setServerReceiver(receiver);
Sender sender = new Sender(newSocket, _dataStore);
// add this connection to list of elements

View file

@ -12,15 +12,15 @@
* Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
*
* Contributors:
* Noriaki Takatsu (IBM) - [220126] [dstore][api][breaking] Single process server for multiple clients
* David McKnight (IBM) [224906] [dstore] changes for getting properties and doing exit due to single-process capability
* Noriaki Takatsu (IBM) - [220126] [dstore][api][breaking] Single process server for multiple clients
* David McKnight (IBM) [224906] [dstore] changes for getting properties and doing exit due to single-process capability
* David McKnight (IBM) - [225507][api][breaking] RSE dstore API leaks non-API types
*******************************************************************************/
package org.eclipse.dstore.core.server;
import java.util.StringTokenizer;
import org.eclipse.dstore.internal.core.server.ConnectionEstablisher;
import org.eclipse.dstore.internal.core.server.ServerReturnCodes;
/**

View file

@ -12,15 +12,15 @@
* Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
*
* Contributors:
* {Name} (company) - description of contribution.
* David McKnight (IBM) - [225507][api][breaking] RSE dstore API leaks non-API types
*******************************************************************************/
package org.eclipse.dstore.internal.core.server;
package org.eclipse.dstore.core.server;
import java.net.Socket;
import org.eclipse.dstore.core.model.DataElement;
import org.eclipse.dstore.internal.core.util.Receiver;
import org.eclipse.dstore.core.util.Receiver;
/**
* The ServerReciever is responsible for recieving data from

View file

@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright (c) 2002, 2007 IBM Corporation and others.
* Copyright (c) 2002, 2008 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@ -12,10 +12,10 @@
* Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
*
* Contributors:
* {Name} (company) - description of contribution.
* David McKnight (IBM) - [225507][api][breaking] RSE dstore API leaks non-API types
*******************************************************************************/
package org.eclipse.dstore.internal.core.util;
package org.eclipse.dstore.core.util;
import java.util.ArrayList;

View file

@ -15,9 +15,10 @@
* David McKnight (IBM) [220123][dstore] Configurable timeout on irresponsiveness
* David McKnight (IBM) [222003] Client remains connected after server terminates
* Noriaki Takatsu (IBM) - [220126] [dstore][api][breaking] Single process server for multiple clients
* David McKnight (IBM) - [225507][api][breaking] RSE dstore API leaks non-API types
*******************************************************************************/
package org.eclipse.dstore.internal.core.util;
package org.eclipse.dstore.core.util;
import java.io.BufferedInputStream;
import java.io.IOException;
@ -28,6 +29,7 @@ import org.eclipse.dstore.core.model.DataElement;
import org.eclipse.dstore.core.model.DataStore;
import org.eclipse.dstore.core.model.IDataStorePreferenceListener;
import org.eclipse.dstore.core.server.SecuredThread;
import org.eclipse.dstore.internal.core.util.XMLparser;
/**
* This class is used for receiving data from a socket in the DataStore

View file

@ -0,0 +1,34 @@
/********************************************************************************
* Copyright (c) 2008 IBM Corporation. All rights reserved.
* This program and the accompanying materials are made available under the terms
* of the Eclipse Public License v1.0 which accompanies this distribution, and is
* available at http://www.eclipse.org/legal/epl-v10.html
*
* Initial Contributors:
* The following IBM employees contributed to the Remote System Explorer
* component that contains this file: David McKnight.
*
* Contributors:
* David McKnight (IBM) - [225507][api][breaking] RSE dstore API leaks non-API types
********************************************************************************/
package org.eclipse.dstore.core.util.ssl;
import java.util.List;
import javax.net.ssl.X509TrustManager;
public interface IDataStoreTrustManager extends X509TrustManager
{
/**
* Sets the path and password for the trust manager
* @param filePath the path
* @param password the password
*/
public void setKeystore(String filePath, String password);
/**
* Returns the list of untrusted certificates
* @return the list of untrusted certificates
*/
public List getUntrustedCerts();
}

View file

@ -22,7 +22,7 @@ import java.net.Socket;
import org.eclipse.dstore.core.model.DE;
import org.eclipse.dstore.core.model.DataElement;
import org.eclipse.dstore.core.model.DataStore;
import org.eclipse.dstore.internal.core.util.Receiver;
import org.eclipse.dstore.core.util.Receiver;
/*
* The ClientReciever is responsible for recieving data from

View file

@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright (c) 2002, 2007 IBM Corporation and others.
* Copyright (c) 2002, 2008 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@ -13,6 +13,7 @@
*
* Contributors:
* David McKnight (IBM) [222168][dstore] Buffer in DataElement is not sent
* David McKnight (IBM) - [225507][api][breaking] RSE dstore API leaks non-API types
*******************************************************************************/
package org.eclipse.dstore.internal.core.server;
@ -26,7 +27,7 @@ import org.eclipse.dstore.core.model.DataElement;
import org.eclipse.dstore.core.model.DataStore;
import org.eclipse.dstore.core.model.DataStoreResources;
import org.eclipse.dstore.core.model.UpdateHandler;
import org.eclipse.dstore.internal.core.util.CommandGenerator;
import org.eclipse.dstore.core.util.CommandGenerator;
import org.eclipse.dstore.internal.core.util.Sender;
/**

View file

@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright (c) 2006, 2007 IBM Corporation and others.
* Copyright (c) 2006, 2008 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@ -12,7 +12,7 @@
* Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
*
* Contributors:
* {Name} (company) - description of contribution.
* David McKnight (IBM) - [225507][api][breaking] RSE dstore API leaks non-API types
*******************************************************************************/
package org.eclipse.dstore.internal.core.util.ssl;
@ -24,6 +24,7 @@ import javax.net.ssl.SSLContext;
import javax.net.ssl.TrustManager;
import org.eclipse.dstore.core.util.ssl.DStoreKeyStore;
import org.eclipse.dstore.core.util.ssl.IDataStoreTrustManager;
public class DStoreSSLContext
@ -51,7 +52,7 @@ public class DStoreSSLContext
return serverContext;
}
public static SSLContext getClientSSLContext(String filePath, String password, DataStoreTrustManager trustManager)
public static SSLContext getClientSSLContext(String filePath, String password, IDataStoreTrustManager trustManager)
{
SSLContext clientContext = null;

View file

@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright (c) 2006, 2007 IBM Corporation and others.
* Copyright (c) 2006, 2008 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@ -12,7 +12,7 @@
* Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
*
* Contributors:
* {Name} (company) - description of contribution.
* David McKnight (IBM) - [225507][api][breaking] RSE dstore API leaks non-API types
*******************************************************************************/
package org.eclipse.dstore.internal.core.util.ssl;
@ -24,12 +24,10 @@ import java.util.ArrayList;
import java.util.Enumeration;
import java.util.List;
import javax.net.ssl.X509TrustManager;
import org.eclipse.dstore.core.util.ssl.DStoreKeyStore;
import org.eclipse.dstore.core.util.ssl.IDataStoreTrustManager;
public class DataStoreTrustManager implements X509TrustManager
public class DataStoreTrustManager implements IDataStoreTrustManager
{
private KeyStore _keystore;
private List _untrustedCerts;