public final class ModeShapeRestClient extends Object
JSONRestClient to an existing ModeShape REST service and unmarshals the
JSON objects into a custom POJO model.| Constructor and Description |
|---|
ModeShapeRestClient(String repoUrl,
String username,
String password)
Creates a new REST client instance which will always use the given URL as the server connection
|
| Modifier and Type | Method and Description |
|---|---|
NodeTypes |
getNodeTypes()
Returns all the node types that are available in the repository from
repoUrl |
Repositories |
getRepositories()
Returns a list with all the available repositories.
|
Repositories.Repository |
getRepository(String name)
Returns a repository which has the given name or
null. |
Workspaces |
getWorkspaces(String repositoryName)
Returns all the workspaces for the named repository.
|
QueryResult |
query(String query,
String queryLanguage)
Runs a query in the specified language against the repository from
repoUrl. |
String |
queryPlan(String query,
String queryLanguage)
Returns a string representation of a query plan in a given language.
|
String |
serverUrl()
Returns the URL this client uses to connect to the server.
|
public ModeShapeRestClient(String repoUrl, String username, String password)
repoUrl - a String representing a connection to a ModeShape REST service in the format:
[protocol]://[host]:[port]/[context]/[repository]/[workspace]. May not be nullusername - a String representing the name of the user to use when authenticating with the above server. May be
null, in which case no authentication will be performed.password - a String the password of the above user, if used. May be nullpublic String serverUrl()
String, never nullpublic Repositories getRepositories()
Repositories instance, never nullpublic Repositories.Repository getRepository(String name)
null.name - the name of a repository; may not be nullRepositories.Repository instace or nullpublic Workspaces getWorkspaces(String repositoryName)
repositoryName - a String the name of a repository; may not be nullWorkspaces instance; never nullpublic NodeTypes getNodeTypes()
repoUrlNodeTypes instance; never nullpublic QueryResult query(String query, String queryLanguage)
repoUrl.query - a String, never nullqueryLanguage - the language of the query, never nullQueryResult instance, never nullQueryCopyright © 2008–2021 JBoss, a division of Red Hat. All rights reserved.