Package net.floodlightcontroller.storage

Examples of net.floodlightcontroller.storage.StorageException


   
    synchronized private MemoryTable getTable(String tableName, boolean create) {
        MemoryTable table = tableMap.get(tableName);
        if (table == null) {
            if (!create)
                throw new StorageException("Table " + tableName + " does not exist");
            table = new MemoryTable(tableName);
            tableMap.put(tableName, table);
        }
        return table;
    }
View Full Code Here


        String primaryKeyName = getTablePrimaryKeyName(tableName);
        synchronized (table) {
            for (Map<String,Object> updateRow : updateRowList) {
                Object rowKey = updateRow.get(primaryKeyName);
                if (rowKey == null)
                    throw new StorageException("Primary key not found.");
                Map<String,Object> row = table.getRow(rowKey);
                if (row == null)
                    row = table.newRow(rowKey);
                for (Map.Entry<String,Object> entry: updateRow.entrySet()) {
                    row.put(entry.getKey(), entry.getValue());
View Full Code Here

            default:
                convertedPredicate = new NoSqlOperatorPredicate(this, operatorPredicate.getColumnName(),
                        operatorPredicate.getOperator(), value);
            }
        } else {
            throw new StorageException("Unknown predicate type");
        }
       
        return convertedPredicate;
    }
View Full Code Here

                // Ignore the exception here. In this case obj will not be set, so we'll
                // throw the StorageException below when we check for a null obj.
            }
           
            if (obj == null)
                throw new StorageException("Column value could not be coerced to the correct type");
           
            return obj;
        }
View Full Code Here

        public boolean canExecuteEfficiently() {
            return false;
        }

        public List<Map<String,Object>> execute(String columnNames[]) {
            throw new StorageException("Unimplemented predicate.");
        }
View Full Code Here

    }
   
    @Override
    public Map<String,Object> getRow() {
        if ((currentIndex < 0) || (currentIndex >= rowList.size())) {
            throw new StorageException("No current row in result set.");
        }
       
        return rowList.get(currentIndex);
    }
View Full Code Here

    public byte[] getByteArray(String columnName) {
        byte[] b = null;
        Object obj = getObject(columnName);
        if (obj != null) {
            if (!(obj instanceof byte[]))
                throw new StorageException("Invalid byte array value");
            b = (byte[])obj;
        }
        return b;
    }
View Full Code Here

TOP

Related Classes of net.floodlightcontroller.storage.StorageException

Copyright © 2018 www.massapicom. 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.