Package org.apache.qpid

Examples of org.apache.qpid.AMQStoreException


                conn.close();
            }
        }
        catch (SQLException e)
        {
            throw new AMQStoreException("Error deleting of configured object with id " + id + " from database: " + e.getMessage(), e);
        }
        return results;
    }
View Full Code Here


                    conn.close();
                }
            }
            catch (SQLException e)
            {
                throw new AMQStoreException("Error updating configured object " + configuredObject + " in database: " + e.getMessage(), e);
            }
        }
    }
View Full Code Here

                conn.close();
            }
        }
        catch (SQLException e)
        {
            throw new AMQStoreException("Error loading of configured object with id " + id + " from database: "
                    + e.getMessage(), e);
        }
        return result;
    }
View Full Code Here

        _name = virtualHost.getName();

        Object storePathAttr = virtualHost.getAttribute(VirtualHost.CONFIG_STORE_PATH);
        if(!(storePathAttr instanceof String))
        {
            throw new AMQStoreException("Cannot determine path for configuration storage");
        }
        _directoryName = (String) storePathAttr;
        _configFileName = _name + ".json";
        _backupFileName = _name + ".bak";
        checkDirectoryIsWritable(_directoryName);
View Full Code Here

        File toFile = new File(_directoryName, toFileName);
        if(toFile.exists())
        {
            if(!toFile.delete())
            {
                throw new AMQStoreException("Cannot delete file " + toFile.getAbsolutePath());
            }
        }
        File fromFile = new File(_directoryName, fromFileName);

        if(!fromFile.renameTo(toFile))
        {
            throw new AMQStoreException("Cannot rename file " + fromFile.getAbsolutePath() + " to " + toFile.getAbsolutePath());
        }
    }
View Full Code Here

        {
            _fileLock = null;
        }
        if(_fileLock == null)
        {
            throw new AMQStoreException("Cannot get lock on file " + lockFile.getAbsolutePath() + " is another instance running?");
        }
        lockFile.deleteOnExit();
    }
View Full Code Here

        {
            if(dir.isDirectory())
            {
                if(!dir.canWrite())
                {
                    throw new AMQStoreException("Configuration path " + directoryName + " exists, but is not writable");
                }

            }
            else
            {
                throw new AMQStoreException("Configuration path " + directoryName + " exists, but is not a directory");
            }
        }
        else if(!dir.mkdirs())
        {
            throw new AMQStoreException("Cannot create directory " + directoryName);
        }
    }
View Full Code Here

    @Override
    public synchronized void create(final UUID id, final String type, final Map<String, Object> attributes) throws AMQStoreException
    {
        if(_objectsById.containsKey(id))
        {
            throw new AMQStoreException("Object with id " + id + " already exists");
        }
        else if(!CLASS_NAME_MAPPING.containsKey(type))
        {
            throw new AMQStoreException("Cannot create object of unknown type " + type);
        }
        else
        {
            ConfiguredObjectRecord record = new ConfiguredObjectRecord(id, type, attributes);
            _objectsById.put(id, record);
View Full Code Here

            backupFile.delete();

        }
        catch (IOException e)
        {
            throw new AMQStoreException("Cannot save to store", e);
        }
    }
View Full Code Here

            if(_objectsById.containsKey(id))
            {
                final ConfiguredObjectRecord existingRecord = _objectsById.get(id);
                if(!type.equals(existingRecord.getType()))
                {
                    throw new AMQStoreException("Cannot change the type of record " + id + " from type "
                                                + existingRecord.getType() + " to type " + type);
                }
            }
            else if(!createIfNecessary)
            {
                throw new AMQStoreException("Cannot update record with id " + id
                                        + " of type " + type + " as it does not exist");
            }
            else if(!CLASS_NAME_MAPPING.containsKey(type))
            {
                throw new AMQStoreException("Cannot update record of unknown type " + type);
            }
        }
        for(ConfiguredObjectRecord record : records)
        {
            final UUID id = record.getId();
View Full Code Here

TOP

Related Classes of org.apache.qpid.AMQStoreException

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.