|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectca.sqlpower.architect.profile.ProfileManagerImpl
public class ProfileManagerImpl
The default ProfileManager implementation. Creates profiles of tables, optionally using a separate worker thread.
| Constructor Summary | |
|---|---|
ProfileManagerImpl(ArchitectSession session)
|
|
| Method Summary | |
|---|---|
void |
addProfileChangeListener(ProfileChangeListener listener)
Adds the given listener to this profile manager. |
java.util.Collection<java.util.concurrent.Future<TableProfileResult>> |
asynchCreateProfiles(java.util.Collection<SQLTable> tables)
Creates TableProfileResult objects for each of the tables in the given list, then adds them to this ProfileManager in an unpopulated state. |
void |
clear()
Removes all contents of the list of TableProfileResults that this ProfileManager keeps track of and fires a ProfileChanged event. |
void |
close()
Closes the Executor service. |
TableProfileResult |
createProfile(SQLTable table)
Creates a new profile result for the given table, and adds it to this ProfileManager. |
TableProfileCreator |
getCreator()
Returns the current profile creator in use. |
ProfileSettings |
getDefaultProfileSettings()
Returns the current default settings for new profile runs in this Profile Manager. |
java.util.List<TableProfileCreator> |
getProfileCreators()
Returns a list of the different types of profile creators. |
java.util.List<TableProfileResult> |
getResults()
Returns an unmodifiable snapshot of the list of all TableProfileResults that this ProfileManager keeps track of. |
java.util.List<TableProfileResult> |
getResults(SQLTable t)
Returns an unmodifiable list of all TableProfileResults for the given table. |
void |
loadResult(ProfileResult pr)
This is a hook designed so the SwingUIProject can insert profile results into this profile manager as it is reading in a project file. |
boolean |
removeProfile(TableProfileResult victim)
Removes a single TableProfileResult from the List of TableProfileResults that this ProfileManager keeps track of. |
void |
removeProfileChangeListener(ProfileChangeListener listener)
Removes the given listener. |
java.util.concurrent.Future<TableProfileResult> |
scheduleProfile(TableProfileResult result)
Schedules a profile to be populated on a separate worker thread. |
void |
setCreator(TableProfileCreator tpc)
Sets the profile manager to use the given profile creator. |
void |
setDefaultProfileSettings(ProfileSettings settings)
Sets the defaults for new profiles created by this profile manager. |
void |
setProcessingOrder(java.util.List<TableProfileResult> tpr)
Modifies the order in which profile results will be calculated. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public ProfileManagerImpl(ArchitectSession session)
| Method Detail |
|---|
public TableProfileResult createProfile(SQLTable table)
throws ArchitectException
ProfileManager
This method operates synchronously, so it will not return until the
profile has been created (which could be several seconds to several
minutes). For use from a Swing GUI, consider
ProfileManager.asynchCreateProfiles(Collection).
createProfile in interface ProfileManagerArchitectExceptionpublic java.util.Collection<java.util.concurrent.Future<TableProfileResult>> asynchCreateProfiles(java.util.Collection<SQLTable> tables)
ProfileManager
asynchCreateProfiles in interface ProfileManagerpublic java.util.concurrent.Future<TableProfileResult> scheduleProfile(TableProfileResult result)
ProfileManagerProfileManager.asynchCreateProfiles(Collection). The use case is for re-trying
profile results that have been canceled by the user before they managed
to fully populate.
scheduleProfile in interface ProfileManagerresult - The result object to reschedule for profiling. It must already
be owned by this profile manager, and must not be in the
process of profiling, and also not already finished profiling.public void clear()
ProfileManager
clear in interface ProfileManagerpublic java.util.List<TableProfileResult> getResults()
ProfileManager
getResults in interface ProfileManagerpublic java.util.List<TableProfileResult> getResults(SQLTable t)
ProfileManager
getResults in interface ProfileManagerpublic boolean removeProfile(TableProfileResult victim)
ProfileManager
removeProfile in interface ProfileManagerpublic ProfileSettings getDefaultProfileSettings()
ProfileManager
getDefaultProfileSettings in interface ProfileManagerpublic void setDefaultProfileSettings(ProfileSettings settings)
ProfileManager
setDefaultProfileSettings in interface ProfileManagerpublic void setProcessingOrder(java.util.List<TableProfileResult> tpr)
ProfileManager
setProcessingOrder in interface ProfileManagertpr - A list of pending profile results that were already
part of this profile manager, but have not been calculated yet.public void loadResult(ProfileResult pr)
This method fires an event every time it adds a table profile result, because not doing so makes it necessary to create the profile manager view after loading in the profile results, and it is impossible to guarantee that policy from here.
The idea is, the SwingUIProject stores all profile results in a flat space (table and column results are sibling elements) so it needs our help to put everything back together into the original hierarchy. This method hangs onto all TableProfileResult objects given to it, and ignores all other result types, assuming the client code will do the appropriate hookups.
You might be asking yourself, "why not store the profile results in the same hierarchy as they had when they were originally created, so we don't need any more error-prone code to recreate what we already had and then threw away? Beside reducing bugs, it would eliminate the need for this public method and accompanying docs that warn you against using it." If so, please apply to SQL Power at hr (@) sqlpower.ca.
public void addProfileChangeListener(ProfileChangeListener listener)
addProfileChangeListener in interface ProfileManagerpublic void removeProfileChangeListener(ProfileChangeListener listener)
removeProfileChangeListener in interface ProfileManagerpublic void close()
ProfileManager
close in interface ProfileManagerpublic java.util.List<TableProfileCreator> getProfileCreators()
ProfileManager
getProfileCreators in interface ProfileManagerpublic TableProfileCreator getCreator()
ProfileManager
getCreator in interface ProfileManagerpublic void setCreator(TableProfileCreator tpc)
ProfileManager
setCreator in interface ProfileManagertpc - the profile creator to use, must not be null.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||