001    /*
002     * Copyright (C) 2012 eXo Platform SAS.
003     *
004     * This is free software; you can redistribute it and/or modify it
005     * under the terms of the GNU Lesser General Public License as
006     * published by the Free Software Foundation; either version 2.1 of
007     * the License, or (at your option) any later version.
008     *
009     * This software is distributed in the hope that it will be useful,
010     * but WITHOUT ANY WARRANTY; without even the implied warranty of
011     * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
012     * Lesser General Public License for more details.
013     *
014     * You should have received a copy of the GNU Lesser General Public
015     * License along with this software; if not, write to the Free
016     * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
017     * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
018     */
019    
020    package org.crsh.shell.impl.remoting;
021    
022    import java.io.Serializable;
023    
024    public abstract class ClientMessage implements Serializable {
025    
026      public static class GetWelcome extends ClientMessage {
027      }
028    
029      public static class GetPrompt extends ClientMessage {
030      }
031    
032      public static class GetCompletion extends ClientMessage {
033    
034        /** . */
035        public final String prefix;
036    
037        public GetCompletion(String prefix) {
038          this.prefix = prefix;
039        }
040      }
041    
042      public static class SetSize extends ClientMessage {
043    
044        /** . */
045        public final int width;
046    
047        /** . */
048        public final int height;
049    
050        public SetSize(int width, int height) {
051          this.width = width;
052          this.height = height;
053        }
054      }
055    
056      public static class Execute extends ClientMessage {
057    
058        /** . */
059        public final int width;
060    
061        /** . */
062        public final int height;
063    
064        /** . */
065        public final String line;
066    
067        public Execute(int width, int height, String line) {
068          this.width = width;
069          this.height = height;
070          this.line = line;
071        }
072      }
073    
074      public static class Cancel extends ClientMessage {
075      }
076    
077      public static class Close extends ClientMessage {
078      }
079    }