/** * */ protected AbstractNodeServiceImpl() { this.uuid = GUID.generate(); }
private synchronized String getInputHandle(InputStream in) { String handle = GUID.generate(); fInputStreams.put(handle, in); fInputLastAccessTimes.put(handle, System.currentTimeMillis()); fInputBusy.put(handle, false); return handle; } }
private synchronized String getOutputHandle(OutputStream out) { String handle = GUID.generate(); fOutputStreams.put(handle, out); fOutputLastAccessTimes.put(handle, System.currentTimeMillis()); fOutputBusy.put(handle, false); return handle; }
public CompositeRenditionDefinition createCompositeRenditionDefinition(QName renditionName) { if (log.isDebugEnabled()) { StringBuilder msg = new StringBuilder(); msg.append("Creating composite rendition definition ") .append(renditionName); log.debug(msg.toString()); } return new CompositeRenditionDefinitionImpl(GUID.generate(), renditionName); }
private void split(Set<NodeRef> toSplit) { for (NodeRef nodeRef : toSplit) { String userName = (String) nodeService.getProperty(nodeRef, ContentModel.PROP_USERNAME); String newUserName = userName + GUID.generate(); nodeService.setProperty(nodeRef, ContentModel.PROP_USERNAME, userName + GUID.generate()); logger.info(" New person object: " + newUserName); } }
public static String createNewFileStoreUrl(int minuteBucketCount) { StringBuilder sb = new StringBuilder(20); sb.append(FileContentStore.STORE_PROTOCOL); sb.append(ContentStore.PROTOCOL_DELIMITER); sb.append(createTimeBasedPath(minuteBucketCount)); sb.append(GUID.generate()).append(".bin"); return sb.toString(); } }
/** * {@inheritDoc} */ @Override public String getLock(QName lockQName, long timeToLive, long retryWait, int retryCount) { String lockToken = GUID.generate(); getLockImpl(lockToken, lockQName, timeToLive, retryWait, retryCount); // Done return lockToken; }
public ReplicationDefinition createReplicationDefinition( String replicationDefinitionName, String description) { if (log.isDebugEnabled()) { StringBuilder msg = new StringBuilder(); msg.append("Creating replication definition ") .append(replicationDefinitionName); log.debug(msg.toString()); } return new ReplicationDefinitionImpl(GUID.generate(), replicationDefinitionName, description); }
/** * @see org.alfresco.service.cmr.action.ActionService#createAction(String) */ public Action createAction(String name) { return new ActionImpl(null, GUID.generate(), name, null); }
/** * @see org.alfresco.service.cmr.action.ActionService#createCompositeAction() */ public CompositeAction createCompositeAction() { return new CompositeActionImpl(null, GUID.generate()); }
/** * Constructs the rule with a reference to a {@link ApplicationContextInit rule} which can be used to retrieve the ApplicationContext. * A GUID-generated username will be used for the test user. * * @param appContextRule a rule which can be used to retrieve the spring app context. */ public AlfrescoPerson(ApplicationContextInit appContextRule) { this(appContextRule, GUID.generate()); }
/** * Constructs the rule with a reference to a {@link ApplicationContextInit rule} which can be used to retrieve the ApplicationContext. * A GUID-generated tenant name will be used for the test user. * * @param appContextRule a rule which can be used to retrieve the spring app context. */ public AlfrescoTenant(ApplicationContextInit appContextRule) { this(appContextRule, GUID.generate()); }
@Override public String createNewFileStoreUrl() { StringBuilder sb = new StringBuilder(20); sb.append(FileContentStore.STORE_PROTOCOL) .append(ContentStore.PROTOCOL_DELIMITER) .append(chooseVolume()).append("/") .append(TimeBasedFileContentUrlProvider.createTimeBasedPath(bucketsPerMinute)) .append(GUID.generate()).append(".bin"); String newContentUrl = sb.toString(); return newContentUrl; }
public String getCurrentTicket() { String currentUser = getCurrentUserName(); String ticket = userToTicket.get(currentUser); if (ticket == null) { ticket = GUID.generate(); userToTicket.put(currentUser, ticket); } return ticket; }
private void createPersistentSchedule(ScheduledPersistedActionImpl schedule) { ChildAssociationRef childAssoc = nodeService.createNode(SCHEDULED_ACTION_ROOT_NODE_REF, ContentModel.ASSOC_CONTAINS, QName.createQName(GUID.generate()), ActionModel.TYPE_ACTION_SCHEDULE); schedule.setPersistedAtNodeRef(childAssoc.getChildRef()); }
public void testUserShouldBeAbleToUpdateTheProfile() { final String USERNAME = GUID.generate(); NodeRef personRef = personService.createPerson(createDefaultProperties(USERNAME, "Aa", "Aa", "aa@aa", "alfresco", rootNodeRef)); AuthenticationUtil.setFullyAuthenticatedUser(USERNAME); nodeService.setProperty(personRef, ContentModel.PROP_FIRSTNAME, "myUpdatedFirstName"); }
public void testCreateLocale() throws Exception { // Create a locale Locale locale = new Locale(GUID.generate().substring(0, 20)); Pair<Long, Locale> localePair = getLocale(locale, true); // Check that it can be retrieved Pair<Long, Locale> localePairCheck = getLocale(localePair.getSecond(), true); assertEquals("Locale ID changed", localePair.getFirst(), localePairCheck.getFirst()); // Check the duplicate checking getLocale(locale, false); }
/** * From CLOUD-957, insure that GROUP_EVERYONE does not have read access to moderated sites' containers. */ @Test public void testModeratedSite() throws Exception { String siteName = GUID.generate(); SiteInfo siteInfo = createSite(siteName, "doclib", SiteVisibility.MODERATED); NodeRef container = this.siteService.getContainer(siteInfo.getShortName(), "doclib"); assertNull("GROUP_EVERYONE shouldn't have any permissions on a moderated site's containers", getAllowedPermissionsMap(container).get(PermissionService.ALL_AUTHORITIES)); }
public void testCreateNamespace() throws Exception { // Create a namespace String uri = GUID.generate(); Pair<Long, String> namespacePair = getNamespace(uri, true, true); // Check that it can be retrieved Pair<Long, String> namespacePairCheck = getNamespace(namespacePair.getSecond(), false, true); assertEquals("Namespace ID changed", namespacePair.getFirst(), namespacePairCheck.getFirst()); // Check the duplicate checking getNamespace(uri, true, false); }
@Test public void testMultiValuedPropertyComparisons() { ActionConditionImpl condition = new ActionConditionImpl(GUID.generate(), ComparePropertyValueEvaluator.NAME); condition.setParameterValue(ComparePropertyValueEvaluator.PARAM_PROPERTY, PROP_MULTI_VALUE); condition.setParameterValue(ComparePropertyValueEvaluator.PARAM_OPERATION, ComparePropertyValueOperation.CONTAINS.toString()); condition.setParameterValue(ComparePropertyValueEvaluator.PARAM_VALUE, "Document"); assertTrue(this.evaluator.evaluate(condition, this.nodeRef)); condition.setParameterValue(ComparePropertyValueEvaluator.PARAM_VALUE, "bobbins"); assertFalse(this.evaluator.evaluate(condition, this.nodeRef)); }