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 destinations.
027     * 
028     * @version $Revision: 1.1.1.1 $
029     */
030    public final class JMSDestinationPermission extends AbstractJMSPermission implements Serializable {
031    
032        private static final long serialVersionUID = 2541402596443739827L;
033        
034        public static final String SEND_ACTION = "send";
035            public static final String PRODUCE_ACTION = "produce";
036            public static final String CONSUME_ACTION = "consume";
037            
038            public static final Set VALID_ACTIONS;
039            static {
040                    HashSet hs = new HashSet();
041                    hs.add(CONSUME_ACTION);
042                    hs.add(PRODUCE_ACTION);
043                    hs.add(SEND_ACTION);
044                    VALID_ACTIONS = Collections.unmodifiableSet(hs);
045            }
046            
047            public JMSDestinationPermission(String destinationName, String action) {
048                    super(destinationName, action);
049            }
050    
051            public Set getValidSetOfActions() {
052                    return VALID_ACTIONS;
053            }
054    }
055