1 17 package org.alfresco.filesys.server.auth.acl; 18 19 import java.util.Hashtable ; 20 21 import org.alfresco.config.ConfigElement; 22 23 32 public class AccessControlFactory 33 { 34 35 37 private Hashtable <String , AccessControlParser> m_parsers; 38 39 42 public AccessControlFactory() 43 { 44 m_parsers = new Hashtable <String , AccessControlParser>(); 45 } 46 47 56 public final AccessControl createAccessControl(String type, ConfigElement params) throws ACLParseException, 57 InvalidACLTypeException 58 { 59 60 62 AccessControlParser parser = m_parsers.get(type); 63 if (parser == null) 64 throw new InvalidACLTypeException(type); 65 66 68 return parser.createAccessControl(params); 69 } 70 71 76 public final void addParser(AccessControlParser parser) 77 { 78 m_parsers.put(parser.getType(), parser); 79 } 80 81 87 public final AccessControlParser removeParser(String type) 88 { 89 return (AccessControlParser) m_parsers.remove(type); 90 } 91 } 92 | Popular Tags |