@SuppressWarnings("unchecked")
    @Override
    public boolean put(final String key, final Object data, final String... indexes)
            throws DataException, InvalidKeyException, DataClassException {
        if (key == null) {
            throw new InvalidKeyException("Null is not a valid key.");
        }
        if (data == null) {
            throw new DataException("Null is not a valid object to store.");
        }
        ClassUtils.typeValidation(data);
        KeyedId keyedId = new KeyedId(data.getClass(), key);

        String[] idxes = indexes;

        if (indexes.length == 0) {
            idxes = getIndexes(data);
        }

        validateIndexes(idxes);
        KeyedObject ko;
        try {
            byte[] value = serialize(data);
            if (value == null || value.length == 0) {
                LOG.debug("No data -> failing");
                throw new DataException("No data to store");
            }

            if (data instanceof LargeData) {
                ko = new LargeKeyedObject(keyedId, value, idxes);
            } else {
                ko = new SmallKeyedObject(keyedId, value, idxes);
            }
            ko = dao.create(ko);
        } catch (IOException e) {
            throw new DataException("Failed to serialize data with error: " + e.getMessage(), e);
        }
        return ko != null;
    }