001    /**
002     * Copyright 2007 Mike Kroutikov.
003     *
004     * This program is free software; you can redistribute it and/or modify
005     *   it under the terms of the Lesser GNU General Public License as 
006     *   published by the Free Software Foundation; either version 3 of
007     *   the License, or (at your option) any later version.
008     *
009     *   This program 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
012     *   Lesser GNU General Public License for more details.
013     *
014     *   You should have received a copy of the Lesser GNU General Public License
015     *   along with this program.  If not, see <http://www.gnu.org/licenses/>.
016     */
017    
018    package org.otfeed.protocol;
019    
020    /**
021     * Enumerates well-known OpenTick error codes.
022     */
023    public enum ErrorEnum {
024    
025            /** Incorrect login (username / password). */
026            BAD_LOGIN                       (1001),
027    
028            /** You are not logged in. */
029            NOT_LOGGED_IN           (1002),
030    
031            /** Requested data does not exist. */
032            NO_DATA                         (1003),
033    
034            /** Invalid cancelId. */
035            INVALID_CANCEL_ID       (1004),
036    
037            /** Invalid interval type or value of the request for historical data. */
038            INVALID_INTERVAL        (1005),
039    
040            /** You do not have a license to request real-time data from the specified exchange. */
041            NO_LICENSE                      (1006),
042    
043            /** Your symbol limit is exceeded. */
044            LIMIT_EXCEEDED          (1007),
045    
046            /** You have requested this tick stream already. */
047            DUPLICATE_REQUEST       (1008),
048    
049            /** Your account is inactive. */
050            INACTIVE_ACCOUNT        (1009),
051    
052            /** You are logged in already. */
053            LOGGED_IN                       (1010),
054    
055            /** Parameters of the request are incorrect. */
056            BAD_REQUEST             (1011),
057    
058            /** You are not subscribed to a historical data package. */
059            NO_HIST_PACKAGE         (1012),
060    
061    
062            /**
063             * API errors.
064             */
065    
066            /** System error. */
067            E_SYSTEM                        (2000),
068    
069            /** Server error. */
070            E_SYSTEM_SERVER_ERROR (2002),
071    
072            /** Cannot connect error. */
073            E_CANNOT_CONNECT (2003),
074    
075            /** Opentick error. */
076            E_OPENTICK (3000),
077    
078            /* 
079             * org.otfeed errors 
080             */
081    
082            /** Otfeed client was shutdown (normal exit) */
083            E_OTFEED_OK(5000),
084    
085            /** Otfeed client experienced an internal error */
086            E_OTFEED_INTERNAL (5001),
087    
088            /** Request has been cancelled */
089            E_OTFEED_CANCELLED (5002);
090    
091            public final int code;
092            
093            private ErrorEnum(int code) {
094                    this.code = code;
095            }
096    }