Change the locale app status
@param string $appname The appname
@param string $status Status ["disabled", "enabled"]
@throws Server500
434457
public function changeStatusLocalAppActivity(string $appname, string $status)
    {
        if ("enabled" === $status) {
            $locale = new AppLocale($appname);
            $locale->setEnabled(true);
            $locale->apply();
            unset($locale);
            $locale = new AppLocale($appname);
            if ($locale->isEnabled()) {
                return ((new Renderer())->jsonRenderer(array("code" => 200, "msg" => "OK")));
            } else {
                return ((new Renderer())->jsonRenderer(array("code" => 500,
                    "results" => "Cannot enabled app locale for $appname")));
            }
        } elseif ("disabled" === $status) {
            $locale = new AppLocale($appname);
            $locale->setEnabled(false);
            $locale->apply();
            unset($locale);
            $locale = new AppLocale($appname);
            if (false === $locale->isEnabled()) {
                return ((new Renderer())->jsonRenderer(array("code" => 200, "msg" => "OK")));
            } else {
                return ((new Renderer())->jsonRenderer(array("code" => 500,
                    "results" => "Cannot disabled app locale for $appname")));
            }
        }
        return ((new Renderer())->jsonRenderer(array("code" => 500,
            "results" => "Undefined locale status $status")));
    }
580627
public static function createHimSelf(string $appname):bool
    {
        if (false == JL::exists(FEnv::get("framework.root")."apps/".
            $appname."/config.json")) {
            $file = new \stdClass();
            $file->visibility_dev = null;
            $file->visibility_prod = null;
            $file->hosts_allowed_dev = null;
            $file->hosts_denied_dev = null;
            $file->hosts_allowed_prod = null;
            $file->hosts_denied_prod = null;
            $file->locale_enabled = false;
            $file->prefer_locale = null;
            $file->locale_values = null;
            $file->trans_type = null;

            JsonListener::put(
                FEnv::get("framework.root")."apps/". $appname."/config.json",
                json_encode($file, JSON_PRETTY_PRINT)
            );
            return (JL::exists(FEnv::get("framework.root")."apps/".
                $appname."/config.json"));
        }
        return (false);
    }
209381
public static function switchStatus(string $status)
    {
        if ($status == "off") {
            self::$status = "off";
        } elseif ($status == "on") {
            self::$status = "on";
        } else {
            die("TaskBar : Undefined status '$status'. Status must be 'on' or 'off'. ");
        }
        return (1);
    }
683673
public function setStatus($event, $status)
    {
        $handle = (string) $this->connections->getCurrentConnectionKey();

        $this->statuses[$event][$handle] = $status;
    }
957320
public function setStatus($status, $calledFromActivity = false)
    {
        parent::setStatus($status);

        // Change the Activity as well only if this method has not been called by an Activity instance to avoid recursion.
        if (!$calledFromActivity && $this->getActivity() && $this->getActivity()->getEqualsOperation()) {
            $this->getActivity()->setStatus($this->status, true);
        }

        return $this;
    }
1293997
public function setStatus($status)
    {
        if (
            !in_array(
                $status,
                array(
                    self::STATUS_SUCCESS,
                    self::STATUS_ERROR,
                    self::STATUS_FAIL,
                )
            )
        ) {
            throw new Doozr_Base_Response_Rest_Exception(

            );
        }

        $this->status = $status;
    }
1091019
public function setStatusCode(int $statusCode, string $statusText = null)
    {
        $this->statusCode = $statusCode;

        if ($statusText === null && isset(ResponseHeaders::$statusTexts[$statusCode])) {
            $this->statusText = ResponseHeaders::$statusTexts[$statusCode];
        } else {
            $this->statusText = $statusText;
        }
    }
1369694
public function setStatus($status)
    {
        $statusAttribute = $this->statusAttribute;
        return (is_string($statusAttribute) && !empty($statusAttribute)) ? $this->$statusAttribute = $status : null;
    }
291081
public void setServerName(String serverName) {
    if (serverName == null || serverName.equals("")) {
      this.serverName = "localhost";
    } else {
      this.serverName = serverName;
    }
  }
766998
void setAppName(final String appName) {
        if (clusterId.applicationName != null && !clusterId.applicationName.equals(appName))
            throw new IllegalStateException("Restting the application name on a cluster is not allowed.");
        clusterId = new ClusterId(appName, clusterId.clusterName);
    }
1203744
def set_status(self, status, origin=None, force=False):
        

        if not self.slave and origin not in self.program_stack:
            raise ValueError('Status cannot be changed directly')

        with self._actuator_status_lock:
            self.logger.debug("set_status got through, program: %s", origin)
            self.logger.debug("Set_status %s %s %s", self.name, origin, status)

            if self.slave:
                return self._do_change_status(status, force)

            self.logger.debug("Sets status %s for %s", status, origin.name)

            with self._program_lock:
                self.program_status[origin] = status

                if self.program == origin:
                    return self._do_change_status(status, force)
903311
public function exportActivity(string $appname):Renderer
    {
        $appconfig = null;
        $file = JL::open(FEnv::get("framework.config.core.apps.file"));
        foreach ($file as $one => $val) {
            if ($val->name == $appname) {
                $appconfig = $val;
                break;
            }
        }
        if ($appconfig == null) {
            throw new Server500(new \ArrayObject(array("The application $appname does not exist.",
                "Please check your app configuration")));
        }
        unset($appconfig->enabled);

        try {
            $date = new \DateTime();
            $datefull = $date;
            $date = $date->format('YmdHi');
            $dirbase = FEnv::get("framework.bin").'exports/';
            $dirapp = $dirbase.($appname).'/';
            $dirappexp  = $dirapp.($appname)."_".$date.'/';
            Server::create($dirbase, 'directory');
            Server::create($dirapp, 'directory');
            Server::create($dirappexp, 'directory');
            JL::put($dirappexp."register.json", json_encode($appconfig, JSON_PRETTY_PRINT));
            $zip = new ZipEngine($dirapp.($appname)."_".$date.".zip");
            $zip->setSource(FEnv::get("framework.apps").$appname);
            $zip->addFile($dirappexp."register.json", "register.json");
            $zip->setArchiveComment("$appname - Export date :".$datefull->format('g:ia \o\n l jS F Y'));
            $zip->recursiveCompress();
            if ($zip->close()) {
                Server::delete($dirappexp, 'directory');
                return ((new Renderer())->jsonRenderer(array("code" => 200, "msg" => "OK")));
            } else {
                return ((new Renderer())->jsonRenderer(array("code" => 500,
                    "msg" => "Error on archive creation process")));
            }
        } catch (\Exception $e) {
            return ((new Renderer())->jsonRenderer(array("code" => 500,
                "msg" => "Error on archive creation process : ".$e->getMessage())));
        }
    }
567048
public static function createIncorrectStatus($status, \Exception $e = null)
    {
        $message = 'Expected server status to be "OK", got "%s" instead';

        return new static(sprintf($message, $status), null, $e);
    }
458978
public T setAppName(String appName) {
    checkNotNull(appName, "appName");
    builder.appName = appName;
    return self();
  }
1328062
public function setStatus($status = null)
    {
        switch ($status) {
            //TODO implement all status codes
            case '500':
                $this->setStatusCode('HTTP/1.0 500 Internal Server Error');
                break;
            case '404':
                $this->setStatusCode('HTTP/1.0 404 Not Found');
                break;
            case '403':
                $this->setStatusCode('HTTP/1.0 403 Forbidden');
                break;
            case '402':
                $this->setStatusCode('HTTP/1.0 402 Payment Required');
                break;
            case '401':
                $this->setStatusCode('HTTP/1.0 401 Unauthorized');
                break;
            case '400':
                $this->setStatusCode('HTTP/1.0 400 Bad Request');
                break;
            case '200':
                $this->setStatusCode(Template::STATUS_OK);
                break;
            default:
                $this->setStatusCode('HTTP/1.0 ' .($status ?: 200));
                break;
        }
        return $this;
    }
359868
public function setStatus($status)
    {
        if ($this->isValidStatus($status)) {
            $this->status = $status;
            $this->saveState();
        } else {
            throw new \InvalidArgumentException(
                sprintf("Status '%s' is not a valid status", $status)
            );
        }
    }
574154
public void setStatus(int status) {
        // 311717
        if (com.ibm.ejs.ras.TraceComponent.isAnyTracingEnabled()&&logger.isLoggable (Level.FINE)) {  //306998.15
            logger.entering(CLASS_NAME,"setStatus", " status --> " + String.valueOf(status)+ " ["+this+"]");
        }
        WebAppDispatcherContext dispatchContext = (WebAppDispatcherContext) getRequest().getWebAppDispatcherContext();
        if (dispatchContext.isInclude() == true) {
            if (com.ibm.ejs.ras.TraceComponent.isAnyTracingEnabled()&&logger.isLoggable (Level.FINE)) {  //306998.15
                logger.logp(Level.FINE, CLASS_NAME,"setStatus", nls.getString("Illegal.from.included.servlet", "Illegal from included servlet"), "setStatus status --> " + String.valueOf(status));  //311717
            }
        }
        else {
            if (!_ignoreStateErrors && isCommitted()) {
                logger.logp(Level.WARNING, CLASS_NAME,"setStatus", "Cannot.set.status.Response.already.committed");
            }
            else {
                if (WCCustomProperties.RESET_BUFFER_ON_SET_STATUS)
                    resetBuffer();
                _response.setStatusCode(status);
                _statusCode = status;
            }
        }
        if (com.ibm.ejs.ras.TraceComponent.isAnyTracingEnabled()&&logger.isLoggable (Level.FINE)) {  //306998.15
            logger.exiting(CLASS_NAME,"setStatus");
        }
    }