Francesco Furfari | ec7e175 | 2006-10-02 13:37:04 +0000 | [diff] [blame] | 1 | /*
|
| 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 Furfari | d8bdb64 | 2006-04-04 23:33:40 +0000 | [diff] [blame] | 9 | *
|
Francesco Furfari | ec7e175 | 2006-10-02 13:37:04 +0000 | [diff] [blame] | 10 | * http://www.apache.org/licenses/LICENSE-2.0
|
Francesco Furfari | d8bdb64 | 2006-04-04 23:33:40 +0000 | [diff] [blame] | 11 | *
|
Francesco Furfari | ec7e175 | 2006-10-02 13:37:04 +0000 | [diff] [blame] | 12 | * 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 Furfari | d8bdb64 | 2006-04-04 23:33:40 +0000 | [diff] [blame] | 18 | */
|
| 19 |
|
| 20 | package org.apache.felix.upnp.basedriver.importer.core.event.structs;
|
| 21 |
|
| 22 |
|
| 23 | import java.util.Dictionary;
|
| 24 | import java.util.Enumeration;
|
| 25 |
|
| 26 | import org.apache.felix.upnp.basedriver.importer.core.event.message.StateChanged;
|
| 27 |
|
Francesco Furfari | f2a6791 | 2006-07-17 17:08:02 +0000 | [diff] [blame] | 28 | /*
|
Karl Pauls | d312acc | 2007-06-18 20:38:33 +0000 | [diff] [blame^] | 29 | * @author <a href="mailto:dev@felix.apache.org">Felix Project Team</a>
|
Francesco Furfari | f2a6791 | 2006-07-17 17:08:02 +0000 | [diff] [blame] | 30 | */
|
Francesco Furfari | d8bdb64 | 2006-04-04 23:33:40 +0000 | [diff] [blame] | 31 | public 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 Pauls | d312acc | 2007-06-18 20:38:33 +0000 | [diff] [blame^] | 68 | } |