Package org.apache.excalibur.instrument.manager

Examples of org.apache.excalibur.instrument.manager.InstrumentSampleDescriptor


        {
            lease = 1;
        }
       
        // Register the new lease
        InstrumentSampleDescriptor sample;
        try
        {
            sample = desc.createInstrumentSample( description, interval, size, lease, type );
        }
        catch ( IllegalArgumentException e )
        {
            // The sample type is not valid.
            throw new FileNotFoundException( e.getMessage() );
        }
        catch ( IllegalStateException e )
        {
            // The sample type was incompatible with the instrument.
            throw new FileNotFoundException( e.getMessage() );
        }
       
        // Redirect to the new sample page.
        throw new HTTPRedirect( "sample.html?name=" + urlEncode( sample.getName() ) );
    }
View Full Code Here


        String name = getParameter( parameters, "name" );
        long baseTime = getLongParameter( parameters, "base-time", 0 );
        boolean packed = getBooleanParameter( parameters, "packed", false );
        boolean compact = getBooleanParameter( parameters, "compact", false );
       
        InstrumentSampleDescriptor desc;
        try
        {
            desc = getInstrumentManager().locateInstrumentSampleDescriptor( name );
        }
        catch ( NoSuchInstrumentSampleException e )
View Full Code Here

    {
        String name = getParameter( parameters, "name" );
        long lease = getLongParameter( parameters, "lease" );
        boolean packed = getBooleanParameter( parameters, "packed", false );
       
        InstrumentSampleDescriptor desc;
        try
        {
            desc = getInstrumentManager().locateInstrumentSampleDescriptor( name );
        }
        catch ( NoSuchInstrumentSampleException e )
        {
            throw new FileNotFoundException(
                "The specified instrument does not exist: " + name );
        }
       
        // The instrument manager will do its own tests of the lease, but the
        //  restrictions on this connector may be stronger so they must be tested
        //  here as well.
        lease = Math.max( 1, Math.min( lease, getConnector().getMaxLeasedSampleLease() ) );
       
        if ( getInstrumentManager().getLeaseSampleCount() >= getConnector().getMaxLeasedSamples() )
        {
            lease = 1;
        }
       
        // Renew the lease
        desc.extendLease( lease );
       
        out.println( InstrumentManagerHTTPConnector.XML_BANNER );
        outputSample( out, desc, "", packed );
    }
View Full Code Here

        {
            outputLine( out, "", packed, "<samples>" );
           
            for ( int i = 0; i < names.length; i++ )
            {
                InstrumentSampleDescriptor desc;
                try
                {
                    desc =
                        getInstrumentManager().locateInstrumentSampleDescriptor( names[i] );
                   
View Full Code Here

        String name = getParameter( parameters, "name" );
        long lease = getLongParameter( parameters, "lease" );
        String instrument = getParameter( parameters, "instrument", null );
        String chart = getParameter( parameters, "chart", null );
       
        InstrumentSampleDescriptor desc;
        try
        {
            desc = getInstrumentManager().locateInstrumentSampleDescriptor( name );
        }
        catch ( NoSuchInstrumentSampleException e )
        {
            // Sample no longer exists, go back to the parent instrument.
            int pos = name.lastIndexOf( '.' );
            if ( pos >= 0 )
            {
                throw new HTTPRedirect(
                    "instrument.html?name=" + urlEncode( name.substring( 0,  pos ) ) );
            }
            else
            {
                throw new HTTPRedirect( "instrument-manager.html" );
            }
        }
       
        // The instrument manager will do its own tests of the lease, but the
        //  restrictions on this connector may be stronger so they must be tested
        //  here as well.
        lease = Math.max( 1, Math.min( lease, m_connector.getMaxLeasedSampleLease() ) );
       
        if ( getInstrumentManager().getLeaseSampleCount() >= m_connector.getMaxLeasedSamples() )
        {
            lease = 1;
        }
       
        // Renew the lease
        desc.extendLease( lease );
       
        if ( instrument != null )
        {
            // Go to the instrument page.
            int pos = name.lastIndexOf( '.' );
            if ( pos >= 0 )
            {
                throw new HTTPRedirect(
                    "instrument.html?name=" + urlEncode( name.substring( 0,  pos ) ) );
            }
            else
            {
                throw new HTTPRedirect( "instrumentable.html" );
            }
        }
        else
        {
            // Redirect to the sample page.
            throw new HTTPRedirect( "sample.html?name=" + urlEncode( desc.getName() )
                + ( chart == null ? "" : "&chart=true" ) );
        }
       
    }
View Full Code Here

        {
            lease = 1;
        }
       
        // Register the new lease
        InstrumentSampleDescriptor sample;
        try
        {
            sample = desc.createInstrumentSample( description, interval, size, lease, type );
        }
        catch ( IllegalArgumentException e )
        {
            // The sample type is not valid.
            throw new FileNotFoundException( e.getMessage() );
        }
        catch ( IllegalStateException e )
        {
            // The sample type was incompatible with the instrument.
            throw new FileNotFoundException( e.getMessage() );
        }
       
        // Redirect to the new sample page.
        throw new HTTPRedirect( "sample.html?name=" + urlEncode( sample.getName() ) );
    }
View Full Code Here

        String name = getParameter( parameters, "name" );
        long baseTime = getLongParameter( parameters, "base-time", 0 );
        boolean packed = getBooleanParameter( parameters, "packed", false );
        boolean compact = getBooleanParameter( parameters, "compact", false );
       
        InstrumentSampleDescriptor desc;
        try
        {
            desc = getInstrumentManager().locateInstrumentSampleDescriptor( name );
        }
        catch ( NoSuchInstrumentSampleException e )
View Full Code Here

    {
        String name = getParameter( parameters, "name" );
        long lease = getLongParameter( parameters, "lease" );
        boolean packed = getBooleanParameter( parameters, "packed", false );
       
        InstrumentSampleDescriptor desc;
        try
        {
            desc = getInstrumentManager().locateInstrumentSampleDescriptor( name );
        }
        catch ( NoSuchInstrumentSampleException e )
        {
            throw new FileNotFoundException(
                "The specified instrument does not exist: " + name );
        }
       
        // The instrument manager will do its own tests of the lease, but the
        //  restrictions on this connector may be stronger so they must be tested
        //  here as well.
        lease = Math.max( 1, Math.min( lease, m_connector.getMaxLeasedSampleLease() ) );
       
        if ( getInstrumentManager().getLeaseSampleCount() >= m_connector.getMaxLeasedSamples() )
        {
            lease = 1;
        }
       
        // Renew the lease
        desc.extendLease( lease );
       
        out.println( InstrumentManagerHTTPConnector.XML_BANNER );
        outputSample( out, desc, "", packed );
    }
View Full Code Here

        throws IOException
    {
        String name = getParameter( parameters, "name" );
        boolean packed = getBooleanParameter( parameters, "packed", false );
       
        InstrumentSampleDescriptor desc;
        try
        {
            desc = getInstrumentManager().locateInstrumentSampleDescriptor( name );
        }
        catch ( NoSuchInstrumentSampleException e )
View Full Code Here

        {
            String childIndent = indent + INDENT;
           
            for ( int i = 0; i < samples.length; i++ )
            {
                InstrumentSampleDescriptor sample = samples[i];
                if ( recurse )
                {
                    outputSample( out, sample, childIndent, packed );
                }
                else
View Full Code Here

TOP

Related Classes of org.apache.excalibur.instrument.manager.InstrumentSampleDescriptor

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.