/* Copyright (c) 2002, Oracle Corporation. All Rights Reserved. */ 
package oracle.portal.sample.portalTools.devguide.jcasample;

import javax.resource.cci.ConnectionSpec;

/**
 * This class implements the JCA <code>ConnectionSpec</code> interface.
 *
 * It stores all connection properties required to create a connection.  
 * This SampleConnectionSpec supports following properties,
 * <pre>
 *  - userName: For this sample, we will accept only "scott".
 *  - password: For this sample we will accept only "tiger"
 *  - dataLocation: URL for the data file.
 * </pre>
 *
 * In the provider definition, this should be defined as follows:
 * <pre>
 * &ltconnectionHandler class="oracle.webdb.reformlet.data.jca.ConnectionHandler">
 *   &ltconnectionFactory class="oracle.portal.sample.portalTools.devguide.jcasample.SampleConnectionFactory"/>
 *   &ltconnectionSpec class="oracle.portal.sample.portalTools.devguide.jcasample.SampleConnectionSpec">
 *      &ltuserName>...&lt/userName>
 *      &ltpassword>...&lt/password>
 *      &ltdataLocation>...&lt/dataLocation>
 *   &lt/connectionSpec> 
 * &lt/connectionHandler>
 * </pre>
 *
 * If there is no connection property to define, the connectionSpec tag may not
 * be defined in the definition.
 *
 * Note that the class must be implemented as a Bean. It must have setUserName 
 * and getUserName methods for the "userName" tag it supports.
 */
public class SampleConnectionSpec implements ConnectionSpec
{
  // Parameters that will be used by the connection factory to create the 
  // connection.
  private String mUserName = null;
  private String mPassword = null;
  private String mDataLocation = null;

  ///////////////////////////////
  // Provide methods for the property "userName"
  ///////////////////////////////

  /**
   * Set the data for the tag "userName".
   * @param val Value to set as the tag value.
   */
  public void setUserName(String val)
  {
    mUserName = val;
  }

  /**
   * Get the data for the tag "userName".
   * @return The tag value.
   */
  public String getUserName()
  {
    return mUserName;
  }

  ///////////////////////////////
  // Provide methods for the property "password"
  ///////////////////////////////

  /**
   * Set the data for the tag "password".
   * @param val Value to set as the tag value.
   */
  public void setPassword(String val)
  {
    mPassword = val;
  }

  /**
   * Get the data for the tag "password".
   * @return The tag value.
   */
  public String getPassword()
  {
    return mPassword;
  }

  ///////////////////////////////
  // Provide methods for the property "dataLocation"
  ///////////////////////////////

  /**
   * Set the data for the tag "dataLocation".
   * @param val Value to set as the tag value.
   */
  public void setDataLocation(String val)
  {
    mDataLocation = val;
  }

  /**
   * Get the data for the tag "dataLocation".
   * @return The tag value.
   */
  public String getDataLocation()
  {
    return mDataLocation;
  }


}
