package com.tm.jndi.ldap;

import javax.naming.InitialContext;
import javax.naming.NamingException;
import javax.naming.NameAlreadyBoundException;
import javax.naming.directory.*;
import java.util.*;

public class Connection extends JndiLdapConnection
{
  public Connection() 
  {
    super();
  }

  public Connection(String hostname, String port, String contextRoot, String username, String password)
    throws ConnectionException
  {
    super(hostname,port,contextRoot,username,password);
    connect();
  }

  public Connection(String url, String user, String password)
    throws ConnectionException
  {  
    super(url, user, password);
    connect();
  }

  public Object lookup(String name)
   throws NamingException
  {
    return context.lookup(name);
  }

  public void bind(String name, Object object)
    throws NamingException
  {
    context.bind(name, object);
  }

  public void destroySubcontext(String name)
    throws NamingException
  {
    context.destroySubcontext(name);
  }
}
