/**
  * Test connecting to the AMQP server
  * @return self
  */
 public function validateamqpAction()
 {
     $request = $this->getRequest();
     $configMap = Mage::getModel('ebayenterprise_amqp/config');
     $hostname = $this->_validatorHelper->getParamOrFallbackValue($request, self::HOSTNAME_PARAM, self::HOSTNAME_USE_DEFAULT_PARAM, $configMap->getPathForKey('hostname'));
     $username = $this->_validatorHelper->getParamOrFallbackValue($request, self::USERNAME_PARAM, self::USERNAME_USE_DEFAULT_PARAM, $configMap->getPathForKey('username'));
     $password = $this->_validatorHelper->getEncryptedParamOrFallbackValue($request, self::PASSWORD_PARAM, self::PASSWORD_USE_DEFAULT_PARAM, $configMap->getPathForKey('password'));
     $validator = $this->_getAmqpApiValidator($this->_getSourceStore());
     $this->getResponse()->setHeader('Content-Type', 'text/json')->setBody(json_encode($validator->testConnection($hostname, $username, $password)));
     return $this;
 }
 /**
  * Validate the SFTP configurations and set the response body to a JSON
  * response including the success of the test connection and any messages to
  * be displayed to the user.
  * @return self
  */
 public function validatesftpAction()
 {
     $request = $this->getRequest();
     $configMap = Mage::getModel('eb2ccore/config');
     $host = $this->_validatorHelper->getParamOrFallbackValue($request, self::SFTP_HOSTNAME_PARAM, self::SFTP_HOSTNAME_USE_DEFAULT_PARAM, $configMap->getPathForKey('sftp_location'));
     $username = $this->_validatorHelper->getParamOrFallbackValue($request, self::SFTP_USERNAME_PARAM, self::SFTP_USERNAME_USE_DEFAULT_PARAM, $configMap->getPathForKey('sftp_username'));
     $port = $this->_validatorHelper->getParamOrFallbackValue($request, self::SFTP_PORT_PARAM, self::SFTP_PORT_USE_DEFAULT_PARAM, $configMap->getPathForKey('sftp_port'));
     $key = $this->_validatorHelper->getSftpPrivateKey($request, self::SFTP_PRIV_KEY_PARAM, self::SFTP_PRIV_KEY_USE_DEFAULT_PARAM, Mage::getSingleton('eb2ccore/config')->getPathForKey('sftp_private_key'));
     $this->getResponse()->setHeader('Content-Type', 'text/json')->setBody(json_encode(Mage::helper('eb2ccore/validator')->testSftpConnection($host, $username, $key, $port)));
     return $this;
 }