Constructor
new RepositoryClientConfig(endpoint)
Repository client configuration constructor.
Initializes endpoints
and
sets configuration default values to
defaultRDFMimeType
,
readTimeout
and
writeTimeout
Parameters:
Name | Type | Description |
---|---|---|
endpoint |
string | server base URL that will be prepend to all server requests |
Extends
Methods
addEndpoint(endpoint) → {this}
Inserts a repository endpoint URL to the rest of the endpoints.
Parameters:
Name | Type | Description |
---|---|---|
endpoint |
string | repository endpoint URL |
Returns:
current config for method chaining
- Type
- this
disableAuthentication()
Disables authentication.
- Overrides:
- Source:
getBasicAuthentication() → {boolean}
- Overrides:
- Source:
Returns:
[basicAuth] if use Basic Auth
- Type
- boolean
getDefaultRDFMimeType() → {string}
Returns the default RDF MIME type.
Returns:
- Type
- string
getEndpoint() → {string}
Returns the server's endpoint URL.
- Overrides:
- Source:
Returns:
the endpoint URL
- Type
- string
getEndpoints() → {Array.<string>}
Gets the repository endpoint URLs.
Returns:
- Type
- Array.<string>
getGdbTokenAuthentication() → {boolean}
- Overrides:
- Source:
Returns:
[gdbTokenAuth] if use Gdb Token Auth
- Type
- boolean
getHeaders() → {Object.<string, string>}
Returns the default headers for each HTTP request.
- Overrides:
- Source:
Returns:
the default headers map
- Type
- Object.<string, string>
getKeepAlive() → {boolean}
- Overrides:
- Source:
Returns:
if the user should be re-logged in after token expires
- Type
- boolean
getPass() → {string}
- Overrides:
- Source:
Returns:
the user password
- Type
- string
getReadTimeout() → {number}
Returns the default read timeout for HTTP requests.
Returns:
- Type
- number
getUsername() → {string}
- Overrides:
- Source:
Returns:
the username
- Type
- string
getWriteTimeout() → {number}
Returns the default write timeout for HTTP requests.
Returns:
- Type
- number
setDefaultRDFMimeType(defaultRDFMimeType) → {this}
Sets the default RDF MIME type.
Parameters:
Name | Type | Description |
---|---|---|
defaultRDFMimeType |
string |
Returns:
current config for method chaining
- Type
- this
setEndpoint(endpoint) → {this}
Sets the server's endpoint URL.
Parameters:
Name | Type | Description |
---|---|---|
endpoint |
string | the endpoint URL |
- Overrides:
- Source:
Returns:
the current config for method chaining
- Type
- this
setEndpoints(endpoints) → {this}
Sets the repository endpoint URLs.
Parameters:
Name | Type | Description |
---|---|---|
endpoints |
Array.<string> | the endpoint URLs |
Returns:
current config for method chaining
- Type
- this
setHeaders(headers) → {this}
Sets the default headers map for each HTTP request.
Parameters:
Name | Type | Description |
---|---|---|
headers |
Object.<string, string> | the default headers |
- Overrides:
- Source:
Returns:
the concrete configuration config for method chaining
- Type
- this
setKeepAlive(keepAlive) → {this}
Parameters:
Name | Type | Description |
---|---|---|
keepAlive |
boolean |
- Overrides:
- Source:
Returns:
the concrete configuration config for method chaining
- Type
- this
setReadTimeout(readTimeout) → {this}
Sets the default read timeout for HTTP requests.
Parameters:
Name | Type | Description |
---|---|---|
readTimeout |
number | the timeout in milliseconds |
Returns:
current config for method chaining
- Type
- this
setWriteTimeout(writeTimeout) → {this}
Sets the default write timeout for HTTP requests.
Parameters:
Name | Type | Description |
---|---|---|
writeTimeout |
number | the timeout in milliseconds |
Returns:
current config for method chaining
- Type
- this
shouldAuthenticate() → {boolean}
Returns true
if basic or gdb token authentication
is enabled. false
otherwise.
- Overrides:
- Source:
Returns:
is authentication enabled
- Type
- boolean
useBasicAuthentication(usernameopt, passopt) → {this}
Username and password for user logging setter. Sets basic authentication as client authentication type.
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
username |
string |
<optional> |
|
pass |
string |
<optional> |
- Overrides:
- Source:
Returns:
the concrete configuration config for method chaining
- Type
- this
useGdbTokenAuthentication(usernameopt, passopt) → {this}
Username and password for user logging setter. Sets gdb token authentication as client authentication type. *
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
username |
string |
<optional> |
|
pass |
string |
<optional> |
- Overrides:
- Source:
Returns:
the concrete configuration config for method chaining
- Type
- this