Examples of InvalidDataException


Examples of krati.store.InvalidDataException

     * @param size    - the size
     * @param maxSize - the max size
     */
    public static void checkMaxSize(int size, int maxSize) {
        if(size < 0 || size > maxSize) {
            throw new InvalidDataException("Invalid size: " + size  + " max: " + maxSize);
        }
    }
View Full Code Here

Examples of krati.store.InvalidDataException

     * @param keySize    - the key size
     * @param maxKeySize - the max key size
     */
    public static void checkMaxKeySize(int keySize, int maxKeySize) {
        if(keySize < 0 || keySize > maxKeySize) {
            throw new InvalidDataException("Invalid key size: " + keySize  + " max: " + maxKeySize);
        }
    }
View Full Code Here

Examples of krati.store.InvalidDataException

     * @param valueSize    - the value size
     * @param maxValueSize - the max value size
     */
    public static void checkMaxValueSize(int valueSize, int maxValueSize) {
        if(valueSize < 0 || valueSize > maxValueSize) {
            throw new InvalidDataException("Invalid value size: " + valueSize  + " max: " + maxValueSize);
        }
    }
View Full Code Here

Examples of krati.store.InvalidDataException

     * @param dataSize    - the data size
     * @param maxDataSize - the max data size
     */
    public static void checkMaxDataSize(int dataSize, int maxDataSize) {
        if(dataSize < 0 || dataSize > maxDataSize) {
            throw new InvalidDataException("Invalid data size: " + dataSize  + " max: " + maxDataSize);
        }
    }
View Full Code Here

Examples of org.gatein.management.api.exceptions.InvalidDataException

        return pagination;
    }

    public static InvalidDataException invalidRequestParameter(String name, String value) {
        throw new InvalidDataException("Invalid value '" + value + "' for request parameter " + name);
    }
View Full Code Here

Examples of org.gatein.management.api.exceptions.InvalidDataException

        return invalidData("%s is required when " + when, names);
    }

    public static InvalidDataException invalidData(String format, String... names) {
        if (names == null) {
            throw new InvalidDataException(format);
        }
        return new InvalidDataException(String.format(format, resolveField(names)));
    }
View Full Code Here

Examples of org.java_websocket.exceptions.InvalidDataException

    try {
      bytes.mark();
      s = decode.decode( bytes ).toString();
      bytes.reset();
    } catch ( CharacterCodingException e ) {
      throw new InvalidDataException( CloseFrame.NO_UTF8, e );
    }
    return s;
  }
View Full Code Here

Examples of org.java_websocket.exceptions.InvalidDataException

    return translateHandshakeHttp( buf, role );
  }

  public int checkAlloc( int bytecount ) throws LimitExedeedException , InvalidDataException {
    if( bytecount < 0 )
      throw new InvalidDataException( CloseFrame.PROTOCOL_ERROR, "Negative count" );
    return bytecount;
  }
View Full Code Here

Examples of org.java_websocket.exceptions.InvalidDataException

  @Override
  public List<Framedata> translateFrame( ByteBuffer buffer ) throws InvalidDataException {
    List<Framedata> frames = translateRegularFrame( buffer );
    if( frames == null ) {
      throw new InvalidDataException( CloseFrame.PROTOCOL_ERROR );
    }
    return frames;
  }
View Full Code Here

Examples of org.java_websocket.exceptions.InvalidDataException

          wsl.onWebsocketPong( this, f );
          continue;
        } else if( !fin || curop == Opcode.CONTINUOUS ) {
          if( curop != Opcode.CONTINUOUS ) {
            if( current_continuous_frame_opcode != null )
              throw new InvalidDataException( CloseFrame.PROTOCOL_ERROR, "Previous continuous frame sequence not completed." );
            current_continuous_frame_opcode = curop;
          } else if( fin ) {
            if( current_continuous_frame_opcode == null )
              throw new InvalidDataException( CloseFrame.PROTOCOL_ERROR, "Continuous frame sequence was not started." );
            current_continuous_frame_opcode = null;
          } else if( current_continuous_frame_opcode == null ) {
            throw new InvalidDataException( CloseFrame.PROTOCOL_ERROR, "Continuous frame sequence was not started." );
          }
          try {
            wsl.onWebsocketMessageFragment( this, f );
          } catch ( RuntimeException e ) {
            wsl.onWebsocketError( this, e );
          }

        } else if( current_continuous_frame_opcode != null ) {
          throw new InvalidDataException( CloseFrame.PROTOCOL_ERROR, "Continuous frame sequence not completed." );
        } else if( curop == Opcode.TEXT ) {
          try {
            wsl.onWebsocketMessage( this, Charsetfunctions.stringUtf8( f.getPayloadData() ) );
          } catch ( RuntimeException e ) {
            wsl.onWebsocketError( this, e );
          }
        } else if( curop == Opcode.BINARY ) {
          try {
            wsl.onWebsocketMessage( this, f.getPayloadData() );
          } catch ( RuntimeException e ) {
            wsl.onWebsocketError( this, e );
          }
        } else {
          throw new InvalidDataException( CloseFrame.PROTOCOL_ERROR, "non control or continious frame expected" );
        }
      }
    } catch ( InvalidDataException e1 ) {
      wsl.onWebsocketError( this, e1 );
      close( e1 );
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.