View Javadoc

1   /**
2      This file is part of GoldenGate Project (named also GoldenGate or GG).
3   
4      Copyright 2009, Frederic Bregier, and individual contributors by the @author
5      tags. See the COPYRIGHT.txt in the distribution for a full listing of
6      individual contributors.
7   
8      All GoldenGate Project is free software: you can redistribute it and/or 
9      modify it under the terms of the GNU General Public License as published 
10     by the Free Software Foundation, either version 3 of the License, or
11     (at your option) any later version.
12  
13     GoldenGate is distributed in the hope that it will be useful,
14     but WITHOUT ANY WARRANTY; without even the implied warranty of
15     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16     GNU General Public License for more details.
17  
18     You should have received a copy of the GNU General Public License
19     along with GoldenGate .  If not, see <http://www.gnu.org/licenses/>.
20   */
21  package openr66.protocol.localhandler.packet;
22  
23  import openr66.protocol.exception.OpenR66ProtocolPacketException;
24  
25  import org.jboss.netty.buffer.ChannelBuffer;
26  import org.jboss.netty.buffer.ChannelBuffers;
27  
28  /**
29   * No Op class
30   *
31   * header = empty middle = empty end = empty
32   *
33   * @author frederic bregier
34   */
35  public class NoOpPacket extends AbstractLocalPacket {
36  
37      /**
38       * @param headerLength
39       * @param middleLength
40       * @param endLength
41       * @param buf
42       * @return the new EndTransferPacket from buffer
43       * @throws OpenR66ProtocolPacketException
44       */
45      public static NoOpPacket createFromBuffer(int headerLength,
46              int middleLength, int endLength, ChannelBuffer buf)
47              throws OpenR66ProtocolPacketException {
48          return new NoOpPacket();
49      }
50  
51      /*
52       * (non-Javadoc)
53       *
54       * @see openr66.protocol.localhandler.packet.AbstractLocalPacket#createEnd()
55       */
56      @Override
57      public void createEnd() {
58          end = ChannelBuffers.EMPTY_BUFFER;
59      }
60  
61      /*
62       * (non-Javadoc)
63       *
64       * @see
65       * openr66.protocol.localhandler.packet.AbstractLocalPacket#createHeader()
66       */
67      @Override
68      public void createHeader() {
69          header = ChannelBuffers.EMPTY_BUFFER;
70      }
71  
72      /*
73       * (non-Javadoc)
74       *
75       * @see
76       * openr66.protocol.localhandler.packet.AbstractLocalPacket#createMiddle()
77       */
78      @Override
79      public void createMiddle() {
80          middle = ChannelBuffers.EMPTY_BUFFER;
81      }
82  
83      @Override
84      public byte getType() {
85          return LocalPacketFactory.NOOPPACKET;
86      }
87  
88      /*
89       * (non-Javadoc)
90       *
91       * @see openr66.protocol.localhandler.packet.AbstractLocalPacket#toString()
92       */
93      @Override
94      public String toString() {
95          return "NoOpPacket";
96      }
97  
98  }