com.ibm.designer.domino.ide.resources.extensions
Class NotesPlatform

java.lang.Object
  extended by com.ibm.designer.domino.ide.resources.extensions.NotesPlatform

public class NotesPlatform
extends java.lang.Object

A thread safe method of executing the Domino Java APIs from within Domino Designer. This utility class allows operations to run in the correct order such that the user can get a valid handle on a lotus.domino.Database. Once this handle is created the full artillery of the Domino Java APIs are at the user's disposal.

For the purposes of thread safety this class is implemented as a singleton. Please use NotesPlatform.getInstance() to get a handle on this class.


Method Summary
 lotus.domino.Database getDatabase(java.lang.String server, java.lang.String path)
          Returns a handle to the specified db on the specified server.
static NotesPlatform getInstance()
          Returns an instance of the current class.
 lotus.domino.Database getLocalDatabase(java.lang.String path)
          Returns a Notes Java API handle to a given local db.
 lotus.domino.Session getSession()
          Returns the current user session.
 boolean isValidThread()
          Determines whether or not the assigned thread is a valid notes thread.
 void syncExec(java.lang.Runnable runnable)
          Runs the given runnable within the notes context.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getInstance

public static NotesPlatform getInstance()
                                 throws java.lang.Throwable
Returns an instance of the current class.

Returns:
returns the singleton instance of com.ibm.designer.domino.ide.resources.extensions.NotesPlatform
Throws:
java.lang.Throwable

getLocalDatabase

public lotus.domino.Database getLocalDatabase(java.lang.String path)
Returns a Notes Java API handle to a given local db.

Parameters:
path - the path to a local db/template (relative to the data directory)
Returns:
returns a handle to the specified db

getDatabase

public lotus.domino.Database getDatabase(java.lang.String server,
                                         java.lang.String path)
Returns a handle to the specified db on the specified server.

Parameters:
server - the qualified servername
path - the path the db
Returns:
a handle to the requested db, if available

syncExec

public void syncExec(java.lang.Runnable runnable)
Runs the given runnable within the notes context.

Parameters:
runnable -
See Also:
Runnable

isValidThread

public boolean isValidThread()
Determines whether or not the assigned thread is a valid notes thread.

Returns:

getSession

public lotus.domino.Session getSession()
Returns the current user session.

Returns:
returns a session