Skip navigation links


oracle.idm.connection
Class Connection

java.lang.Object
  extended by oracle.idm.connection.Connection

All Implemented Interfaces:
java.lang.Cloneable, java.lang.Comparable, XmlPrintable
Direct Known Subclasses:
LdapConnection, SqlConnection

public abstract class Connection
extends java.lang.Object
implements java.lang.Cloneable, java.lang.Comparable, XmlPrintable

This class represents connections and various information that can be collected about connections in this framework.

Note: this class has a natural ordering that is inconsistent with equals.


Nested Class Summary
 class Connection.BusyInfo
          This class contains information about the connection busy phase.
 class Connection.CaptureInfo
          This class contains information about capture operations.
 class Connection.CloseInfo
          This class contains information about close operations.
static class Connection.CountInfo
          This class maintains connection count information.
 class Connection.IdleInfo
          This class contains information about the connection idle phase.
 class Connection.InvalidateInfo
          This class contains information about invalidate operations.
static class Connection.Match
          This class facilitates connection matching.
 class Connection.OpenInfo
          This class contains information of open operations.
static class Connection.Operation
          This class defines common connection operations.
 class Connection.OperationInfo
          This class contains common information about connection operations.
static class Connection.Parameter
          This class defines commonly used connection parameters.
 class Connection.ProxyInfo
          This class contains information about proxy operations.
 class Connection.ReleaseInfo
          This class contains information about release operations.
 class Connection.RemoveInfo
          This class contains information about remove operations.
 class Connection.ReturnInfo
          This class contains information about return operations.
static class Connection.Status
          This class defines common connection statuses.
 class Connection.ValidateInfo
          This class contains information about validate operations.

 

Field Summary
protected  java.lang.String tag
          Tag used to print the connection as an XML element.
static java.lang.String TYPE
          Use for every connection type parameter value.

 

Constructor Summary
protected Connection(ConnectionDelegate delegate, java.util.Map parameters)
          Constructor for the connection.

 

Method Summary
protected  void check(java.lang.String operation)
          This method checks this connection for validity.
 java.lang.Object clone()
          Clones the connection.
 int compareTo(java.lang.Object that)
          This method compares connections based on their validity.
 void finalize()
          Finalizes the connection.
 Connection.BusyInfo getBusyInfo()
          Returns busy phase related information.
 Connection.CaptureInfo getCaptureInfo()
          Returns capture operation related information.
 Connection.CloseInfo getCloseInfo()
          Returns close operation related information.
 ConnectionDelegate getConnectionDelegate()
          Returns the connection delegate of this connection.
 ConnectionGroup getConnectionGroup()
          Returns the connection group of this connection.
 ConnectionPool getConnectionPool()
          Returns the connection pool of this connection.
 Connection.IdleInfo getIdleInfo()
          Returns idle phase related information.
 Connection.InvalidateInfo getInvalidateInfo()
          Returns invalidate operation related information.
 java.util.logging.Logger getLogger()
          This method returns the logger for this connection.
 Connection.OpenInfo getOpenInfo()
          Returns open operation related information.
 Connection.OperationInfo getOperationInfo()
          Returns last operation related information.
 Connection.ProxyInfo getProxyInfo()
          Returns proxy operation related information.
 Connection.ReleaseInfo getReleaseInfo()
          Returns release operation related information.
 Connection.RemoveInfo getRemoveInfo()
          Returns remove operation related information.
 Connection.ReturnInfo getReturnInfo()
          Returns return operation related information.
 long getSerialNumber()
          Returns the connection serial number.
abstract  java.lang.String getType()
          Returns the connection type.
 Connection.ValidateInfo getValidateInfo()
          Returns validate operation related information.
 boolean isClone()
          Retirns true if the connection is a clone.
 boolean isMatchingType(java.lang.String type)
          Tests if the connection type value matches.
protected  void recordCapture(java.util.Map parameters, java.lang.StackTraceElement[] stackTrace)
          Records capture operation, called from the connection delegate.
protected  void recordClose(java.util.Map parameters, java.lang.StackTraceElement[] stackTrace)
          Records close operation, called from the connection delegate.
protected  void recordInvalidate(java.util.Map parameters, java.lang.StackTraceElement[] stackTrace)
          Records invalidate operation, called from the connection delegate.
protected  void recordOpen(java.util.Map parameters, java.lang.StackTraceElement[] stackTrace)
          Records open operation, called from the connection delegate.
protected  void recordProxy(java.util.Map parameters, java.lang.StackTraceElement[] stackTrace)
          Records proxy operation, called from the connection delegate.
protected  void recordRelease(java.util.Map parameters, java.lang.StackTraceElement[] stackTrace)
          Reocrds release operation, called from the connection delegate.
protected  void recordRemove(java.util.Map parameters, java.lang.StackTraceElement[] stackTrace)
          Records remove operation, called from the connection delegate.
protected  void recordReturn(java.util.Map parameters, java.lang.StackTraceElement[] stackTrace)
          Records return operation, called from the connection delegate.
protected  void recordState()
          Records state, called upon capture and remove operations.
protected  void recordValidate(java.util.Map parameters, java.lang.StackTraceElement[] stackTrace)
          Records validate operation, called from the connection delegate.
protected  void unrecordState()
          Unrecords state, called upon release and return operations.
 void xprint(XmlPrintWriter out)
          Prints connection properties to the PrintWriter as an XML element.
protected  void xprintBody(XmlPrintWriter out)
          This method prints the connection XML tag body.

 

Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

 

Field Detail

TYPE

public static final java.lang.String TYPE
Use for every connection type parameter value.
See Also:
Constant Field Values

tag

protected java.lang.String tag
Tag used to print the connection as an XML element.

Constructor Detail

Connection

protected Connection(ConnectionDelegate delegate,
                     java.util.Map parameters)
Constructor for the connection.

Note: parameters are not cloned at this point.

Method Detail

finalize

public void finalize()
              throws java.lang.Throwable
Finalizes the connection.
Overrides:
finalize in class java.lang.Object
Throws:
java.lang.Throwable

getLogger

public java.util.logging.Logger getLogger()
This method returns the logger for this connection.
Returns:
connection logger

compareTo

public int compareTo(java.lang.Object that)
This method compares connections based on their validity.

If this connection is more recently opened, proxied or validated than that connection, it returns -1.

If this connection is less recently opened, proxied or validated than that connection, it returns 1.

If this and that connections are equally recently opened, proxied or validated, it returns 0.

Specified by:
compareTo in interface java.lang.Comparable
Returns:
a negative integer, zero, or a positive integer

getSerialNumber

public final long getSerialNumber()
Returns the connection serial number.
Returns:
long representing the connection serial number

getType

public abstract java.lang.String getType()
Returns the connection type.
Returns:
string representing the connection type

isMatchingType

public final boolean isMatchingType(java.lang.String type)
Tests if the connection type value matches.

Every connection matches the Connection.TYPE value.

Returns:
true if the type matches, false otherwise

isClone

public final boolean isClone()
Retirns true if the connection is a clone.
Returns:
true if the connection is a clone, false otherwise

getConnectionDelegate

public final ConnectionDelegate getConnectionDelegate()
Returns the connection delegate of this connection.
Returns:
connection delegate of this connection

getConnectionGroup

public final ConnectionGroup getConnectionGroup()
Returns the connection group of this connection.
Returns:
connection group of this connection

getConnectionPool

public final ConnectionPool getConnectionPool()
Returns the connection pool of this connection.
Returns:
connection pool of this connection

getOpenInfo

public final Connection.OpenInfo getOpenInfo()
Returns open operation related information.
Returns:
open info

getCloseInfo

public final Connection.CloseInfo getCloseInfo()
Returns close operation related information.
Returns:
close info

getProxyInfo

public final Connection.ProxyInfo getProxyInfo()
Returns proxy operation related information.
Returns:
proxy info

getCaptureInfo

public final Connection.CaptureInfo getCaptureInfo()
Returns capture operation related information.
Returns:
capture info

getReleaseInfo

public final Connection.ReleaseInfo getReleaseInfo()
Returns release operation related information.
Returns:
release info

getRemoveInfo

public final Connection.RemoveInfo getRemoveInfo()
Returns remove operation related information.
Returns:
remove info

getReturnInfo

public final Connection.ReturnInfo getReturnInfo()
Returns return operation related information.
Returns:
return info

getValidateInfo

public final Connection.ValidateInfo getValidateInfo()
Returns validate operation related information.
Returns:
validate info

getInvalidateInfo

public final Connection.InvalidateInfo getInvalidateInfo()
Returns invalidate operation related information.
Returns:
invalidate info

getOperationInfo

public final Connection.OperationInfo getOperationInfo()
Returns last operation related information.
Returns:
operation info

getBusyInfo

public final Connection.BusyInfo getBusyInfo()
Returns busy phase related information.
Returns:
busy info

getIdleInfo

public final Connection.IdleInfo getIdleInfo()
Returns idle phase related information.
Returns:
idle info

clone

public java.lang.Object clone()
                       throws java.lang.CloneNotSupportedException
Clones the connection. Connections are cloned when referenced in connection events and exceptions. Make sure you null out all the fields you do not want to be accessible from those contexts.
Overrides:
clone in class java.lang.Object
Returns:
a connection clone
Throws:
java.lang.CloneNotSupportedException

check

protected void check(java.lang.String operation)
              throws ConnectionException
This method checks this connection for validity.
Throws:
ConnectionException

recordState

protected void recordState()
                    throws ConnectionException
Records state, called upon capture and remove operations.
Throws:
ConnectionException

unrecordState

protected void unrecordState()
                      throws ConnectionException
Unrecords state, called upon release and return operations.
Throws:
ConnectionException

recordOpen

protected void recordOpen(java.util.Map parameters,
                          java.lang.StackTraceElement[] stackTrace)
                   throws ConnectionException
Records open operation, called from the connection delegate.

Note: Parameters are already cloned at this point.

Throws:
ConnectionException

recordClose

protected void recordClose(java.util.Map parameters,
                           java.lang.StackTraceElement[] stackTrace)
                    throws ConnectionException
Records close operation, called from the connection delegate.

Note: Parameters are already cloned at this point.

Throws:
ConnectionException

recordProxy

protected void recordProxy(java.util.Map parameters,
                           java.lang.StackTraceElement[] stackTrace)
                    throws ConnectionException
Records proxy operation, called from the connection delegate.

Note: Parameters are already cloned at this point.

Throws:
ConnectionException

recordCapture

protected void recordCapture(java.util.Map parameters,
                             java.lang.StackTraceElement[] stackTrace)
                      throws ConnectionException
Records capture operation, called from the connection delegate.

Note: Parameters are already cloned at this point.

Throws:
ConnectionException

recordRelease

protected void recordRelease(java.util.Map parameters,
                             java.lang.StackTraceElement[] stackTrace)
                      throws ConnectionException
Reocrds release operation, called from the connection delegate.

Note: Parameters are already cloned at this point.

Throws:
ConnectionException

recordRemove

protected void recordRemove(java.util.Map parameters,
                            java.lang.StackTraceElement[] stackTrace)
                     throws ConnectionException
Records remove operation, called from the connection delegate.

Note: Parameters are already cloned at this point.

Throws:
ConnectionException

recordReturn

protected void recordReturn(java.util.Map parameters,
                            java.lang.StackTraceElement[] stackTrace)
                     throws ConnectionException
Records return operation, called from the connection delegate.

Note: Parameters are already cloned at this point.

Throws:
ConnectionException

recordValidate

protected void recordValidate(java.util.Map parameters,
                              java.lang.StackTraceElement[] stackTrace)
                       throws ConnectionException
Records validate operation, called from the connection delegate.

Note: Parameters are already cloned at this point.

Throws:
ConnectionException

recordInvalidate

protected void recordInvalidate(java.util.Map parameters,
                                java.lang.StackTraceElement[] stackTrace)
                         throws ConnectionException
Records invalidate operation, called from the connection delegate.

Note: Parameters are already cloned at this point.

Throws:
ConnectionException

xprint

public void xprint(XmlPrintWriter out)
Prints connection properties to the PrintWriter as an XML element.
Specified by:
xprint in interface XmlPrintable
Parameters:
out - PrintWriter for printing connection propeties.

xprintBody

protected void xprintBody(XmlPrintWriter out)
This method prints the connection XML tag body.

Skip navigation links