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


Java NoCredentialsFoundException类代码示例

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


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

示例1: ensureCredentialsFound

import org.alfresco.service.cmr.remoteticket.NoCredentialsFoundException; //导入依赖的package包/类
protected PasswordCredentialsInfo ensureCredentialsFound(String remoteSystemId, BaseCredentialsInfo credentails)
{
    // Check they exist, and are of the right type
    if (credentails == null)
    {
        throw new NoCredentialsFoundException(remoteSystemId);
    }
    if (! (credentails instanceof PasswordCredentialsInfo))
    {
        throw new AlfrescoRuntimeException("Credentials found, but of the wrong type, needed PasswordCredentialsInfo but got " + credentails); 
    }
    return (PasswordCredentialsInfo)credentails;
}
 
开发者ID:Alfresco,项目名称:alfresco-repository,代码行数:14,代码来源:RemoteAlfrescoTicketServiceImpl.java

示例2: getAlfrescoTicket

import org.alfresco.service.cmr.remoteticket.NoCredentialsFoundException; //导入依赖的package包/类
/**
 * Returns the current Alfresco Ticket for the current user on
 *  the remote system, fetching if it isn't already cached.
 */
public RemoteAlfrescoTicketInfo getAlfrescoTicket(String remoteSystemId)
   throws AuthenticationException, NoCredentialsFoundException, NoSuchSystemException, RemoteSystemUnavailableException
{
    // Check we know about the system
    ensureRemoteSystemKnown(remoteSystemId);
    
    // Grab the user's details
    BaseCredentialsInfo creds = getRemoteCredentials(remoteSystemId);
    PasswordCredentialsInfo credentials = ensureCredentialsFound(remoteSystemId, creds);
    
    // Is there a cached ticket?
    String cacheKey = toCacheKey(remoteSystemId, credentials);
    String ticket = ticketsCache.get(cacheKey);
    
    // Refresh if if isn't cached
    if (ticket == null)
    {
        return refreshTicket(remoteSystemId, credentials);
    }
    else
    {
        if (logger.isDebugEnabled())
            logger.debug("Cached ticket found for " + creds.getRemoteUsername() + " on " + remoteSystemId);
            
        // Wrap and return
        return new AlfTicketRemoteAlfrescoTicketImpl(ticket);
    }
}
 
开发者ID:Alfresco,项目名称:alfresco-repository,代码行数:33,代码来源:RemoteAlfrescoTicketServiceImpl.java

示例3: refetchAlfrescoTicket

import org.alfresco.service.cmr.remoteticket.NoCredentialsFoundException; //导入依赖的package包/类
/**
 * Forces a re-fetch of the Alfresco Ticket for the current user,
 *  if possible, and marks the credentials as failing if not. 
 */
public RemoteAlfrescoTicketInfo refetchAlfrescoTicket(String remoteSystemId)
   throws AuthenticationException, NoCredentialsFoundException, NoSuchSystemException, RemoteSystemUnavailableException
{
    // Check we know about the system
    ensureRemoteSystemKnown(remoteSystemId);
    
    // Grab the user's details
    BaseCredentialsInfo creds = getRemoteCredentials(remoteSystemId);
    PasswordCredentialsInfo credentials = ensureCredentialsFound(remoteSystemId, creds);
    
    // Trigger the refresh
    return refreshTicket(remoteSystemId, credentials);
}
 
开发者ID:Alfresco,项目名称:alfresco-repository,代码行数:18,代码来源:RemoteAlfrescoTicketServiceImpl.java


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