/*
 * Created on December 11, 2003
 *
 * ConnectionMetaDataImpl.java is used to test the J2EE Connector
 * as implemented by JOnAS. 
 *  
 */
package ersatz.resourceadapter;

import javax.resource.ResourceException;
import javax.resource.cci.ConnectionMetaData;

/**
 * @author Bob Kruse
 *
 * Ersatz Resource Adapter
 *
 * used to test the J2EE Connector as implemented by JOnAS.
 * 
 */
public class ConnectionMetaDataImpl 
        implements ConnectionMetaData
{
    public String product="Ersatz EIS"; // see J2eeConnectorTestBeanClient
    String version="1.1";
    String UserName="Ersatz_User_Name";  //
    private ManagedConnectionImpl mc;
    private ConnectionImpl conn;
    String cName = "ConnectionImpl";

    //
    //  The method getUserName returns the user name for an active connection as 
    //  known to the underlying EIS instance. The name corresponds the resource 
    //  principal under whose security context a connection to the EIS
    //  instance has been established.
    //
    public ConnectionMetaDataImpl(ConnectionImpl c, ManagedConnectionImpl mc) { // constructor
        Utility.log(cName+".constructor");
        this.mc=mc;
        this.conn=c;
    }
    public String getEISProductName()
                                       throws ResourceException
    {
        return (product);
    }
    public String getEISProductVersion()
                                          throws ResourceException
    {
        return (version);
    }
    public String getUserName()
                                          throws ResourceException
    {
        return (UserName);
    }
}
