Changeset 16
- Timestamp:
- 09/22/20 08:52:08 (4 years ago)
- Files:
-
- 6 added
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
pom.xml
r15 r16 6 6 <artifactId>profilesserver</artifactId> 7 7 <packaging>war</packaging> 8 <version>1. 4.4</version> <!-- must equal ${geniusweb.version} -->8 <version>1.5.0</version> <!-- must equal ${geniusweb.version} --> 9 9 <name>profileserver Maven Webapp</name> 10 10 <url>http://maven.apache.org</url> … … 18 18 <jackson-2-version>2.9.10</jackson-2-version> 19 19 <tomcat.version>8.5.20</tomcat.version> 20 <geniusweb.version>1. 4.4</geniusweb.version>20 <geniusweb.version>1.5.0</geniusweb.version> 21 21 </properties> 22 22 … … 70 70 <groupId>tudelft.utilities</groupId> 71 71 <artifactId>tree</artifactId> 72 <version>1.1. 0</version>72 <version>1.1.1</version> 73 73 </dependency> 74 74 … … 87 87 <groupId>tudelft.utilities</groupId> 88 88 <artifactId>files</artifactId> 89 <version>1.1. 0</version>89 <version>1.1.1</version> 90 90 </dependency> 91 91 -
src/main/java/geniusweb/profilesserver/websocket/GetProfileSocket.java
r13 r16 28 28 import geniusweb.profile.utilityspace.LinearAdditive; 29 29 import geniusweb.profilesserver.Jackson; 30 import geniusweb.profilesserver.Profiles Factory;30 import geniusweb.profilesserver.ProfilesRepository; 31 31 import geniusweb.profilesserver.events.ChangeEvent; 32 32 import tudelft.utilities.immutablelist.FixedList; … … 38 38 * and profiles. Every time something changes, a new list of domains and 39 39 * profiles is sent. For each new websocket the server will create one of this 40 * but they all share one {@link Profiles Factory}.40 * but they all share one {@link ProfilesRepository}. 41 41 * 42 42 * <p> … … 80 80 }; 81 81 sendupdatedProfile(); 82 Profiles. factory.addListener(changeListener);82 Profiles.repository.addListener(changeListener); 83 83 } 84 84 85 85 private void sendupdatedProfile() { 86 Profile newprof = Profiles. factory.getProfile(profilename);86 Profile newprof = Profiles.repository.getProfile(profilename); 87 87 // notice, may be null if profile does not exist/was removed. 88 88 if (newprof == null ? prof != null : !newprof.equals(prof)) { … … 164 164 @OnClose 165 165 public void end() throws IOException { 166 Profiles. factory.removeListener(changeListener);166 Profiles.repository.removeListener(changeListener); 167 167 } 168 168 -
src/main/java/geniusweb/profilesserver/websocket/Profiles.java
r1 r16 1 1 package geniusweb.profilesserver.websocket; 2 2 3 import geniusweb.profilesserver.AutoUpdatingProfiles Factory;4 import geniusweb.profilesserver.Profiles Factory;3 import geniusweb.profilesserver.AutoUpdatingProfilesRepository; 4 import geniusweb.profilesserver.ProfilesRepository; 5 5 import tudelft.utilities.logging.ReportToLogger; 6 6 7 7 /** 8 * Just a shared copy of the profiles factory, for use with all websockets.8 * Just a shared copy of the profiles repository, for use with all websockets. 9 9 * 10 10 */ 11 11 class Profiles { 12 public static final ProfilesFactory factory = new AutoUpdatingProfilesFactory(new ReportToLogger("profilesserver")); 12 public static final ProfilesRepository repository = new AutoUpdatingProfilesRepository( 13 new ReportToLogger("profilesserver")); 13 14 } -
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 -
src/main/webapp/index.jsp
r2 r16 1 1 <html> 2 <head> 3 <title>profiles server</title> 4 <link rel="stylesheet" type="text/css" href="css/list.css" /> 5 6 </head> 2 7 <body> 3 8 <h1>GeniusWeb Domains and Profiles Server.</h1> … … 10 15 </h1> 11 16 12 The list of currently available profiles is <a 13 href="websocket/list.xhtml">here</a>.<br> The list of domain and14 profile files is browsable <a href="domainsrepo">here</a>. Notice that15 these may contain files with errors, and thus are not available for16 use.17 The list of currently available profiles is <aa 18 onclick="window.location='list.xhtml'+window.location.search;">here</aa>.<br> 19 The list of domain and profile files is browsable <a 20 href="domainsrepo">here</a>. Notice that these may contain files with 21 errors, and thus are not available for use. 17 22 <p> 18 23 For creating a profile or adding it to the server please check the <a 19 24 href="https://tracinsy.ewi.tudelft.nl/pubtrac/GeniusWebProfilesServer">wiki</a>. 25 20 26 21 27 </body> -
src/test/java/geniusweb/profilesserver/AutoUpdatingProfilesFactoryTest.java
r12 r16 51 51 private List<String> warnings; 52 52 private Path copyrepodir; 53 private AutoUpdatingProfiles Factory factory;53 private AutoUpdatingProfilesRepository factory; 54 54 private final long HIGHRATE = 500; // fast so that we can test quickly. 55 55 private final List<ChangeEvent> changes = new LinkedList<>(); … … 80 80 }; 81 81 82 factory = new AutoUpdatingProfiles Factory(logger) {82 factory = new AutoUpdatingProfilesRepository(logger) { 83 83 84 84 @Override -
src/test/java/geniusweb/profilesserver/DefaultProfilesFactoryTest.java
r1 r16 27 27 private Domain domain1 = mock(Domain.class); 28 28 private List<ChangeEvent> events = new LinkedList<>(); 29 private DefaultProfiles Factory factory;29 private DefaultProfilesRepository factory; 30 30 31 31 private Profile profile1 = mock(Profile.class); … … 40 40 when(profile1a.getDomain()).thenReturn(domain1); 41 41 when(profile1a.getName()).thenReturn(PROFILE1); 42 factory = new DefaultProfiles Factory();42 factory = new DefaultProfilesRepository(); 43 43 factory.addListener(new Listener<ChangeEvent>() { 44 44
Note:
See TracChangeset
for help on using the changeset viewer.