97ce3f967e52da5e1bb57b8b7b3185b7da6f2f44
java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/home/server/EventActionUtil.java
| ... | ... | @@ -6,6 +6,7 @@ import java.util.Map; |
| 6 | 6 | import java.util.Map.Entry; |
| 7 | 7 | import java.util.Set; |
| 8 | 8 | import java.util.UUID; |
| 9 | +import java.util.logging.Logger; |
|
| 9 | 10 | |
| 10 | 11 | import com.google.gwt.core.shared.GwtIncompatible; |
| 11 | 12 | import com.sap.sailing.domain.base.Event; |
| ... | ... | @@ -35,6 +36,8 @@ import com.sap.sse.gwt.dispatch.shared.exceptions.DispatchException; |
| 35 | 36 | */ |
| 36 | 37 | @GwtIncompatible |
| 37 | 38 | public final class EventActionUtil { |
| 39 | + private static final Logger logger = Logger.getLogger(EventActionUtil.LeaderboardCallback.class.getName()); |
|
| 40 | + |
|
| 38 | 41 | private EventActionUtil() { |
| 39 | 42 | } |
| 40 | 43 | |
| ... | ... | @@ -125,6 +128,10 @@ public final class EventActionUtil { |
| 125 | 128 | public static <T extends DTO> ResultWithTTL<T> withLiveRaceOrDefaultScheduleWithReadPermissions(SailingDispatchContext context, |
| 126 | 129 | UUID eventId, CalculationWithEvent<T> callback, T defaultResult) { |
| 127 | 130 | Event event = context.getRacingEventService().getEvent(eventId); |
| 131 | + if (event == null) { |
|
| 132 | + logger.warning("Event with ID "+eventId+" not found."); |
|
| 133 | + return new ResultWithTTL<T>(Duration.FOREVER, defaultResult); |
|
| 134 | + } |
|
| 128 | 135 | context.getSecurityService().checkCurrentUserReadPermission(event); |
| 129 | 136 | EventState eventState = HomeServiceUtil.calculateEventState(event); |
| 130 | 137 | if (eventState == EventState.FINISHED) { |
java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/home/shared/refresh/RefreshManager.java
| ... | ... | @@ -98,7 +98,6 @@ public abstract class RefreshManager { |
| 98 | 98 | * Triggers an update for all {@link RefreshableWidget}s that will have a timeout in the next 5 seconds. |
| 99 | 99 | */ |
| 100 | 100 | private void update() { |
| 101 | - |
|
| 102 | 101 | for (final RefreshHolder<DTO, SailingAction<ResultWithTTL<DTO>>> refreshable : refreshables) { |
| 103 | 102 | // Everything that needs refresh within the next 5000ms will be refreshed now. |
| 104 | 103 | // This makes it possible to use batching resulting in less requests. |
| ... | ... | @@ -145,7 +144,6 @@ public abstract class RefreshManager { |
| 145 | 144 | @Override |
| 146 | 145 | public void execute() { |
| 147 | 146 | scheduled = false; |
| 148 | - |
|
| 149 | 147 | if (refreshables.isEmpty()) { |
| 150 | 148 | LOG.log(Level.FINE, "No refreshables found -> skipping refresh"); |
| 151 | 149 | return; |
| ... | ... | @@ -158,7 +156,6 @@ public abstract class RefreshManager { |
| 158 | 156 | LOG.log(Level.FINE, "Refresh not allowed to execute -> skipping refresh"); |
| 159 | 157 | return; |
| 160 | 158 | } |
| 161 | - |
|
| 162 | 159 | Long nextUpdate = null; |
| 163 | 160 | for (final RefreshHolder<DTO, SailingAction<ResultWithTTL<DTO>>> refreshable : refreshables) { |
| 164 | 161 | if (refreshable.callRunning || !refreshable.provider.isActive()) { |
| ... | ... | @@ -170,8 +167,8 @@ public abstract class RefreshManager { |
| 170 | 167 | nextUpdate = Math.min(nextUpdate, refreshable.timeout); |
| 171 | 168 | } |
| 172 | 169 | } |
| 173 | - if(nextUpdate == null) { |
|
| 174 | - // This can occur, if there is already a call running for all RefreshableWidgets |
|
| 170 | + if (nextUpdate == null) { |
|
| 171 | + // This can occur if there is already a call running for all RefreshableWidgets |
|
| 175 | 172 | LOG.log(Level.FINE, "Nothing to auto update"); |
| 176 | 173 | } else { |
| 177 | 174 | int delayMillis = (int) (nextUpdate - System.currentTimeMillis()); |
| ... | ... | @@ -182,7 +179,6 @@ public abstract class RefreshManager { |
| 182 | 179 | LOG.log(Level.FINE, "Scheduling auto refresh in " + delayMillis + "ms"); |
| 183 | 180 | timer.schedule(delayMillis); |
| 184 | 181 | } |
| 185 | - |
|
| 186 | 182 | } |
| 187 | 183 | } |
| 188 | 184 | }); |
java/com.sap.sse.common/src/com/sap/sse/common/Duration.java
| ... | ... | @@ -26,6 +26,7 @@ public interface Duration extends Serializable, Comparable<Duration> { |
| 26 | 26 | static final Duration ONE_DAY = ONE_HOUR.times(24); |
| 27 | 27 | static final Duration ONE_WEEK = ONE_DAY.times(7); |
| 28 | 28 | static final Duration ONE_YEAR = ONE_DAY.times(365); // well, leap years have 366 days, but this should be close enough... |
| 29 | + static final Duration FOREVER = new MillisecondsDurationImpl(Long.MAX_VALUE); |
|
| 29 | 30 | |
| 30 | 31 | long asMillis(); |
| 31 | 32 |
wiki/info/landscape/olympic-setup.md
| ... | ... | @@ -162,11 +162,11 @@ The tunnel configurations are established and configured using a set of scripts, |
| 162 | 162 | On sap-p1-1 two SSH connections are maintained, with the following default port forwards, assuming sap-p1-1 is the local master: |
| 163 | 163 | |
| 164 | 164 | * tokyo-ssh.sapsailing.com: 10203-->10203; 5763-->rabbit-ap-northeast-1.sapsailing.com:5762; 15763-->rabbit-ap-northeast-1.sapsailing.com:15672; 5675:rabbit.internal.sapsailing.com:5672; 15675:rabbit.internal.sapsailing.com:15672; 10201<--10201; 18122<--22; 443:security-service.sapsailing.com:443; 8888<--8888; 9443<--9443 |
| 165 | -* sap-p1-2: 10202-->10202; 5674-->5672; 15674-->15672; 10201<--10201; 5674<--5672; 15674<--15672 |
|
| 165 | +* sap-p1-2: 10202-->10202; 10201<--10201 |
|
| 166 | 166 | |
| 167 | 167 | On sap-p1-2, the following SSH connections are maintained, assuming sap-p1-2 is the local replica: |
| 168 | 168 | |
| 169 | -- tokyo-ssh.sapsailing.com: 10203-->10203; 5763-->rabbit-ap-northeast-1.sapsailing.com:5762; 15763-->rabbit-ap-northeast-1.sapsailing.com; 5675:rabbit.internal.sapsailing.com:5672; 15675:rabbit.internal.sapsailing.com:15672; 10202<--10202; 15674<--15672; 9444<--9443 |
|
| 169 | +- tokyo-ssh.sapsailing.com: 10203-->10203; 5763-->rabbit-ap-northeast-1.sapsailing.com:5762; 15763-->rabbit-ap-northeast-1.sapsailing.com; 5675:rabbit.internal.sapsailing.com:5672; 15675:rabbit.internal.sapsailing.com:15672; 10202<--10202; 9444<--9443 |
|
| 170 | 170 | |
| 171 | 171 | A useful set of entries in your personal ``~/.ssh/config`` file for "off-site" use may look like this: |
| 172 | 172 | |
| ... | ... | @@ -221,12 +221,12 @@ Host sap-p1-2 |
| 221 | 221 | On sap-p1-1, if the operating system still runs and the failure affects only the Java process running the SAP Sailing Analytics, two SSH connections are maintained, with the following default port forwards, assuming sap-p1-1 is not running an SAP Sailing Analytics process currently: |
| 222 | 222 | |
| 223 | 223 | * tokyo-ssh.sapsailing.com: 10203-->10203; 5763-->rabbit-ap-northeast-1.sapsailing.com:5762; 15763-->rabbit-ap-northeast-1.sapsailing.com:15672; 5675:rabbit.internal.sapsailing.com:5672; 15675:rabbit.internal.sapsailing.com:15672; 10201<--10201; 18122<--22; 443:security-service.sapsailing.com:443 |
| 224 | -* sap-p1-2: 10202-->10202; 5674-->5672; 15674-->15672; 10201<--10201; 5674<--5672; 15674<--15672 |
|
| 224 | +* sap-p1-2: 10202-->10202; 10201<--10201 |
|
| 225 | 225 | |
| 226 | 226 | On sap-p1-2 two SSH connections are maintained, with the following default port forwards, assuming sap-p1-2 is the local master: |
| 227 | 227 | |
| 228 | 228 | * tokyo-ssh.sapsailing.com: 10203-->10203; 5763-->rabbit-ap-northeast-1.sapsailing.com:5762; 15763-->rabbit-ap-northeast-1.sapsailing.com:15672; 5675:rabbit.internal.sapsailing.com:5672; 15675:rabbit.internal.sapsailing.com:15672; 10202<--10202; 18222<--22; 443:security-service.sapsailing.com:443; 8888<--8888 |
| 229 | -* sap-p1-1 (if the operating system on sap-p1-1 still runs): 10202-->10202; 5674-->5672; 15674-->15672; 10201<--10201; 5674<--5672; 15674<--15672 |
|
| 229 | +* sap-p1-1 (if the operating system on sap-p1-1 still runs): 10202-->10202; 10201<--10201 |
|
| 230 | 230 | |
| 231 | 231 | So the essential change is that the reverse forward from ``tokyo-ssh.sapsailing.com:8888`` now targets ``sap-p1-2:8888`` where we now assume the failover master to be running. |
| 232 | 232 | |
| ... | ... | @@ -238,7 +238,7 @@ There is little we can do against the lack of Internet connection regarding prov |
| 238 | 238 | |
| 239 | 239 | On ``sap-p1-1`` an SSH connection to ``sap-p1-2`` is maintained, with the following port forwards: |
| 240 | 240 | |
| 241 | -* sap-p1-2: 10202-->10202; 5674-->5672; 15674-->15672; 10201<--10201; 5674<--5672; 15674<--15672; 5763-->localhost:5672 |
|
| 241 | +* sap-p1-2: 10202-->10202; 10201<--10201; 5763-->localhost:5672 |
|
| 242 | 242 | |
| 243 | 243 | So the essential changes are that there are no more SSH connections into the cloud, and the port forward on each laptop's port 5673, which would point to ``rabbit-ap-northeast-1.sapsailing.com`` during regular operations, now points to ``sap-p1-2:5672`` where the RabbitMQ installation takes over from the cloud instance. |
| 244 | 244 |