Changeset 16 for src/main


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

Version 1.5.

Location:
src/main
Files:
6 added
4 edited

Legend:

Unmodified
Added
Removed
  • 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>
Note: See TracChangeset for help on using the changeset viewer.