ePages 6.17.13 - DE_EPAGES/Flex/API/ConfigureEpages.pm

Package DE_EPAGES::Flex::API::ConfigureEpages

This package contains response functions that return a response for a request received by the ConfigurationServer. The ConfigurationServer receives requests of the following format: REQUEST_NUMBER PASSWD REQUEST_LINE Example: 3 qwert6 newpasswd=qwert7 DE_EPAGES::Flex::API::Constants defines constants for each REQUEST_NUMBER. The $RESPONSE_FUNCTION hash that maps the REQUEST_NUMBER to a response function. Each response function defined here must be mentioned in $RESPONSE_FUNCTION. Each response function has 1 input argument: the REQUEST_LINE, and 1 output argument: the RESPONSE_LINE. A response has this format: 0|1 RESPONSE_LINE\r\n 0 means success, 1 failure. If a response function was executed successfully, the RESPONSE_LINE returned must be a (maybe empty) string. If a response function fails it must return undef.

@EXPORT_OK
testpassword
$RESPONSE_FUNCTION

Functions

configureepages
getinfoepages
getpatchlog
restart
runhotfixes
runpatch
setpassword
testpassword

configureepages

This function is called whenever the ConfigurationServer gets the request REQUEST_CONFIGURE (1). It reconfigures the epages configuration files and restarts the epages service if necessary.

Syntax
$Result = configureepages($RequestLine);
Input
$RequestLine (string)
request line, supported patterns are:
storename=<storename> the storename default:Store
storepassword=<storepassword> the store password
newpasswd=<value> the new passwd for the configuration server
restartepages=<1|0> restart epages service after reconfiguration
ipaddress=<ip address> ip address of server
storedomainname=<storedomainname> the domain name for the store (default: ip address)
appservercount=<count of appservers> number of running application server to use
maxmemory=<max memory to use> max memory amount for each application server process
webservicepassword=<store webservice password> webservice password for accessing the Store
Return
$Result (string)
undef (failure) or any string (success)

getinfoepages

This function is called whenever the ConfigurationServer gets the request REQUEST_GET_INFO (2). It collects epages installation information and returns it as a string.

Syntax
$Result = getinfoepages();
Return
$Result (string)
information about epages

getpatchlog

This function is called whenever the ConfigurationServer gets the request REQUEST_GET_PATCH_LOG (4). It returns the content of $EPAGES_LOG/FlexPatch-[Store]-[Version].log where [Store] and [Version] are derived from $RequestLine. If logtype is set in $RequstLine, it returns the content of $EPAGES_LOG/FlexPatch-[Store]-[Version]-[LogType].log Each request line looks like: STORE=VERSION=OPTION=LOGTYPE OPTION and/or LOGTYPE may be omitted. Set LOGTYPE w/o OPTION: STORE=VERSION==LOGTYPE Only hotfixes use OPTION for /etc/cron.daily/epages-hotfix See FlexProvider::API::ConfigurationServerClient::getPatchLog See FlexProvider::API::ConfigurationServerClient::runHotfixesOnStore

Syntax
$FileContent = getpatchlog($RequestLine);
Input
$RequestLine (string)
parameters
Return
$Content (string)
base64-encoded content of FlexPatch-[Store]-[Version].log

restart

This function is called whenever the ConfigurationServer gets the request REQUEST_RUN_PATCH (5). It executes each file in patch directory with arguments [Store] and [Version] where [Store] and [Version] are derived from $RequestLine.

Syntax
$Result = restart($RequestLine);
Input
$RequestLine (string)
parameters
Return
$Result (string)
undef (failure) or any string (success)

runhotfixes

This function is called whenever the ConfigurationServer gets the request REQUEST_RUN_HOTFIXES (7). It executes each file in hotfixes directory with arguments [Store] and [Version] where [Store] and [Version] are derived from $RequestLine.

Syntax
$Result = runhotfixes($RequestLine);
Input
$RequestLine (string)
parameters
Return
$Result (string)
undef (failure) or any string (success)

runpatch

This function is called whenever the ConfigurationServer gets the request REQUEST_RUN_PATCH (5). It executes each file in patch directory with arguments [Store] and [Version] where [Store] and [Version] are derived from $RequestLine.

Syntax
$Result = runpatch($RequestLine);
Input
$RequestLine (string)
parameters
Return
$Result (string)
undef (failure) or any string (success)

setpassword

This function is called whenever the ConfigurationServer gets the request REQUEST_SET_PASSWD (3). It sets a new password and/or a new allowedfrom list for the configuration server. If allowedfrom list is changed, the server is restarted.

Syntax
$CryptedPasswd = setpassword($RequestLine);
Input
$RequestLine (string)
parameters
Return
$CryptedPasswd (string)
crypted password for accessing the server

testpassword

This function is called whenever the ConfigurationServer gets a request. It compares the password in the request with the password in "$ENV{EPAGES_CONFIG}/Flex/ConfigServer.conf"->get( 'GLOBAL', 'Password');

Syntax
$Result = testpassword($Passwd,$ConfigPasswd);
$Result = testpassword('qwert6','34252574676545345672352...');
Input
$Passwd (string)
plain password
$ConfigPasswd (string)
crypted password
Return
$Result (string)
PASSWD_OK or PASSWD_FALSE