pcap: Rename packages to org.eclipse.tracecompass.*
[deliverable/tracecompass.git] / org.eclipse.tracecompass.lttng2.control.core / src / org / eclipse / linuxtools / internal / lttng2 / control / core / relayd / lttngviewerCommands / NewStreamsRequest.java
1 /**********************************************************************
2 * Copyright (c) 2014 Ericsson
3 *
4 * All rights reserved. This program and the accompanying materials are
5 * made available under the terms of the Eclipse Public License v1.0 which
6 * accompanies this distribution, and is available at
7 * http://www.eclipse.org/legal/epl-v10.html
8 *
9 * Contributors:
10 * Matthew Khouzam - Initial implementation and API
11 * Marc-Andre Laperle - Initial implementation and API
12 **********************************************************************/
13
14 package org.eclipse.linuxtools.internal.lttng2.control.core.relayd.lttngviewerCommands;
15
16 import java.nio.ByteBuffer;
17 import java.nio.ByteOrder;
18
19 /**
20 * LTTNG_VIEWER_GET_NEW_STREAMS payload.
21 *
22 * @author Matthew Khouzam
23 * @since 3.0
24 */
25 public class NewStreamsRequest implements IRelayCommand {
26
27 /**
28 * Command size (fSessionId)
29 */
30 public static final int SIZE = Long.SIZE / 8;
31
32 /** session ID */
33 private final long fSessionId;
34
35 /**
36 * Constructor
37 *
38 * @param sessionId
39 * the session id we want
40 */
41 public NewStreamsRequest(long sessionId) {
42 fSessionId = sessionId;
43 }
44
45 @Override
46 public byte[] serialize() {
47 byte data[] = new byte[SIZE];
48 ByteBuffer bb = ByteBuffer.wrap(data);
49 bb.order(ByteOrder.BIG_ENDIAN);
50 bb.putLong(fSessionId);
51 return data;
52 }
53 }
This page took 0.032395 seconds and 5 git commands to generate.