Package org.apache.qpid.server.store

Examples of org.apache.qpid.server.store.StoreException


                {
                    attributes = mapper.readValue(json, MAP_TYPE_REFERENCE);
                }
                catch (Exception e)
                {
                    throw new StoreException(e);
                }
                String name = (String)attributes.get("name");

                if (type.equals("Exchange"))
                {
                    _defaultExchanges.remove(name);
                }

                if(!type.endsWith("Binding"))
                {
                    storeVirtualHostHierarchyRecord(hierarchyDb, txn, id, virtualHostId);
                }
                else
                {
                    try
                    {
                        DatabaseEntry hierarchyKey = new DatabaseEntry();
                        DatabaseEntry hierarchyValue = new DatabaseEntry();

                        Object queueIdString = attributes.remove("queue");
                        if(queueIdString instanceof String)
                        {
                            UUID queueId = UUID.fromString(queueIdString.toString());
                            UUIDTupleBinding.getInstance().objectToEntry(queueId,hierarchyValue);
                            TupleOutput tupleOutput = new TupleOutput();
                            tupleOutput.writeLong(id.getMostSignificantBits());
                            tupleOutput.writeLong(id.getLeastSignificantBits());
                            tupleOutput.writeString("Queue");
                            TupleBinding.outputToEntry(tupleOutput, hierarchyKey);
                            hierarchyDb.put(txn, hierarchyKey, hierarchyValue);
                        }
                        Object exchangeIdString = attributes.remove("exchange");
                        if(exchangeIdString instanceof String)
                        {
                            UUID exchangeId = UUID.fromString(exchangeIdString.toString());
                            UUIDTupleBinding.getInstance().objectToEntry(exchangeId,hierarchyValue);
                            TupleOutput tupleOutput = new TupleOutput();
                            tupleOutput.writeLong(id.getMostSignificantBits());
                            tupleOutput.writeLong(id.getLeastSignificantBits());
                            tupleOutput.writeString("Exchange");
                            TupleBinding.outputToEntry(tupleOutput, hierarchyKey);
                            hierarchyDb.put(txn, hierarchyKey, hierarchyValue);
                        }
                        TupleOutput tupleOutput = new TupleOutput();
                        tupleOutput.writeString(type);
                        StringWriter writer = new StringWriter();
                        mapper.writeValue(writer,attributes);
                        tupleOutput.writeString(writer.getBuffer().toString());
                        TupleBinding.outputToEntry(tupleOutput, value);
                        objectsCursor.putCurrent(value);
                    }
                    catch (IOException e)
                    {
                        throw new StoreException(e);
                    }
                }
            }
        }
        finally
View Full Code Here


        configuredObjectBinding.objectToEntry(configuredObject, value);
        OperationStatus status = configuredObjectsDb.put(txn, key, value);
        if (status != OperationStatus.SUCCESS)
        {
            throw new StoreException("Error writing configured object " + configuredObject + " to database: "
                    + status);
        }
    }
View Full Code Here

                            queuesToDiscard.add(queueName);
                            messagesToDiscard.add(messageId);
                        }
                        else
                        {
                            throw new StoreException("Unable is aborted!");
                        }
                    }
                }

                if (!messagesToDiscard.contains(messageId))
View Full Code Here

        {
            DerbyUtils.shutdownDatabase(_connectionURL);
        }
        catch (SQLException e)
        {
            throw new StoreException("Error closing configuration store", e);
        }
    }
View Full Code Here

        {
            Class<Driver> driverClass = (Class<Driver>) Class.forName(SQL_DRIVER_NAME);
        }
        catch (ClassNotFoundException e)
        {
            throw new StoreException("Failed to load driver " + SQL_DRIVER_NAME, e);
        }
    }
View Full Code Here

            File location = new File(storeLocation);
            if (location.exists())
            {
                if (!FileUtils.delete(location, true))
                {
                    throw new StoreException("Failed to delete the store at location : " + storeLocation);
                }
            }
        }
    }
View Full Code Here

                                                                                      getPlainTextPassword(settings),
                                                                                      providerAttributes);
            }
            catch (SQLException e)
            {
                throw new StoreException("Failed to create connection provider for connectionUrl: " + _connectionURL +
                                            " and username: " + settings.getUsername(), e);
            }
            _blobType = details.getBlobType();
            _varBinaryType = details.getVarBinaryType();
            _useBytesMethodsForBlob = details.isUseBytesMethodsForBlob();
View Full Code Here

            {
                _connectionProvider.close();
            }
            catch (SQLException e)
            {
                throw new StoreException("Unable to close connection provider ", e);
            }
        }
    }
View Full Code Here

                                                                                  getPlainTextPassword(settings),
                                                                                  providerAttributes);
        }
        catch (SQLException e)
        {
            throw new StoreException("Failed to create connection provider for connectionUrl: " + _connectionURL +
                                    " and username: " + settings.getUsername());
        }

    }
View Full Code Here

        {
            _connectionProvider.close();
        }
        catch (SQLException e)
        {
            throw new StoreException("Unable to close connection provider ", e);
        }
    }
View Full Code Here

TOP

Related Classes of org.apache.qpid.server.store.StoreException

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.