public class OnPremConnector extends Connector
This class acts as a facade to the connector library. All requests to the eSales service are initiated by method calls to a
Connector
object, or an object obtained via the connector.
Use the getOrCreate(String)
method to obtain a OnPremConnector
object.
Connector.ConnectorKey
Modifier and Type | Method | Description |
---|---|---|
List<String> |
availableAdAttributes() |
Gets a list of the names of all ad attributes that has been imported to eSales.
|
List<String> |
availableAttributeTypes() |
Returns a list of available attribute types from the eSales cluster.
|
List<String> |
availableCategoryAttributes() |
Gets a list of the names of all category attributes that has been imported to eSales.
|
List<String> |
availableProductAttributes() |
Gets a list of the names of all product and variant attributes that has been imported to eSales.
|
List<String> |
availableScanRules() |
Deprecated.
No longer serves any purpose.
|
List<String> |
availableStringRules() |
Deprecated.
No longer serves any purpose.
|
static OnPremConnector |
defineCluster(String clusterString) |
Defines a cluster.
|
static OnPremConnector |
defineCluster(String clusterString,
ExecutorService asyncTaskExecutor) |
Defines a cluster.
|
void |
defragment() |
Defragments the eSales Servers in the eSales cluster.
|
static OnPremConnector |
get(String uri) |
Gets a connector, provided a cluster URI.
|
static OnPremConnector |
get(String uri,
ExecutorService asyncTaskExecutor) |
Gets a connector, provided a cluster URI and task executor.
|
static OnPremConnector |
getOrCreate(String uri) |
Creates a connector, unless already created, provided a cluster URI.
|
static OnPremConnector |
getOrCreate(String uri,
ExecutorService asyncTaskExecutor) |
Creates a connector, unless already created, provided a cluster URI.
|
String |
queryStatistics(int qp) |
Returns query statistics for the specified eSales Server.
|
void |
synchronize(boolean ignore) |
Synchronizes all eSales Servers in the eSales cluster.
|
String |
testPanel(String panelXml,
String panel,
String role,
Map<? extends CharSequence,? extends CharSequence> arguments) |
Deprecated.
use testPanel(String panelXml, String panel, String role, Map<String, String> arguments,
String sessionKey, String market, String customerKey) instead.
|
String |
testPanel(String panelXml,
String panel,
String role,
Map<String,String> arguments,
String sessionKey,
String market,
String customerKey) |
Executes a panel from the specified panel definition.
|
PanelContent |
testPanelAndParse(String panelXml,
String panel,
String role,
Map<? extends CharSequence,? extends CharSequence> arguments) |
Deprecated.
use testPanelAndParse(String panelXml, String panel, String role, Map<String, String> arguments,
String sessionKey, String market, String customerKey) instead.
|
PanelContent |
testPanelAndParse(String panelXml,
String panel,
String role,
Map<String,String> arguments,
String sessionKey,
String market,
String customerKey) |
Executes a panel from the specified panel definition.
|
availableMarkets, checkCustomerDataJobStatus, createExportCustomerDataJob, createRemoveCustomerDataJob, downloadExportCustomerDataJobResult, downloadExportCustomerDataJobResult, exportAds, exportAds, exportConfiguration, exportConfiguration, exportPanels, exportPanels, exportProducts, exportProducts, exportProducts, exportSynonyms, exportSynonyms, getVersion, importAds, importAds, importConfiguration, importConfiguration, importFile, importPanels, importPanels, importProducts, importProducts, importSynonyms, importSynonyms, latestNotifications, latestNotifications, putStrings, reporter, reporterForUnknownMarket, save, serverLog, serverLogNames, session, session, status
public static OnPremConnector get(String uri)
get(String, ExecutorService)
with the asyncTaskExecutor set to ForkJoinPool.commonPool().
See getOrCreate(String)
for details on the URI format.
uri
- The base URI to an eSales clusterpublic static OnPremConnector get(String uri, ExecutorService asyncTaskExecutor)
See getOrCreate(String, ExecutorService)
for details on the URI format.
uri
- The base URI to an eSales clusterasyncTaskExecutor
- specify executor or null if you want to run healthcheck calls in the same threadpublic static OnPremConnector getOrCreate(String uri) throws com.apptus.util.http.ClientCreationException, FetchClusterException, MalformedURLException
uriString
already exists but has an executor service associated.
(getOrCreate(String, ExecutorService)
)
Equivalent of calling getOrCreate(String, ExecutorService)
with the asyncTaskExecutor set to ForkJoinPool.commonPool().
To disable non-blocking behaviour, call getOrCreate(String, ExecutorService)
with asyncTaskExecutor set to null.
The URI should be on the following format:
esales://host1[:port1][;host2[:port2][;...]][?parameter1=value1[¶meter2=value2[&...]]]
Example: esales://node1.apptus.com;node2.apptus.com:35811?query_timeout=3500¬ification_timeout=3500
Unspecified ports defaults to 35810.
The available parameters are:
Parameter values must be URL encoded in order to avoid ambiguity.
uri
- The base URI to an eSales cluster.com.apptus.util.http.ClientCreationException
FetchClusterException
MalformedURLException
- if the URL contains errors.public static OnPremConnector getOrCreate(String uri, ExecutorService asyncTaskExecutor) throws com.apptus.util.http.ClientCreationException, FetchClusterException, MalformedURLException
uriString
already exists but has
a different executor service associated.
Works the same as getOrCreate(String)
, providing an ExecutorService allows healthcheck
calls to unresponsive nodes in a cluster to be run on a separate thread, without blocking other requests.uri
- The base URI to an eSales cluster.asyncTaskExecutor
- Executor for health check tasks.com.apptus.util.http.ClientCreationException
FetchClusterException
MalformedURLException
- if the URL contains errors.public static OnPremConnector defineCluster(String clusterString) throws IOException
clusterString
- A string defining a cluster.OnPremConnector
using the given cluster.com.apptus.util.http.Response.BusyClusterIOException
- if the cluster is busy with another taskIOException
- if any other I/O error occursgetOrCreate(String)
public static OnPremConnector defineCluster(String clusterString, ExecutorService asyncTaskExecutor) throws IOException
clusterString
- A string defining a cluster.asyncTaskExecutor
- Executor for health check tasks.OnPremConnector
using the given cluster.com.apptus.util.http.Response.BusyClusterIOException
- if the cluster is busy with another taskIOException
- if any other I/O error occursgetOrCreate(String, ExecutorService)
public void synchronize(boolean ignore) throws IOException
When ignore is set to true any inconsistencies between eSales Servers in the eSales cluster are ignored by clearing the update history on all servers.
ignore
- should be set to true if inconsistencies in the cluster should be ignoredcom.apptus.util.http.Response.BusyClusterIOException
- if the cluster is busy with another taskIOException
- if any other I/O error occurspublic String queryStatistics(int qp) throws IOException
qp
- The (0-based) index of the eSales ServerIOException
- if there was any problem sending the request.IndexOutOfBoundsException
- if no qp with the given index can be foundpublic void defragment() throws IOException
com.apptus.util.http.Response.BusyClusterIOException
- if cluster is busy with another taskIOException
- if any other I/O error occurspublic List<String> availableAttributeTypes() throws IOException
IOException
- if there was any error getting available attribute types@Deprecated public List<String> availableStringRules() throws IOException
IOException
- it does not, kept for legacy reasons.@Deprecated public List<String> availableScanRules() throws IOException
IOException
- it does not, kept for legacy reasons.public List<String> availableProductAttributes() throws IOException
IOException
- if there was any error getting product and variant attributespublic List<String> availableAdAttributes() throws IOException
IOException
- if there was any error getting ad attributespublic List<String> availableCategoryAttributes() throws IOException
IOException
- if there was any error getting category attributes@Deprecated public String testPanel(String panelXml, String panel, String role, Map<? extends CharSequence,? extends CharSequence> arguments) throws IOException
IOException
@Deprecated public PanelContent testPanelAndParse(String panelXml, String panel, String role, Map<? extends CharSequence,? extends CharSequence> arguments) throws IOException, ParseException
IOException
ParseException
public String testPanel(String panelXml, String panel, String role, Map<String,String> arguments, String sessionKey, String market, String customerKey) throws IOException
The arguments is always applied to the entire named panel.
panelXml
- The panel definition, as an XML documentpanel
- The panel to executerole
- The part of the panel the return results fromarguments
- The arguments of the panelsessionKey
- The session key for this requestmarket
- The market for this requestcustomerKey
- The customer key for this requestIOException
- if there was an error executing the panel.public PanelContent testPanelAndParse(String panelXml, String panel, String role, Map<String,String> arguments, String sessionKey, String market, String customerKey) throws IOException, ParseException
The arguments is always applied to the entire named panel.
panelXml
- The panel definition, as an XML documentpanel
- The panel to executerole
- The part of the panel the return results fromarguments
- The arguments of the panelsessionKey
- The session key for this requestmarket
- The market for this requestcustomerKey
- The customer key for this requestIOException
- if there was an error executing the panel.ParseException
- if result couldn't be parsed.Copyright © 2020 Apptus Technologies AB. All rights reserved.