private static HttpSession getHttpSession() { MessageContext msgCtx = MessageContext.getCurrentMessageContext(); HttpSession httpSess = null; if (msgCtx != null) { HttpServletRequest request = (HttpServletRequest) msgCtx .getProperty(HTTPConstants.MC_HTTP_SERVLETREQUEST); httpSess = request.getSession(); } return httpSess; }
/** * Retrieves the auth token of the remote client that has initiated the * current request. * @return AuthToken */ public static AuthToken getClientAuthToken() { return (AuthToken) MessageContext.getCurrentMessageContext().getProperty(AUTHTOKEN_CLIENT); }
private HttpSession getHttpSession() { MessageContext msgCtx = MessageContext.getCurrentMessageContext(); HttpSession httpSession = null; if (msgCtx != null) { HttpServletRequest request = (HttpServletRequest) msgCtx.getProperty(HTTPConstants.MC_HTTP_SERVLETREQUEST); httpSession = request.getSession(); } return httpSession; }
private static HttpSession getHttpSession() { MessageContext msgCtx = MessageContext.getCurrentMessageContext(); HttpSession httpSess = null; if (msgCtx != null) { HttpServletRequest request = (HttpServletRequest) msgCtx .getProperty(HTTPConstants.MC_HTTP_SERVLETREQUEST); httpSess = request.getSession(); } return httpSess; }
private HttpSession getHttpSession() { MessageContext msgCtx = MessageContext.getCurrentMessageContext(); HttpSession httpSession = null; if (msgCtx != null) { HttpServletRequest request = (HttpServletRequest) msgCtx.getProperty(HTTPConstants.MC_HTTP_SERVLETREQUEST); httpSession = request.getSession(); } return httpSession; }
public static void setMyAuthToken(AuthToken authToken) { MessageContext.getCurrentMessageContext().setProperty(AUTHTOKEN_MINE, authToken); }
private static HttpSession getHttpSession() { MessageContext msgCtx = MessageContext.getCurrentMessageContext(); HttpSession httpSess = null; if (msgCtx != null) { HttpServletRequest request = (HttpServletRequest) msgCtx .getProperty(HTTPConstants.MC_HTTP_SERVLETREQUEST); httpSess = request.getSession(); } return httpSess; }
public static void setSessionResourcePath(String path) throws RegistryException { MessageContext messageContext = MessageContext.getCurrentMessageContext(); if (messageContext == null) { String msg = "Could not get the user's Registry session. Message context not found."; log.error(msg); throw new RegistryException(msg); } HttpServletRequest request = (HttpServletRequest) messageContext.getProperty("transport.http.servletRequest"); request.getSession().setAttribute(RegistryConstants.SESSION_RESOURCE_PATH, path); }
public static String getSessionResourcePath() throws RegistryException { MessageContext messageContext = MessageContext.getCurrentMessageContext(); if (messageContext == null) { String msg = "Could not get the user's Registry session. Message context not found."; log.error(msg); throw new RegistryException(msg); } HttpServletRequest request = (HttpServletRequest) messageContext.getProperty("transport.http.servletRequest"); String resourcePath = (String) request.getSession(). getAttribute(RegistryConstants.SESSION_RESOURCE_PATH); return resourcePath; }
private String getFilePathFromFileId(String fileId) { ConfigurationContext configCtx = MessageContext.getCurrentMessageContext().getConfigurationContext(); Map fileResMap = (Map) configCtx.getProperty(ServerConstants.FILE_RESOURCE_MAP); return (String) fileResMap.get(fileId); } }
private String getFilePathFromArchiveId(String archiveId) { ConfigurationContext configCtx = MessageContext.getCurrentMessageContext().getConfigurationContext(); Map fileResMap = (Map) configCtx.getProperty(org.wso2.wsas.ServerConstants.FILE_RESOURCE_MAP); return (String) fileResMap.get(archiveId); }
public void logout() throws AxisFault { MessageContext.getCurrentMessageContext(). getServiceGroupContext().getProperties().clear(); }
public static String getCurrentContextUsername(DataService dataService) { MessageContext ctx = MessageContext.getCurrentMessageContext(); if (ctx != null) { try { return dataService.getAuthorizationProvider().getUsername(ctx); } catch (DataServiceFault dataServiceFault) { return null; } } else { return null; } }
private boolean isAuthorized(String targetUser, String permissionString) throws UserStoreException, CarbonException { boolean isAuthrized = false; MessageContext msgContext = MessageContext.getCurrentMessageContext(); HttpServletRequest request = (HttpServletRequest) msgContext .getProperty(HTTPConstants.MC_HTTP_SERVLETREQUEST); HttpSession httpSession = request.getSession(false); if (httpSession != null) { String userName = (String) httpSession.getAttribute(ServerConstants.USER_LOGGED_IN); isAuthrized = isUserAuthorizedToConfigureProfile(getUserRealm(), userName, targetUser, permissionString); } return isAuthrized; }
private static Object getSimpleTypeObjectChecked(Class classType, OMElement omElement) throws AxisFault { try { return SimpleTypeMapper.getSimpleTypeObject(classType, omElement); } catch (NumberFormatException e) { MessageContext msgContext = MessageContext.getCurrentMessageContext(); QName faultCode = msgContext != null ? msgContext.getEnvelope().getVersion().getSenderFaultCode() : null; throw new AxisFault("Invalid value \"" + omElement.getText() + "\" for element " + omElement.getLocalName(), faultCode, e); } }
private static Object getSimpleTypeObjectChecked(Class classType, OMElement omElement) throws AxisFault { try { return SimpleTypeMapper.getSimpleTypeObject(classType, omElement); } catch (NumberFormatException e) { MessageContext msgContext = MessageContext.getCurrentMessageContext(); QName faultCode = msgContext != null ? msgContext.getEnvelope().getVersion().getSenderFaultCode() : null; throw new AxisFault("Invalid value \"" + omElement.getText() + "\" for element " + omElement.getLocalName(), faultCode, e); } }
public static UserRegistry getUserRegistry(RegistryService registryService) throws RegistryException { MessageContext messageContext = MessageContext.getCurrentMessageContext(); if (messageContext == null) { String msg = "Could not get the user's Registry session. Message context not found."; log.error(msg); throw new RegistryException(msg); } HttpServletRequest request = (HttpServletRequest) messageContext.getProperty("transport.http.servletRequest"); return getUserRegistry(registryService, request); }
public void serverRegistered() { ConfigurationContext configCtx = MessageContext.getCurrentMessageContext().getConfigurationContext(); configCtx.setProperty(ServerConstants.SERVER_REGISTERED, "true"); pm.updateConfigurationProperty(ServerConstants.SERVER_REGISTERED, "true"); }
private void setSoapFault(String code, String subCode, String reason, String details, ResponseToken responseToken) throws XMLStreamException { String soapFaultStr = genFaultResponse(MessageContext.getCurrentMessageContext(), code, subCode, reason, details).toStringWithConsume(); responseToken.setResults(soapFaultStr); }
private ClusteringAgent getClusteringAgent() throws AxisFault { AxisConfiguration axisConfig = MessageContext.getCurrentMessageContext(). getConfigurationContext().getAxisConfiguration(); ClusteringAgent clusterManager = axisConfig.getClusteringAgent(); if (clusterManager == null) { handleException("ClusteringAgent not enabled in axis2.xml file"); } return clusterManager; }