Package org.apache.qpid.server.store

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


    }

    private ConfiguredObjectRecord[] convertToConfigurationRecords(final String initialConfigurationLocation,
                                                                   final SystemConfig systemConfig) throws IOException
    {
        ConfiguredObjectRecordConverter converter = new ConfiguredObjectRecordConverter(BrokerModel.getInstance());

        Reader reader;

        try
        {
            URL url = new URL(initialConfigurationLocation);
            reader = new InputStreamReader(url.openStream());
        }
        catch (MalformedURLException e)
        {
            reader = new FileReader(initialConfigurationLocation);
        }

        try
        {
            Collection<ConfiguredObjectRecord> records =
                    converter.readFromJson(org.apache.qpid.server.model.Broker.class,
                                           systemConfig, reader);
            return records.toArray(new ConfiguredObjectRecord[records.size()]);
        }
        finally
        {
View Full Code Here


        final AbstractSystemConfig parentObject = new JsonSystemConfigImpl(taskExecutor,
                                                               mock(EventLogger.class),
                                                               mock(LogRecorder.class),
                                                               brokerOptions);

        ConfiguredObjectRecordConverter converter = new ConfiguredObjectRecordConverter(BrokerModel.getInstance());

        Reader reader;
        try
        {
            try
            {
                URL url = new URL(initialStoreLocation);
                try(InputStream urlStream = url.openStream())
                {
                    reader = new InputStreamReader(urlStream);
                }
            }
            catch (MalformedURLException e)
            {
                reader = new FileReader(initialStoreLocation);
            }

            Collection<ConfiguredObjectRecord> records = converter.readFromJson(org.apache.qpid.server.model.Broker.class, parentObject, reader);
            reader.close();

            _store = new AbstractMemoryStore(Broker.class){};

            ConfiguredObjectRecord[] initialRecords = records.toArray(new ConfiguredObjectRecord[records.size()]);
View Full Code Here

    protected abstract ConfiguredObjectRecord enrichInitialVirtualHostRootRecord(final ConfiguredObjectRecord vhostRecord);

    protected final ConfiguredObjectRecord[] getInitialRecords() throws IOException
    {
        ConfiguredObjectRecordConverter converter = new ConfiguredObjectRecordConverter(getModel());

        Collection<ConfiguredObjectRecord> records =
                new ArrayList<>(converter.readFromJson(VirtualHost.class,this,getInitialConfigReader()));

        if(!records.isEmpty())
        {
            ConfiguredObjectRecord vhostRecord = null;
            for(ConfiguredObjectRecord record : records)
View Full Code Here

    }

    private ConfiguredObjectRecord[] convertToConfigurationRecords(final String initialConfigurationLocation,
                                                                   final SystemConfig systemConfig) throws IOException
    {
        ConfiguredObjectRecordConverter converter = new ConfiguredObjectRecordConverter(BrokerModel.getInstance());

        Reader reader;

        try
        {
            URL url = new URL(initialConfigurationLocation);
            reader = new InputStreamReader(url.openStream());
        }
        catch (MalformedURLException e)
        {
            reader = new FileReader(initialConfigurationLocation);
        }

        try
        {
            Collection<ConfiguredObjectRecord> records =
                    converter.readFromJson(org.apache.qpid.server.model.Broker.class,
                                           systemConfig, reader);
            return records.toArray(new ConfiguredObjectRecord[records.size()]);
        }
        finally
        {
View Full Code Here

    protected abstract ConfiguredObjectRecord enrichInitialVirtualHostRootRecord(final ConfiguredObjectRecord vhostRecord);

    protected final ConfiguredObjectRecord[] getInitialRecords() throws IOException
    {
        ConfiguredObjectRecordConverter converter = new ConfiguredObjectRecordConverter(getModel());

        Collection<ConfiguredObjectRecord> records =
                new ArrayList<>(converter.readFromJson(VirtualHost.class,this,getInitialConfigReader()));

        if(!records.isEmpty())
        {
            ConfiguredObjectRecord vhostRecord = null;
            for(ConfiguredObjectRecord record : records)
View Full Code Here

                                                               mock(EventLogger.class),
                                                               mock(LogRecorder.class),
                                                               brokerOptions,
                                                               mock(BrokerShutdownProvider.class));

        ConfiguredObjectRecordConverter converter = new ConfiguredObjectRecordConverter(BrokerModel.getInstance());

        Reader reader;
        try
        {
            try
            {
                URL url = new URL(initialStoreLocation);
                try(InputStream urlStream = url.openStream())
                {
                    reader = new InputStreamReader(urlStream);
                }
            }
            catch (MalformedURLException e)
            {
                reader = new FileReader(initialStoreLocation);
            }

            Collection<ConfiguredObjectRecord> records = converter.readFromJson(org.apache.qpid.server.model.Broker.class, parentObject, reader);
            reader.close();

            _store = new AbstractMemoryStore(Broker.class){};

            ConfiguredObjectRecord[] initialRecords = records.toArray(new ConfiguredObjectRecord[records.size()]);
View Full Code Here

TOP

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

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.