- Timestamp:
- 09/22/20 08:52:08 (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/main/java/geniusweb/profilesserver/websocket/ProfilesListSocket.java
r8 r16 25 25 26 26 import geniusweb.profilesserver.Jackson; 27 import geniusweb.profilesserver.Profiles Factory;27 import geniusweb.profilesserver.ProfilesRepository; 28 28 import geniusweb.profilesserver.events.ChangeEvent; 29 29 import tudelft.utilities.listener.Listener; … … 35 35 * and profiles. Every time something changes, a new list of domains and 36 36 * profiles is sent. For each new websocket the server will create one of this 37 * but they all share one {@link Profiles Factory}.37 * but they all share one {@link ProfilesRepository}. 38 38 */ 39 39 @ServerEndpoint("/websocket/liststream") … … 71 71 } 72 72 }; 73 Profiles. factory.addListener(changeListener);73 Profiles.repository.addListener(changeListener); 74 74 } 75 75 … … 90 90 private Map<URI, List<URI>> getDomainsProfiles() { 91 91 Map<URI, List<URI>> allprofiles = new HashMap<>(); 92 for (String domain : Profiles. factory.getDomains()) {93 List<URI> profiles = Profiles. factory.getProfiles(domain).stream()92 for (String domain : Profiles.repository.getDomains()) { 93 List<URI> profiles = Profiles.repository.getProfiles(domain).stream() 94 94 .map(profile -> makeURI(domain, profile.getName())) 95 95 .collect(Collectors.toList()); … … 153 153 @OnClose 154 154 public void end() throws IOException { 155 Profiles. factory.removeListener(changeListener);155 Profiles.repository.removeListener(changeListener); 156 156 } 157 157
Note:
See TracChangeset
for help on using the changeset viewer.