Examples of NCube


Examples of com.cedarsoftware.ncube.NCube

        return ncube.getCell(coord, output);
    }

    public Object getFixedCubeCell(String name, Map coord)
    {
        NCube cube = NCubeManager.getCube(name, ncube.getVersion());
        if (cube == null)
        {
            throw new IllegalArgumentException("NCube '" + name + "' not loaded into NCubeManager, attempting fixed ($) reference to cell: " + coord.toString());
        }
        return cube.getCell(coord, output);
    }
View Full Code Here

Examples of com.cedarsoftware.ncube.NCube

    }

    public Object getRelativeCubeCell(String name, Map coord)
    {
        input.putAll(coord);
        NCube cube = NCubeManager.getCube(name, ncube.getVersion());
        if (cube == null)
        {
            throw new IllegalArgumentException("NCube '" + name + "' not loaded into NCubeManager, attempting relative (@) reference to cell: " + coord.toString());
        }
        return cube.getCell(input, output);
    }
View Full Code Here

Examples of com.cedarsoftware.ncube.NCube

     * @return is the return Map from the other rule cube
     */
    public Object runRuleCube(String name, Map coord)
    {
        input.putAll(coord);
        NCube cube = NCubeManager.getCube(name, ncube.getVersion());
        if (cube == null)
        {
            throw new IllegalArgumentException("NCube '" + name + "' not loaded into NCubeManager, attempting runRuleCube() to cell: " + coord.toString());
        }
        return cube.getCells(input, output);
    }
View Full Code Here

Examples of com.cedarsoftware.ncube.NCube

            coord.put(CONTENT_NAME, logicalName);
            coord.put(CONTENT_TYPE, type);
            coord.put(HTTP_REQUEST, request);
            coord.put(HTTP_RESPONSE, response);
            Map output = new HashMap();
            NCube routingCube = NCubeManager.getCube(cubeName, version);
            if (routingCube == null)
            {
                routingCube = NCubeManager.getCube("cdnRouter", version);
            }
            Connection connection = (Connection) coord.get(CONNECTION);
            if (routingCube == null)
            {
                String app = (String) coord.get(APP);
                String status = (String) coord.get(STATUS);
                Date date = (Date) coord.get(DATE);

                if (connection == null)
                {
                    String msg = "CdnRouter - CdnRoutingProvider did not set up '" + CONNECTION + "' in the Map coordinate.";
                    sendErrorResponse(response, HttpServletResponse.SC_INTERNAL_SERVER_ERROR, msg);
                    return;
                }

                if (StringUtilities.isEmpty(app))
                {
                    String msg = "CdnRouter - CdnRoutingProvider did not set '" + APP + "' in the Map coordinate.";
                    sendErrorResponse(response, HttpServletResponse.SC_INTERNAL_SERVER_ERROR, msg);
                    return;
                }

                if (StringUtilities.isEmpty(status))
                {
                    String msg = "CdnRouter - CdnRoutingProvider did not set '" + STATUS + "' in the Map coordinate.";
                    sendErrorResponse(response, HttpServletResponse.SC_INTERNAL_SERVER_ERROR, msg);
                    return;
                }
                routingCube = NCubeManager.loadCube(connection, app, cubeName, version, status, date);
            }
            provider.doneWithConnection(connection);
            routingCube.getCell(coord, output);
        }
        catch (Exception e)
        {
            LOG.error("CdnRouter exception occurred", e);
            try
View Full Code Here

Examples of com.cedarsoftware.ncube.NCube

        return ncube.getCell(coord, output);
    }

    public Object getFixedCubeCell(String name, Map coord)
    {
        NCube cube = NCubeManager.getCube(name, ncube.getVersion());
        if (cube == null)
        {
            throw new IllegalArgumentException("NCube '" + name + "' not loaded into NCubeManager, attempting fixed ($) reference to cell: " + coord.toString());
        }
        return cube.getCell(coord, output);
    }
View Full Code Here

Examples of com.cedarsoftware.ncube.NCube

    }

    public Object getRelativeCubeCell(String name, Map coord)
    {
        input.putAll(coord);
        NCube cube = NCubeManager.getCube(name, ncube.getVersion());
        if (cube == null)
        {
            throw new IllegalArgumentException("NCube '" + name + "' not loaded into NCubeManager, attempting relative (@) reference to cell: " + coord.toString());
        }
        return cube.getCell(input, output);
    }
View Full Code Here

Examples of com.cedarsoftware.ncube.NCube

            coord.put(HTTP_REQUEST, request);
            coord.put(HTTP_RESPONSE, response);
            Map output = new HashMap();
            // TODO: MUST send account and app so that the router knows what cube to get.
            ApplicationID appId = new ApplicationID(null, null, version);
            NCube routingCube = NCubeManager.getCube(cubeName, appId);
            if (routingCube == null)
            {
                throw new IllegalStateException("In order to use the n-cube CDN routing capabilities, " +
                        "a CdnRouter n-cube must already be loaded, and it's name passed in as CdnRouter.CUBE_NAME");
            }
            routingCube.getCells(coord, output);
        }
        catch (Exception e)
        {
            LOG.error("CdnRouter exception occurred", e);
            // Required, so that error message is not double logged.
View Full Code Here

Examples of com.cedarsoftware.ncube.NCube

        return ncube.getCell(coord, output);
    }

    public Object getFixedCubeCell(String name, Map coord)
    {
        NCube cube = NCubeManager.getCube(name, ncube.getApplicationID());
        if (cube == null)
        {
            throw new IllegalArgumentException("NCube '" + name + "' not loaded into NCubeManager, attempting fixed ($) reference to cell: " + coord.toString());
        }
        return cube.getCell(coord, output);
    }
View Full Code Here

Examples of com.cedarsoftware.ncube.NCube

    }

    public Object getRelativeCubeCell(String name, Map coord)
    {
        input.putAll(coord);
        NCube cube = NCubeManager.getCube(name, ncube.getApplicationID());
        if (cube == null)
        {
            throw new IllegalArgumentException("NCube '" + name + "' not loaded into NCubeManager, attempting relative (@) reference to cell: " + coord.toString());
        }
        return cube.getCell(input, output);
    }
View Full Code Here

Examples of com.cedarsoftware.ncube.NCube

     * @return is the return Map from the other rule cube
     */
    public Object runRuleCube(String name, Map coord)
    {
        input.putAll(coord);
        NCube cube = NCubeManager.getCube(name, ncube.getApplicationID());
        if (cube == null)
        {
            throw new IllegalArgumentException("NCube '" + name + "' not loaded into NCubeManager, attempting runRuleCube() to cell: " + coord.toString());
        }
        return cube.getCells(input, output);
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.