/** * @return Returns the string representation of the store reference */ public String getStore() { return store == null ? null : store.toString(); }
protected StoreRef getName(StoreRef storeRef, String tenantDomain, boolean checkTenantEnabled) { if (storeRef == null) { return null; } if (tenantDomain != null) { storeRef = new StoreRef(storeRef.getProtocol(), getName(storeRef.getIdentifier(), tenantDomain, checkTenantEnabled)); } return storeRef; }
/** * Create Version Store Ref * * @param storeRef ref * @return store ref for version store */ public static StoreRef convertStoreRef(StoreRef storeRef) { return new StoreRef(StoreRef.PROTOCOL_WORKSPACE, storeRef.getIdentifier()); }
/** * This methods checks whether the specified nodeRef instance is a version nodeRef (ie. in the 'version' store) * * @param nodeRef - version nodeRef * @return <b>true</b> if version nodeRef <b>false</b> otherwise */ protected boolean isVersionNodeRef(NodeRef nodeRef) { return nodeRef.getStoreRef().getProtocol().equals(VersionModel.STORE_PROTOCOL) || nodeRef.getStoreRef().getIdentifier().equals(Version2Model.STORE_ID); }
private void bootstrapVersionTenantStore(ImporterBootstrap versionImporterBootstrap, String tenantDomain) { // Bootstrap Tenant-Specific Version Store StoreRef bootstrapStoreRef = versionImporterBootstrap.getStoreRef(); bootstrapStoreRef = new StoreRef(bootstrapStoreRef.getProtocol(), tenantService.getName(bootstrapStoreRef.getIdentifier(), tenantDomain)); versionImporterBootstrap.setStoreUrl(bootstrapStoreRef.toString()); versionImporterBootstrap.bootstrap(); if (logger.isDebugEnabled()) { logger.debug("Bootstrapped store: "+tenantService.getBaseName(bootstrapStoreRef)+" (Tenant: "+tenantDomain+")"); } }
/** * Sets the root store. * * @param store * store_type://store_id */ public void setStore(String store) { this.storeRef = new StoreRef(store); }
@Before public void before() throws Exception { nodeService = (NodeService)applicationContext.getBean(ServiceRegistry.NODE_SERVICE.getLocalName()); systemBootstrap = (ImporterBootstrap)applicationContext.getBean("systemBootstrap"); storeRef = new StoreRef("system", "Test_" + System.currentTimeMillis()); systemBootstrap.setStoreUrl(storeRef.toString()); systemBootstrap.bootstrap(); this.authenticationComponent = (AuthenticationComponent)this.applicationContext.getBean("authenticationComponent"); this.authenticationComponent.setSystemUserAsCurrentUser(); }
private AccessControlListDAO getACLDAO(StoreRef storeRef) { AccessControlListDAO ret = fProtocolToACLDAO.get(storeRef.getProtocol()); if (ret == null) { return fDefaultACLDAO; } return ret; }
@Override public boolean handle(Pair<Long, NodeRef> nodePair) { NodeRef nodeRef = nodePair.getSecond(); if (storeRef == null || nodeRef.getStoreRef().equals(storeRef)) { result.add(nodeRef); } // Always ask for the next one return true; } }
/** * @return the store id for the node */ public String getStoreId() { return this.nodeRef.getStoreRef().getIdentifier(); }
private void bootstrapVersionTenantStore(ImporterBootstrap versionImporterBootstrap, String tenantDomain) { // Bootstrap Tenant-Specific Version Store StoreRef bootstrapStoreRef = versionImporterBootstrap.getStoreRef(); bootstrapStoreRef = new StoreRef(bootstrapStoreRef.getProtocol(), tenantService.getName(bootstrapStoreRef.getIdentifier(), tenantDomain)); versionImporterBootstrap.setStoreUrl(bootstrapStoreRef.toString()); versionImporterBootstrap.bootstrap(); if (logger.isDebugEnabled()) { logger.debug("Bootstrapped store: "+tenantService.getBaseName(bootstrapStoreRef)+" (Tenant: "+tenantDomain+")"); } }
@Override protected String getItemURI(NodeRef item) { StringBuilder builder = new StringBuilder("/api/node/"); builder.append(item.getStoreRef().getProtocol()).append("/"); builder.append(item.getStoreRef().getIdentifier()).append("/"); builder.append(item.getId()); return builder.toString(); }
/** * @param defaultStoreStr the defaultStoreStr to set */ public void setDefaultStore(String defaultStoreStr) { this.defaultStore = new StoreRef(defaultStoreStr); } }
@Test public void testBootstrap() { StoreRef bootstrapStoreRef = new StoreRef(StoreRef.PROTOCOL_WORKSPACE, "Test_" + System.currentTimeMillis()); importerBootstrap.setStoreUrl(bootstrapStoreRef.toString()); importerBootstrap.bootstrap(); authenticationComponent.setSystemUserAsCurrentUser(); System.out.println(NodeStoreInspector.dumpNodeStore(nodeService, bootstrapStoreRef)); }
/** * Create Version Store Ref * * @param storeRef ref * @return store ref for version store */ public static StoreRef convertStoreRef(StoreRef storeRef) { return new StoreRef(StoreRef.PROTOCOL_WORKSPACE, storeRef.getIdentifier()); }
/** * @return the store type for the node */ public String getStoreType() { return this.nodeRef.getStoreRef().getProtocol(); }
@Override public boolean handle(Pair<Long, NodeRef> nodePair) { NodeRef nodeRef = nodePair.getSecond(); if (storeRef == null || nodeRef.getStoreRef().equals(storeRef)) { result.add(nodeRef); } // Always ask for the next one return true; } }
/** * @return the store id for the node */ public String getStoreId() { return this.nodeRef.getStoreRef().getIdentifier(); }
private void bootstrapSpacesArchiveTenantStore(ImporterBootstrap spacesArchiveImporterBootstrap, String tenantDomain) { // Bootstrap Tenant-Specific Spaces Archive Store StoreRef bootstrapStoreRef = spacesArchiveImporterBootstrap.getStoreRef(); bootstrapStoreRef = new StoreRef(bootstrapStoreRef.getProtocol(), tenantService.getName(bootstrapStoreRef.getIdentifier(), tenantDomain)); spacesArchiveImporterBootstrap.setStoreUrl(bootstrapStoreRef.toString()); // override default property (archive://SpacesStore) List<String> mustNotExistStoreUrls = new ArrayList<String>(); mustNotExistStoreUrls.add(bootstrapStoreRef.toString()); spacesArchiveImporterBootstrap.setMustNotExistStoreUrls(mustNotExistStoreUrls); spacesArchiveImporterBootstrap.bootstrap(); if (logger.isDebugEnabled()) { logger.debug("Bootstrapped store: "+tenantService.getBaseName(bootstrapStoreRef)+" (Tenant: "+tenantDomain+")"); } }
@Override public String stringifyRepositoryLocation(RepositoryNodeRef repositoryNodeRef) throws ReferenceEncodingException { NodeRef nodeRef = repositoryNodeRef.getNodeRef(); StoreRef storeRef = nodeRef.getStoreRef(); return NODE + DELIMITER + storeRef.getProtocol() + DELIMITER + storeRef.getIdentifier() + DELIMITER + nodeRef.getId(); }