org.eclipse.datatools.connectivity
Class ProfileManager

java.lang.Object
  extended byorg.eclipse.datatools.connectivity.ProfileManager

public class ProfileManager
extends java.lang.Object

ProfileManger is a singleton class serverd as a helper class for connection profiles access. It also caches connection profiles and only persists to storage when changes made and at Eclipse shutdown.

Author:
shongxum

Constructor Summary
ProfileManager()
           
 
Method Summary
 void addProfile(IConnectionProfile profile)
          Add a connection profile object to the profiles cache.
 void addProfile(IConnectionProfile profile, boolean replaceExisting)
          Add a connection profile object to the profiles cache.
 void addProfileListener(IProfileListener listener)
          Register a listener for proifle operation
 void createProfile(java.lang.String name, java.lang.String description, java.lang.String providerID, java.util.Properties baseProperties)
          Create connection profile
 void createProfile(java.lang.String name, java.lang.String description, java.lang.String providerID, java.util.Properties baseProperties, java.lang.String parentProfile)
          Create connection profile
 void createProfile(java.lang.String name, java.lang.String description, java.lang.String providerID, java.util.Properties baseProperties, java.lang.String parentProfile, boolean autoConnect)
          Create connection profile
 void deleteProfile(IConnectionProfile profile)
          Delete a connection profile object from the profiles cache
 java.lang.String duplicateProfile(IConnectionProfile profile)
          Duplicate a connection profile
 java.lang.Object getAdapter(java.lang.Class adapter)
           
 ICategory getCategory(java.lang.String catID)
          Get category by name
static ProfileManager getInstance()
           
 IConnectionProfile getProfileByInstanceID(java.lang.String id)
          Get connection profile by instance ID
 IConnectionProfile getProfileByName(java.lang.String name)
          Get connection profile by name
 IConnectionProfile[] getProfileByProviderID(java.lang.String ID)
          Get connection profiles by connection profile(cp) provider ID associated with each cp
 IConnectionProfile[] getProfiles()
          Get all connection profiles persisted in workspace
 IConnectionProfile[] getProfilesByCategory(java.lang.String catID)
          Get connection profiles by category
 ICategory[] getRootCategories()
          Get root categories whose parent category is null
 void modifyProfile(IConnectionProfile profile)
          Modify an existing connection profile
 void modifyProfile(IConnectionProfile profile, java.lang.String newName, java.lang.String newDesc)
          Modify an existing connection profile, plus it's name and description We don't expose a setName and setDescription in IConnectionProfile, so instead we expose this api for that same purpose.
 void modifyProfile(IConnectionProfile profile, java.lang.String newName, java.lang.String newDesc, java.lang.Boolean autoConnect)
          Modify an existing connection profile, plus it's name and description We don't expose a setName and setDescription in IConnectionProfile, so instead we expose this api for that same purpose.
 void removeProfileListener(IProfileListener listener)
          Remove the listener for profile operation
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ProfileManager

public ProfileManager()
Method Detail

getInstance

public static ProfileManager getInstance()

getProfiles

public IConnectionProfile[] getProfiles()
Get all connection profiles persisted in workspace

Returns:
connection profiles

getCategory

public ICategory getCategory(java.lang.String catID)
Get category by name

Parameters:
catID -
Returns:
ICategory

getRootCategories

public ICategory[] getRootCategories()
Get root categories whose parent category is null

Returns:
ICategory[]

getProfilesByCategory

public IConnectionProfile[] getProfilesByCategory(java.lang.String catID)
Get connection profiles by category

Parameters:
catID -
Returns:
IConnectionProfile[]

getProfileByName

public IConnectionProfile getProfileByName(java.lang.String name)
Get connection profile by name

Parameters:
name -
Returns:
IConnectionProfile

getProfileByInstanceID

public IConnectionProfile getProfileByInstanceID(java.lang.String id)
Get connection profile by instance ID

Parameters:
id -
Returns:
IConnectionProfile

getProfileByProviderID

public IConnectionProfile[] getProfileByProviderID(java.lang.String ID)
Get connection profiles by connection profile(cp) provider ID associated with each cp

Parameters:
ID -
Returns:
IConnectionProfile[]

createProfile

public void createProfile(java.lang.String name,
                          java.lang.String description,
                          java.lang.String providerID,
                          java.util.Properties baseProperties)
                   throws ConnectionProfileException
Create connection profile

Parameters:
name -
description -
providerID -
baseProperties -
Throws:
ConnectionProfileException

createProfile

public void createProfile(java.lang.String name,
                          java.lang.String description,
                          java.lang.String providerID,
                          java.util.Properties baseProperties,
                          java.lang.String parentProfile)
                   throws ConnectionProfileException
Create connection profile

Parameters:
name -
description -
providerID -
baseProperties -
parentProfile -
Throws:
ConnectionProfileException

createProfile

public void createProfile(java.lang.String name,
                          java.lang.String description,
                          java.lang.String providerID,
                          java.util.Properties baseProperties,
                          java.lang.String parentProfile,
                          boolean autoConnect)
                   throws ConnectionProfileException
Create connection profile

Parameters:
name -
description -
providerID -
baseProperties -
parentProfile -
autoConnect -
Throws:
ConnectionProfileException

duplicateProfile

public java.lang.String duplicateProfile(IConnectionProfile profile)
                                  throws ConnectionProfileException
Duplicate a connection profile

Parameters:
profile -
Throws:
ConnectionProfileException

addProfile

public void addProfile(IConnectionProfile profile)
                throws ConnectionProfileException
Add a connection profile object to the profiles cache. Throws ConnectionProfileException if the new profile's name already exists in cache.

Parameters:
profile -
Throws:
ConnectionProfileException

addProfile

public void addProfile(IConnectionProfile profile,
                       boolean replaceExisting)
                throws ConnectionProfileException
Add a connection profile object to the profiles cache. If the new profile's name already exists in cache, replace the cached profile with the given profile provided the replaceExisting flag is true; otherwise, throws ConnectionProfileException.

Parameters:
profile -
replaceExisting -
Throws:
ConnectionProfileException

deleteProfile

public void deleteProfile(IConnectionProfile profile)
                   throws ConnectionProfileException
Delete a connection profile object from the profiles cache

Parameters:
profile -
Throws:
ConnectionProfileException

modifyProfile

public void modifyProfile(IConnectionProfile profile)
                   throws ConnectionProfileException
Modify an existing connection profile

Parameters:
profile -
Throws:
ConnectionProfileException

modifyProfile

public void modifyProfile(IConnectionProfile profile,
                          java.lang.String newName,
                          java.lang.String newDesc)
                   throws ConnectionProfileException
Modify an existing connection profile, plus it's name and description We don't expose a setName and setDescription in IConnectionProfile, so instead we expose this api for that same purpose.

Parameters:
profile -
Throws:
ConnectionProfileException

modifyProfile

public void modifyProfile(IConnectionProfile profile,
                          java.lang.String newName,
                          java.lang.String newDesc,
                          java.lang.Boolean autoConnect)
                   throws ConnectionProfileException
Modify an existing connection profile, plus it's name and description We don't expose a setName and setDescription in IConnectionProfile, so instead we expose this api for that same purpose.

Parameters:
profile -
Throws:
ConnectionProfileException

addProfileListener

public void addProfileListener(IProfileListener listener)
Register a listener for proifle operation

Parameters:
listener -

removeProfileListener

public void removeProfileListener(IProfileListener listener)
Remove the listener for profile operation

Parameters:
listener -

getAdapter

public java.lang.Object getAdapter(java.lang.Class adapter)


Copyright © 2006 Actuate, IBM Corporation, Sybase, Inc. and others. All rights reserved.