本文整理汇总了Java中org.alfresco.jlan.server.SrvSession.getClientInformation方法的典型用法代码示例。如果您正苦于以下问题:Java SrvSession.getClientInformation方法的具体用法?Java SrvSession.getClientInformation怎么用?Java SrvSession.getClientInformation使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.alfresco.jlan.server.SrvSession
的用法示例。
在下文中一共展示了SrvSession.getClientInformation方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getShareList
import org.alfresco.jlan.server.SrvSession; //导入方法依赖的package包/类
/**
* Return the list of available shares.
*
* @param host String
* @param sess SrvSession
* @param allShares boolean
* @return SharedDeviceList
*/
public SharedDeviceList getShareList(String host, SrvSession sess, boolean allShares)
{
// Check if the user has a home folder, and the session does not currently have any
// dynamic shares defined
if ( sess != null &&
sess.hasClientInformation() &&
sess.hasDynamicShares() == false &&
sess.getClientInformation() instanceof AlfrescoClientInfo)
{
AlfrescoClientInfo client = (AlfrescoClientInfo) sess.getClientInformation();
NodeRef personNode = getPersonService().getPerson(client.getUserName());
if(personNode != null)
{
NodeRef homeSpaceRef = (NodeRef)getNodeService().getProperty(personNode, ContentModel.PROP_HOMEFOLDER);
if (homeSpaceRef != null)
{
// Create the home folder share
DiskSharedDevice homeShare = createHomeDiskShare(homeSpaceRef, client.getUserName());
sess.addDynamicShare(homeShare);
if ( logger.isDebugEnabled())
{
logger.debug("Added " + getHomeFolderName() + " share to list of shares for " + client.getUserName());
}
}
}
}
// Make a copy of the global share list and add the per session dynamic shares
SharedDeviceList shrList = new SharedDeviceList(getFilesystemsConfigSection().getShares());
if ( sess != null && sess.hasDynamicShares()) {
// Add the per session dynamic shares
shrList.addShares(sess.getDynamicShareList());
}
// Remove unavailable shares from the list and return the list
if ( allShares == false)
{
shrList.removeUnavailableShares();
}
return shrList;
}
示例2: procGetAuthTicket
import org.alfresco.jlan.server.SrvSession; //导入方法依赖的package包/类
/**
* Process the get authentication ticket request
*
* @param sess Server session
* @param tree Tree connection
* @param reqBuf Request buffer
* @param folderNode NodeRef of parent folder
* @param netFile NetworkFile for the folder
* @return DataBuffer
*/
private final DataBuffer procGetAuthTicket( SrvSession sess, TreeConnection tree, DataBuffer reqBuf, NodeRef folderNode,
NetworkFile netFile, Object contentDriver, AlfrescoContext contentContext)
{
// DEBUG
if ( logger.isDebugEnabled())
{
logger.debug(" Get Auth Ticket");
}
// Create a response buffer
DataBuffer respBuf = new DataBuffer(256);
respBuf.putFixedString(IOControl.Signature, IOControl.Signature.length());
if(contentDriver instanceof TransactionalFilesystemInterface)
{
TransactionalFilesystemInterface tx = (TransactionalFilesystemInterface)contentDriver;
tx.beginReadTransaction( sess);
}
// Get an authentication ticket for the client, or validate the existing ticket. The ticket can be used when
// generating URLs for the client-side application so that the user does not have to re-authenticate
getTicketForClient( sess);
// Pack the response
AlfrescoClientInfo cInfo = (AlfrescoClientInfo) sess.getClientInformation();
if ( cInfo != null && cInfo.getAuthenticationTicket() != null) {
respBuf.putInt(DesktopAction.StsAuthTicket);
respBuf.putString( cInfo.getAuthenticationTicket(), true);
}
else {
respBuf.putInt(DesktopAction.StsError);
respBuf.putString( "Client information invalid", true);
}
// Return the response
return respBuf;
}
示例3: getTicketForClient
import org.alfresco.jlan.server.SrvSession; //导入方法依赖的package包/类
/**
* Get, or validate, an authentication ticket for the client
*
* @param sess SrvSession
*/
private final void getTicketForClient(SrvSession sess)
{
// Get the client information and check if there is a ticket allocated
AlfrescoClientInfo cInfo = (AlfrescoClientInfo) sess.getClientInformation();
if ( cInfo == null)
return;
boolean needTicket = true;
if ( cInfo.hasAuthenticationTicket())
{
// Validate the existing ticket, it may have expired
try
{
// Validate the existing ticket
getAuthenticationService().validate( cInfo.getAuthenticationTicket());
needTicket = false;
}
catch ( AuthenticationException ex)
{
// Invalidate the current ticket
try
{
getAuthenticationService().invalidateTicket( cInfo.getAuthenticationTicket());
cInfo.setAuthenticationTicket( null);
}
catch (Exception ex2)
{
// DEBUG
if ( logger.isDebugEnabled())
{
logger.debug("Error during invalidate ticket", ex2);
}
}
// DEBUG
if ( logger.isDebugEnabled())
{
logger.debug("Auth ticket expired or invalid");
}
}
}
// Check if a ticket needs to be allocated
if ( needTicket == true)
{
// Allocate a new ticket and store in the client information for this session
String ticket = getAuthenticationService().getCurrentTicket();
cInfo.setAuthenticationTicket( ticket);
}
}
示例4: sessionLoggedOn
import org.alfresco.jlan.server.SrvSession; //导入方法依赖的package包/类
/**
* User successfully logged on notification
*
* @param sess SrvSession
*/
public void sessionLoggedOn(SrvSession sess)
{
// Check the client information for the session
ClientInfo cInfo = sess.getClientInformation();
if ( cInfo == null || cInfo.isNullSession())
return;
// Check if there is an active session to the authentication server for this local
// session
PassthruDetails passDetails = m_sessions.get(sess.getUniqueId());
if (passDetails != null)
{
// Remove the passthru session from the active list
m_sessions.remove(sess.getUniqueId());
// Close the passthru authentication session
try
{
// Close the authentication session
AuthenticateSession authSess = passDetails.getAuthenticateSession();
authSess.CloseSession();
// DEBUG
if (logger.isDebugEnabled())
logger.debug("Closed auth session, sessId=" + authSess.getSessionId());
}
catch (Exception ex)
{
// Debug
logger.error("Passthru error closing session (logon)", ex);
}
}
}