/* Generated by Together */

package cobalt.deployment.descriptor.dist;

import java.util.Set;
import java.util.HashSet;

/**
 * Title:        J2EE role map description
 * Description:  Represents J2EE-specific role mapping description for standard role mapping description
 * Copyright:    Copyright (c) 2001
 * Company:      ETRI
 * @author Yeon Jun Choi
 * @version 1.0
 */

public class J2eeRoleMap {
    public J2eeRoleMap(String name) {
        this.name = name;
        principals = new HashSet();
        groups = new HashSet();
    }

    public Set getPrincipals() { return principals; }

    public void setPrincipals(Set principals) { this.principals = principals; }

    public void addPrincipal(String item) {
//		if ( principals.contains(item) )	return;
        principals.add(item);
    }

    public void removePrincipal(String item) {
        principals.remove(item);
    }

    public Set getGroups() { return groups; }

    public void setGroups(Set groups) { this.groups = groups; }

    public void addGroup(String item) {
//		if ( groups.contains(item) )	return;
        groups.add(item);
    }

    public void removeGroup(String item) {
        groups.remove(item);
    }

    public String getName(){ return name; }

    public void setName(String name){ this.name = name; }

    private Set principals;
    private Set groups;
    private String name;
}
