public List<ResourceTreeEntity> getHomes(boolean all) throws NamespaceException, UnsupportedEncodingException { final List<ResourceTreeEntity> resources = Lists.newArrayList(); if (all) { for (HomeConfig homeConfig : namespaceService.get().getHomeSpaces()) { resources.add(new ResourceTreeEntity(homeConfig)); } } else { resources.add(new ResourceTreeEntity(namespaceService.get().getHome( new NamespaceKey(HomeName.getUserHomePath(securityContext.getUserPrincipal().getName()).getName())))); } return resources; }
private HomeConfig getHomeForCurrentUser() throws NamespaceException { HomePath homePath = new HomePath(HomeName.getUserHomePath(context.getUserPrincipal().getName())); return namespaceService.getHome(homePath.toNamespaceKey()); }
try { final NamespaceKey homeKey = new HomePath(HomeName.getUserHomePath(userName.getName())).toNamespaceKey(); final HomeConfig homeConfig = namespaceService.getHome(homeKey); namespaceService.deleteHome(homeKey, homeConfig.getTag()); } catch (NamespaceNotFoundException ex) {
@GET @Produces(MediaType.APPLICATION_JSON) public Home getHome(@QueryParam("includeContents") @DefaultValue("true") boolean includeContents) throws NamespaceException, HomeNotFoundException, DatasetNotFoundException { try { long dsCount = namespaceService.getDatasetCount(homePath.toNamespaceKey(), BoundedDatasetCount.SEARCH_TIME_LIMIT_MS, BoundedDatasetCount.COUNT_LIMIT_TO_STOP_SEARCH).getCount(); final HomeConfig homeConfig = namespaceService.getHome(homePath.toNamespaceKey()).setExtendedConfig(new ExtendedConfig().setDatasetCount(dsCount)); Home home = newHome(homePath, homeConfig); if (includeContents) { home.setContents(newNamespaceTree(namespaceService.list(homePath.toNamespaceKey()))); } return home; } catch (NamespaceNotFoundException nfe) { throw new HomeNotFoundException(homePath.getHomeName(), nfe); } }
root = new ResourceTreeEntity(namespaceService.get().getHome(new NamespaceKey(expandPathList.get(0)))); resources.add(root); } catch (NamespaceException nse) {
final NamespaceKey homeKey = new HomePath(HomeName.getUserHomePath(userConfig.getUserName())).toNamespaceKey(); try { ns.getHome(homeKey); } catch (NamespaceNotFoundException nnfe) {
if ("home".equals(type)) { HomePath homePath = new HomePath(containerName); HomeConfig home = namespaceService.getHome(homePath.toNamespaceKey()); long dsCount = namespaceService.getAllDatasetsCount(homePath.toNamespaceKey()); home.setExtendedConfig(new ExtendedConfig().setDatasetCount(dsCount));
homeConfig.setOwner("user"); homeConfig.setId(new EntityId("home-id")); when(namespaceService.getHome(new HomePath(HomeName.getUserHomePath("user")).toNamespaceKey())).thenReturn(homeConfig);