1/*2 * Copyright 2001-2004 The Apache Software Foundation.3 *4 * Licensed under the Apache License, Version 2.0 (the "License");5 * you may not use this file except in compliance with the License.6 * You may obtain a copy of the License at7 *8 * http://www.apache.org/licenses/LICENSE-2.09 *10 * Unless required by applicable law or agreed to in writing, software11 * distributed under the License is distributed on an "AS IS" BASIS,12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.13 * See the License for the specific language governing permissions and14 * limitations under the License.15 */16package org.apache.ws.scout.registry.infomodel;
1718import java.util.Collection;
19import java.util.HashMap;
20import java.util.Map;
2122import javax.xml.registry.JAXRException;
23import javax.xml.registry.infomodel.ExtensibleObject;
24import javax.xml.registry.infomodel.Slot;
2526/**27 * Implements JAXR Interface.28 * For futher details, look into the JAXR API Javadoc.29 *30 * @author Anil Saldhana <anil@apache.org>31 */32publicclassExtensibleObjectImplimplements ExtensibleObject
33 {
34private Map<String,Slot> slots = new HashMap<String,Slot>();
3536publicvoid addSlot(Slot slot) throws JAXRException
37 {
38 slots.put(slot.getName(), slot);
39 }
4041publicvoid addSlots(Collection slots) throws JAXRException
42 {
43for (Object slot : slots) {
44 addSlot((Slot) slot);
45 }
46 }
4748public Slot getSlot(String slotName)
49 {
50return (Slot) slots.get(slotName);
51 }
5253public Collection<Slot> getSlots()
54 {
55return slots.values();
56 }
5758publicvoid removeSlot(String slotName)
59 {
60 slots.remove(slotName);
61 }
6263publicvoid removeSlots(Collection slotNames)
64 {
65 slots.keySet().removeAll(slotNames);
66 }
67 }