Package org.wso2.carbon.registry.core

Examples of org.wso2.carbon.registry.core.Collection


            registry.put(r8Path, r8);
        } catch (RegistryException e) {

        }

        Collection collection = registry.searchContent("powerpoint");
        String[] paths = (String[]) collection.getContent();

        assertEquals("Search should return the relevant path corresponding to the content which includes " +
                "submitted keywords.", "/c1/r8", paths[0]);

    }
View Full Code Here


            registry.put(r9Path, r9);
        } catch (RegistryException e) {

        }

        Collection collection = registry.searchContent("pdf");
        String[] paths = (String[]) collection.getContent();

        assertEquals("Search should return the relevant path corresponding to the content which includes " +
                "submitted keywords.", "/c1/r9", paths[0]);

    }
View Full Code Here

        }


        String[] totalPaths = totalPathsArr.toArray(new String[totalPathsArr.size()]);

        Collection c = registry.newCollection();
        c.setContent(totalPaths);

        query = null;
        this.queryPath = null;

        return c;
View Full Code Here

    }

    public void testAxis2Repository() throws RegistryException {

        String axis2Path = "/axis2test";
        Collection axis2 = registry.newCollection();
        axis2.setMediaType("application/vnd.apache.axis2");
        registry.put(axis2Path, axis2);

        assertTrue("axis2 repo conf collection not found.", registry.resourceExists(axis2Path + "/conf"));
        assertTrue("axis2 repo modles collection not found.", registry.resourceExists(axis2Path + "/modules"));
        assertTrue("axis2 repo services collection not found.", registry.resourceExists(axis2Path + "/services"));
View Full Code Here

    }

    public void testEsbRepository() throws RegistryException {

        String esbPath = "/esbtest";
        Collection esb = registry.newCollection();
        esb.setMediaType("application/vnd.wso2.esb");
        registry.put(esbPath, esb);

        assertTrue("esb repo conf collection not found.", registry.resourceExists(esbPath + "/conf"));
        assertTrue("esb repo endpoints collection not found.", registry.resourceExists(esbPath + "/endpoints"));
        assertTrue("esb repo entries collection not found.", registry.resourceExists(esbPath + "/entries"));
View Full Code Here

            if (!registry.resourceExists(minorVersionPath)) {
                String majorVersionPath = RegistryUtils.getParentPath(minorVersionPath);
                if (!registry.resourceExists(majorVersionPath)) {
                    String versionCollectionPath = RegistryUtils.getParentPath(majorVersionPath);
                    if (!registry.resourceExists(versionCollectionPath)) {
                        Collection collection = registry.newCollection();
                        collection.setMediaType(
                                CommonConstants.SLA_VERSION_COLLECTION_MEDIA_TYPE);
                        registry.put(versionCollectionPath, collection);
                        for (String key : smartLifecycleLinks) {
                            Resource linkResource = registry.newResource();
                            linkResource.setMediaType(
                                    CommonConstants.SMART_LIFECYCLE_LINK_MEDIA_TYPE);
                            registry.put(versionCollectionPath +
                                    RegistryConstants.PATH_SEPARATOR + key, linkResource);
                        }
                    }
                    Collection collection = registry.newCollection();
                    collection.setMediaType(CommonConstants.SLA_MAJOR_VERSION_MEDIA_TYPE);
                    registry.put(majorVersionPath, collection);
                }
                Collection collection = registry.newCollection();
                collection.setMediaType(CommonConstants.SLA_MINOR_VERSION_MEDIA_TYPE);
                registry.put(minorVersionPath, collection);
            }
            Collection collection = registry.newCollection();
            collection.setMediaType(CommonConstants.SLA_PATCH_VERSION_MEDIA_TYPE);
            registry.put(patchVersionPath, collection);
        }
        registry.put(slaVersionPath, resource);
    }
View Full Code Here

    }

    public void testWsasRepository() throws RegistryException {

        String wsasPath = "/wsastest";
        Collection wsas = registry.newCollection();
        wsas.setMediaType("application/vnd.wso2.wsas");
        registry.put(wsasPath, wsas);

        assertTrue("wsas repo conf collection not found.", registry.resourceExists(wsasPath + "/conf"));
        assertTrue("wsas repo modles collection not found.", registry.resourceExists(wsasPath + "/modules"));
        assertTrue("wsas repo services collection not found.", registry.resourceExists(wsasPath + "/services"));
View Full Code Here

    }

    public void testSynapseRepository() throws RegistryException {

        String esbPath = "/synapsetest";
        Collection esb = registry.newCollection();
        esb.setMediaType("application/vnd.apache.synapse");
        registry.put(esbPath, esb);

        assertTrue("synapse repo conf collection not found.", registry.resourceExists(esbPath + "/conf"));
        assertTrue("synapse repo endpoints collection not found.", registry.resourceExists(esbPath + "/endpoints"));
        assertTrue("synapse repo entries collection not found.", registry.resourceExists(esbPath + "/entries"));
View Full Code Here

                String msg = path + " is not a collection. Topics should be collections.";
                log.error(msg);
                throw new TopicException(msg);
            }

            Collection topic = (Collection) r;

            List<MapEntry> endpointList = new ArrayList<MapEntry> ();
            List<MapEntry> subtopicList = new ArrayList<MapEntry> ();

            String[] children = (String[]) topic.getContent();
            for(String childPath: children) {
                processTopicChild(childPath, endpointList, subtopicList, registry);
            }
            r.discard();
View Full Code Here

            MapEntry endpointEntry = new MapEntry(RegistryUtils.getResourceName(childPath), childPath);
            endpointList.add(endpointEntry);

        } else if (TopicConstants.SUBSCRIPTIONS_MEDIA_TYPE.equals(r.getMediaType())) {

            Collection subcriptions = (Collection) registry.get(childPath);
            String[] subscriptionPaths = (String[]) subcriptions.getContent();
            subcriptions.discard();
            for (String subscription: subscriptionPaths) {
                processTopicChild(subscription, endpointList, topicList, registry);
            }
        }
        r.discard();
View Full Code Here

TOP

Related Classes of org.wso2.carbon.registry.core.Collection

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.