001    /*
002      GRANITE DATA SERVICES
003      Copyright (C) 2013 GRANITE DATA SERVICES S.A.S.
004    
005      This file is part of Granite Data Services.
006    
007      Granite Data Services is free software; you can redistribute it and/or modify
008      it under the terms of the GNU Library General Public License as published by
009      the Free Software Foundation; either version 2 of the License, or (at your
010      option) any later version.
011    
012      Granite Data Services is distributed in the hope that it will be useful, but
013      WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
014      FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License
015      for more details.
016    
017      You should have received a copy of the GNU Library General Public License
018      along with this library; if not, see <http://www.gnu.org/licenses/>.
019    */
020    
021    package org.granite.messaging.jmf;
022    
023    import java.nio.charset.Charset;
024    
025    /**
026     * @author Franck WOLFF
027     */
028    public interface JMFConstants {
029    
030            static final String CLIENT_PERSISTENCE_COLLECTION_PACKAGE = "org.granite.client.persistence.collection";
031            
032            static final Charset UTF8 = Charset.forName("UTF-8");
033    
034            // Types with 4 bits of parameters (bit 4 always 0)
035            
036            static final int JMF_CLASS                              = 0x00; // JMF_XXXX_0000
037            static final int JMF_OBJECT                             = 0x01; // JMF_XXXX_0001
038            static final int JMF_ENUM                               = 0x02; // JMF_XXXX_0010
039            static final int JMF_ARRAY                              = 0x03; // JMF_XXXX_0011
040            static final int JMF_LONG                               = 0x04; // JMF_XXXX_0100
041            static final int JMF_LONG_OBJECT                = 0x05; // JMF_XXXX_0101
042    
043            static final int JMF_XXXX_0110                  = 0x06; // JMF_XXXX_0110
044            static final int JMF_XXXX_0111                  = 0x07; // JMF_XXXX_0111
045            
046            // Types with 3 bits of parameters (bit 5 always 0, bit 4 always 1)
047    
048            static final int JMF_INTEGER                    = 0x08; // JMF_XXX0_1000
049            static final int JMF_INTEGER_OBJECT             = 0x09; // JMF_XXX0_1001
050            static final int JMF_STRING                             = 0x0A; // JMF_XXX0_1010
051            static final int JMF_ARRAY_LIST                 = 0x0B; // JMF_XXX0_1011
052            static final int JMF_HASH_SET                   = 0x0C; // JMF_XXX0_1100
053            static final int JMF_HASH_MAP                   = 0x0D; // JMF_XXX0_1101
054    
055            static final int JMF_XXX0_1110                  = 0x0E; // JMF_XXX0_1110
056            static final int JMF_XXX0_1111                  = 0x0F; // JMF_XXX0_1111
057            
058            // Types with 2 bits of parameters (bit 6 always 0, bit 5 and 4 always 1)
059            static final int JMF_SHORT                              = 0x18; // JMF_XX01_1000
060            static final int JMF_SHORT_OBJECT               = 0x19; // JMF_XX01_1001
061            static final int JMF_BIG_INTEGER                = 0x1A; // JMF_XX01_1010
062            static final int JMF_BIG_DECIMAL                = 0x1B; // JMF_XX01_1011
063            static final int JMF_DOUBLE                             = 0x1C; // JMF_XX01_1100
064            static final int JMF_DOUBLE_OBJECT              = 0x1D; // JMF_XX01_1101
065    
066            static final int JMF_XX01_1110                  = 0x1E; // JMF_XX01_1110
067            static final int JMF_XX01_1111                  = 0x1F; // JMF_XX01_1111
068            
069            // Types with 1 bit of parameters (bit 7 always 0, bit 6, 5 and 4 always 1)
070    
071            static final int JMF_BOOLEAN                    = 0x38; // JMF_X011_1000
072            static final int JMF_BOOLEAN_OBJECT             = 0x39; // JMF_X011_1001
073            static final int JMF_CHARACTER                  = 0x3A; // JMF_X011_1010
074            static final int JMF_CHARACTER_OBJECT   = 0x3B; // JMF_X011_1011
075    
076            static final int JMF_X011_1100                  = 0x3C; // JMF_X011_1100
077            static final int JMF_X011_1101                  = 0x3D; // JMF_X011_1101
078            static final int JMF_X011_1110                  = 0x3E; // JMF_X011_1110
079            static final int JMF_X011_1111                  = 0x3F; // JMF_X011_1111
080            
081            // Types with 0 bit of parameters (bit 7, 6, 5 and 4 always 1)
082    
083            static final int JMF_NULL                               = 0x78; // JMF_0111_1000
084            static final int JMF_OBJECT_END                 = 0x79; // JMF_0111_1001
085            static final int JMF_BYTE                               = 0x7A; // JMF_0111_1010
086            static final int JMF_BYTE_OBJECT                = 0x7B; // JMF_0111_1011
087            static final int JMF_FLOAT                              = 0x7C; // JMF_0111_1100
088            static final int JMF_FLOAT_OBJECT               = 0x7D; // JMF_0111_1101
089            static final int JMF_DATE                               = 0x7E; // JMF_0111_1110
090            static final int JMF_SQL_DATE                   = 0x7F; // JMF_0111_1111
091    
092            static final int JMF_SQL_TIME                   = 0xF8; // JMF_1111_1000
093            static final int JMF_SQL_TIMESTAMP              = 0xF9; // JMF_1111_1001
094    
095            static final int JMF_1111_1010                  = 0xFA; // JMF_1111_1010
096            static final int JMF_1111_1011                  = 0xFB; // JMF_1111_1011
097            static final int JMF_1111_1100                  = 0xFC; // JMF_1111_1100
098            static final int JMF_1111_1101                  = 0xFD; // JMF_1111_1101
099            static final int JMF_1111_1110                  = 0xFE; // JMF_1111_1110
100            static final int JMF_1111_1111                  = 0xFF; // JMF_1111_1111
101    }