1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package org.apache.ws.scout.registry.infomodel;
17
18 import java.util.Collection;
19 import java.util.HashMap;
20 import java.util.Map;
21
22 import javax.xml.registry.JAXRException;
23 import javax.xml.registry.infomodel.ExtensibleObject;
24 import javax.xml.registry.infomodel.Slot;
25
26
27
28
29
30
31
32 public class ExtensibleObjectImpl implements ExtensibleObject
33 {
34 private Map<String,Slot> slots = new HashMap<String,Slot>();
35
36 public void addSlot(Slot slot) throws JAXRException
37 {
38 slots.put(slot.getName(), slot);
39 }
40
41 public void addSlots(Collection slots) throws JAXRException
42 {
43 for (Object slot : slots) {
44 addSlot((Slot) slot);
45 }
46 }
47
48 public Slot getSlot(String slotName)
49 {
50 return (Slot) slots.get(slotName);
51 }
52
53 public Collection<Slot> getSlots()
54 {
55 return slots.values();
56 }
57
58 public void removeSlot(String slotName)
59 {
60 slots.remove(slotName);
61 }
62
63 public void removeSlots(Collection slotNames)
64 {
65 slots.keySet().removeAll(slotNames);
66 }
67 }