View Javadoc

1   /*
2   Copyright 2011-2014 AGH-UST, http://www.agh.edu.pl
3   Faculty of Computer Science, Electronics and Telecommunications
4   Department of Computer Science 
5   
6   See the NOTICE file distributed with this work for additional
7   information regarding copyright ownership
8   
9   Licensed under the Apache License, Version 2.0 (the "License");
10  you may not use this file except in compliance with the License.
11  You may obtain a copy of the License at
12  
13    http://www.apache.org/licenses/LICENSE-2.0
14  
15  Unless required by applicable law or agreed to in writing, software
16  distributed under the License is distributed on an "AS IS" BASIS,
17  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
18  See the License for the specific language governing permissions and
19  limitations under the License.
20  */
21  package org.universAAL.ri.gateway.eimanager.impl;
22  
23  import org.universAAL.middleware.context.ContextPublisher;
24  import org.universAAL.middleware.context.ContextSubscriber;
25  import org.universAAL.middleware.service.ServiceCallee;
26  import org.universAAL.middleware.service.ServiceCaller;
27  import org.universAAL.middleware.bus.member.BusMember;
28  import org.universAAL.middleware.ui.UICaller;
29  import org.universAAL.middleware.ui.UIHandler;
30  import org.universAAL.ri.gateway.eimanager.impl.registry.RepoOperation;
31  
32  public class InternalEIOperation {
33  
34      protected String memberId;
35      protected BusMember busMember;
36      protected BusMemberType type;
37      protected RepoOperation op;
38  
39      public InternalEIOperation(BusMember member, RepoOperation op){
40  	this.busMember = member;
41  	this.op = op;
42  	if (member instanceof ServiceCallee){
43  	    type = BusMemberType.ServiceCallee;
44  	    memberId = ((ServiceCallee)busMember).getMyID();
45  	}else if (member instanceof ServiceCaller){
46  	    type = BusMemberType.ServiceCaller;
47  	    memberId = ((ServiceCaller)busMember).getMyID();
48  	}else if (member instanceof ContextPublisher){
49  	    type = BusMemberType.ContextPublisher;
50  	    memberId = ((ContextPublisher)busMember).getMyID();
51  	}else if (member instanceof ContextSubscriber){
52  	    type = BusMemberType.ContextSubscriber;
53  	    memberId = ((ContextSubscriber)busMember).getMyID();
54  	}else if (member instanceof UIHandler){
55  	    type = BusMemberType.UIHandler;
56  	    memberId = ((UIHandler)busMember).getMyID();
57  	}else if (member instanceof UICaller){
58  	    type = BusMemberType.UICaller;
59  	    memberId = ((UICaller)busMember).getMyID();
60  	}
61      }
62  
63      public BusMember getBusMember() {
64          return busMember;
65      }
66  
67      public void setBusMember(BusMember busMember) {
68          this.busMember = busMember;
69      }
70  
71      public BusMemberType getType() {
72          return type;
73      }
74  
75      public void setType(BusMemberType type) {
76          this.type = type;
77      }
78  
79      public RepoOperation getOp() {
80          return op;
81      }
82  
83      public void setOp(RepoOperation op) {
84          this.op = op;
85      }
86  
87      public String getMemberId() {
88          return memberId;
89      }
90  
91      public void setMemberId(String memberId) {
92          this.memberId = memberId;
93      }
94  
95  }