blob: 48af2f3e68a30e962b93c363cca297a759d4faac [file] [log] [blame]
Francesco Furfariec7e1752006-10-02 13:37:04 +00001/*
2 * Licensed to the Apache Software Foundation (ASF) under one
3 * or more contributor license agreements. See the NOTICE file
4 * distributed with this work for additional information
5 * regarding copyright ownership. The ASF licenses this file
6 * to you under the Apache License, Version 2.0 (the
7 * "License"); you may not use this file except in compliance
8 * with the License. You may obtain a copy of the License at
Francesco Furfarid8bdb642006-04-04 23:33:40 +00009 *
Francesco Furfariec7e1752006-10-02 13:37:04 +000010 * http://www.apache.org/licenses/LICENSE-2.0
Francesco Furfarid8bdb642006-04-04 23:33:40 +000011 *
Francesco Furfariec7e1752006-10-02 13:37:04 +000012 * Unless required by applicable law or agreed to in writing,
13 * software distributed under the License is distributed on an
14 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15 * KIND, either express or implied. See the License for the
16 * specific language governing permissions and limitations
17 * under the License.
Francesco Furfarid8bdb642006-04-04 23:33:40 +000018 */
19
20package org.apache.felix.upnp.basedriver.importer.core.event.structs;
21
22
23import java.util.Dictionary;
24import java.util.Enumeration;
25
26import org.apache.felix.upnp.basedriver.importer.core.event.message.StateChanged;
27
Francesco Furfarif2a67912006-07-17 17:08:02 +000028/*
Karl Paulsd312acc2007-06-18 20:38:33 +000029* @author <a href="mailto:dev@felix.apache.org">Felix Project Team</a>
Francesco Furfarif2a67912006-07-17 17:08:02 +000030*/
Francesco Furfarid8bdb642006-04-04 23:33:40 +000031public class StateVarsToNotify {
32 private Dictionary stateVars;
33 private String sid;
34 private String deviceID;
35 private String serviceID;
36
37 //public StateVarsToNotify(String sid, String deviceID, String serviceID,Dictionary dic) {
38 public StateVarsToNotify(StateChanged msg) {
39 this.stateVars= msg.getDictionary();
40 this.sid = msg.getSid();
41 this.deviceID = msg.getDeviceID();
42 this.serviceID = msg.getServiceID();
43 }
44
45
46 public synchronized Dictionary getDictionary() {
47 return stateVars;
48 }
49 public synchronized String getSid() {
50 return sid;
51 }
52 public synchronized String getDeviceID() {
53 return deviceID;
54 }
55 public synchronized String getServiceID() {
56 return serviceID;
57 }
58
59
60 public void updateDic(Dictionary dic){
61 Enumeration e=dic.keys();
62 while(e.hasMoreElements()){
63 String varName=(String)e.nextElement();
64 Object varValue=dic.get(varName);
65 stateVars.put(varName,varValue);
66 }
67 }
Karl Paulsd312acc2007-06-18 20:38:33 +000068}