org.eclipse.datatools.connectivity_1.2.4.v201202041105

16:42:45.350 INFO  jd.cli.Main - Decompiling org.eclipse.datatools.connectivity_1.2.4.v201202041105.jar
package org.eclipse.datatools.connectivity;

import org.eclipse.core.runtime.CoreException;

public class ConnectAdapter
  implements IConnectListener
{
  public boolean okToClose(ConnectEvent event)
  {
    return true;
  }
  
  public void openConnection(ConnectEvent event)
    throws CoreException
  {}
  
  public void closeConnection(ConnectEvent event)
    throws CoreException
  {}
}

/* Location:
 * Qualified Name:     org.eclipse.datatools.connectivity.ConnectAdapter
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.datatools.connectivity;

import java.util.EventObject;

public class ConnectEvent
  extends EventObject
{
  private IManagedConnection mConnection;
  private Object mContext;
  
  public ConnectEvent(IConnectionProfile profile)
  {
    this(profile, null);
  }
  
  public ConnectEvent(IConnectionProfile profile, IManagedConnection connection)
  {
    this(profile, connection, null);
  }
  
  public ConnectEvent(IConnectionProfile profile, IManagedConnection connection, Object context)
  {
    super(profile);
    mConnection = connection;
    mContext = context;
  }
  
  public IConnectionProfile getConnectionProfile()
  {
    return (IConnectionProfile)getSource();
  }
  
  public IManagedConnection getConnection()
  {
    return mConnection;
  }
  
  public Object getContext()
  {
    return mContext;
  }
}

/* Location:
 * Qualified Name:     org.eclipse.datatools.connectivity.ConnectEvent
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.datatools.connectivity;

import org.eclipse.datatools.connectivity.internal.ConnectivityPlugin;

public class ConnectionProfileConstants
{
  public static final String PING_FACTORY_ID = "org.eclipse.datatools.connectivity.connectionFactory.pingFactory";
  public static final String PROP_PREFIX = "org.eclipse.datatools.connectivity.";
  public static final String PROP_UID = "org.eclipse.datatools.connectivity.uid";
  public static final String PROP_PWD = "org.eclipse.datatools.connectivity.pwd";
  public static final String PROP_DRIVER_DEFINITION_ID = "org.eclipse.datatools.connectivity.driverDefinitionID";
  public static final String VERSION_INFO_PROFILE_EXTENSION_ID = "org.eclipse.datatools.connectivity.versionInfo";
  public static final String PROP_SERVER_PREFIX = "server.";
  public static final String PROP_SERVER_VERSION = "server.version";
  public static final String PROP_SERVER_NAME = "server.name";
  public static final String PROP_TECHNOLOGY_PREFIX = "technology.";
  public static final String PROP_TECHNOLOGY_NAME_PREFIX = "technology.name.";
  public static final String PROP_TECHNOLOGY_VERSION_PREFIX = "technology.version.";
  public static final String UNKNOWN_VERSION = ConnectivityPlugin.getDefault().getResourceString(
    "ConnectionProfileConstants.unknownVersion");
  /**
   * @deprecated
   */
  public static final String PROP_TECHNOLOGY_VERSION_SUFFIX = ".version";
  /**
   * @deprecated
   */
  public static final String PROP_TECHNOLOGY_NAME_SUFFIX = ".mame";
  
  public static final String createTechnologyVersionKey(String technology)
  {
    return "technology.version." + technology;
  }
  
  public static final String createTechnologyNameKey(String technology)
  {
    return "technology.name." + technology;
  }
}

/* Location:
 * Qualified Name:     org.eclipse.datatools.connectivity.ConnectionProfileConstants
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.datatools.connectivity;

public class ConnectionProfileException
  extends Exception
{
  public ConnectionProfileException() {}
  
  public ConnectionProfileException(String message)
  {
    super(message);
  }
  
  public ConnectionProfileException(String message, Throwable cause)
  {
    super(message, cause);
  }
  
  public ConnectionProfileException(Throwable cause)
  {
    super(cause);
  }
}

/* Location:
 * Qualified Name:     org.eclipse.datatools.connectivity.ConnectionProfileException
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.datatools.connectivity;

import java.util.HashMap;
import java.util.Iterator;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Properties;
import java.util.Set;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IConfigurationElement;
import org.eclipse.core.runtime.IExecutableExtension;
import org.eclipse.core.runtime.Status;
import org.eclipse.datatools.connectivity.internal.ConnectionProfileManager;
import org.eclipse.datatools.connectivity.internal.ConnectivityPlugin;

public class ConnectionProfileMigratorBase
  implements IConnectionProfileMigrator, IExecutableExtension
{
  private static final String ELEM_PROPERTY_MIGRATION = "propertyMigration";
  private static final String ATTR_OLD_PROPERTY_KEY = "oldPropertyKey";
  private static final String ATTR_NEW_PROPERTY_KEY = "newPropertyKey";
  private static final String ATTR_NEW_VALUE = "newValue";
  private static final String ATTR_NEW_PROVIDER_ID = "newProviderID";
  private Map mPropertyMigrations;
  private Map mDefaults;
  private String mNewProviderID;
  
  public void performMigration(IConnectionProfile profile)
  {
    applyPropertyMigrations(profile);
  }
  
  public final String getNewProviderID()
  {
    return mNewProviderID;
  }
  
  protected final void applyPropertyMigrations(IConnectionProfile profile)
  {
    Properties props = profile.getProperties(mNewProviderID);
    if (props == null) {
      props = new Properties();
    }
    for (Iterator it = mPropertyMigrations.entrySet().iterator(); it
          .hasNext();)
    {
      Map.Entry entry = (Map.Entry)it.next();
      String oldKey = (String)entry.getKey();
      String newKey = (String)entry.getValue();
      String value = props.getProperty(oldKey);
      props.remove(oldKey);
      if ((newKey != null) && (value != null)) {
        props.setProperty(newKey, value);
      }
    }
    for (Iterator it = mDefaults.entrySet().iterator(); it.hasNext();)
    {
      Map.Entry entry = (Map.Entry)it.next();
      String value = (String)entry.getValue();
      if (value != null) {
        props.setProperty((String)entry.getKey(), value);
      }
    }
    profile.setProperties(mNewProviderID, props);
  }
  
  public final void setInitializationData(IConfigurationElement config, String propertyName, Object data)
    throws CoreException
  {
    mNewProviderID = config.getAttribute("newProviderID");
    if ((mNewProviderID != null) && (mNewProviderID.length() < 1))
    {
      IConfigurationElement parentElement = (IConfigurationElement)config
        .getParent();
      if ("connectionProfile".equals(parentElement.getName()))
      {
        mNewProviderID = parentElement
          .getAttribute("id");
      }
      else if ("profileExtension".equals(parentElement.getName()))
      {
        mNewProviderID = parentElement
          .getAttribute("id");
      }
      else
      {
        Status status = new Status(4, ConnectivityPlugin.getSymbolicName(), -1, 
          ConnectivityPlugin.getDefault().getResourceString(
          "migration.error.unknownParentElement", 
          new Object[] { parentElement.getName() }), null);
        throw new CoreException(status);
      }
    }
    else if (!ConnectionProfileManager.getInstance().getProviders().containsKey(mNewProviderID))
    {
      Status status = new Status(4, ConnectivityPlugin.getSymbolicName(), -1, 
        ConnectivityPlugin.getDefault().getResourceString(
        "migration.error.providerDoesNotExist", 
        new Object[] { mNewProviderID }), null);
      throw new CoreException(status);
    }
    parsePropertyMigrations(config);
  }
  
  private void parsePropertyMigrations(IConfigurationElement config)
    throws CoreException
  {
    IConfigurationElement[] propertyMigrations = config
      .getChildren("propertyMigration");
    mPropertyMigrations = new HashMap(propertyMigrations.length);
    mDefaults = new HashMap(propertyMigrations.length);
    if ((propertyMigrations == null) || (propertyMigrations.length == 0)) {
      return;
    }
    int index = 0;
    for (int count = propertyMigrations.length; index < count; index++)
    {
      String oldPropertyKey = propertyMigrations[index]
        .getAttribute("oldPropertyKey");
      if ((oldPropertyKey == null) || (oldPropertyKey.length() == 0))
      {
        String newPropertyKey = propertyMigrations[index]
          .getAttribute("newPropertyKey");
        if ((newPropertyKey == null) || (newPropertyKey.length() == 0))
        {
          Status status = new Status(
            4, 
            ConnectivityPlugin.getSymbolicName(), 
            -1, 
            
            ConnectivityPlugin.getDefault()
            .getResourceString(
            "migration.error.invalidPropertyMigrationElement"), 
            null);
          throw new CoreException(status);
        }
        String value = propertyMigrations[index]
          .getAttribute("newValue");
        if (value != null) {
          mDefaults.put(newPropertyKey, value);
        }
      }
      else
      {
        mPropertyMigrations.put(oldPropertyKey, 
          propertyMigrations[index]
          .getAttribute("newPropertyKey"));
      }
    }
  }
}

/* Location:
 * Qualified Name:     org.eclipse.datatools.connectivity.ConnectionProfileMigratorBase
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.datatools.connectivity;

import java.util.Properties;
import org.eclipse.datatools.connectivity.drivers.DriverInstance;
import org.eclipse.datatools.connectivity.drivers.DriverManager;
import org.eclipse.datatools.connectivity.internal.ConnectivityPlugin;

public abstract class DriverConnectionBase
  extends VersionProviderConnection
{
  protected DriverInstance mDriver;
  protected Object mConnection;
  protected Throwable mConnectException;
  
  public DriverConnectionBase(IConnectionProfile profile, Class factoryClass)
  {
    super(profile, factoryClass);
  }
  
  public void open()
  {
    if (mConnection != null) {
      close();
    }
    mConnection = null;
    mConnectException = null;
    
    internalCreateConnection();
  }
  
  public Object getRawConnection()
  {
    return mConnection;
  }
  
  public Throwable getConnectException()
  {
    return mConnectException;
  }
  
  protected abstract Object createConnection(ClassLoader paramClassLoader)
    throws Throwable;
  
  protected abstract void initVersions();
  
  protected ClassLoader getParentClassLoader()
  {
    return null;
  }
  
  private void internalCreateConnection()
  {
    try
    {
      DriverInstance driver = getDriverDefinition();
      ClassLoader parentCL = getParentClassLoader();
      ClassLoader driverCL = parentCL == null ? driver.getClassLoader() : 
        driver.createClassLoader(parentCL);
      
      mConnection = createConnection(driverCL);
      if (mConnection == null) {
        throw new Exception(ConnectivityPlugin.getDefault().getResourceString("DriverConnectionBase.error.unknown"));
      }
      initVersions();
      updateVersionCache();
    }
    catch (Throwable t)
    {
      mConnectException = t;
      clearVersionCache();
    }
  }
  
  protected DriverInstance getDriverDefinition()
    throws Exception
  {
    if (mDriver == null)
    {
      String driverID = getDriverDefinitionId();
      if (driverID == null)
      {
        String messageId = "DriverConnectionBase.error.driverDefinitionNotSpecified";
        throw new Exception(ConnectivityPlugin.getDefault().getResourceString(messageId), 
          new Throwable(messageId));
      }
      mDriver = DriverManager.getInstance().getDriverInstanceByID(
        driverID);
      if (mDriver == null)
      {
        String messageId = "DriverConnectionBase.error.driverDefinitionNotFound";
        throw new Exception(ConnectivityPlugin.getDefault().getResourceString(messageId), 
          new Throwable(messageId));
      }
    }
    return mDriver;
  }
  
  protected String getDriverDefinitionId()
  {
    IConnectionProfile profile = getConnectionProfile();
    if (profile == null) {
      return null;
    }
    return profile.getBaseProperties().getProperty(
      "org.eclipse.datatools.connectivity.driverDefinitionID");
  }
}

/* Location:
 * Qualified Name:     org.eclipse.datatools.connectivity.DriverConnectionBase
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.datatools.connectivity;

import java.util.List;

public abstract interface ICategory
{
  public abstract String getId();
  
  public abstract String getName();
  
  public abstract ICategory getParent();
  
  public abstract List getChildCategories();
  
  public abstract List getAssociatedProfiles();
}

/* Location:
 * Qualified Name:     org.eclipse.datatools.connectivity.ICategory
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.datatools.connectivity;

/**
 * @deprecated
 */
public abstract interface IConfigurationType
{
  public abstract String getId();
  
  public abstract String getName();
  
  public abstract boolean equals(Object paramObject);
  
  public abstract int hashCode();
}

/* Location:
 * Qualified Name:     org.eclipse.datatools.connectivity.IConfigurationType
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.datatools.connectivity;

import org.eclipse.core.runtime.CoreException;

/**
 * @deprecated
 */
public abstract interface IConnectListener
{
  public abstract boolean okToClose(ConnectEvent paramConnectEvent);
  
  public abstract void openConnection(ConnectEvent paramConnectEvent)
    throws CoreException;
  
  public abstract void closeConnection(ConnectEvent paramConnectEvent)
    throws CoreException;
}

/* Location:
 * Qualified Name:     org.eclipse.datatools.connectivity.IConnectListener
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.datatools.connectivity;

public abstract interface IConnection
{
  public abstract Object getRawConnection();
  
  public abstract void close();
  
  public abstract Throwable getConnectException();
  
  public abstract IConnectionProfile getConnectionProfile();
}

/* Location:
 * Qualified Name:     org.eclipse.datatools.connectivity.IConnection
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.datatools.connectivity;

public abstract interface IConnectionFactory
{
  public abstract IConnection createConnection(IConnectionProfile paramIConnectionProfile);
  
  public abstract IConnection createConnection(IConnectionProfile paramIConnectionProfile, String paramString1, String paramString2);
}

/* Location:
 * Qualified Name:     org.eclipse.datatools.connectivity.IConnectionFactory
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.datatools.connectivity;

public abstract interface IConnectionFactoryProvider
  extends IConnectionFactory
{
  public abstract String getId();
  
  public abstract String getName();
  
  public abstract Class getConnectionFactoryClass();
  
  public abstract String getPriority();
}

/* Location:
 * Qualified Name:     org.eclipse.datatools.connectivity.IConnectionFactoryProvider
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.datatools.connectivity;

import java.util.Map;
import java.util.Properties;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.jobs.IJobChangeListener;

public abstract interface IConnectionProfile
{
  public static final String CONNECTION_PROFILE_PROPERTY_SET = IConnectionProfile.class.getName();
  /**
   * @deprecated
   */
  public static final String CONNECTED_PROPERTY_ID = "connected";
  public static final String CONNECTION_STATE_PROPERTY_ID = "connectionState";
  public static final String NAME_PROPERTY_ID = "name";
  public static final String DESCRIPTION_PROPERTY_ID = "description";
  public static final String AUTO_CONNECT_PROPERTY_ID = "autoConnect";
  public static final String INSTANCE_ID_PROPERTY_ID = "instanceID";
  public static final String TRANSIENT_PROPERTY_ID = "isTransient";
  public static final int DISCONNECTED_STATE = 0;
  public static final int CONNECTED_STATE = 1;
  public static final int WORKING_OFFLINE_STATE = 2;
  
  public abstract String getName();
  
  public abstract String getDescription();
  
  public abstract boolean isAutoConnect();
  
  public abstract String getInstanceID();
  
  public abstract IConnectionProfile getParentProfile();
  
  public abstract Properties getBaseProperties();
  
  public abstract void setBaseProperties(Properties paramProperties);
  
  public abstract Properties getProperties(String paramString);
  
  public abstract void setProperties(String paramString, Properties paramProperties);
  
  public abstract boolean arePropertiesComplete();
  
  public abstract boolean arePropertiesComplete(String paramString);
  
  /**
   * @deprecated
   */
  public abstract void setConnected(boolean paramBoolean);
  
  /**
   * @deprecated
   */
  public abstract boolean isConnected();
  
  public abstract int getConnectionState();
  
  public abstract IStatus connect();
  
  public abstract void connect(IJobChangeListener paramIJobChangeListener);
  
  public abstract IStatus connectWithoutJob();
  
  public abstract IStatus disconnect();
  
  public abstract void disconnect(IJobChangeListener paramIJobChangeListener);
  
  public abstract IStatus workOffline();
  
  public abstract void workOffline(IJobChangeListener paramIJobChangeListener);
  
  public abstract boolean supportsWorkOfflineMode();
  
  public abstract boolean canWorkOffline();
  
  public abstract IStatus saveWorkOfflineData();
  
  public abstract void saveWorkOfflineData(IJobChangeListener paramIJobChangeListener);
  
  /**
   * @deprecated
   */
  public abstract void addConnectListener(IConnectListener paramIConnectListener);
  
  /**
   * @deprecated
   */
  public abstract void removeConnectListener(IConnectListener paramIConnectListener);
  
  public abstract IManagedConnection getManagedConnection(String paramString);
  
  public abstract void addPropertySetListener(IPropertySetListener paramIPropertySetListener);
  
  public abstract void removePropertySetListener(IPropertySetListener paramIPropertySetListener);
  
  public abstract String getProviderName();
  
  public abstract String getProviderId();
  
  public abstract ICategory getCategory();
  
  /**
   * @deprecated
   */
  public abstract IConfigurationType getConfigurationType();
  
  public abstract Map getProfileExtensions();
  
  public abstract IConnection createConnection(String paramString);
  
  public abstract IConnection createConnection(String paramString1, String paramString2, String paramString3);
  
  public abstract IConnectionProfileProvider getProvider();
}

/* Location:
 * Qualified Name:     org.eclipse.datatools.connectivity.IConnectionProfile
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.datatools.connectivity;

public abstract interface IConnectionProfileMigrator
{
  public abstract void performMigration(IConnectionProfile paramIConnectionProfile);
  
  public abstract String getNewProviderID();
}

/* Location:
 * Qualified Name:     org.eclipse.datatools.connectivity.IConnectionProfileMigrator
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.datatools.connectivity;

import java.net.URL;
import java.util.Map;

public abstract interface IConnectionProfileProvider
{
  public abstract String getName();
  
  public abstract String getId();
  
  public abstract URL getIconURL();
  
  public abstract IConnectionFactoryProvider getConnectionFactory(String paramString);
  
  public abstract Map getConnectionFactories();
  
  public abstract Map getProfileExtensions();
  
  public abstract IConfigurationType getConfigurationType();
  
  public abstract ICategory getCategory();
  
  public abstract String getFileExtension();
  
  public abstract boolean needsMaintainConnection();
}

/* Location:
 * Qualified Name:     org.eclipse.datatools.connectivity.IConnectionProfileProvider
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.datatools.connectivity;

public abstract interface IManagedConnection$ICloneConnectionJob
{
  public abstract IConnection getConnection();
}

/* Location:
 * Qualified Name:     org.eclipse.datatools.connectivity.IManagedConnection.ICloneConnectionJob
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.datatools.connectivity;

import org.eclipse.core.runtime.jobs.IJobChangeListener;

public abstract interface IManagedConnection
{
  public abstract boolean isConnected();
  
  public abstract IConnection getConnection();
  
  public abstract String getFactoryID();
  
  public abstract void addConnectionListener(IManagedConnectionListener paramIManagedConnectionListener);
  
  public abstract void removeConnectionListener(IManagedConnectionListener paramIManagedConnectionListener);
  
  public abstract void fireModifiedEvent(Object paramObject);
  
  public abstract IConnection cloneConnection();
  
  public abstract void cloneConnection(IJobChangeListener paramIJobChangeListener);
  
  public abstract boolean isWorkingOffline();
  
  public static abstract interface ICloneConnectionJob
  {
    public abstract IConnection getConnection();
  }
}

/* Location:
 * Qualified Name:     org.eclipse.datatools.connectivity.IManagedConnection
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.datatools.connectivity;

public abstract interface IManagedConnectionListener
{
  public abstract void opened(ConnectEvent paramConnectEvent);
  
  public abstract void modified(ConnectEvent paramConnectEvent);
  
  public abstract boolean okToClose(ConnectEvent paramConnectEvent);
  
  public abstract void aboutToClose(ConnectEvent paramConnectEvent);
  
  public abstract void closed(ConnectEvent paramConnectEvent);
}

/* Location:
 * Qualified Name:     org.eclipse.datatools.connectivity.IManagedConnectionListener
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.datatools.connectivity;

public abstract interface IManagedConnectionOfflineListener
  extends IManagedConnectionListener
{
  public abstract boolean okToDetach(ConnectEvent paramConnectEvent);
  
  public abstract void aboutToDetach(ConnectEvent paramConnectEvent);
  
  public abstract void workingOffline(ConnectEvent paramConnectEvent);
  
  public abstract void aboutToAttach(ConnectEvent paramConnectEvent);
}

/* Location:
 * Qualified Name:     org.eclipse.datatools.connectivity.IManagedConnectionOfflineListener
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.datatools.connectivity;

import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IProgressMonitor;

public abstract interface IOfflineConnection
  extends IConnection
{
  public abstract void attach(IProgressMonitor paramIProgressMonitor)
    throws CoreException;
  
  public abstract void detach(IProgressMonitor paramIProgressMonitor)
    throws CoreException;
  
  public abstract void save(IProgressMonitor paramIProgressMonitor)
    throws CoreException;
  
  public abstract boolean isWorkingOffline();
}

/* Location:
 * Qualified Name:     org.eclipse.datatools.connectivity.IOfflineConnection
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.datatools.connectivity;

import org.eclipse.core.runtime.IProgressMonitor;

public abstract interface IOfflineConnectionFactory
  extends IConnectionFactory
{
  public abstract IOfflineConnection createOfflineConnection(IConnectionProfile paramIConnectionProfile, IProgressMonitor paramIProgressMonitor);
  
  public abstract IOfflineConnection createConnection(IConnectionProfile paramIConnectionProfile, IProgressMonitor paramIProgressMonitor);
  
  public abstract boolean canWorkOffline(IConnectionProfile paramIConnectionProfile);
}

/* Location:
 * Qualified Name:     org.eclipse.datatools.connectivity.IOfflineConnectionFactory
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.datatools.connectivity;

public abstract interface IProfileExtensionProvider
{
  public abstract String getId();
  
  public abstract String getName();
  
  public abstract IConnectionProfileProvider getConnectionProfileProvider();
}

/* Location:
 * Qualified Name:     org.eclipse.datatools.connectivity.IProfileExtensionProvider
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.datatools.connectivity;

public abstract interface IProfileListener
{
  public abstract void profileAdded(IConnectionProfile paramIConnectionProfile);
  
  public abstract void profileDeleted(IConnectionProfile paramIConnectionProfile);
  
  public abstract void profileChanged(IConnectionProfile paramIConnectionProfile);
}

/* Location:
 * Qualified Name:     org.eclipse.datatools.connectivity.IProfileListener
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.datatools.connectivity;

public abstract interface IProfileListener1
  extends IProfileListener
{
  public abstract void profileChanged(IConnectionProfile paramIConnectionProfile, String paramString1, String paramString2, Boolean paramBoolean);
}

/* Location:
 * Qualified Name:     org.eclipse.datatools.connectivity.IProfileListener1
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.datatools.connectivity;

import java.util.Properties;

public abstract interface IPropertiesPersistenceHook
{
  public abstract Properties getPersitentProperties(Properties paramProperties);
  
  public abstract Properties populateTransientProperties(Properties paramProperties);
  
  public abstract boolean arePropertiesComplete(Properties paramProperties);
  
  public abstract String getConnectionPropertiesPageID();
}

/* Location:
 * Qualified Name:     org.eclipse.datatools.connectivity.IPropertiesPersistenceHook
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.datatools.connectivity;

public abstract interface IPropertySetChangeEvent$IChangedProperty
{
  public abstract String getID();
  
  public abstract String getOldValue();
  
  public abstract String getNewValue();
}

/* Location:
 * Qualified Name:     org.eclipse.datatools.connectivity.IPropertySetChangeEvent.IChangedProperty
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.datatools.connectivity;

import java.util.Map;

public abstract interface IPropertySetChangeEvent
{
  public abstract IConnectionProfile getConnectionProfile();
  
  public abstract String getPropertySetType();
  
  public abstract Map getChangedProperties();
  
  public abstract IChangedProperty getChangedProperty(String paramString);
  
  public static abstract interface IChangedProperty
  {
    public abstract String getID();
    
    public abstract String getOldValue();
    
    public abstract String getNewValue();
  }
}

/* Location:
 * Qualified Name:     org.eclipse.datatools.connectivity.IPropertySetChangeEvent
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.datatools.connectivity;

public abstract interface IPropertySetListener
{
  public abstract void propertySetChanged(IPropertySetChangeEvent paramIPropertySetChangeEvent);
}

/* Location:
 * Qualified Name:     org.eclipse.datatools.connectivity.IPropertySetListener
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.datatools.connectivity;

public abstract interface IServerVersionProvider
{
  public abstract Version getProviderVersion();
  
  public abstract String getProviderName();
  
  public abstract Version getTechnologyVersion();
  
  public abstract String getTechnologyName();
}

/* Location:
 * Qualified Name:     org.eclipse.datatools.connectivity.IServerVersionProvider
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.datatools.connectivity;

public class ManagedConnectionAdapter
  implements IManagedConnectionOfflineListener
{
  public void opened(ConnectEvent event) {}
  
  public void modified(ConnectEvent event) {}
  
  public boolean okToClose(ConnectEvent event)
  {
    return true;
  }
  
  public void aboutToClose(ConnectEvent event) {}
  
  public void closed(ConnectEvent event) {}
  
  public void aboutToAttach(ConnectEvent event) {}
  
  public void aboutToDetach(ConnectEvent event) {}
  
  public void workingOffline(ConnectEvent event) {}
  
  public boolean okToDetach(ConnectEvent event)
  {
    return true;
  }
}

/* Location:
 * Qualified Name:     org.eclipse.datatools.connectivity.ManagedConnectionAdapter
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.datatools.connectivity;

class ProfileConnectionManager$ManagedProfileKey
{
  private IConnectionProfile mProfile;
  private String mFactoryID;
  
  public ProfileConnectionManager$ManagedProfileKey(IConnectionProfile profile, String factoryID)
  {
    mProfile = profile;
    mFactoryID = factoryID;
  }
  
  public IConnectionProfile getConnectionProfile()
  {
    return mProfile;
  }
  
  public String getFactoryID()
  {
    return mFactoryID;
  }
  
  public boolean equals(Object object)
  {
    if ((object instanceof ManagedProfileKey))
    {
      ManagedProfileKey other = (ManagedProfileKey)object;
      
      return (mProfile.equals(mProfile)) && (mFactoryID.equals(mFactoryID));
    }
    return false;
  }
  
  public int hashCode()
  {
    return mProfile.hashCode();
  }
}

/* Location:
 * Qualified Name:     org.eclipse.datatools.connectivity.ProfileConnectionManager.ManagedProfileKey
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.datatools.connectivity;

import java.util.HashMap;
import java.util.Iterator;
import java.util.Set;

class ProfileConnectionManager$MyProfileListener
  implements IProfileListener
{
  private ProfileConnectionManager$MyProfileListener(ProfileConnectionManager paramProfileConnectionManager) {}
  
  public void profileAdded(IConnectionProfile profile) {}
  
  public void profileDeleted(IConnectionProfile profile)
  {
    if (!ProfileConnectionManager.access$0(this$0).containsKey(profile)) {
      return;
    }
    for (Iterator it = ((Set)ProfileConnectionManager.access$0(this$0).get(profile))
          .iterator(); 
          it.hasNext();)
    {
      ProfileConnectionManager.ProfileConnectListener listener = 
        (ProfileConnectionManager.ProfileConnectListener)it.next();
      ProfileConnectionManager.ManagedProfileKey key = new ProfileConnectionManager.ManagedProfileKey(profile, listener
        .getFactoryID());
      
      profile.removeConnectListener(listener);
      if (ProfileConnectionManager.access$1(this$0).containsKey(profile))
      {
        IConnection con = 
          (IConnection)ProfileConnectionManager.access$1(this$0).get(key);
        if (con != null) {
          try
          {
            con.close();
          }
          catch (Throwable localThrowable) {}
        }
      }
      ProfileConnectionManager.access$1(this$0).remove(key);
      ProfileConnectionManager.access$2(this$0).remove(key);
    }
    ProfileConnectionManager.access$0(this$0).remove(profile);
  }
  
  public void profileChanged(IConnectionProfile profile)
  {
    ProfileConnectionManager.access$1(this$0).containsKey(profile);
  }
}

/* Location:
 * Qualified Name:     org.eclipse.datatools.connectivity.ProfileConnectionManager.MyProfileListener
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.datatools.connectivity;

import java.util.HashMap;
import java.util.Iterator;
import java.util.Set;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.Status;
import org.eclipse.datatools.connectivity.internal.ConnectivityPlugin;

class ProfileConnectionManager$ProfileConnectListener
  extends ConnectAdapter
{
  private String mFactoryID;
  
  public ProfileConnectionManager$ProfileConnectListener(ProfileConnectionManager paramProfileConnectionManager, String factoryID)
  {
    mFactoryID = factoryID;
  }
  
  public String getFactoryID()
  {
    return mFactoryID;
  }
  
  public boolean okToClose(ConnectEvent event)
  {
    ProfileConnectionManager.ManagedProfileKey key = new ProfileConnectionManager.ManagedProfileKey(event
      .getConnectionProfile(), mFactoryID);
    if (ProfileConnectionManager.access$2(this$0).containsKey(key)) {
      for (Iterator it = 
            ((Set)ProfileConnectionManager.access$2(this$0).get(key)).iterator(); 
            it.hasNext();)
      {
        Object obj = it.next();
        if (((obj instanceof IConnectListener)) && 
          (!((IConnectListener)obj).okToClose(event))) {
          return false;
        }
      }
    }
    return true;
  }
  
  public void closeConnection(ConnectEvent event)
    throws CoreException
  {
    ProfileConnectionManager.ManagedProfileKey key = new ProfileConnectionManager.ManagedProfileKey(event
      .getConnectionProfile(), mFactoryID);
    if (ProfileConnectionManager.access$1(this$0).containsKey(key))
    {
      for (Iterator it = 
            ((Set)ProfileConnectionManager.access$2(this$0).get(key)).iterator(); 
            it.hasNext();)
      {
        Object obj = it.next();
        if ((obj instanceof IConnectListener)) {
          try
          {
            ((IConnectListener)obj).closeConnection(event);
          }
          catch (CoreException localCoreException) {}
        }
      }
      IConnection con = 
        (IConnection)ProfileConnectionManager.access$1(this$0).get(key);
      if (con != null)
      {
        try
        {
          con.close();
        }
        catch (Throwable localThrowable) {}
        ProfileConnectionManager.access$1(this$0).put(key, null);
      }
    }
  }
  
  public void openConnection(ConnectEvent event)
    throws CoreException
  {
    ProfileConnectionManager.ManagedProfileKey key = new ProfileConnectionManager.ManagedProfileKey(event
      .getConnectionProfile(), mFactoryID);
    if (ProfileConnectionManager.access$1(this$0).containsKey(key))
    {
      IConnection con = 
        (IConnection)ProfileConnectionManager.access$1(this$0).get(key);
      if ((con == null) || (con.getConnectException() != null))
      {
        con = event.getConnectionProfile().createConnection(
          mFactoryID);
        if (con.getConnectException() == null) {
          ProfileConnectionManager.access$1(this$0).put(key, con);
        } else {
          throw new CoreException(new Status(4, 
            ConnectivityPlugin.getSymbolicName(), 
            10001, 
            ConnectivityPlugin.getDefault()
            .getResourceString(
            "error.connect", 
            new String[] {event
            .getConnectionProfile()
            .getName() }), con
            .getConnectException()));
        }
      }
      for (Iterator it = 
            ((Set)ProfileConnectionManager.access$2(this$0).get(key)).iterator(); 
            it.hasNext();)
      {
        Object obj = it.next();
        if ((obj instanceof IConnectListener)) {
          try
          {
            ((IConnectListener)obj).openConnection(event);
          }
          catch (CoreException localCoreException) {}
        }
      }
    }
  }
}

/* Location:
 * Qualified Name:     org.eclipse.datatools.connectivity.ProfileConnectionManager.ProfileConnectListener
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.datatools.connectivity;

import java.util.HashMap;
import java.util.HashSet;
import java.util.Iterator;
import java.util.Set;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.Status;
import org.eclipse.datatools.connectivity.internal.ConnectivityPlugin;

public class ProfileConnectionManager
{
  private static ProfileConnectionManager mConnectionManager = null;
  private HashMap mManagedProfileKeyToConnections;
  private HashMap mManagedProfileKeyToClientSet;
  private HashMap mProfileToListenerSet;
  private HashMap mFactoryIDToListener;
  private MyProfileListener listener = null;
  
  public ProfileConnectionManager()
  {
    mManagedProfileKeyToConnections = new HashMap();
    mManagedProfileKeyToClientSet = new HashMap();
    mProfileToListenerSet = new HashMap();
    mFactoryIDToListener = new HashMap();
    listener = new MyProfileListener(null);
    ProfileManager.getInstance().addProfileListener(listener);
  }
  
  public static ProfileConnectionManager getProfileConnectionManagerInstance()
  {
    if (mConnectionManager == null) {
      mConnectionManager = new ProfileConnectionManager();
    }
    return mConnectionManager;
  }
  
  public void manageProfileConnection(IConnectionProfile profile, String factoryID, Object client)
  {
    ManagedProfileKey key = new ManagedProfileKey(profile, factoryID);
    if (!mManagedProfileKeyToConnections.containsKey(key))
    {
      IConnection con = createConnection(profile, factoryID);
      
      mManagedProfileKeyToConnections.put(key, con);
      mManagedProfileKeyToClientSet.put(key, new HashSet());
      
      IConnectListener listener = 
        (IConnectListener)mFactoryIDToListener.get(factoryID);
      if (listener == null)
      {
        listener = new ProfileConnectListener(factoryID);
        mFactoryIDToListener.put(factoryID, listener);
      }
      Set listeners = (Set)mProfileToListenerSet.get(profile);
      if (listeners == null)
      {
        listeners = new HashSet();
        mProfileToListenerSet.put(profile, listeners);
      }
      listeners.add(listener);
      profile.addConnectListener(listener);
    }
    ((Set)mManagedProfileKeyToClientSet.get(key)).add(client);
  }
  
  public void unmanageProfileConnection(IConnectionProfile profile, String factoryID, Object client)
  {
    ManagedProfileKey key = new ManagedProfileKey(profile, factoryID);
    if (mManagedProfileKeyToConnections.containsKey(key))
    {
      Set clientSet = (Set)mManagedProfileKeyToClientSet.get(key);
      clientSet.remove(client);
      if (clientSet.size() == 0)
      {
        IConnection con = 
          (IConnection)mManagedProfileKeyToConnections.get(key);
        if (con != null) {
          try
          {
            con.close();
          }
          catch (Throwable localThrowable) {}
        }
        mManagedProfileKeyToConnections.remove(key);
        mManagedProfileKeyToClientSet.remove(key);
        
        IConnectListener listener = 
          (IConnectListener)mFactoryIDToListener.get(factoryID);
        profile.removeConnectListener(listener);
        ((Set)mProfileToListenerSet.get(profile)).remove(listener);
      }
    }
  }
  
  public IConnection getConnection(IConnectionProfile profile, String factoryID)
  {
    ManagedProfileKey key = new ManagedProfileKey(profile, factoryID);
    if (mManagedProfileKeyToConnections.containsKey(key)) {
      return (IConnection)mManagedProfileKeyToConnections.get(key);
    }
    return null;
  }
  
  private class MyProfileListener
    implements IProfileListener
  {
    private MyProfileListener() {}
    
    public void profileAdded(IConnectionProfile profile) {}
    
    public void profileDeleted(IConnectionProfile profile)
    {
      if (!mProfileToListenerSet.containsKey(profile)) {
        return;
      }
      for (Iterator it = ((Set)mProfileToListenerSet.get(profile))
            .iterator(); 
            it.hasNext();)
      {
        ProfileConnectionManager.ProfileConnectListener listener = 
          (ProfileConnectionManager.ProfileConnec
1 2 3 4 5 6 7 8 9 10 11 12 13

Further reading...

For more information on Java 1.5 Tiger, you may find Java 1.5 Tiger, A developer's Notebook by D. Flanagan and B. McLaughlin from O'Reilly of interest.

New!JAR listings


Copyright 2006-2017. Infinite Loop Ltd