@Test public void shouldNotFindTeiidsWhenWorkspaceIsEmpty() throws Exception { assertThat(this.wsMgr.findTeiids(getTransaction()).length, is(0)); }
public Teiid[] findTeiids( UnitOfWork transaction ) throws KException { ArgCheck.isNotNull( transaction, "transaction" ); ArgCheck.isTrue( ( transaction.getState() == org.komodo.spi.repository.Repository.UnitOfWork.State.NOT_STARTED ), "transaction state is not NOT_STARTED" ); final String[] paths = findByType(transaction, KomodoLexicon.Teiid.NODE_TYPE); Teiid[] result = null; if (paths.length == 0) { result = Teiid.NO_TEIIDS; } else { result = new Teiid[paths.length]; int i = 0; for (final String path : paths) { result[i++] = new TeiidImpl(transaction, getRepository(), path); } } return result; }
WorkspaceManager extends ObjectImpl implements RelationalObject { public Teiid[] findTeiids( UnitOfWork transaction ) throws KException { ArgCheck.isNotNull( transaction, "transaction" ); ArgCheck.isTrue( ( transaction.getState() == org.komodo.spi.repository.Repository.UnitOfWork.State.NOT_STARTED ), "transaction state is not NOT_STARTED" ); final String[] paths = findByType(transaction, KomodoLexicon.Teiid.NODE_TYPE); Teiid[] result = null; if (paths.length == 0) { result = Teiid.NO_TEIIDS; } else { result = new Teiid[paths.length]; int i = 0; for (final String path : paths) { result[i++] = new TeiidImpl(transaction, getRepository(), path); } } return result; } }
WorkspaceManager extends ObjectImpl implements RelationalObject { public Teiid[] findTeiids( UnitOfWork transaction ) throws KException { ArgCheck.isNotNull( transaction, "transaction" ); ArgCheck.isTrue( ( transaction.getState() == org.komodo.spi.repository.Repository.UnitOfWork.State.NOT_STARTED ), "transaction state is not NOT_STARTED" ); final String[] paths = findByType(transaction, KomodoLexicon.Teiid.NODE_TYPE); Teiid[] result = null; if (paths.length == 0) { result = Teiid.NO_TEIIDS; } else { result = new Teiid[paths.length]; int i = 0; for (final String path : paths) { result[i++] = new TeiidImpl(transaction, getRepository(), path); } } return result; } private  WorkspaceManager(Repository repository, UnitOfWork uow ); }
WorkspaceManager extends ObjectImpl implements RelationalObject { public Teiid[] findTeiids( UnitOfWork transaction ) throws KException { ArgCheck.isNotNull( transaction, "transaction" ); ArgCheck.isTrue( ( transaction.getState() == org.komodo.spi.repository.Repository.UnitOfWork.State.NOT_STARTED ), "transaction state is not NOT_STARTED" ); final String[] paths = findByType(transaction, KomodoLexicon.Teiid.NODE_TYPE); Teiid[] result = null; if (paths.length == 0) { result = Teiid.NO_TEIIDS; } else { result = new Teiid[paths.length]; int i = 0; for (final String path : paths) { result[i++] = new TeiidImpl(transaction, getRepository(), path); } } return result; } private  WorkspaceManager(Repository repository, UnitOfWork uow ); static WorkspaceManager getInstance( Repository repository, UnitOfWork transaction); String getOwner(); @Override KomodoType[] getChildTypes(); @Override Filter[] getFilters(); @Override int getTypeId(); @Override KomodoType getTypeIdentifier(UnitOfWork uow); static void uncacheInstance(final Repository repository, final String owner); Model createModel( final UnitOfWork uow,
                              final Vdb vdb,
                              final String modelName ); Dataservice createDataservice( final UnitOfWork uow,
                                        final KomodoObject parent,
                                        final String serviceName ); Connection createConnection( final UnitOfWork uow,
                                        final KomodoObject parent,
                                        final String sourceName ); DdlFile createDdlFile( final UnitOfWork uow,
                                  final KomodoObject parent,
                                  final String ddlFileName,
                                  final byte[] content ); Driver createDriver( UnitOfWork uow,
                                KomodoObject parent,
                                String driverName,
                                final byte[] content ); Driver createDriver( UnitOfWork uow,
                                KomodoObject parent,
                                String driverName); Folder createFolder( final UnitOfWork uow,
                                final KomodoObject parent,
                                final String folderName ); ResourceFile createResourceFile( final UnitOfWork uow,
                                            final KomodoObject parent,
                                            final String resourceFileName,
                                            final byte[] content ); Schema createSchema( final UnitOfWork uow,
                                final KomodoObject parent,
                                final String schemaName ); Teiid createTeiid( final UnitOfWork uow,
                              final KomodoObject parent,
                              final String id ); UdfFile createUdfFile( final UnitOfWork uow,
                                  final KomodoObject parent,
                                  final String udfFileName,
                                  final byte[] content ); Vdb createVdb( final UnitOfWork uow,
                          final KomodoObject parent,
                          final String vdbName,
                          final String externalFilePath ); void delete( final UnitOfWork transaction,
                        final KomodoObject... kobjects ); String[] findByType( final UnitOfWork transaction,
                                final String type,
                                String parentPath,
                                final String namePattern,
                                boolean includeSubTypes); String[] findByType( final UnitOfWork transaction,
                                final String type); String[] findByType( final UnitOfWork transaction,
                                final String type,
                                boolean includeSubTypes); Model[] findModels( final UnitOfWork transaction ); Schema[] findSchemas( final UnitOfWork transaction ); Dataservice[] findDataservices( UnitOfWork transaction ); Connection[] findConnections( UnitOfWork transaction ); Driver[] findDrivers( UnitOfWork transaction ); Teiid[] findTeiids( UnitOfWork transaction ); Vdb[] findVdbs( final UnitOfWork transaction ); @Override void remove( final UnitOfWork transaction ); @Override final void rename( final UnitOfWork transaction,
                              final String newName ); T resolve( final UnitOfWork transaction,
                                                 final Object object,
                                                 final Class<T> resolvedClass ); @Override void setFilters( Filter[] newFilters ); ImportMessages importArtifact(final UnitOfWork transaction,
                                         final KomodoObject parent,
                                         StorageReference storageRef); ImportMessages importArtifact(final UnitOfWork transaction,
                                         final KomodoObject parent, 
                                         StorageReference storageRef,
                                         ImportOptions importOptions); String exportArtifact(final UnitOfWork transaction, final Exportable artifact,
                                       final String storageType, final Properties parameters); }
WorkspaceManager extends ObjectImpl implements RelationalObject { public Teiid[] findTeiids( UnitOfWork transaction ) throws KException { ArgCheck.isNotNull( transaction, "transaction" ); ArgCheck.isTrue( ( transaction.getState() == org.komodo.spi.repository.Repository.UnitOfWork.State.NOT_STARTED ), "transaction state is not NOT_STARTED" ); final String[] paths = findByType(transaction, KomodoLexicon.Teiid.NODE_TYPE); Teiid[] result = null; if (paths.length == 0) { result = Teiid.NO_TEIIDS; } else { result = new Teiid[paths.length]; int i = 0; for (final String path : paths) { result[i++] = new TeiidImpl(transaction, getRepository(), path); } } return result; } private  WorkspaceManager(Repository repository, UnitOfWork uow ); static WorkspaceManager getInstance( Repository repository, UnitOfWork transaction); String getOwner(); @Override KomodoType[] getChildTypes(); @Override Filter[] getFilters(); @Override int getTypeId(); @Override KomodoType getTypeIdentifier(UnitOfWork uow); static void uncacheInstance(final Repository repository, final String owner); Model createModel( final UnitOfWork uow,
                              final Vdb vdb,
                              final String modelName ); Dataservice createDataservice( final UnitOfWork uow,
                                        final KomodoObject parent,
                                        final String serviceName ); Connection createConnection( final UnitOfWork uow,
                                        final KomodoObject parent,
                                        final String sourceName ); DdlFile createDdlFile( final UnitOfWork uow,
                                  final KomodoObject parent,
                                  final String ddlFileName,
                                  final byte[] content ); Driver createDriver( UnitOfWork uow,
                                KomodoObject parent,
                                String driverName,
                                final byte[] content ); Driver createDriver( UnitOfWork uow,
                                KomodoObject parent,
                                String driverName); Folder createFolder( final UnitOfWork uow,
                                final KomodoObject parent,
                                final String folderName ); ResourceFile createResourceFile( final UnitOfWork uow,
                                            final KomodoObject parent,
                                            final String resourceFileName,
                                            final byte[] content ); Schema createSchema( final UnitOfWork uow,
                                final KomodoObject parent,
                                final String schemaName ); Teiid createTeiid( final UnitOfWork uow,
                              final KomodoObject parent,
                              final String id ); UdfFile createUdfFile( final UnitOfWork uow,
                                  final KomodoObject parent,
                                  final String udfFileName,
                                  final byte[] content ); Vdb createVdb( final UnitOfWork uow,
                          final KomodoObject parent,
                          final String vdbName,
                          final String externalFilePath ); void delete( final UnitOfWork transaction,
                        final KomodoObject... kobjects ); String[] findByType( final UnitOfWork transaction,
                                final String type,
                                String parentPath,
                                final String namePattern,
                                boolean includeSubTypes); String[] findByType( final UnitOfWork transaction,
                                final String type); String[] findByType( final UnitOfWork transaction,
                                final String type,
                                boolean includeSubTypes); Model[] findModels( final UnitOfWork transaction ); Schema[] findSchemas( final UnitOfWork transaction ); Dataservice[] findDataservices( UnitOfWork transaction ); Connection[] findConnections( UnitOfWork transaction ); Driver[] findDrivers( UnitOfWork transaction ); Teiid[] findTeiids( UnitOfWork transaction ); Vdb[] findVdbs( final UnitOfWork transaction ); @Override void remove( final UnitOfWork transaction ); @Override final void rename( final UnitOfWork transaction,
                              final String newName ); T resolve( final UnitOfWork transaction,
                                                 final Object object,
                                                 final Class<T> resolvedClass ); @Override void setFilters( Filter[] newFilters ); ImportMessages importArtifact(final UnitOfWork transaction,
                                         final KomodoObject parent,
                                         StorageReference storageRef); ImportMessages importArtifact(final UnitOfWork transaction,
                                         final KomodoObject parent, 
                                         StorageReference storageRef,
                                         ImportOptions importOptions); String exportArtifact(final UnitOfWork transaction, final Exportable artifact,
                                       final String storageType, final Properties parameters); static final int TYPE_ID; }