1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21 package org.universAAL.ri.gateway.eimanager.impl.importing;
22
23 import java.io.IOException;
24 import java.util.HashSet;
25 import java.util.Set;
26
27 import org.universAAL.middleware.container.ModuleContext;
28 import org.universAAL.middleware.rdf.Resource;
29 import org.universAAL.middleware.service.owls.profile.ServiceProfile;
30 import org.universAAL.middleware.ui.UIHandler;
31 import org.universAAL.middleware.ui.UIHandlerProfile;
32 import org.universAAL.middleware.ui.UIRequest;
33 import org.universAAL.ri.gateway.eimanager.impl.ProxyBusMember;
34
35 public class ProxyUIHandler extends ProxyBusMember {
36
37 private UIHandler handler;
38 private Set<ServiceProfile> profilesSet;
39
40 public ProxyUIHandler(UIHandlerProfile[] handlerProfiles,
41 ImportedProxyManager manager, final String targetId,
42 ModuleContext mc) {
43 super(manager, targetId,"", mc);
44
45 profilesSet = new HashSet<ServiceProfile>();
46
47 handler = new UIHandler(mc, handlerProfiles) {
48
49 public void handleUICall(UIRequest uicall) {
50 try {
51 ((ImportedProxyManager) getManager())
52 .realizeRemoteUIRequest(targetId, uicall);
53 } catch (IOException e) {
54
55 e.printStackTrace();
56 }
57 }
58
59 public Resource cutDialog(String dialogID) {
60 return null;
61 }
62
63 public void communicationChannelBroken() {
64 }
65
66 public void adaptationParametersChanged(String dialogID,
67 String changedProp, Object newVal) {
68 }
69 };
70 }
71
72 public void removeProxy() {
73 handler.close();
74 }
75
76 public String getId() {
77 return handler.getMyID();
78 }
79
80 public Set<ServiceProfile> getProfilesSet() {
81 return profilesSet;
82 }
83
84 public void setProfilesSet(Set<ServiceProfile> profilesSet) {
85 this.profilesSet = profilesSet;
86 }
87 }