1 9 package org.jboss.portal.server.metadata; 10 11 import java.util.HashMap ; 12 import java.util.HashSet ; 13 import java.util.Map ; 14 import java.util.Set ; 15 16 import org.jboss.portal.common.metadata.MetaData; 17 import org.jboss.portal.common.plugin.PluginMetaData; 18 import org.jboss.portal.server.ServerObjectID; 19 20 26 public class ServerObjectMetaData implements MetaData 27 { 28 29 30 protected final ServerObjectID id; 31 32 33 protected final Set depends; 34 35 36 protected final String name; 37 38 39 protected final Map plugins; 40 41 public ServerObjectMetaData(ServerObjectID id, String name) 42 { 43 if (id == null) 44 { 45 throw new IllegalArgumentException ("ID must not be null"); 46 } 47 if (name == null) 48 { 49 throw new IllegalArgumentException ("Name must not be null"); 50 } 51 this.id = id; 52 this.depends = new HashSet (); 53 this.name = name; 54 this.plugins = new HashMap (); 55 } 56 57 public Set getDepends() 58 { 59 return depends; 60 } 61 62 public void addPlugin(String key, PluginMetaData plugin) 63 { 64 plugins.put(key, plugin); 65 } 66 67 public Set getPluginKeySet() 68 { 69 return plugins.keySet(); 70 } 71 72 public PluginMetaData getPlugin(String key) 73 { 74 return (PluginMetaData)plugins.get(key); 75 } 76 77 public ServerObjectID getID() 78 { 79 return id; 80 } 81 82 public String getName() 83 { 84 return name; 85 } 86 87 public String toString() 88 { 89 return "PortalObject[" + id + "]"; 90 } 91 } 92 | Popular Tags |