ePages 6.11.0 - DE_EPAGES/WebInterfacePoolDB/API/Object/ASPoolDB.pm

Package DE_EPAGES::WebInterfacePoolDB::API::Object::ASPoolDB

Provides access to the application server pool database.

Example
my $ASPoolDB = DE_EPAGES::WebInterfacePoolDB::API::Object::ASPoolDB->new;
my $hSite = $ASPoolDB->getInfoSiteByURI( 'www.provider.com', '/epages/MyShop.sf' );
my $DatabaseName = $hSite->{'DatabaseName'};

Functions

deleteSite
deleteStore
disconnect
existsDomainName
existsPool
existsSite
existsStore
getAllPools
getDatabasesByPool
getInfoPool
getInfoSiteByURI
getInfoStore
getPoolByAS
getPoolByDatabase
getSiteByDomainName
insertSite
insertStore
new
setSiteRequest
setSiteRequests
updateSite
updateStore

deleteSite

Deletes the site.

Syntax
$ASPoolDB->deleteSite($GUID);
Input
$GUID (string)
guid of shop

deleteStore

Deletes a store and all dependent entries.

Syntax
$ASPoolDB->deleteStore($DatabaseName);
Example
$ASPoolDB->deleteStore('Store');
Input
$DatabaseName (string)
database alias, e.g. 'Store'

disconnect

Disconnects the database. It's recommended to use RunOnPoolDB instead of calling disconnect() directly.

Syntax
$ASPoolDB->disconnect;

existsDomainName

Returns true if domainname is used by a different shop.

Syntax
$exists = $ASPoolDB->existsDomainName( $DomainName, $ObjectPath );
Example
$exists = $ASPoolDB->existsDomainName( 'www.epages.de', '/Shops/MyShop' );
Input
$DomainName (string)
domain name
$ObjectPath (string)
path to shop
Return
$exists (boolean)
true if domainname exists in a different shop

existsPool

Returns true if the Pool exists.

Syntax
$Exists = $ASPoolDB->existsPool($PoolName);
Example
if( $ASPoolDB->existsPool('DefaultPool') ) { ... }
Input
$PoolName (string)
pool name
Return
$Exists (boolean)
true if the Pool exists

existsSite

Returns true if a site with the GUID exists.

Syntax
$Exists = $ASPoolDB->existsSite($GUID);
Input
$GUID (string)
guid of shop
Return
$Exists (boolean)
true if the site exists

existsStore

Returns true if the Store exists.

Syntax
$Exists = $ASPoolDB->existsStore($DatabaseName);
Example
if( $ASPoolDB->existsStore('Store') ) { ... }
Input
$DatabaseName (string)
database alias, e.g. 'Store'
Return
$Exists (boolean)
1/0 the Store exists (yes/no)

getAllPools

Returns the names of all application server pools.

Syntax
$aPoolNames = $ASPoolDB->getAllPools;
Return
$aPoolNames (ref.array.string)
list of pool names

getDatabasesByPool

Returns the database name of a pool.

Syntax
$DatabaseNames = $ASPoolDB->getDatabasesByPool( $PoolName);
Example
$DatabaseNames = $ASPoolDB->getDatabasesByPool( 'StorePool');
Input
$PoolName (string)
pool name
Return
$DatabaseNames (ref.array.string)
list of databases

getInfoPool

Returns information about a pool.

Syntax
$hPool = $ASPoolDB->getInfoPool($PoolName);
Input
$PoolName (string)
pool name, e.g. 'DefaultPool'
Return
$hPool (reference to hash)
with following keys:
  • PoolID - pool id (primary key)- int
  • Name - pool name - string
  • MaxServersPerSite - maximum number of parallel processes for one site (optional)- int
  • MaxServersPerClient - maximum number of parallel processes for the same client IP (optional)- int
  • MaxMemoryPerServer - maximum memory for each application server (optional)- int

getInfoSiteByURI

Returns the site information for the web server name and URI. Returns undef if the web server name / uri combination is not found.

Syntax
$hSite = $ASPoolDB->getInfoSiteByURI( $HttpHost, $URI );
Example
$hSite = $ASPoolDB->getInfoSiteByURI( 'www.provider.com', '/epages/MyShop.sf' );
$hSite = $ASPoolDB->getInfoSiteByURI( 'www.provider.com', '/epages/MyShop.' );
Input
$HttpHost (string)
Web server name
$URI (string)
request URI
Return
$hSite (ref.hash)
  • PoolName - pool name - string
  • StoreName - database alias - string
  • GUID - site GUID - string
  • ObjectPath - path to site - string

getInfoStore

Returns information about a store.

Syntax
$hStore = $ASPoolDB->getInfoStore($DatabaseName);
Example
$hStore = $ASPoolDB->getInfoStore('Store');
Input
$DatabaseName (string)
database alias, e.g. 'Store'
Return
$hStore (reference to hash)
with following keys:
  • StoreID - store database id (primary key)- int
  • PoolID - pool id - int
  • Name - store database alias - varchar(255)

getPoolByAS

Returns the pool name of an application server. Returns 'DefaultPool' if the application server is not explicitely assigned to a pool.

Syntax
$PoolName = $ASPoolDB->getPoolByAS( $IP, $Port );
Example
$PoolName = $ASPoolDB->getPoolByAS( '127.0.0.1', 10045 );
Input
$IP (string)
ip addess of the application server host
$Port (int)
port number of the application server process
Return
$PoolName (string)
pool name

getPoolByDatabase

Returns the pool name of a database. Returns 'DefaultPool' if the database is not explicitely assigned to a pool.

Syntax
$PoolName = $ASPoolDB->getPoolByDatabase( $DatabaseName);
Example
$PoolName = $ASPoolDB->getPoolByDatabase( 'Store');
Input
$DatabaseName (string)
name of database
Return
$PoolName (string)
pool name

getSiteByDomainName

Returns the site that is the owner of the given domain. Returns undef if the domain does not exist or if the owner is NULL.

Syntax
$hSite = $ASPoolDB->getSiteByDomainName( $DomainName );
Example
$hSite = $ASPoolDB->getSiteByDomainName( 'www.epages.de' );
Input
$DomainName (string)
domain name
Return
$hInfo (ref.hash.string)
site info
  • StoreAlias - database alias - string
  • ObjectPath - object path in this database - string

insertSite

Inserts a site. Updates the GUID of the site if the $DatabaseName/$ObjectPath combination already exists.

Syntax
$ASPoolDB->insertSite($DatabaseName, $GUID, $ObjectPath);
Example
$ASPoolDB->insertSite('Store', 'E882746E-56EA-4EA7-B36E-B9299C648A34', '/Shops/DemoShop');
Input
$DatabaseName (string)
database alias, e.g. 'Store'
$GUID (string)
Shop GUID
$ObjectPath (string)
object path within the database $DatabaseName

insertStore

Inserts a store.

Syntax
$ASPoolDB->insertStore($DatabaseName, $GUID);
Example
$ASPoolDB->insertStore('Store', 'E882746E-56EA-4EA7-B36E-B9299C648A34');
Input
$DatabaseName (string)
database alias, e.g. 'Store'
$GUID (string)
system GUID

new

Connects to the application server pool database.

Syntax
$ASPoolDB = DE_EPAGES::WebInterfacePoolDB::API::Object::ASPoolDB->new;
Return
$ASPoolDB (object)
ASPoolDB object

setSiteRequest

set domain and uri for site.

Syntax
$ASPoolDB->setSiteRequest($DatabaseName, $ObjectPath, $Host, $URI );
Example
$ASPoolDB->setSiteRequest('Store', '/Shops/DemoShop', 'www.provider.com', '/epages/MyShop.sf');
Input
$DatabaseName (string)
name of database of site (shop, system)
$ObjectPath (string)
path to site (shop, system)
$Host (string)
Web server name
$URI (string)
request URI

setSiteRequests

set domain and uri for site.

Syntax
$ASPoolDB->setSiteRequests($DatabaseName, $ObjectPath, $ahEntries);
Example
$ASPoolDB->setSiteRequests('Store', '/Shops/DemoShop', [{
    'Host'=>'www.provider.com',
    'URI'=>'/epages/MyShop.'
}]);
Input
$DatabaseName (string)
name of database of site (shop, system)
$ObjectPath (string)
path to site (shop, system)
$aEntries (ref.array.hash)
keys:
  • Host - Web server name - string
  • URI - request uri without extension - string
  • updateSite

    Updates the site.

    Syntax
    $ASPoolDB->updateSite($GUID, $hValues);
    Input
    $GUID (string)
    guid of shop
    $hValues (string)
    columns to update
    • StoreID - database id (in ASPoolDB) - int
    • ObjectPath - object path in the database - string

    updateStore

    Updates a store.

    Syntax
    $ASPoolDB->updateStore($DatabaseName, $hStore);
    Example
    $ASPoolDB->updateStore('Store', { PoolID => $PoolID });
    Input
    $DatabaseName (string)
    database alias, e.g. 'Store'
    $hStore (reference to hash)
    with following keys:
    • PoolID - pool id - int
    • Name - store database alias - varchar(255)