/* Copyright (c) 2000, 2001 Oracle Corporation. All Rights Reserved. */
package oracle.portal.provider.v2.oid;


import oracle.portal.provider.v2.ProviderContext;
import oracle.portal.provider.v2.ProviderException;

/**
 * An <code>OidInfo</code> is a class that contains all the OID connection
 * details.
 *
 * This base class has getter and setter methods for the OID host, port,
 * username and password. The getter methods are packaged scoped  and so can
 * only be called by the OidManager class.
 *
 * Implementers of this class need to take care to secure the information
 * contained in this class and if the information is read from a file
 * then the contents of that file need to be secured.
 */
public abstract class OidInfo
{
    private String mHost = null;
    private String mPort = null;
    private String mUser = null;
    private String mPasswd = null;

    public abstract void init(ProviderContext pc) throws ProviderException;

    /**
     * Set's the OID host.
     * 
     * @param host the name of the host
     */
    public void setLDAPHost(String host)
    {
        mHost = host;
    }

    /**
     * Set's the OID port.
     * 
     * @param port the name of the port
     */
    public void setLDAPPort(String port)
    {
        mPort = port;
    }

    /**
     * Set's the OID user.
     * 
     * @param user the OID user name
     */
    public void setLDAPUser(String user)
    {
        mUser = user;
    }

    /**
     * Set's the OID password.
     * 
     * @param passwd the name of the password
     */
    public void setLDAPPasswd(String passwd)
    {
        mPasswd = passwd;
    }


    // The following methods are deliberately package scoped

   /**
    * get the OID Host name.
    *
    * @return the OID host name
    *
    * @see #setLDAPHost
    */
    String getLDAPHost()
    {
        return mHost;
    }

   /**
    * get the OID port.
    *
    * @return the OID port
    *
    * @see #setLDAPPort
    */
    String getLDAPPort()
    {
        return mPort;
    }

   /**
    * get the OID user name.
    *
    * @return the OID user name
    *
    * @see #setLDAPUser
    */
    String getLDAPUser()
    {
        return mUser;
    }

   /**
    * get the OID password.
    *
    * @return the OID password
    *
    * @see #setLDAPHost
    */
    String getLDAPPasswd()
    {
        return mPasswd;
    }

}
