view src/main/java/jp/ac/u_ryukyu/alicevnc/AliceVNCMessage.java @ 56:9f1289c78b22

update maven change compressed DSM to only pixelData
author Nozomi Teruya <e125769@ie.u-ryukyu.ac.jp>
date Mon, 16 Nov 2015 23:19:26 +0900
parents aace9df1462e
children
line wrap: on
line source

package jp.ac.u_ryukyu.alicevnc;

import java.util.List;

import org.msgpack.annotation.Message;

@Message
public class AliceVNCMessage {
    public int messageID;
    public List<String> route;
    public boolean allowChange = false;
    public String name;

    public AliceVNCMessage(){
        // constructor need for MessagePack
    }

    public AliceVNCMessage(MessageType type){
        messageID = type.getId();
    }

    public String getNextAddress(){
        int last = route.size() - 1;
        String address = route.get(last);
        route.remove(last);
        return address;
    }

    public enum MessageType{
        ChangeRequest(1),
        StartNegotiate(2),
        CurrentVNCInfo(3),
        StopProxy(4),
        DeniedRequest(5);

        private final int id;
        private MessageType(final int id) {
            this.id = id;
        }

        public int getId() {
            return id;
        }
    }
}