本文整理汇总了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;
}
示例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);
}
}
示例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);
}