package com.mit.mimax.realm;

import java.io.Serializable;
import java.util.Enumeration;
import java.util.LinkedList;
import java.util.List;
import java.util.Properties;

import com.mit.logging.Logger;
import com.sun.appserv.security.AppservRealm;
import com.sun.enterprise.security.auth.realm.BadRealmException;
import com.sun.enterprise.security.auth.realm.InvalidOperationException;
import com.sun.enterprise.security.auth.realm.NoSuchRealmException;
import com.sun.enterprise.security.auth.realm.NoSuchUserException;

public class MiMaxRealm extends  AppservRealm implements Serializable
{
	/**
	 * 
	 */
	private static final long serialVersionUID = 7914665084575989104L;
	private String jaasCtxName;
	private String startWith;

	protected void init(Properties props) throws BadRealmException, NoSuchRealmException 
	{ 
		Logger.info("MiMaxRealm: init()");
		jaasCtxName = props.getProperty("jaas-context", "MiMaxRealm");
	}

	@Override public String getJAASContext() { return jaasCtxName; }
	@SuppressWarnings("unchecked")
	public Enumeration getGroupNames(String string) throws InvalidOperationException, NoSuchUserException 
	{
		List groupNames = new LinkedList(); return (Enumeration) groupNames;
	}

	public String getAuthType() 
	{
		return "MiMaxRealm";
	}
	
	public String getStartWith() 
	{
		return startWith; 
	}
}
