/*
 * JOnAS: Java(TM) Open Application Server
 * Copyright (C) 1999 Bull S.A.
 * Contact: jonas-team@objectweb.org
 * 
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public
 * License as published by the Free Software Foundation; either
 * version 2.1 of the License, or any later version.
 * 
 * This library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * Lesser General Public License for more details.
 * 
 * You should have received a copy of the GNU Lesser General Public
 * License along with this library; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307
 * USA
 *
 * Initial developer(s): ____________________________________.
 * Contributor(s): Michel Bruno and Guillaume Riviere
 *
 * --------------------------------------------------------------------------
 * $Id$
 * --------------------------------------------------------------------------
 */

package org.objectweb.jonas.dbm;

import java.util.Set;

/**
 * MBean Interface for general DataSource Management 
 * MBean type: Standard
 * MBean model: inheritance
 */
public interface JmxDataSourceMBean {

    /**
     * @return String data source name
     */ 
    public String getDSName();

    /**
     * @return String data source url
     */ 
    public String getUrl();

    /**
     * @return String data source class name
     */ 
    public String getClassName();

    /**
     * @return String data source user
     */ 
    public String getUserName();

    /**
     * @return String data source password
     */ 
    public String getPassword();

    /**
     * @return the data source factory
     * none or JonasStandardXADataSource
     */
    public String getDataSourceFactory();

    /**
     * @return the DataSourceXAName
     */
    public String getDataSourceXADataName();

    /**
     * @return the description of this datasource
     */
    public String getDataSourceDescription();


    /**
     * @return Integer number of open connection in this ds
     */
    public Integer getCurrentNumberOfJDBCConnectionOpen();

    /**
     * MBean method:
     * @return connection level
     */
    public Integer getJDBCConnCheckLevel();
    /**
     * MBean method:
     * @param connection level
     */
    public void setJDBCConnCheckLevel(Integer level);

    /**
     * MBean method:
     * @return connection max age
     */
    public Integer getJDBCConnMaxAge();
    /**
     * MBean method:
     * @param connection max age
     */
    public void setJDBCConnMaxAge(Integer age);

    /**
     * MBean method:
     * @return test statement 
     */
    public String getJDBCTestStatement();
    /**
     * MBean method:
     * @param test statement 
     */
    public void setJDBCTestStatement(String test);

    /**
     * MBean method:
     * @return connection pool min
     */
    public Integer getJDBCMinConnPool();
   /**
     * MBean method: 
     * @param min for connection pool
     */
    public void setJDBCMinConnPool(Integer min);
    /**
     * MBean method:
     * @return connection pool max
     */
    public Integer getJDBCMaxConnPool();
   /**
     * MBean method:
     * @param max for connection pool 
     */
    public void setJDBCMaxConnPool(Integer max);
    /**
     * MBean method:
     * @return Integer sleep Time out
     */
    public Integer getJDBCSleepTimeOut();
   /**
     * MBean method: do nothing 
     * @param Integer sleep Time out
     */
    public void setJDBCSleepTimeOut(Integer timeOut);
    /**
     * MBean method:
     * @return Integer lock pool
     */
    public Integer getJDBCDeadLockPool();
   /**
     * MBean method: 
     * @param Integer lock pool
     */
    public void setJDBCDeadLockPool(Integer size);
    /**
     * MBean method:
     * @return Integer wait pool
     */
    public Integer getJDBCLoopWaitPool();
   /**
     * MBean method:
     * @param Integer wait pool
     */
    public void setJDBCLoopWaitPool(Integer size);
    
    /**
     * return the type of this data source
     */
    public String getDataSourceType();

}
