use of com.google.appengine.api.datastore.Index.IndexState in project appengine-java-standard by GoogleCloudPlatform.
the class DatastoreViewerServlet method doGetIndexes.
private void doGetIndexes(HttpServletRequest req, HttpServletResponse resp) throws IOException {
// Empty namespace parameter equals to no namespace specified
String requestedNamespace = req.getParameter(NAMESPACE);
String namespace = requestedNamespace != null ? requestedNamespace : "";
String savedNamespace = NamespaceManager.get();
try {
NamespaceManager.set(namespace);
DatastoreService ds = DatastoreServiceFactory.getDatastoreService();
Map<Index, IndexState> indexes = ds.getIndexes();
req.setAttribute(INDEXES, indexes);
req.setAttribute(APPLICATION_NAME, ApiProxy.getCurrentEnvironment().getAppId());
try {
getServletContext().getRequestDispatcher("/_ah/adminConsole?subsection=" + Subsection.indexDetails.name()).forward(req, resp);
} catch (ServletException e) {
throw new RuntimeException("Could not forward request", e);
}
} finally {
NamespaceManager.set(savedNamespace);
}
}
Aggregations