Changeset 16


Ignore:
Timestamp:
09/22/20 08:52:08 (4 years ago)
Author:
bart
Message:

Version 1.5.

Files:
6 added
7 edited

Legend:

Unmodified
Added
Removed
  • pom.xml

    r15 r16  
    66        <artifactId>profilesserver</artifactId>
    77        <packaging>war</packaging>
    8         <version>1.4.4</version> <!-- must equal ${geniusweb.version} -->
     8        <version>1.5.0</version> <!-- must equal ${geniusweb.version} -->
    99        <name>profileserver Maven Webapp</name>
    1010        <url>http://maven.apache.org</url>
     
    1818                <jackson-2-version>2.9.10</jackson-2-version>
    1919                <tomcat.version>8.5.20</tomcat.version>
    20                 <geniusweb.version>1.4.4</geniusweb.version>
     20                <geniusweb.version>1.5.0</geniusweb.version>
    2121        </properties>
    2222
     
    7070                        <groupId>tudelft.utilities</groupId>
    7171                        <artifactId>tree</artifactId>
    72                         <version>1.1.0</version>
     72                        <version>1.1.1</version>
    7373                </dependency>
    7474
     
    8787                        <groupId>tudelft.utilities</groupId>
    8888                        <artifactId>files</artifactId>
    89                         <version>1.1.0</version>
     89                        <version>1.1.1</version>
    9090                </dependency>
    9191
  • src/main/java/geniusweb/profilesserver/websocket/GetProfileSocket.java

    r13 r16  
    2828import geniusweb.profile.utilityspace.LinearAdditive;
    2929import geniusweb.profilesserver.Jackson;
    30 import geniusweb.profilesserver.ProfilesFactory;
     30import geniusweb.profilesserver.ProfilesRepository;
    3131import geniusweb.profilesserver.events.ChangeEvent;
    3232import tudelft.utilities.immutablelist.FixedList;
     
    3838 * and profiles. Every time something changes, a new list of domains and
    3939 * profiles is sent. For each new websocket the server will create one of this
    40  * but they all share one {@link ProfilesFactory}.
     40 * but they all share one {@link ProfilesRepository}.
    4141 *
    4242 * <p>
     
    8080                };
    8181                sendupdatedProfile();
    82                 Profiles.factory.addListener(changeListener);
     82                Profiles.repository.addListener(changeListener);
    8383        }
    8484
    8585        private void sendupdatedProfile() {
    86                 Profile newprof = Profiles.factory.getProfile(profilename);
     86                Profile newprof = Profiles.repository.getProfile(profilename);
    8787                // notice, may be null if profile does not exist/was removed.
    8888                if (newprof == null ? prof != null : !newprof.equals(prof)) {
     
    164164        @OnClose
    165165        public void end() throws IOException {
    166                 Profiles.factory.removeListener(changeListener);
     166                Profiles.repository.removeListener(changeListener);
    167167        }
    168168
  • src/main/java/geniusweb/profilesserver/websocket/Profiles.java

    r1 r16  
    11package geniusweb.profilesserver.websocket;
    22
    3 import geniusweb.profilesserver.AutoUpdatingProfilesFactory;
    4 import geniusweb.profilesserver.ProfilesFactory;
     3import geniusweb.profilesserver.AutoUpdatingProfilesRepository;
     4import geniusweb.profilesserver.ProfilesRepository;
    55import tudelft.utilities.logging.ReportToLogger;
    66
    77/**
    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.
    99 *
    1010 */
    1111class Profiles {
    12         public static final ProfilesFactory factory = new AutoUpdatingProfilesFactory(new ReportToLogger("profilesserver"));
     12        public static final ProfilesRepository repository = new AutoUpdatingProfilesRepository(
     13                        new ReportToLogger("profilesserver"));
    1314}
  • src/main/java/geniusweb/profilesserver/websocket/ProfilesListSocket.java

    r8 r16  
    2525
    2626import geniusweb.profilesserver.Jackson;
    27 import geniusweb.profilesserver.ProfilesFactory;
     27import geniusweb.profilesserver.ProfilesRepository;
    2828import geniusweb.profilesserver.events.ChangeEvent;
    2929import tudelft.utilities.listener.Listener;
     
    3535 * and profiles. Every time something changes, a new list of domains and
    3636 * profiles is sent. For each new websocket the server will create one of this
    37  * but they all share one {@link ProfilesFactory}.
     37 * but they all share one {@link ProfilesRepository}.
    3838 */
    3939@ServerEndpoint("/websocket/liststream")
     
    7171                        }
    7272                };
    73                 Profiles.factory.addListener(changeListener);
     73                Profiles.repository.addListener(changeListener);
    7474        }
    7575
     
    9090        private Map<URI, List<URI>> getDomainsProfiles() {
    9191                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()
    9494                                        .map(profile -> makeURI(domain, profile.getName()))
    9595                                        .collect(Collectors.toList());
     
    153153        @OnClose
    154154        public void end() throws IOException {
    155                 Profiles.factory.removeListener(changeListener);
     155                Profiles.repository.removeListener(changeListener);
    156156        }
    157157
  • src/main/webapp/index.jsp

    r2 r16  
    11<html>
     2<head>
     3<title>profiles server</title>
     4<link rel="stylesheet" type="text/css" href="css/list.css" />
     5
     6</head>
    27<body>
    38        <h1>GeniusWeb Domains and Profiles Server.</h1>
     
    1015                </h1>
    1116
    12                 The list of currently available profiles is <a
    13                         href="websocket/list.xhtml">here</a>.<br> The list of domain and
    14                 profile files is browsable <a href="domainsrepo">here</a>. Notice that
    15                 these may contain files with errors, and thus are not available for
    16                 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.
    1722                <p>
    1823                        For creating a profile or adding it to the server please check the <a
    1924                                href="https://tracinsy.ewi.tudelft.nl/pubtrac/GeniusWebProfilesServer">wiki</a>.
     25
    2026               
    2127</body>
  • src/test/java/geniusweb/profilesserver/AutoUpdatingProfilesFactoryTest.java

    r12 r16  
    5151        private List<String> warnings;
    5252        private Path copyrepodir;
    53         private AutoUpdatingProfilesFactory factory;
     53        private AutoUpdatingProfilesRepository factory;
    5454        private final long HIGHRATE = 500; // fast so that we can test quickly.
    5555        private final List<ChangeEvent> changes = new LinkedList<>();
     
    8080                };
    8181
    82                 factory = new AutoUpdatingProfilesFactory(logger) {
     82                factory = new AutoUpdatingProfilesRepository(logger) {
    8383
    8484                        @Override
  • src/test/java/geniusweb/profilesserver/DefaultProfilesFactoryTest.java

    r1 r16  
    2727        private Domain domain1 = mock(Domain.class);
    2828        private List<ChangeEvent> events = new LinkedList<>();
    29         private DefaultProfilesFactory factory;
     29        private DefaultProfilesRepository factory;
    3030
    3131        private Profile profile1 = mock(Profile.class);
     
    4040                when(profile1a.getDomain()).thenReturn(domain1);
    4141                when(profile1a.getName()).thenReturn(PROFILE1);
    42                 factory = new DefaultProfilesFactory();
     42                factory = new DefaultProfilesRepository();
    4343                factory.addListener(new Listener<ChangeEvent>() {
    4444
Note: See TracChangeset for help on using the changeset viewer.