Package org.apache.wink.common.internal.model.admin

Examples of org.apache.wink.common.internal.model.admin.Resource


        List<ResourceRecord> records = registry.getRecords();

        for (ResourceRecord record : records) {

            // Add current resource
            Resource xmLResource = buildResource(record);
            xmLResource.setPriority(new BigDecimal(record.getPriority()));
            xmLResource.setClassName(record.getMetadata().getResourceClass().getCanonicalName());

            // Add sub-resource locators & methods
            addSubRrcMethodsAndLocators(xmLResource, record);

            resources.getResource().add(xmLResource);
View Full Code Here


    private void addResourceMethods(Map<String, Resource> uri2ResourceMap,
                                    String uri,
                                    org.apache.wink.common.internal.model.admin.Methods xmlSRL) {

        if (uri2ResourceMap.get(uri) != null) {
            Resource r = uri2ResourceMap.get(uri);
            r.getMethods().getMethod().addAll(xmlSRL.getMethod());
        } else {
            Resource newResource = resourcesObjectFactory.createResource();
            newResource.setUri(uri);
            newResource.setMethods(xmlSRL);
            uri2ResourceMap.put(uri, newResource);
        }
    }
View Full Code Here

        return methods;
    }

    private Resource buildResource(ResourceRecord record) {

        Resource newResource = resourcesObjectFactory.createResource();

        // Add dispatched URIs
        UriTemplateProcessor uriTemplate = record.getTemplateProcessor();
        newResource.setUri(SLASH + uriTemplate.getTemplate());

        // Add Collection/Workspace data
        newResource.setWorkspace(record.getMetadata().getWorkspaceName());
        newResource.setCollection(record.getMetadata().getCollectionTitle());

        // Add supported HTTP methods
        List<MethodMetadata> methodRecords = new LinkedList<MethodMetadata>();
        methodRecords.addAll(record.getMetadata().getResourceMethods());
        org.apache.wink.common.internal.model.admin.Methods methods =
            resourcesObjectFactory.createMethods();
        addResourceMethods(methodRecords, methods);
        newResource.setMethods(methods);

        return newResource;

    }
View Full Code Here

        List<ResourceRecord> records = registry.getRecords();

        for (ResourceRecord record : records) {

            // Add current resource
            Resource xmLResource = buildResource(record);
            xmLResource.setPriority(new BigDecimal(record.getPriority()));
            xmLResource.setClassName(record.getMetadata().getResourceClass().getCanonicalName());

            // Add sub-resource locators & methods
            addSubRrcMethodsAndLocators(xmLResource, record);

            resources.getResource().add(xmLResource);
View Full Code Here

    private void addResourceMethods(Map<String, Resource> uri2ResourceMap,
                                    String uri,
                                    org.apache.wink.common.internal.model.admin.Methods xmlSRL) {

        if (uri2ResourceMap.get(uri) != null) {
            Resource r = uri2ResourceMap.get(uri);
            r.getMethods().getMethod().addAll(xmlSRL.getMethod());
        } else {
            Resource newResource = resourcesObjectFactory.createResource();
            newResource.setUri(uri);
            newResource.setMethods(xmlSRL);
            uri2ResourceMap.put(uri, newResource);
        }
    }
View Full Code Here

        return methods;
    }

    private Resource buildResource(ResourceRecord record) {

        Resource newResource = resourcesObjectFactory.createResource();

        // Add dispatched URIs
        UriTemplateProcessor uriTemplate = record.getTemplateProcessor();
        newResource.setUri(SLASH + uriTemplate.getTemplate());

        // Add Collection/Workspace data
        newResource.setWorkspace(record.getMetadata().getWorkspaceName());
        newResource.setCollection(record.getMetadata().getCollectionTitle());

        // Add supported HTTP methods
        List<MethodMetadata> methodRecords = new LinkedList<MethodMetadata>();
        methodRecords.addAll(record.getMetadata().getResourceMethods());
        org.apache.wink.common.internal.model.admin.Methods methods =
            resourcesObjectFactory.createMethods();
        addResourceMethods(methodRecords, methods);
        newResource.setMethods(methods);

        return newResource;

    }
View Full Code Here

        List<ResourceRecord> records = registry.getRecords();

        for (ResourceRecord record : records) {

            // Add current resource
            Resource xmLResource = buildResource(record);
            xmLResource.setPriority(new BigDecimal(record.getPriority()));
            xmLResource.setClassName(record.getMetadata().getResourceClass().getCanonicalName());

            // Add sub-resource locators & methods
            addSubRrcMethodsAndLocators(xmLResource, record);

            resources.getResource().add(xmLResource);
View Full Code Here

    private void addResourceMethods(Map<String, Resource> uri2ResourceMap,
                                    String uri,
                                    org.apache.wink.common.internal.model.admin.Methods xmlSRL) {

        if (uri2ResourceMap.get(uri) != null) {
            Resource r = uri2ResourceMap.get(uri);
            r.getMethods().getMethod().addAll(xmlSRL.getMethod());
        } else {
            Resource newResource = resourcesObjectFactory.createResource();
            newResource.setUri(uri);
            newResource.setMethods(xmlSRL);
            uri2ResourceMap.put(uri, newResource);
        }
    }
View Full Code Here

        return methods;
    }

    private Resource buildResource(ResourceRecord record) {

        Resource newResource = resourcesObjectFactory.createResource();

        // Add dispatched URIs
        UriTemplateProcessor uriTemplate = record.getTemplateProcessor();
        newResource.setUri(SLASH + uriTemplate.getTemplate());

        // Add Collection/Workspace data
        newResource.setWorkspace(record.getMetadata().getWorkspaceName());
        newResource.setCollection(record.getMetadata().getCollectionTitle());

        // Add supported HTTP methods
        List<MethodMetadata> methodRecords = new LinkedList<MethodMetadata>();
        methodRecords.addAll(record.getMetadata().getResourceMethods());
        org.apache.wink.common.internal.model.admin.Methods methods =
            resourcesObjectFactory.createMethods();
        addResourceMethods(methodRecords, methods);
        newResource.setMethods(methods);

        return newResource;

    }
View Full Code Here

        List<ResourceRecord> records = registry.getRecords();

        for (ResourceRecord record : records) {

            // Add current resource
            Resource xmLResource = buildResource(record);
            xmLResource.setPriority(new BigDecimal(record.getPriority()));
            xmLResource.setClassName(record.getMetadata().getResourceClass().getCanonicalName());

            // Add sub-resource locators & methods
            addSubRrcMethodsAndLocators(xmLResource, record);

            resources.getResource().add(xmLResource);
View Full Code Here

TOP

Related Classes of org.apache.wink.common.internal.model.admin.Resource

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.