本文整理汇总了Java中org.alfresco.webservice.authentication.AuthenticationFault类的典型用法代码示例。如果您正苦于以下问题:Java AuthenticationFault类的具体用法?Java AuthenticationFault怎么用?Java AuthenticationFault使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
AuthenticationFault类属于org.alfresco.webservice.authentication包,在下文中一共展示了AuthenticationFault类的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: startAlfrescoSession
import org.alfresco.webservice.authentication.AuthenticationFault; //导入依赖的package包/类
private String startAlfrescoSession() throws AuthenticationFault {
configureAlfrescoRepository();
String alfrescoUser = GlobalProperties.getInstance().getProperty("app.gesdoc.plugin.user");
if (alfrescoUser == null || alfrescoUser.length() == 0)
alfrescoUser = GlobalProperties.getInstance().getProperty("app.docstore.alfresco.user");
String alfrescoPass = GlobalProperties.getInstance().getProperty("app.gesdoc.plugin.pass");
if (alfrescoPass == null || alfrescoPass.length() == 0)
alfrescoPass = GlobalProperties.getInstance().getProperty("app.docstore.alfresco.pass");
AuthenticationUtils.startSession(alfrescoUser, alfrescoPass);
return AuthenticationUtils.getAuthenticationDetails().getTicket();
}
示例2: startSession
import org.alfresco.webservice.authentication.AuthenticationFault; //导入依赖的package包/类
/**
* Start a session
*
* @param username
* @param password
* @throws AuthenticationFault
*/
public static void startSession(String username, String password, String endpointAddress)
throws AuthenticationFault
{
try
{
AuthenticationServiceSoapBindingStub authenticationService = endpointAddress == null ? WebServiceFactory
.getAuthenticationService()
: WebServiceFactory.getAuthenticationService(endpointAddress);
// Start the session
AuthenticationResult result = authenticationService.startSession(username, password);
// Store the ticket for use later
authenticationDetails.set(new AuthenticationDetails(result.getUsername(), result.getTicket(), result.getSessionid(), endpointAddress));
}
catch (RemoteException exception)
{
if (exception instanceof AuthenticationFault)
{
// Rethrow the authentication exception
throw (AuthenticationFault)exception;
}
else
{
// Throw the exception as a wrapped runtime exception
exception.printStackTrace();
throw new WebServiceException("Error starting session.", exception);
}
}
}
示例3: startAlfrescoSession
import org.alfresco.webservice.authentication.AuthenticationFault; //导入依赖的package包/类
public String startAlfrescoSession() throws AuthenticationFault {
configureAlfrescoRepository();
AuthenticationUtils.startSession(userName, password);
return AuthenticationUtils.getAuthenticationDetails().getTicket();
}