1 18 package org.apache.activemq.security; 19 20 import org.apache.activemq.command.ActiveMQDestination; 21 import org.apache.activemq.filter.DestinationMap; 22 23 import java.util.Set ; 24 25 33 public class SimpleAuthorizationMap implements AuthorizationMap { 34 35 private DestinationMap writeACLs; 36 private DestinationMap readACLs; 37 private DestinationMap adminACLs; 38 39 private TempDestinationAuthorizationEntry tempDestinationAuthorizationEntry; 40 41 public SimpleAuthorizationMap() { 42 } 43 44 public SimpleAuthorizationMap(DestinationMap writeACLs, DestinationMap readACLs, DestinationMap adminACLs) { 45 this.writeACLs = writeACLs; 46 this.readACLs = readACLs; 47 this.adminACLs = adminACLs; 48 } 49 50 55 56 public void setTempDestinationAuthorizationEntry(TempDestinationAuthorizationEntry tempDestinationAuthorizationEntry) { 57 this.tempDestinationAuthorizationEntry = tempDestinationAuthorizationEntry; 58 } 59 60 public TempDestinationAuthorizationEntry getTempDestinationAuthorizationEntry() { 61 return this.tempDestinationAuthorizationEntry; 62 } 63 64 65 public Set getTempDestinationAdminACLs() { 66 if(tempDestinationAuthorizationEntry != null) 67 return tempDestinationAuthorizationEntry.getAdminACLs(); 68 else 69 return null; 70 } 71 72 public Set getTempDestinationReadACLs() { 73 if(tempDestinationAuthorizationEntry != null) 74 return tempDestinationAuthorizationEntry.getReadACLs(); 75 else 76 return null; 77 } 78 79 public Set getTempDestinationWriteACLs() { 80 if(tempDestinationAuthorizationEntry != null) 81 return tempDestinationAuthorizationEntry.getWriteACLs(); 82 else 83 return null; 84 } 85 86 public Set getAdminACLs(ActiveMQDestination destination) { 87 return adminACLs.get(destination); 88 } 89 90 public Set getReadACLs(ActiveMQDestination destination) { 91 return readACLs.get(destination); 92 } 93 94 public Set getWriteACLs(ActiveMQDestination destination) { 95 return writeACLs.get(destination); 96 } 97 98 public DestinationMap getAdminACLs() { 99 return adminACLs; 100 } 101 102 public void setAdminACLs(DestinationMap adminACLs) { 103 this.adminACLs = adminACLs; 104 } 105 106 public DestinationMap getReadACLs() { 107 return readACLs; 108 } 109 110 public void setReadACLs(DestinationMap readACLs) { 111 this.readACLs = readACLs; 112 } 113 114 public DestinationMap getWriteACLs() { 115 return writeACLs; 116 } 117 118 public void setWriteACLs(DestinationMap writeACLs) { 119 this.writeACLs = writeACLs; 120 } 121 122 } 123 | Popular Tags |