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