1. /*
  2. * @(#)Message.java 1.8 03/01/23
  3. *
  4. * Copyright 2003 Sun Microsystems, Inc. All rights reserved.
  5. * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
  6. */
  7. package com.sun.corba.se.internal.iiop.messages;
  8. import com.sun.corba.se.internal.core.GIOPVersion;
  9. /**
  10. * This is the base interface for different message type interfaces.
  11. *
  12. * @author Ram Jeyaraman 05/14/2000
  13. * @version 1.0
  14. */
  15. public interface Message {
  16. // Generic constants
  17. int defaultBufferSize = 1024;
  18. int GIOPBigEndian = 0;
  19. int GIOPLittleEndian = 1;
  20. int GIOPBigMagic = 0x47494F50;
  21. int GIOPLittleMagic = 0x504F4947;
  22. int GIOPMessageHeaderLength = 12;
  23. // Other useful constants
  24. byte LITTLE_ENDIAN_BIT = 0x01;
  25. byte MORE_FRAGMENTS_BIT = 0x02;
  26. byte FLAG_NO_FRAG_BIG_ENDIAN = 0x00;
  27. // Message types
  28. byte GIOPRequest = 0;
  29. byte GIOPReply = 1;
  30. byte GIOPCancelRequest = 2;
  31. byte GIOPLocateRequest = 3;
  32. byte GIOPLocateReply = 4;
  33. byte GIOPCloseConnection = 5;
  34. byte GIOPMessageError = 6;
  35. byte GIOPFragment = 7; // 1.1 & 1.2:
  36. // Accessor methods
  37. GIOPVersion getGIOPVersion();
  38. boolean isLittleEndian();
  39. boolean moreFragmentsToFollow();
  40. int getType();
  41. int getSize();
  42. // Mutator methods
  43. void read(org.omg.CORBA.portable.InputStream istream);
  44. void write(org.omg.CORBA.portable.OutputStream ostream);
  45. void setSize(byte[] buf, int size);
  46. FragmentMessage createFragmentMessage();
  47. }