/** 
 * 
 * Copyright 2004 Hiram Chirino
 * 
 * Licensed under the Apache License, Version 2.0 (the "License"); 
 * you may not use this file except in compliance with the License. 
 * You may obtain a copy of the License at 
 * 
 * http://www.apache.org/licenses/LICENSE-2.0
 * 
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS, 
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 
 * See the License for the specific language governing permissions and 
 * limitations under the License. 
 * 
 **/
package org.codehaus.activemq.security.jassjacc;

import java.io.Serializable;
import java.util.Collections;
import java.util.HashSet;
import java.util.Set;

/**
 * Used to define permissions needed to operate against the ActiveMQ broker.
 * 
 * @version $Revision: 1.1 $
 */
public final class JMSBrokerPermission extends AbstractJMSPermission implements Serializable {
	
	public static final String CONNECT_ACTION = "connect";
	public static final String DESTROY_DESTINATION_ACTION = "destroy destination";
	public static final String CREATE_DESTINATION_ACTION = "create destination";
	
	public static final Set VALID_ACTIONS;
	static {
		HashSet hs = new HashSet();
		hs.add(CREATE_DESTINATION_ACTION);
		hs.add(DESTROY_DESTINATION_ACTION);
		hs.add(CONNECT_ACTION);
		VALID_ACTIONS = Collections.unmodifiableSet(hs);
	}
	
	public JMSBrokerPermission(String name, String action) {
		super(name, action);
	}

	public Set getValidSetOfActions() {
		return VALID_ACTIONS;
	}
}

