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
25 public class AttachSessionRequest
implements IRelayCommand
{
30 * fSessionId + fOffset + fSeek
32 public static final int SIZE
= (Long
.SIZE
+ Long
.SIZE
) / 8 + SeekCommand
.SIZE
;
33 /** the id of a session */
34 private final long fSessionId
;
36 private final long fOffset
;
37 /** enum lttng_viewer_seek */
38 private final SeekCommand fSeek
;
41 * Attach session request constructor
48 public AttachSessionRequest(long id
, SeekCommand seekCommand
) {
49 this(id
, 0, seekCommand
);
53 * Attach session request constructor
63 public AttachSessionRequest(long id
, int offset
, SeekCommand seekCommand
) {
71 public byte[] serialize() {
72 byte data
[] = new byte[SIZE
];
73 ByteBuffer bb
= ByteBuffer
.wrap(data
);
74 bb
.order(ByteOrder
.BIG_ENDIAN
);
75 bb
.putLong(fSessionId
);
77 bb
.putInt(fSeek
.getCommand());
This page took 0.032727 seconds and 5 git commands to generate.