Skip to content

Package: EMFStoreLogOutHelper

EMFStoreLogOutHelper

nameinstructionbranchcomplexitylinemethod
logout(InternalRepository, Shell)
M: 17 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 4 C: 0
0%
M: 1 C: 0
0%

Coverage

1: /*******************************************************************************
2: * Copyright (c) 2011-2014 EclipseSource Muenchen GmbH and others.
3: *
4: * All rights reserved. This program and the accompanying materials
5: * are made available under the terms of the Eclipse Public License 2.0
6: * which accompanies this distribution, and is available at
7: * https://www.eclipse.org/legal/epl-2.0/
8: *
9: * SPDX-License-Identifier: EPL-2.0
10: *
11: * Contributors:
12: * Eugen - initial API and implementation
13: ******************************************************************************/
14: package org.eclipse.emf.ecp.emfstore.internal.ui.handler;
15:
16: import java.util.Collections;
17:
18: import org.eclipse.emf.ecp.emfstore.core.internal.EMFStoreProvider;
19: import org.eclipse.emf.ecp.spi.core.InternalRepository;
20: import org.eclipse.emf.emfstore.client.ESServer;
21: import org.eclipse.emf.emfstore.internal.client.ui.controller.UILogoutSessionController;
22: import org.eclipse.swt.widgets.Shell;
23:
24: /**
25: * Logout Helper delegating to {@link UILogoutSessionController}.
26: *
27: * @author Eugen
28: *
29: */
30: public final class EMFStoreLogOutHelper {
31:
32:         private EMFStoreLogOutHelper() {
33:         }
34:
35:         /**
36:          * Logouts to the selected {@link InternalRepository}. Delegates to {@link UILogoutSessionController}.
37:          *
38:          * @param ecpRepository the {@link InternalRepository}
39:          * @param shell the {@link Shell}
40:          */
41:         public static void logout(InternalRepository ecpRepository, Shell shell) {
42:                 final ESServer server = EMFStoreProvider.INSTANCE.getServerInfo(ecpRepository);
43:                 // TODO EMFStore Constructor is missing
44:                 new UILogoutSessionController(shell, server.getLastUsersession()).execute();
45:
46:                 ecpRepository.notifyObjectsChanged(Collections.singleton((Object) ecpRepository));
47:         }
48: }