ca.sqlpower.wabit
Class WabitSessionImpl

java.lang.Object
  extended by ca.sqlpower.wabit.WabitSessionImpl
All Implemented Interfaces:
ca.sqlpower.util.SPSession, WabitSession
Direct Known Subclasses:
WabitClientSession

public class WabitSessionImpl
extends java.lang.Object
implements WabitSession


Constructor Summary
WabitSessionImpl(WabitSessionContext context)
           
 
Method Summary
 void addPropertyChangeListener(java.beans.PropertyChangeListener l)
           
 void addSessionLifecycleListener(ca.sqlpower.swingui.event.SessionLifecycleListener<WabitSession> l)
           
 boolean close()
          Ends this session, disposing its frame and releasing any system resources that were obtained explicitly by this session.
 ca.sqlpower.util.UserPrompter createUserPrompter(java.lang.String question, ca.sqlpower.util.UserPrompterFactory.UserPromptType responseType, ca.sqlpower.util.UserPrompter.UserPromptOptions optionType, ca.sqlpower.util.UserPrompter.UserPromptResponse defaultResponseType, java.lang.Object defaultResponse, java.lang.String... buttonNames)
           
 WabitSessionContext getContext()
          Returns the context this session belongs to.
 ca.sqlpower.sql.DataSourceCollection<ca.sqlpower.sql.SPDataSource> getDataSources()
          Returns a collection of all the data sources that are available to this session.
 WabitWorkspace getSystemWorkspace()
          This method might return a WabitWorkspace, the system one, located on the Wabit server, if the current session is backed by a remote server session.
 WabitWorkspace getWorkspace()
          Returns the workspace associated with this session.
 boolean isEnterpriseServerSession()
          Returns true if the current session is in fact a remote session with the wabit enterprise server.
 boolean isForegroundThread()
           
 void removePropertyChangeListener(java.beans.PropertyChangeListener l)
           
 void removeSessionLifecycleListener(ca.sqlpower.swingui.event.SessionLifecycleListener<WabitSession> l)
           
 void runInBackground(java.lang.Runnable runner)
           
 void runInForeground(java.lang.Runnable runner)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

WabitSessionImpl

public WabitSessionImpl(WabitSessionContext context)
Method Detail

addPropertyChangeListener

public void addPropertyChangeListener(java.beans.PropertyChangeListener l)
Specified by:
addPropertyChangeListener in interface WabitSession

addSessionLifecycleListener

public void addSessionLifecycleListener(ca.sqlpower.swingui.event.SessionLifecycleListener<WabitSession> l)
Specified by:
addSessionLifecycleListener in interface WabitSession

close

public boolean close()
Description copied from interface: WabitSession
Ends this session, disposing its frame and releasing any system resources that were obtained explicitly by this session. Also fires a sessionClosing lifecycle event, so any resources used up by subsystems dependent on this session can be freed by the appropriate parties.

Specified by:
close in interface WabitSession
Returns:
True if the session was successfully closed. False if the session did not close due to an error or user intervention.

createUserPrompter

public ca.sqlpower.util.UserPrompter createUserPrompter(java.lang.String question,
                                                        ca.sqlpower.util.UserPrompterFactory.UserPromptType responseType,
                                                        ca.sqlpower.util.UserPrompter.UserPromptOptions optionType,
                                                        ca.sqlpower.util.UserPrompter.UserPromptResponse defaultResponseType,
                                                        java.lang.Object defaultResponse,
                                                        java.lang.String... buttonNames)

getContext

public WabitSessionContext getContext()
Description copied from interface: WabitSession
Returns the context this session belongs to.

Specified by:
getContext in interface WabitSession

getWorkspace

public WabitWorkspace getWorkspace()
Description copied from interface: WabitSession
Returns the workspace associated with this session.

Specified by:
getWorkspace in interface ca.sqlpower.util.SPSession
Specified by:
getWorkspace in interface WabitSession

removePropertyChangeListener

public void removePropertyChangeListener(java.beans.PropertyChangeListener l)
Specified by:
removePropertyChangeListener in interface WabitSession

removeSessionLifecycleListener

public void removeSessionLifecycleListener(ca.sqlpower.swingui.event.SessionLifecycleListener<WabitSession> l)
Specified by:
removeSessionLifecycleListener in interface WabitSession

getDataSources

public ca.sqlpower.sql.DataSourceCollection<ca.sqlpower.sql.SPDataSource> getDataSources()
Description copied from interface: WabitSession
Returns a collection of all the data sources that are available to this session. The data sources do not have to be in the session's workspace. All of the data sources in the session's workspace will be in this collection.

Specified by:
getDataSources in interface WabitSession

runInBackground

public void runInBackground(java.lang.Runnable runner)
Specified by:
runInBackground in interface ca.sqlpower.util.SPSession

runInForeground

public void runInForeground(java.lang.Runnable runner)
Specified by:
runInForeground in interface ca.sqlpower.util.SPSession

isForegroundThread

public boolean isForegroundThread()
Specified by:
isForegroundThread in interface ca.sqlpower.util.SPSession

isEnterpriseServerSession

public boolean isEnterpriseServerSession()
Description copied from interface: WabitSession
Returns true if the current session is in fact a remote session with the wabit enterprise server.

Specified by:
isEnterpriseServerSession in interface WabitSession
Returns:

getSystemWorkspace

public WabitWorkspace getSystemWorkspace()
Description copied from interface: WabitSession
This method might return a WabitWorkspace, the system one, located on the Wabit server, if the current session is backed by a remote server session. It will return null if it is not a server session or the user doesn't have access to the system workspace. One can also use isEnterpriseSession() to verify if this call will return null beforehand.

Specified by:
getSystemWorkspace in interface WabitSession
Returns:


Copyright © 2009. All Rights Reserved.