/** * Returns the authentication provider from the session or <code>null</code> * if no authentication provider is set. */ public static AuthenticationProvider getAuthenticationProvider(BindingSession session) { assert session != null; return (AuthenticationProvider) session.get(AUTHENTICATION_PROVIDER_OBJECT); }
/** * Returns the service document URL of this session. */ protected String getServiceDocURL() { Object url = session.get(SessionParameter.ATOMPUB_URL); if (url instanceof String) { return (String) url; } return null; }
/** * Returns the repository info cache from the session. */ public static RepositoryInfoCache getRepositoryInfoCache(BindingSession session) { assert session != null; return (RepositoryInfoCache) session.get(REPOSITORY_INFO_CACHE); }
public void setSession(BindingSession session) { this.session = session; final Object compression = session.get(SessionParameter.COMPRESSION); useCompression = (compression != null) && Boolean.parseBoolean(compression.toString()); final Object clientCompression = session.get(SessionParameter.CLIENT_COMPRESSION); useClientCompression = (clientCompression != null) && Boolean.parseBoolean(clientCompression.toString()); if (session.get(CmisBindingsHelper.ACCEPT_LANGUAGE) instanceof String) { acceptLanguage = session.get(CmisBindingsHelper.ACCEPT_LANGUAGE).toString(); } }
@Override public void setSession(BindingSession session) { super.setSession(session); contentThreshold = session.get(SessionParameter.WEBSERVICES_MEMORY_THRESHOLD, 4 * 1024 * 1024); responseThreshold = session.get(SessionParameter.WEBSERVICES_REPSONSE_MEMORY_THRESHOLD, -1); if (responseThreshold > contentThreshold) { contentThreshold = responseThreshold; } }
/** * Sets the current session. */ protected void setSession(BindingSession session) { this.session = session; Object succintObj = session.get(SessionParameter.BROWSER_SUCCINCT); this.succint = succintObj == null ? true : Boolean.parseBoolean(succintObj.toString()); Object dateTimeFormatObj = session.get(SessionParameter.BROWSER_DATETIME_FORMAT); this.dateTimeFormat = dateTimeFormatObj == null ? DateTimeFormat.SIMPLE : DateTimeFormat .fromValue(dateTimeFormatObj.toString().toLowerCase(Locale.ENGLISH)); }
/** * Sets the current session. */ protected void setSession(BindingSession session) { this.session = session; Object succintObj = session.get(SessionParameter.BROWSER_SUCCINCT); this.succint = succintObj == null ? true : Boolean.parseBoolean(succintObj.toString()); Object dateTimeFormatObj = session.get(SessionParameter.BROWSER_DATETIME_FORMAT); this.dateTimeFormat = dateTimeFormatObj == null ? DateTimeFormat.SIMPLE : DateTimeFormat .fromValue(dateTimeFormatObj.toString().toLowerCase(Locale.ENGLISH)); }
/** * Returns if a UsernameToken should be sent. (Web Services binding only.) */ protected boolean getSendUsernameToken() { return getSession().get(SessionParameter.AUTH_SOAP_USERNAMETOKEN, false); }
@Override public void clearRepositoryCache(String repositoryId) { LinkCache linkCache = (LinkCache) session.get(SpiSessionParameter.LINK_CACHE); if (linkCache != null) { linkCache.clearRepository(repositoryId); } }
/** * Gets the proxy user name from the session. * * @return the proxy user name or {@code null} if the user name is not set */ protected String getProxyUser() { Object userObject = getSession().get(SessionParameter.PROXY_USER); if (userObject instanceof String) { return (String) userObject; } return null; }
@Override public void clearRepositoryCache(String repositoryId) { LinkCache linkCache = (LinkCache) session.get(SpiSessionParameter.LINK_CACHE); if (linkCache != null) { linkCache.clearRepository(repositoryId); } }
@Override public BindingType getBindingType() { Object bindingType = session.get(SessionParameter.BINDING_TYPE); if (!(bindingType instanceof String)) { return BindingType.CUSTOM; } try { return BindingType.fromValue((String) bindingType); } catch (IllegalArgumentException e) { return BindingType.CUSTOM; } }
private String getAccessToken() { Object accessTokenObject = getSession().get("accessToken"); if (accessTokenObject instanceof String) { return (String) accessTokenObject; } return null; }
/** * Gets the password from the session. * * @return the password or {@code null} if the password is not set */ protected String getPassword() { Object passwordObject = getSession().get(SessionParameter.PASSWORD); if (passwordObject instanceof String) { return (String) passwordObject; } return null; }
/** * Gets the proxy password from the session. * * @return the proxy password or {@code null} if the password is not set */ protected String getProxyPassword() { Object passwordObject = getSession().get(SessionParameter.PROXY_PASSWORD); if (passwordObject instanceof String) { return (String) passwordObject; } return null; }
/** * Gets the user name from the session. * * @return the user name or {@code null} if the user name is not set */ protected String getUser() { Object userObject = getSession().get(SessionParameter.USER); if (userObject instanceof String) { return (String) userObject; } return null; }
/** * Gets the proxy user name from the session. * * @return the proxy user name or {@code null} if the user name is not set */ protected String getProxyUser() { Object userObject = getSession().get(SessionParameter.PROXY_USER); if (userObject instanceof String) { return (String) userObject; } return null; }
/** * Gets the bearer token from the session. * * @return the bearer token or {@code null} if the token is not set */ protected String getBearerToken() { Object tokenObject = getSession().get(SessionParameter.OAUTH_ACCESS_TOKEN); if (tokenObject instanceof String) { return (String) tokenObject; } return null; }
@Override public void clearRepositoryCache(String repositoryId) { RepositoryUrlCache repUrlCache = (RepositoryUrlCache) session.get(SpiSessionParameter.REPOSITORY_URL_CACHE); if (repUrlCache != null) { repUrlCache.removeRepository(repositoryId); } }
/** * Returns the repository URL cache or creates a new cache if it doesn't * exist. */ protected RepositoryUrlCache getRepositoryUrlCache() { RepositoryUrlCache repositoryUrlCache = (RepositoryUrlCache) getSession().get( SpiSessionParameter.REPOSITORY_URL_CACHE); if (repositoryUrlCache == null) { repositoryUrlCache = new RepositoryUrlCache(); getSession().put(SpiSessionParameter.REPOSITORY_URL_CACHE, repositoryUrlCache); } return repositoryUrlCache; }