当前位置: 首页>>代码示例>>Java>>正文


Java AuthenticationService类代码示例

本文整理汇总了Java中org.alfresco.service.cmr.security.AuthenticationService的典型用法代码示例。如果您正苦于以下问题:Java AuthenticationService类的具体用法?Java AuthenticationService怎么用?Java AuthenticationService使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


AuthenticationService类属于org.alfresco.service.cmr.security包,在下文中一共展示了AuthenticationService类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: authenticateAsGuest

import org.alfresco.service.cmr.security.AuthenticationService; //导入依赖的package包/类
/**
 * {@inheritDoc}
 */
public void authenticateAsGuest() throws AuthenticationException
{
    String defaultGuestName = AuthenticationUtil.getGuestUserName();
    if (defaultGuestName != null && defaultGuestName.length() > 0)
    {
        preAuthenticationCheck(defaultGuestName);
    }
    for (AuthenticationService authService : getUsableAuthenticationServices())
    {
        try
        {
            authService.authenticateAsGuest();
            return;
        }
        catch (AuthenticationException e)
        {
            // Ignore and chain
        }
    }
    throw new AuthenticationException(GUEST_AUTHENTICATION_NOT_SUPPORTED);
}
 
开发者ID:Alfresco,项目名称:alfresco-repository,代码行数:25,代码来源:AbstractChainingAuthenticationService.java

示例2: getCurrentUserName

import org.alfresco.service.cmr.security.AuthenticationService; //导入依赖的package包/类
/**
 * {@inheritDoc}
 */
public String getCurrentUserName() throws AuthenticationException
{
    for (AuthenticationService authService : getUsableAuthenticationServices())
    {
        try
        {
            return authService.getCurrentUserName();
        }
        catch (AuthenticationException e)
        {
            // Ignore and chain
        }
    }
    return null;
}
 
开发者ID:Alfresco,项目名称:alfresco-repository,代码行数:19,代码来源:AbstractChainingAuthenticationService.java

示例3: invalidateUserSession

import org.alfresco.service.cmr.security.AuthenticationService; //导入依赖的package包/类
/**
 * {@inheritDoc}
 */
public void invalidateUserSession(String userName) throws AuthenticationException
{
    for (AuthenticationService authService : getUsableAuthenticationServices())
    {
        try
        {
            authService.invalidateUserSession(userName);
            return;
        }
        catch (AuthenticationException e)
        {
            // Ignore and chain
        }
    }
    throw new AuthenticationException("Unable to invalidate user session");

}
 
开发者ID:Alfresco,项目名称:alfresco-repository,代码行数:21,代码来源:AbstractChainingAuthenticationService.java

示例4: invalidateTicket

import org.alfresco.service.cmr.security.AuthenticationService; //导入依赖的package包/类
/**
 * {@inheritDoc}
 */
public void invalidateTicket(String ticket) throws AuthenticationException
{
    for (AuthenticationService authService : getUsableAuthenticationServices())
    {
        try
        {
            authService.invalidateTicket(ticket);
            return;
        }
        catch (AuthenticationException e)
        {
            // Ignore and chain
        }
    }
    throw new AuthenticationException("Unable to invalidate ticket");

}
 
开发者ID:Alfresco,项目名称:alfresco-repository,代码行数:21,代码来源:AbstractChainingAuthenticationService.java

示例5: validate

import org.alfresco.service.cmr.security.AuthenticationService; //导入依赖的package包/类
/**
 * {@inheritDoc}
 */
public void validate(String ticket) throws AuthenticationException
{
    for (AuthenticationService authService : getUsableAuthenticationServices())
    {
        try
        {
            authService.validate(ticket);
            return;
        }
        catch (AuthenticationException e)
        {
            // Ignore and chain
        }
    }
    throw new AuthenticationException("Unable to validate ticket");

}
 
开发者ID:Alfresco,项目名称:alfresco-repository,代码行数:21,代码来源:AbstractChainingAuthenticationService.java

示例6: getCurrentTicket

import org.alfresco.service.cmr.security.AuthenticationService; //导入依赖的package包/类
/**
 * {@inheritDoc}
 */
public String getCurrentTicket()
{
    for (AuthenticationService authService : getUsableAuthenticationServices())
    {
        try
        {
            return authService.getCurrentTicket();
        }
        catch (AuthenticationException e)
        {
            // Ignore and chain
        }
    }
    throw new AuthenticationException("Unable to issue ticket");
}
 
开发者ID:Alfresco,项目名称:alfresco-repository,代码行数:19,代码来源:AbstractChainingAuthenticationService.java

示例7: getNewTicket

import org.alfresco.service.cmr.security.AuthenticationService; //导入依赖的package包/类
/**
 * {@inheritDoc}
 */
public String getNewTicket()
{
    for (AuthenticationService authService : getUsableAuthenticationServices())
    {
        try
        {
            return authService.getNewTicket();
        }
        catch (AuthenticationException e)
        {
            // Ignore and chain
        }
    }
    throw new AuthenticationException("Unable to issue ticket");
}
 
开发者ID:Alfresco,项目名称:alfresco-repository,代码行数:19,代码来源:AbstractChainingAuthenticationService.java

示例8: clearCurrentSecurityContext

import org.alfresco.service.cmr.security.AuthenticationService; //导入依赖的package包/类
/**
 * {@inheritDoc}
 */
public void clearCurrentSecurityContext()
{
    for (AuthenticationService authService : getUsableAuthenticationServices())
    {
        try
        {
            authService.clearCurrentSecurityContext();
            return;
        }
        catch (AuthenticationException e)
        {
            // Ignore and chain
        }
    }
    throw new AuthenticationException("Failed to clear security context");

}
 
开发者ID:Alfresco,项目名称:alfresco-repository,代码行数:21,代码来源:AbstractChainingAuthenticationService.java

示例9: isCurrentUserTheSystemUser

import org.alfresco.service.cmr.security.AuthenticationService; //导入依赖的package包/类
/**
 * {@inheritDoc}
 */
public boolean isCurrentUserTheSystemUser()
{
    for (AuthenticationService authService : getUsableAuthenticationServices())
    {
        try
        {
            return authService.isCurrentUserTheSystemUser();
        }
        catch (AuthenticationException e)
        {
            // Ignore and chain
        }
    }
    return false;
}
 
开发者ID:Alfresco,项目名称:alfresco-repository,代码行数:19,代码来源:AbstractChainingAuthenticationService.java

示例10: getUsableAuthenticationServices

import org.alfresco.service.cmr.security.AuthenticationService; //导入依赖的package包/类
@Override
protected List<AuthenticationService> getUsableAuthenticationServices()
{
    if (this.mutableAuthenticationService == null)
    {
        return this.authenticationServices;
    }
    else
    {
        ArrayList<AuthenticationService> services = new ArrayList<AuthenticationService>(
                this.authenticationServices == null ? 1 : this.authenticationServices.size() + 1);
        services.add(this.mutableAuthenticationService);
        if (this.authenticationServices != null)
        {
            services.addAll(this.authenticationServices);
        }
        return services;
    }
}
 
开发者ID:Alfresco,项目名称:alfresco-repository,代码行数:20,代码来源:ChainingAuthenticationServiceImpl.java

示例11: getId

import org.alfresco.service.cmr.security.AuthenticationService; //导入依赖的package包/类
@Override
protected String getId(AuthenticationService authService)
{
    this.lock.readLock().lock();
    try
    {
        for (String instance : this.instanceIds)
        {
            if (authService.equals(this.sourceBeans.get(instance)))
            {
                return instance;
            }
        }
    }
    finally
    {
        this.lock.readLock().unlock();
    }
    return super.getId(authService);
}
 
开发者ID:Alfresco,项目名称:alfresco-repository,代码行数:21,代码来源:SubsystemChainingAuthenticationService.java

示例12: TaskFormPersister

import org.alfresco.service.cmr.security.AuthenticationService; //导入依赖的package包/类
public TaskFormPersister(ContentModelItemData<WorkflowTask> itemData,
            NamespaceService namespaceService,
            DictionaryService dictionaryService,
            WorkflowService workflowService,
            NodeService nodeService,
            AuthenticationService authenticationService,
            BehaviourFilter behaviourFilter, Log logger)
{
    super(itemData, namespaceService, dictionaryService, logger);
    WorkflowTask item = itemData.getItem();

    // make sure that the task is not already completed
    if (item.getState().equals(WorkflowTaskState.COMPLETED))
    {
        throw new AlfrescoRuntimeException("workflowtask.already.done.error");
    }

    // make sure the current user is able to edit the task
    if (!workflowService.isTaskEditable(item, authenticationService.getCurrentUserName()))
    {
        throw new AccessDeniedException("Failed to update task with id '" + item.getId() + "'.");
    }
    
    this.updater = new TaskUpdater(item.getId(), workflowService, nodeService, behaviourFilter);
}
 
开发者ID:Alfresco,项目名称:alfresco-repository,代码行数:26,代码来源:TaskFormPersister.java

示例13: HttpAlfrescoContentReader

import org.alfresco.service.cmr.security.AuthenticationService; //导入依赖的package包/类
public HttpAlfrescoContentReader(
        TransactionService transactionService,
        AuthenticationService authenticationService,
        String baseHttpUrl,
        String contentUrl)
{
    super(contentUrl);
    this.transactionService = transactionService;
    this.authenticationService = authenticationService;
    this.baseHttpUrl = baseHttpUrl;
    // Helpers
    this.httpClient = new HttpClient();
    this.ticketCallback = new PropagateTicketCallback();
    // A trip to the remote server has not been made
    cachedExists = false;
    cachedSize = 0L;
    cachedLastModified = 0L;
}
 
开发者ID:Alfresco,项目名称:alfresco-repository,代码行数:19,代码来源:HttpAlfrescoContentReader.java

示例14: testServiceOne_AuthFail

import org.alfresco.service.cmr.security.AuthenticationService; //导入依赖的package包/类
public void testServiceOne_AuthFail()
{
    ChainingAuthenticationServiceImpl as = new ChainingAuthenticationServiceImpl();
    ArrayList<AuthenticationService> ases = new ArrayList<AuthenticationService>();
    ases.add(service1);
    as.setAuthenticationServices(ases);
    try
    {
        as.authenticate("andy", "woof".toCharArray());
        fail();
    }
    catch (AuthenticationException e)
    {

    }
}
 
开发者ID:Alfresco,项目名称:alfresco-repository,代码行数:17,代码来源:ChainingAuthenticationServiceTest.java

示例15: testServiceOne_GuestDenied

import org.alfresco.service.cmr.security.AuthenticationService; //导入依赖的package包/类
public void testServiceOne_GuestDenied()
{
    ChainingAuthenticationServiceImpl as = new ChainingAuthenticationServiceImpl();
    ArrayList<AuthenticationService> ases = new ArrayList<AuthenticationService>();
    ases.add(service1);
    as.setAuthenticationServices(ases);
    try
    {
        as.authenticateAsGuest();
        fail();
    }
    catch (AuthenticationException e)
    {

    }

}
 
开发者ID:Alfresco,项目名称:alfresco-repository,代码行数:18,代码来源:ChainingAuthenticationServiceTest.java


注:本文中的org.alfresco.service.cmr.security.AuthenticationService类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。