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
.commands
;
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
26 public class CreateSessionResponse
implements IRelayResponse
{
29 * Response size (fStatus)
31 public static final int SIZE
= Integer
.SIZE
/ 8;
33 /** enum lttng_viewer_create_session_return_code */
34 private final CreateSessionReturnCode fStatus
;
37 * Create session response network constructor
40 * network input stream
44 public CreateSessionResponse(DataInputStream inNet
) throws IOException
{
45 byte[] data
= new byte[SIZE
];
46 inNet
.readFully(data
);
47 ByteBuffer bb
= ByteBuffer
.wrap(data
);
48 bb
.order(ByteOrder
.BIG_ENDIAN
);
49 fStatus
= (CreateSessionReturnCode
.values()[bb
.getInt() - 1]);
57 public CreateSessionReturnCode
getStatus() {