-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathPeerSystem.java
More file actions
58 lines (43 loc) · 1.45 KB
/
Copy pathPeerSystem.java
File metadata and controls
58 lines (43 loc) · 1.45 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
package lld.peerlearningsystem;
import lld.peerlearningsystem.entity.Peer;
import lld.peerlearningsystem.entity.Subject;
import lld.peerlearningsystem.service.ResourceService;
import lld.peerlearningsystem.service.SubjectService;
import lld.peerlearningsystem.service.TopicService;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
public class PeerSystem {
Map<Integer,Peer> peerList = new HashMap<>();
SubjectService subjectService = new SubjectService();
ResourceService resourceService = new ResourceService();
TopicService topicService = new TopicService();
public SubjectService getSubjectService() {
return subjectService;
}
public ResourceService getResourceService() {
return resourceService;
}
public TopicService getTopicService() {
return topicService;
}
public Map<Integer, Peer> getPeerList() {
return peerList;
}
public void setPeerList(Map<Integer, Peer> peerList) {
this.peerList = peerList;
}
public Peer getPeer(Integer peerId){
return peerList.get(peerId);
}
public void setPeer(Peer peer){
this.peerList.put(peer.getPeerId(),peer);
}
public void addSubject(Subject subject) {
this.subjectService.addSubject(subject);
}
public Subject getSubject(Integer subjectId) throws Exception {
return this.subjectService.findBySubjectId(subjectId);
}
}