001 /** 002 * 003 * Copyright 2004 Hiram Chirino 004 * 005 * Licensed under the Apache License, Version 2.0 (the "License"); 006 * you may not use this file except in compliance with the License. 007 * You may obtain a copy of the License at 008 * 009 * http://www.apache.org/licenses/LICENSE-2.0 010 * 011 * Unless required by applicable law or agreed to in writing, software 012 * distributed under the License is distributed on an "AS IS" BASIS, 013 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 014 * See the License for the specific language governing permissions and 015 * limitations under the License. 016 * 017 **/ 018 package org.activemq.security.jassjacc; 019 020 import java.io.Serializable; 021 import java.util.Collections; 022 import java.util.HashSet; 023 import java.util.Set; 024 025 /** 026 * Used to define permissions needed to operate against the ActiveMQ broker. 027 * 028 * @version $Revision: 1.1.1.1 $ 029 */ 030 public final class JMSBrokerPermission extends AbstractJMSPermission implements Serializable { 031 032 private static final long serialVersionUID = 1222115376467481468L; 033 034 public static final String CONNECT_ACTION = "connect"; 035 public static final String DESTROY_DESTINATION_ACTION = "destroy destination"; 036 public static final String CREATE_DESTINATION_ACTION = "create destination"; 037 038 public static final Set VALID_ACTIONS; 039 static { 040 HashSet hs = new HashSet(); 041 hs.add(CREATE_DESTINATION_ACTION); 042 hs.add(DESTROY_DESTINATION_ACTION); 043 hs.add(CONNECT_ACTION); 044 VALID_ACTIONS = Collections.unmodifiableSet(hs); 045 } 046 047 public JMSBrokerPermission(String name, String action) { 048 super(name, action); 049 } 050 051 public Set getValidSetOfActions() { 052 return VALID_ACTIONS; 053 } 054 } 055