@Test public void shouldGetNodeTypesForRepository() throws Exception { NodeTypes nodeTypes = REST_CLIENT.getNodeTypes(); assertFalse(nodeTypes.isEmpty()); assertNotNull(nodeTypes.getNodeType("nt:base")); assertNotNull(nodeTypes.getNodeType("nt:unstructured")); assertNull(nodeTypes.getNodeType("foobar")); }
public NodeTypes getNodeTypes() { String url = jsonRestClient.appendToURL(ITEMS_METHOD, NODE_TYPES_SEGMENT); JSONRestClient.Response response = jsonRestClient.doGet(url); if (!response.isOK()) { throw new RuntimeException(JdbcI18n.invalidServerResponse.text(url, response.asString())); } return new NodeTypes(response.json()); }
ModeShapeRestClient { public NodeTypes getNodeTypes() { String url = jsonRestClient.appendToURL(ITEMS_METHOD, NODE_TYPES_SEGMENT); JSONRestClient.Response response = jsonRestClient.doGet(url); if (!response.isOK()) { throw new RuntimeException(JdbcI18n.invalidServerResponse.text(url, response.asString())); } return new NodeTypes(response.json()); } }
ModeShapeRestClient { public NodeTypes getNodeTypes() { String url = jsonRestClient.appendToURL(ITEMS_METHOD, NODE_TYPES_SEGMENT); JSONRestClient.Response response = jsonRestClient.doGet(url); if (!response.isOK()) { throw new RuntimeException(JdbcI18n.invalidServerResponse.text(url, response.asString())); } return new NodeTypes(response.json()); } ModeShapeRestClient( String repoUrl,
                                String username,
                                String password ); }
ModeShapeRestClient { public NodeTypes getNodeTypes() { String url = jsonRestClient.appendToURL(ITEMS_METHOD, NODE_TYPES_SEGMENT); JSONRestClient.Response response = jsonRestClient.doGet(url); if (!response.isOK()) { throw new RuntimeException(JdbcI18n.invalidServerResponse.text(url, response.asString())); } return new NodeTypes(response.json()); } ModeShapeRestClient( String repoUrl,
                                String username,
                                String password ); String serverUrl(); Repositories getRepositories(); Repositories.Repository getRepository( String name ); Workspaces getWorkspaces( String repositoryName ); NodeTypes getNodeTypes(); QueryResult query( String query,
                              String queryLanguage ); String queryPlan( String query,
                             String queryLanguage ); }
ModeShapeRestClient { public NodeTypes getNodeTypes() { String url = jsonRestClient.appendToURL(ITEMS_METHOD, NODE_TYPES_SEGMENT); JSONRestClient.Response response = jsonRestClient.doGet(url); if (!response.isOK()) { throw new RuntimeException(JdbcI18n.invalidServerResponse.text(url, response.asString())); } return new NodeTypes(response.json()); } ModeShapeRestClient( String repoUrl,
                                String username,
                                String password ); String serverUrl(); Repositories getRepositories(); Repositories.Repository getRepository( String name ); Workspaces getWorkspaces( String repositoryName ); NodeTypes getNodeTypes(); QueryResult query( String query,
                              String queryLanguage ); String queryPlan( String query,
                             String queryLanguage );  }