mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-08-14 17:58:59 +00:00
Merged HEAD-QA to HEAD (4.2) (including moving test classes into separate folders)
51903 to 54309 git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@54310 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (C) 2005-2010 Alfresco Software Limited.
|
||||
* Copyright (C) 2005-2013 Alfresco Software Limited.
|
||||
*
|
||||
* This file is part of Alfresco
|
||||
*
|
||||
@@ -558,23 +558,39 @@ public class Utils
|
||||
/**
|
||||
* Gets the current http session id
|
||||
*
|
||||
* @return the current http session id, null if none found
|
||||
* @return the current http session id, null if none found
|
||||
*/
|
||||
public static String getSessionId()
|
||||
{
|
||||
String result = null;
|
||||
ServletEndpointContext endpointContext = (ServletEndpointContext)MessageContext.getCurrentContext().getProperty("servletEndpointContext");
|
||||
HttpSession session = getSession();
|
||||
return ((session != null) ? (session.getId()) : (null));
|
||||
}
|
||||
|
||||
private static HttpSession getSession()
|
||||
{
|
||||
HttpSession result = null;
|
||||
|
||||
ServletEndpointContext endpointContext = (ServletEndpointContext) MessageContext.getCurrentContext().getProperty("servletEndpointContext");
|
||||
if (endpointContext != null)
|
||||
{
|
||||
HttpSession session = endpointContext.getHttpSession();
|
||||
if (session != null)
|
||||
{
|
||||
result = session.getId();
|
||||
}
|
||||
result = endpointContext.getHttpSession();
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* Invalidates the current http session
|
||||
*/
|
||||
public static void invalidateSession()
|
||||
{
|
||||
HttpSession session = getSession();
|
||||
if (session != null)
|
||||
{
|
||||
session.invalidate();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the value of the <code>fetchSize</code> from the
|
||||
* QueryConfiguration SOAP header (if present)
|
||||
|
Reference in New Issue
Block a user