Search in sources :

Example 6 with ExtensibleEntity

use of com.thinkbiganalytics.metadata.api.extension.ExtensibleEntity in project kylo by Teradata.

the class JcrExtensibleEntityProvider method getEntities.

public List<ExtensibleEntity> getEntities(String typeName) {
    String qualifiedName = ((JcrExtensibleTypeProvider) this.typeProvider).ensureTypeName(typeName);
    List<ExtensibleEntity> list = new ArrayList<>();
    Session session = getSession();
    try {
        String path = EntityUtil.pathForExtensibleEntity(qualifiedName);
        if (session.nodeExists(path)) {
            Node typeNameNode = session.getNode(path);
            NodeIterator entityItr = typeNameNode.getNodes();
            while (entityItr.hasNext()) {
                Node entNode = (Node) entityItr.next();
                list.add(new JcrExtensibleEntity(entNode));
            }
        }
        return list;
    } catch (RepositoryException e) {
        throw new MetadataRepositoryException("Failed to retrieve list of extensible entities", e);
    }
}
Also used : NodeIterator(javax.jcr.NodeIterator) MetadataRepositoryException(com.thinkbiganalytics.metadata.modeshape.MetadataRepositoryException) Node(javax.jcr.Node) ArrayList(java.util.ArrayList) MetadataRepositoryException(com.thinkbiganalytics.metadata.modeshape.MetadataRepositoryException) RepositoryException(javax.jcr.RepositoryException) ExtensibleEntity(com.thinkbiganalytics.metadata.api.extension.ExtensibleEntity) Session(javax.jcr.Session)

Aggregations

ExtensibleEntity (com.thinkbiganalytics.metadata.api.extension.ExtensibleEntity)6 Node (javax.jcr.Node)4 Feed (com.thinkbiganalytics.metadata.api.feed.Feed)2 MetadataRepositoryException (com.thinkbiganalytics.metadata.modeshape.MetadataRepositoryException)2 JcrFeed (com.thinkbiganalytics.metadata.modeshape.feed.JcrFeed)2 JcrServiceLevelAgreement (com.thinkbiganalytics.metadata.modeshape.sla.JcrServiceLevelAgreement)2 ServiceLevelAgreement (com.thinkbiganalytics.metadata.sla.api.ServiceLevelAgreement)2 ArrayList (java.util.ArrayList)2 NodeIterator (javax.jcr.NodeIterator)2 RepositoryException (javax.jcr.RepositoryException)2 Session (javax.jcr.Session)2 SpringBootTest (org.springframework.boot.test.context.SpringBootTest)2 Test (org.testng.annotations.Test)2 ExtensibleType (com.thinkbiganalytics.metadata.api.extension.ExtensibleType)1 HashMap (java.util.HashMap)1