]> gerrit.simantics Code Review - simantics/platform.git/blob - bundles/org.simantics.db.server/src/org/simantics/db/server/protocol/GetServerInfo2Function.java
Migrated source code from Simantics SVN
[simantics/platform.git] / bundles / org.simantics.db.server / src / org / simantics / db / server / protocol / GetServerInfo2Function.java
1 /*******************************************************************************\r
2  * Copyright (c) 2007, 2010 Association for Decentralized Information Management\r
3  * in Industry THTH ry.\r
4  * All rights reserved. This program and the accompanying materials\r
5  * are made available under the terms of the Eclipse Public License v1.0\r
6  * which accompanies this distribution, and is available at\r
7  * http://www.eclipse.org/legal/epl-v10.html\r
8  *\r
9  * Contributors:\r
10  *     VTT Technical Research Centre of Finland - initial API and implementation\r
11  *******************************************************************************/\r
12 package org.simantics.db.server.protocol;\r
13 \r
14 import java.nio.ByteOrder;\r
15 \r
16 public class GetServerInfo2Function extends AbstractFunction {\r
17     public long firstChangeSetId = 0;\r
18     public String serverId = "";\r
19     public String protocolId = "";\r
20     public String databaseId = "";\r
21     public GetServerInfo2Function() {\r
22         super(MessageNumber.GetServerInfo2Request, MessageNumber.GetServerInfo2Response);\r
23     }\r
24     @Override\r
25     public DataBuffer serialize(ByteOrder byteOrder) {\r
26         buffer.clear();\r
27         buffer.order(byteOrder);\r
28         buffer.mark();\r
29         return buffer;\r
30     }\r
31     @Override\r
32     public void deserialize(int receivedNumber_, DataBuffer dataBuffer) {\r
33         receivedNumber = receivedNumber_;\r
34         if (notRightDataForUs())\r
35             return;\r
36         firstChangeSetId = dataBuffer.get(firstChangeSetId);\r
37         serverId = dataBuffer.get(serverId);\r
38         protocolId = dataBuffer.get(protocolId);\r
39         databaseId = dataBuffer.get(databaseId);\r
40         gotResponse();\r
41     }\r
42 }\r