Package com.volantis.mcs.dissection.impl

Examples of com.volantis.mcs.dissection.impl.SelectedShards


        DissectedDocumentImpl document
            = (DissectedDocumentImpl) dissectedDocument;

        // Select the shards from each area.
        SelectedShards selectedShards = getSelectedShards(dissectionContext,
                                                          document,
                                                          requestedShards,
                                                          availableShards);

    }
View Full Code Here


        DissectedDocumentImpl document
            = (DissectedDocumentImpl) dissectedDocument;

        // Select the shards from each area.
        SelectedShards selectedShards = getSelectedShards(dissectionContext, document,
                                                          requestedShards,
                                                          availableShards);

        DissectableArea area = document.getDissectableArea(1);
View Full Code Here

        DissectedDocumentImpl document
            = (DissectedDocumentImpl) dissectedDocument;

        // Select the shards from each area.
        SelectedShards selectedShards = getSelectedShards(dissectionContext, document,
                                                          requestedShards,
                                                          null);

        DissectedDocumentSerializer serializer
            = new DissectedDocumentSerializer();
View Full Code Here

                                            AvailableShards availableShards)
        throws DissectionException {

        // Create a SelectedShards object to hold the shards that have been
        // selected for each dissectable area.
        SelectedShards selectedShards = document.createSelectedShards();

        // Get the shard that has been selected for each dissectable area. This
        // is done by iterating over the dissectable areas looking to see if a
        // shard has been specified for them in the fragmentation state. If no
        // shard has been explicitly set then the first shard is used.
        int count = selectedShards.getCount();
        for (int i = 0; i < count; i += 1) {
            DissectableArea area = document.getDissectableArea(i);

            int shardIndex = requestedShards.getShard(area.getIndex());

            // Retrieve the appropriate shard from the area. If the shard index
            // is invalid for some reason then we may not get back exactly the
            // one that we asked for but we will get one back.
            Shard shard
                = area.retrieveShard(dissectionContext, shardIndex,
                                     (AvailableShardsImpl) availableShards);
            if (shard == null) {
                throw new DissectionException(
                        exceptionLocalizer.format("shard-not-found"));
            }

            // todo: We need to check to see whether there are any discrepancies
            // todo: between the requested shards and the selected ones as if
            // todo: there are it means that there is a problem with the
            // todo: source of the information such as fragmentation state.

            // Set the shard on the specified area.
            selectedShards.setShard(area, shard);
        }

        return selectedShards;
    }
View Full Code Here

TOP

Related Classes of com.volantis.mcs.dissection.impl.SelectedShards

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.