1 /*******************************************************************************
2 * Copyright (c) 2007, 2010 Association for Decentralized Information Management
4 * All rights reserved. This program and the accompanying materials
5 * are made available under the terms of the Eclipse Public License v1.0
6 * which accompanies this distribution, and is available at
7 * http://www.eclipse.org/legal/epl-v10.html
10 * VTT Technical Research Centre of Finland - initial API and implementation
11 *******************************************************************************/
12 package fi.vtt.simantics.procore;
14 import org.simantics.db.ServerReference;
15 import org.simantics.db.SessionReference;
19 * @author Toni Kalajainen
21 public class ProCoreSessionReference implements SessionReference {
23 public final ProCoreServerReference serverReference;
25 public final long sessionId;
27 public ProCoreSessionReference(ProCoreServerReference serverReference, long sessionId) {
28 assert(serverReference!=null);
29 this.serverReference = serverReference;
30 this.sessionId = sessionId;
34 public String toString() {
35 return serverReference+"/"+sessionId;
39 public int hashCode() {
40 return super.hashCode();
44 public boolean equals(Object other) {
45 if (this == other) return true;
46 if (other == null || !(getClass().equals(other.getClass()))) return false;
47 ProCoreSessionReference r = (ProCoreSessionReference) other;
48 return r.sessionId==sessionId && r.serverReference.equals(serverReference);
52 public ServerReference getServerReference() {
53 return serverReference;
56 public long getSessionId() {