1 /**********************************************************************
2 * Copyright (c) 2014 Ericsson
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
10 * Matthew Khouzam - Initial implementation and API
11 * Marc-Andre Laperle - Initial implementation and API
12 **********************************************************************/
14 package org
.eclipse
.tracecompass
.internal
.lttng2
.control
.core
.relayd
.lttngviewerCommands
;
16 import java
.nio
.ByteBuffer
;
17 import java
.nio
.ByteOrder
;
20 * VIEWER_ATTACH_SESSION payload.
22 * @author Matthew Khouzam
24 public class AttachSessionRequest
implements IRelayCommand
{
29 * fSessionId + fOffset + fSeek
31 public static final int SIZE
= (Long
.SIZE
+ Long
.SIZE
) / 8 + SeekCommand
.SIZE
;
32 /** the id of a session */
33 private final long fSessionId
;
35 private final long fOffset
;
36 /** enum lttng_viewer_seek */
37 private final SeekCommand fSeek
;
40 * Attach session request constructor
47 public AttachSessionRequest(long id
, SeekCommand seekCommand
) {
48 this(id
, 0, seekCommand
);
52 * Attach session request constructor
62 public AttachSessionRequest(long id
, int offset
, SeekCommand seekCommand
) {
70 public byte[] serialize() {
71 byte data
[] = new byte[SIZE
];
72 ByteBuffer bb
= ByteBuffer
.wrap(data
);
73 bb
.order(ByteOrder
.BIG_ENDIAN
);
74 bb
.putLong(fSessionId
);
76 bb
.putInt(fSeek
.getCommand());
This page took 0.047116 seconds and 5 git commands to generate.