public class SessionParameterMap extends LinkedHashMap<String,String>
Sample code:
SessionFactory factory = ... SessionParameterMap parameter = new SessionParameterMap(); parameter.setBasicAuthentication("Otto", "****"); parameter.setAtomPubBindingUrl("http://localhost/cmis/atom"); parameter.setRepositoryId("myRepository"); ... Session session = factory.createSession(parameter);
SessionParameter
,
SessionFactory
,
Serialized FormAbstractMap.SimpleEntry<K,V>, AbstractMap.SimpleImmutableEntry<K,V>
Constructor and Description |
---|
SessionParameterMap()
Creates an empty map.
|
SessionParameterMap(Map<? extends String,? extends String> map)
Creates a map with the same mappings as the specified map.
|
Modifier and Type | Method and Description |
---|---|
void |
addHeader(String header,
String value)
Adds a HTTP header.
|
void |
load(File file)
Loads entries from the given UTF-8 encoded file.
|
void |
load(InputStream stream)
Loads entries from the given, UTF-8 encoded stream and leaves the stream
open.
|
void |
parse(String parameters)
Parses a string that contains key-value pairs.
|
String |
put(String key,
boolean value)
Sets a boolean value.
|
String |
put(String key,
long value)
Sets a long value.
|
protected void |
putLine(String line) |
void |
setAtomPubBindingUrl(String url)
Sets the AtomPub URL and sets the binding to AtomPub.
|
void |
setAuthenticationProvider(Class<? extends AuthenticationProvider> authenticationProviderClass)
Sets the authentication provider class.
|
void |
setBasicAuthentication(String user,
String password)
Turns basic authentication on and UsernameToken authentication off if the
standard authentication provider is used.
|
void |
setBearerToken(String token)
Sets bearer token.
|
void |
setBrowserBindingSuccinct(boolean succinct)
Sets whether properties should be sent in the succinct format or not.
|
void |
setBrowserBindingUrl(String url)
Sets the Browser URL and sets the binding to Browser.
|
void |
setClientCompression(boolean compression)
Sets whether requests to the server should be compressed or not.
|
void |
setCompression(boolean compression)
Sets if the server should be asked to use compression.
|
void |
setConnectionTimeout(long timeout)
Sets the HTTP connection timeout.
|
void |
setCookies(boolean cookies)
Sets whether cookies should be managed or not.
|
void |
setHttpInvoker(Class<?> httpInvokerClass)
Sets the HTTP invoker class.
|
void |
setLocalBindingClass(Class<? extends CmisServiceFactory> serviceFactoryClass)
Sets the local service factory and sets the binding to Local.
|
void |
setLocale(Locale locale)
Sets the locale of the session.
|
void |
setLocale(String language)
Sets the locale of the session.
|
void |
setLocale(String language,
String country)
Sets the locale of the session.
|
void |
setNoAuthentication()
Turns all authentication off if the standard authentication provider is
used.
|
void |
setNtlmAuthentication(String user,
String password)
Turns NTLM authentication on and basic authentication and UsernameToken
authentication off.
|
void |
setOAuthAuthentication(String tokenEntpoint,
String clientId,
String clientSecret,
String code,
String redirectUri)
Turns OAuth 2.0 authentication on and basic authentication and
UsernameToken authentication off.
|
void |
setOAuthAuthentication(String tokenEntpoint,
String clientId,
String clientSecret,
String accessToken,
String refreshToken,
long expirationTimestamp)
Turns OAuth 2.0 authentication on and basic authentication and
UsernameToken authentication off.
|
void |
setOAuthBearerTokenAuthentication(String token)
Turns simple OAuth 2.0 bearer token authentication on and basic
authentication and UsernameToken authentication off.
|
void |
setObjectFactory(Class<? extends ObjectFactory> objectFactoryClass)
Sets the object factory class.
|
void |
setProxyUserAndPassword(String user,
String password)
Sets HTTP proxy user and password.
|
void |
setReadTimeout(long timeout)
Sets the HTTP read timeout.
|
void |
setRepositoryId(String repositoryId)
Sets the repository ID.
|
void |
setUserAndPassword(String user,
String password)
Sets user and password.
|
void |
setUsernameTokenAuthentication(String user,
String password,
boolean basicAuth)
Turns UsernameToken authentication on for the Web Services binding if the
standard authentication provider is used.
|
void |
setWebServicesBindingUrl(String url)
Sets the Web Services WSDL URL and sets the binding to Web Services.
|
void |
setWebServicesMemoryThreshold(long threshold)
Sets the Web Service memory threshold.
|
void |
store(File file)
Writes all entries to the given file.
|
void |
store(OutputStream stream)
Writes all entries UTF-8 encoded to the given stream and leaves the
stream open.
|
String |
toString() |
clear, containsValue, get, removeEldestEntry
clone, containsKey, entrySet, isEmpty, keySet, put, putAll, remove, size, values
equals, hashCode
public String put(String key, long value)
key
- the keyvalue
- the valuenull
public String put(String key, boolean value)
key
- the keyvalue
- the valuenull
public void setAtomPubBindingUrl(String url)
url
- the AtomPub binding URLpublic void setWebServicesBindingUrl(String url)
url
- the Web Services WSDL URLpublic void setWebServicesMemoryThreshold(long threshold)
threshold
- the threshold in bytespublic void setBrowserBindingUrl(String url)
url
- the Browser binding URLpublic void setBrowserBindingSuccinct(boolean succinct)
succinct
- true
if properties should be sent in the succinct
format, false
otherwisepublic void setLocalBindingClass(Class<? extends CmisServiceFactory> serviceFactoryClass)
serviceFactoryClass
- the local service factory classpublic void setRepositoryId(String repositoryId)
repositoryId
- the repository IDpublic void setUserAndPassword(String user, String password)
user
- the userpassword
- the passwordpublic void setBearerToken(String token)
token
- the bearer tokenpublic void setNoAuthentication()
public void setBasicAuthentication(String user, String password)
user
- the userpassword
- the passwordpublic void setUsernameTokenAuthentication(String user, String password, boolean basicAuth)
user
- the userpassword
- the passwordbasicAuth
- true
if basic authentication should be used in
addition to the UsernameToken authentication (required by some
servers), false
otherwisepublic void setNtlmAuthentication(String user, String password)
Works only in single user environments and only with NTLMv1!
user
- the userpassword
- the passwordpublic void setOAuthBearerTokenAuthentication(String token)
This authentication method does not refresh the token when it expires.
token
- the bearer tokenpublic void setOAuthAuthentication(String tokenEntpoint, String clientId, String clientSecret, String code, String redirectUri)
This authentication method requests a new token and refreshes the token when it expires.
tokenEntpoint
- the token endpoint URLclientId
- the client IDclientSecret
- the client secret if required, null
otherwisecode
- the authorization coderedirectUri
- the redirect URI if required, null
otherwisepublic void setOAuthAuthentication(String tokenEntpoint, String clientId, String clientSecret, String accessToken, String refreshToken, long expirationTimestamp)
This authentication method uses the provided token and refreshes the token when it expires.
tokenEntpoint
- the token endpoint URLclientId
- the client IDclientSecret
- the client secret if required, null
otherwiseaccessToken
- the bearer access tokenrefreshToken
- the refresh tokenexpirationTimestamp
- the timestamp when the access token expirespublic void setLocale(Locale locale)
locale
- the localepublic void setLocale(String language, String country)
language
- ISO 639 language codecountry
- ISO 3166 country codepublic void setLocale(String language)
language
- ISO 639 language codepublic void setCookies(boolean cookies)
cookies
- true
if cookies should be managed, false
otherwisepublic void setCompression(boolean compression)
compression
- true
if the server should be asked to use compression,
false
otherwisepublic void setClientCompression(boolean compression)
compression
- true
if requests should be compressed, false
otherwisepublic void setConnectionTimeout(long timeout)
timeout
- the connection timeout in millisecondspublic void setReadTimeout(long timeout)
timeout
- the read timeout in millisecondspublic void setHttpInvoker(Class<?> httpInvokerClass)
httpInvokerClass
- the HTTP invoker classpublic void addHeader(String header, String value)
header
- the header namevalue
- the header valuepublic void setProxyUserAndPassword(String user, String password)
user
- the userpassword
- the passwordpublic void setAuthenticationProvider(Class<? extends AuthenticationProvider> authenticationProviderClass)
authenticationProviderClass
- the authentication provider classpublic void setObjectFactory(Class<? extends ObjectFactory> objectFactoryClass)
objectFactoryClass
- the object factory classpublic void load(File file) throws IOException
file
- the fileIOException
- if the entries cannot be readload(InputStream)
public void load(InputStream stream) throws IOException
stream
- the streamIOException
- if the entries cannot be readpublic void parse(String parameters)
parameters
- the parameters stringprotected void putLine(String line)
public final void store(File file) throws IOException
file
- the fileIOException
- if the entries cannot be writtenstore(OutputStream)
public void store(OutputStream stream) throws IOException
stream
- the streamIOException
- if the entries cannot be writtenpublic String toString()
toString
in class AbstractMap<String,String>
Copyright © 2009-2015 The Apache Software Foundation. All Rights Reserved.