Examples of NCube


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)
            {
                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.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

    }

    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

        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

    }

    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);
            }
            if (routingCube == null)
            {
                Connection connection = (Connection) coord.get(CONNECTION);
                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);
            }
            routingCube.getCell(coord, output);
        }
        catch (Exception e)
        {
            String msg = "CdnRouter - Error occurred writing HTTP response: " + e.getMessage();
            sendErrorResponse(response, HttpServletResponse.SC_INTERNAL_SERVER_ERROR, msg);
View Full Code Here

Examples of com.cedarsoftware.ncube.NCube

                String msg = "CdnRouter - CdnRoutingProvider did not set up '" + CUBE_NAME + "' or '" + CUBE_VERSION + "' in the Map coordinate.";
                sendErrorResponse(response, HttpServletResponse.SC_INTERNAL_SERVER_ERROR, msg);
                return;
            }

            NCube routingCube = NCubeManager.getCube(cubeName, version);
            if (routingCube == null)
            {
                Connection connection = (Connection) coord.get(CONNECTION);
                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);
            }

            coord.put(CONTENT_NAME, logicalName);
            coord.put(CONTENT_TYPE, type);
            Map output = new HashMap();
            routingCube.getCell(coord, output, new CdnUrlExecutor(request, response));
        }
        catch (Exception e)
        {
            String msg = "CdnRouter - Error occurred writing HTTP response: " + e.getMessage();
            sendErrorResponse(response, HttpServletResponse.SC_INTERNAL_SERVER_ERROR, msg);
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);
            }
            if (routingCube == null)
            {
                Connection connection = (Connection) coord.get(CONNECTION);
                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);
            }
            routingCube.getCell(coord, output);
        }
        catch (Exception e)
        {
            LOG.error("CdnRouter exception occurred", e);
            try
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.