Java Code Examples for org.alfresco.service.cmr.security.AuthorityService#ZONE_AUTH_EXT_PREFIX

The following examples show how to use org.alfresco.service.cmr.security.AuthorityService#ZONE_AUTH_EXT_PREFIX . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: ChainingUserRegistrySynchronizer.java    From alfresco-repository with GNU Lesser General Public License v3.0 5 votes vote down vote up
public Set<QName> getPersonMappedProperties(String username)
{
    Set<String> authorityZones = this.authorityService.getAuthorityZones(username);
    if (authorityZones == null)
    {
        return Collections.emptySet();
    }
    Collection<String> instanceIds = this.applicationContextManager.getInstanceIds();

    // Visit the user registries in priority order and return the person mapping of the first registry that matches
    // one of the person's zones
    for (String id : instanceIds)
    {
        String zoneId = AuthorityService.ZONE_AUTH_EXT_PREFIX + id;
        if (!authorityZones.contains(zoneId))
        {
            continue;
        }
        try
        {
            ApplicationContext context = this.applicationContextManager.getApplicationContext(id);
            UserRegistry plugin = (UserRegistry) context.getBean(this.sourceBeanName);
            if (!(plugin instanceof ActivateableBean) || ((ActivateableBean) plugin).isActive())
            {
                return plugin.getPersonMappedProperties();
            }
        }
        catch (RuntimeException e)
        {
            // The bean doesn't exist or this subsystem won't start. The reason would have been logged. Ignore and continue.
        }
    }

    return Collections.emptySet();
}
 
Example 2
Source File: ChainingUserRegistrySynchronizer.java    From alfresco-repository with GNU Lesser General Public License v3.0 5 votes vote down vote up
@Override
public Date getSynchronizationLastUserUpdateTime(String id)
{
    String zoneId = AuthorityService.ZONE_AUTH_EXT_PREFIX + id;
    long time = getMostRecentUpdateTime(ChainingUserRegistrySynchronizer.PERSON_LAST_MODIFIED_ATTRIBUTE, zoneId, false);
    Date lastUserUpdate = time == -1 ? null : new Date(time);
    return lastUserUpdate;
}
 
Example 3
Source File: ChainingUserRegistrySynchronizer.java    From alfresco-repository with GNU Lesser General Public License v3.0 5 votes vote down vote up
@Override
public Date getSynchronizationLastGroupUpdateTime(String id)
{
    String zoneId = AuthorityService.ZONE_AUTH_EXT_PREFIX + id;
    long time = getMostRecentUpdateTime(ChainingUserRegistrySynchronizer.GROUP_LAST_MODIFIED_ATTRIBUTE, zoneId, false);
    Date lastGroupUpdate = time == -1 ? null : new Date(time);
    return lastGroupUpdate;
}