org.postgresql.pljava.internal
Class Session

java.lang.Object
  extended by org.postgresql.pljava.internal.Session
All Implemented Interfaces:
Session

public class Session
extends java.lang.Object
implements Session

An instance of this interface reflects the current session. The attribute store is transactional.


Constructor Summary
Session()
           
 
Method Summary
 void addSavepointListener(SavepointListener listener)
          Adds the specified listener to the list of listeners that will receive savepoint events.
 void addTransactionListener(TransactionListener listener)
          Adds the specified listener to the list of listeners that will receive transactional events.
 void executeAsSessionUser(java.sql.Connection conn, java.lang.String statement)
          Execute a statement as a session user rather then the effective user.
 java.lang.Object getAttribute(java.lang.String attributeName)
          Obtain an attribute from the current session.
 ObjectPool getObjectPool(java.lang.Class cls)
          Return an object pool for the given class.
 java.lang.String getSessionUserName()
          Return the session user.
 java.lang.String getUserName()
          Return the current user.
 void removeAttribute(java.lang.String attributeName)
          Remove an attribute previously stored in the session.
 void removeSavepointListener(SavepointListener listener)
          Removes the specified listener from the list of listeners that will receive savepoint events.
 void removeTransactionListener(TransactionListener listener)
          Removes the specified listener from the list of listeners that will receive transactional events.
 void setAttribute(java.lang.String attributeName, java.lang.Object value)
          Set an attribute to a value in the current session.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Session

public Session()
Method Detail

addTransactionListener

public void addTransactionListener(TransactionListener listener)
Adds the specified listener to the list of listeners that will receive transactional events.

Specified by:
addTransactionListener in interface Session
Parameters:
listener - The listener to be added.

addSavepointListener

public void addSavepointListener(SavepointListener listener)
Adds the specified listener to the list of listeners that will receive savepoint events.

Specified by:
addSavepointListener in interface Session
Parameters:
listener - The listener to be added.

getAttribute

public java.lang.Object getAttribute(java.lang.String attributeName)
Description copied from interface: Session
Obtain an attribute from the current session.

Specified by:
getAttribute in interface Session
Parameters:
attributeName - The name of the attribute
Returns:
The value of the attribute

getObjectPool

public ObjectPool getObjectPool(java.lang.Class cls)
Description copied from interface: Session
Return an object pool for the given class. The class must implement the interface PooledObject.

Specified by:
getObjectPool in interface Session
Returns:
An object pool that pools object of the given class.

getUserName

public java.lang.String getUserName()
Return the current user.

Specified by:
getUserName in interface Session

getSessionUserName

public java.lang.String getSessionUserName()
Return the session user.

Specified by:
getSessionUserName in interface Session

removeAttribute

public void removeAttribute(java.lang.String attributeName)
Description copied from interface: Session
Remove an attribute previously stored in the session. If no attribute is found, nothing happens.

Specified by:
removeAttribute in interface Session
Parameters:
attributeName - The name of the attribute.

setAttribute

public void setAttribute(java.lang.String attributeName,
                         java.lang.Object value)
Description copied from interface: Session
Set an attribute to a value in the current session.

Specified by:
setAttribute in interface Session

removeTransactionListener

public void removeTransactionListener(TransactionListener listener)
Removes the specified listener from the list of listeners that will receive transactional events.

Specified by:
removeTransactionListener in interface Session
Parameters:
listener - The listener to be removed.

removeSavepointListener

public void removeSavepointListener(SavepointListener listener)
Removes the specified listener from the list of listeners that will receive savepoint events.

Specified by:
removeSavepointListener in interface Session
Parameters:
listener - The listener to be removed.

executeAsSessionUser

public void executeAsSessionUser(java.sql.Connection conn,
                                 java.lang.String statement)
                          throws java.sql.SQLException
Description copied from interface: Session
Execute a statement as a session user rather then the effective user. This is useful when functions declared using SECURITY DEFINER wants to give up the definer rights.

Specified by:
executeAsSessionUser in interface Session
Parameters:
conn - The connection used for the execution
statement - The statement to execute
Throws:
java.sql.SQLException - if something goes wrong when executing.
See Also:
Statement.execute(java.lang.String)


Copyright (c) 2003, 2004, 2005 TADA AB - Taby Sweden. \ Distributed under the terms shown in COPYRIGHT