Overview

Namespaces

  • Apptus
    • ESales
      • Connector
        • Report
        • Time
    • Util
      • Cache
  • PHP

Classes

  • Ad
  • Ads
  • ArgMap
  • Attribute
  • AttributeValidation
  • Authorization
  • Category
  • CategoryData
  • CategoryList
  • CategoryNode
  • CloudConnector
  • ClusterUriIterator
  • Completion
  • Completions
  • CompressionMode
  • Connector
  • ConnectorSettingsBuilder
  • Correction
  • Corrections
  • Count
  • CssClass
  • CustomerKeyAuthentication
  • DynamicPage
  • EventDataJobResult
  • FacetList
  • FacetRange
  • Facets
  • Filter
  • FilterBuilder
  • ImportData
  • JavaScriptNotifier
  • MessageAuthentication
  • OnPremConnector
  • Order
  • OrderLine
  • Panel
  • PanelContent
  • Path
  • Phrase
  • Phrases
  • Product
  • Products
  • Reporter
  • ResultType
  • Session
  • Status
  • Subpanel
  • Value
  • Values
  • Variant

Interfaces

  • Facet
  • Result

Exceptions

  • BusyClusterException
  • ClusterUnavailableException
  • DuplicateSubpanelException
  • FetchClusterException
  • IOException
  • MalformedJsonException
  • MalformedURLException
  • MissingSubpanelException
  • PanelException
  • ParseException
  • ReportException
  • RequestFailedException
  • ResultTypeException
  • Overview
  • Namespace
  • Class
  • Tree

Class OnPremConnector

Connector for on-premise instances of Apptus eSales.

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.

Apptus\ESales\Connector\Connector
Extended by Apptus\ESales\Connector\OnPremConnector
Namespace: Apptus\ESales\Connector
Located at Connector/OnPremConnector.php
Methods summary
public Apptus\ESales\Connector\OnPremConnector
# __construct( string $uri, Apptus\Util\Cache\StateCache $stateCache = null )

Creates a connector for the given eSales cluster URI.

Creates a connector for the given eSales cluster URI.

The URI should be on the following format:

esales://host1[:port1][;host2[:port2][;...]][?parameter1=value1[&parameter2=value2[&...]]]

Example: esales://node1.apptus.com;node2.apptus.com:35811?query_timeout=3500&notification_timeout=3500

Unspecified ports defaults to 35810.

The available parameters are:

  • connection_timeout - the connection timeout in milliseconds, default 2000
  • query_timeout - the query timeout in milliseconds, default 3000
  • export_timeout - the export timeout in milliseconds, default 60000
  • import_timeout - the import timeout in milliseconds, default 600000
  • notification_timeout - the notification timeout in milliseconds, default 3000
  • health_check_timeout - the health check timeout in milliseconds, default 500
  • compression_mode - what compression should be used when sending imports. Available settings:
    • none - No compression.
    • gzip - Compress with GZIP. This is the default.
    • pre_compressed_gzip - Send headers to indicate the import is compressed with GZIP, but don't do any compression. Use this if the file or InputStream you supply is already compressed.
    Note that files with names that end with ".gz" or ".gzip" will behave as if compression_mode=pre_compressed_gzip, regardless of what compression_mode is actually set to.

Parameter values must be URL encoded in order to avoid ambiguity.

Parameters

$uri
base URI to an eSales cluster.
$stateCache

instance of an object implementing the Apptus\Util\Cache\StateCache interface. Defaults to an SQLite3StateCache using the file 'esales.statecache' in the current working directory.

Returns

Apptus\ESales\Connector\OnPremConnector
A connector instance.

Throws

Apptus\ESales\Connector\MalformedURLException
if the given URL is malformed in some way.
public static
# defineCluster( string $clusterString )

Defines a cluster. The format of the cluster string is :;:;...

Defines a cluster. The format of the cluster string is :;:;...

Parameters

$clusterString
string defining a cluster.

Throws

Apptus\ESales\Connector\BusyClusterException
if the cluster is busy with another task
Apptus\ESales\Connector\RequestFailedException
public
# synchronize( boolean $ignore = false )

Synchronizes all eSales Servers in the eSales cluster.

Synchronizes all eSales Servers in the eSales cluster.

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.

Parameters

$ignore
if inconsistencies in the cluster should be ignored.

Throws

Apptus\ESales\Connector\BusyClusterException
if the cluster is busy with another task
Apptus\ESales\Connector\RequestFailedException
if the request to the cluster fails.
public string
# queryStatistics( integer $qp )

Return query statistics for the specified eSales Server.

Return query statistics for the specified eSales Server.

Parameters

$qp
(0-based) index of the eSales Server.

Returns

string
A string containing query statistics in the form of an XML document.

Throws

InvalidArgumentException
if there is no server for the given index.
Apptus\ESales\Connector\RequestFailedException
if the request to the server fails.
public
# defragment( )

Defragments the eSales Servers in the eSales cluster.

Defragments the eSales Servers in the eSales cluster.

Throws

Apptus\ESales\Connector\BusyClusterException
if the cluster is busy with another task
Apptus\ESales\Connector\RequestFailedException
if the request to the cluster fails.
public array
# availableAttributeTypes( )

Return a list of available attribute types from the eSales cluster. Never returns null.

Return a list of available attribute types from the eSales cluster. Never returns null.

Returns

array
An indexed array of type names.

Throws

Apptus\ESales\Connector\RequestFailedException
if the request to the cluster fails.
public array
# availableStringRules( )

Always returns an empty list.

Always returns an empty list.

Deprecated

No longer of any use.

Returns

array
An empty array.
public array
# availableScanRules( )

Always returns an empty list.

Always returns an empty list.

Deprecated

No longer of any use.

Returns

array
An empty array.
public array
# availableProductAttributes( )

Gets a list of the name of all product and variant attributes that has been imported to eSales.

Gets a list of the name of all product and variant attributes that has been imported to eSales.

Returns

array
An indexed array of product and variant attribute names.

Throws

Apptus\ESales\Connector\RequestFailedException
public array
# availableAdAttributes( )

Gets a list of the name of all ad attributes that has been imported to eSales.

Gets a list of the name of all ad attributes that has been imported to eSales.

Returns

array
An indexed array of ad attribute names.

Throws

Apptus\ESales\Connector\RequestFailedException
public string
# testPanel( string $panelXml, string $panel, string $role, Apptus\ESales\Connector\ArgMap|array|null $arguments )

Executes a panel from the specified panel definition.

Executes a panel from the specified panel definition.

If a role is specified, then only the part of the panel specified by the role is executed.

The arguments is always applied to the entire named panel.

Parameters

$panelXml
panel definition, as a string with an XML document.
$panel
panel to execute.
$role
part of the panel the return results from.
$arguments
arguments of the panel.

Returns

string
The result as an XML document.

Throws

Apptus\ESales\Connector\ClusterUnavailableException
if the request to the cluster fails.
Apptus\ESales\Connector\RequestFailedException
if the request fails in a way that indicate a client error.
public Apptus\ESales\Connector\PanelContent
# testPanelAndParse( string $panelXml, string $panel, string $role, Apptus\ESales\Connector\ArgMap|array|null $arguments )

Executes a panel from the specified panel definition and parse the resulting XML.

Executes a panel from the specified panel definition and parse the resulting XML.

If a role is specified, then only the part of the panel specified by the role is executed.

The arguments is always applied to the entire named panel.

Parameters

$panelXml
panel definition, as a string with an XML document.
$panel
panel to execute.
$role
part of the panel the return results from.
$arguments
arguments of the panel.

Returns

Apptus\ESales\Connector\PanelContent
The result as a PanelContent object.

Throws

Apptus\ESales\Connector\ClusterUnavailableException
if the request to the cluster fails.
Apptus\ESales\Connector\RequestFailedException
if the request fails in a way that indicate a client error.
Methods inherited from Apptus\ESales\Connector\Connector
availableMarkets(), checkCustomerDataJobStatus(), createExportCustomerDataJob(), createRemoveCustomerDataJob(), downloadExportCustomerDataJobResult(), downloadExportCustomerDataJobResultToDestination(), exportAds(), exportConfiguration(), exportPanels(), exportProducts(), exportSynonyms(), getVersion(), importAds(), importConfiguration(), importPanels(), importProducts(), importSynonyms(), latestNotifications(), reporter(), reporterForUnknownMarket(), serverLog(), serverLogNames(), session(), status()
Apptus ESales Connector PHP API documentation generated by ApiGen