Package com.mozilla.grouperfish.naming

Examples of com.mozilla.grouperfish.naming.Scope


    public void testQueries() {
        assertNotNull(scope(NS).queries());
    }

    public void testResourceMap() {
        Scope ns = scope(NS);
        assertEquals(
                ns.documents(), ns.resourceMap(DocumentsResource.class));
        assertEquals(
                ns.queries(), ns.resourceMap(QueriesResource.class));
        assertEquals(
                ns.results(), ns.resourceMap(ResultsResource.class));
        assertEquals(
                ns.map(Type.CONFIGURATION_FILTER),
                ns.resourceMap(ConfigurationsResource.FilterConfigsResource.class));
        assertEquals(
                ns.map(Type.CONFIGURATION_TRANSFORM),
                ns.resourceMap(ConfigurationsResource.TransformConfigsResource.class));
    }
View Full Code Here


                ns.resourceMap(ConfigurationsResource.TransformConfigsResource.class));
    }

    @Test(expectedExceptions=IllegalStateException.class)
    public void testInvalidResourceMap() {
        final Scope ns = scope(NS);
        ns.resourceMap(Object.class);
    }
View Full Code Here

    public void testValidator() {
        assertNotNull(scope(NS).validator(DocumentsResource.class));
    }

    private Scope scope(String namespace) {
        return new Scope(namespace, grid);
    }
View Full Code Here

        if (!task.isOk()) {
            log.debug("Not putting result for failed task %s", task);
        }

        final String key = ResultsResource.key(task.transform().name(), task.query().name());
        final Map<String, String> results = new Scope(task.namespace(), grid).results();

        try {
            final Reader reader = fs.reader(resultsFilename(task));
            results.put(key, StreamTool.consume(reader));
        }
View Full Code Here

    public ResourceBase(final Grid grid) {
        this.grid = grid;
    }

    protected Scope scope(final String namespace) {
        return new Scope(namespace, grid);
    }
View Full Code Here

        }

        @POST
        public Response runTransformsForQuery(@PathParam("namespace") final String namespace,
                                              @Context final HttpServletRequest request) {
            final Scope ns = scope(namespace);

            if (!ns.allows(RunResource.class, new HttpAccess(Operation.RUN, request))) {
                return FORBIDDEN;
            }

            try {
                batchService().schedule(ns);
View Full Code Here

        @POST
        public Response runTransformsForQuery(@PathParam("namespace") final String namespace,
                                              @PathParam("transformName") final String transformName,
                                              @PathParam("queryName") final String queryName,
                                              @Context final HttpServletRequest request) {
            final Scope ns = scope(namespace);

            if (!ns.allows(RunResource.class, new HttpAccess(Operation.RUN, request))) {
                return FORBIDDEN;
            }

            final Box<Response> any404 = new Box<Response>();
            final Query q = fetchQuery(ns, queryName, any404);
View Full Code Here

        @POST
        public Response runOneTransformForQuery(@PathParam("namespace") final String namespace,
                                                @PathParam("transformName") final String transformName,
                                                @PathParam("queryName") final String queryName,
                                                @Context final HttpServletRequest request) {
            final Scope ns = scope(namespace);

            if (!ns.allows(RunResource.class, new HttpAccess(Operation.RUN, request))) {
                return FORBIDDEN;
            }

            final Box<Response> any404 = new Box<Response>();
View Full Code Here

TOP

Related Classes of com.mozilla.grouperfish.naming.Scope

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.