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
.linuxtools
.internal
.lttng2
.control
.core
.relayd
.lttngviewerCommands
;
16 import java
.io
.DataInputStream
;
17 import java
.io
.IOException
;
18 import java
.nio
.ByteBuffer
;
19 import java
.nio
.ByteOrder
;
22 * Response to a "create session" command
24 * @author Matthew Khouzam
27 public class CreateSessionResponse
implements IRelayResponse
{
30 * Response size (fStatus)
32 public static final int SIZE
= Integer
.SIZE
/ 8;
34 /** enum lttng_viewer_create_session_return_code */
35 private final CreateSessionReturnCode fStatus
;
38 * Create session response network constructor
41 * network input stream
45 public CreateSessionResponse(DataInputStream inNet
) throws IOException
{
46 byte[] data
= new byte[SIZE
];
47 inNet
.readFully(data
);
48 ByteBuffer bb
= ByteBuffer
.wrap(data
);
49 bb
.order(ByteOrder
.BIG_ENDIAN
);
50 fStatus
= (CreateSessionReturnCode
.values()[bb
.getInt() - 1]);
58 public CreateSessionReturnCode
getStatus() {