Maps the {@link InternalKieScanner.Status} to a scanner status used by KIE Server.

@param status {@link InternalKieScanner.Status} to be converted

@return {@link KieScannerStatus} which maps to the specified {@link InternalKieScanner.Status}
183440
public static KieScannerStatus mapScannerStatus(InternalKieScanner.Status status) {
        switch (status) {
            case STARTING:
                return KieScannerStatus.CREATED;
            case RUNNING:
                return KieScannerStatus.STARTED;
            case SCANNING:
            case UPDATING:
                return KieScannerStatus.SCANNING;
            case STOPPED:
                return KieScannerStatus.STOPPED;
            case SHUTDOWN:
                return KieScannerStatus.DISPOSED;
            default:
                return KieScannerStatus.UNKNOWN;
        }
    }
823651
public Status getStatus(CmsUUID id) {

        CmsDetailPageInfo info = m_infoById.get(id);
        if (info == null) {
            return Status.noDetailPage;
        }
        String type = info.getType();
        int index = m_map.get(type).indexOf(info);
        if (index == 0) {
            return Status.firstDetailPage;
        }
        return Status.otherDetailPage;
    }
970891
public StatusGroup getStatusGroup()
    {
        StatusGroup ret;
        try {
            ret = Status.get(statusGroupUUID);
        } catch (final CacheReloadException e) {
            LOG.error("Catched CacheReloadException", e);
            ret = null;
        }
        return ret;
    }
77982
@POST
  @Path("/statuses")
  @Produces(APPLICATION_JSON)
  @Timed
  @ExceptionMetered
  public Map<String, HostStatus> hostStatuses(
      final List<String> hosts,
      @QueryParam("status") @DefaultValue("") final String statusFilter) {
    final Map<String, HostStatus> statuses = Maps.newHashMap();
    for (final String host : hosts) {
      final HostStatus status = model.getHostStatus(host);
      if (status != null) {
        if (isNullOrEmpty(statusFilter) || statusFilter.equals(status.getStatus().toString())) {
          statuses.put(host, status);
        }
      }
    }
    return statuses;
  }
409734
public ReturnCode status(boolean starting) {
        // Use initialized bootstrap configuration to find the server lock file.
        ServerLock serverLock = ServerLock.createTestLock(bootProps);
        ReturnCode rc = ReturnCode.OK;

        // The lock file may have been (erroneously) deleted: this can happen on linux
        boolean lockExists = serverLock.lockFileExists();

        if (lockExists) {
            // If the lock exists, check quickly to see if the process is holding it.
            if (serverLock.testServerRunning()) {
                rc = ReturnCode.OK;
            } else {
                // nope: lock not held, we're not running
                rc = ReturnCode.REDUNDANT_ACTION_STATUS;
            }
        } else {
            // no lock file: we assume the server is not running.
            rc = ReturnCode.REDUNDANT_ACTION_STATUS;
        }

        if (rc == ReturnCode.OK) {
            String pid = getPID();
            if (pid == null) {
                if (starting) {
                    System.out.println(MessageFormat.format(BootstrapConstants.messages.getString("info.serverIsAlreadyRunning"), serverName));
                } else {
                    System.out.println(MessageFormat.format(BootstrapConstants.messages.getString("info.serverIsRunning"), serverName));
                }
            } else {
                if (starting) {
                    System.out.println(MessageFormat.format(BootstrapConstants.messages.getString("info.serverIsAlreadyRunningWithPID"), serverName, pid));
                } else {
                    System.out.println(MessageFormat.format(BootstrapConstants.messages.getString("info.serverIsRunningWithPID"), serverName, pid));
                }
            }
        } else if (rc == ReturnCode.REDUNDANT_ACTION_STATUS) {
            if (!starting) {
                System.out.println(MessageFormat.format(BootstrapConstants.messages.getString("info.serverNotRunning"), serverName));
            }
        } else if (rc == ReturnCode.SERVER_NOT_EXIST_STATUS) {
            System.out.println(MessageFormat.format(BootstrapConstants.messages.getString("info.serverNotExist"), serverName));
        } else {
            if (!starting) {
                System.out.println(MessageFormat.format(BootstrapConstants.messages.getString("info.serverStatusException"), serverName));
            } else {
                if (rc == ReturnCode.SERVER_UNKNOWN_STATUS) {
                    String pid = getPID();
                    String pidFile = launchArgs.getOption(INTERNAL_PID_FILE);
                    if (pid == null || pidFile == null) {
                        System.out.println(MessageFormat.format(BootstrapConstants.messages.getString("info.serverStartException"), serverName));
                    } else {
                        System.out.println(MessageFormat.format(BootstrapConstants.messages.getString("info.serverStartUnreachable"), serverName, pidFile, pid));
                    }
                } else {
                    System.out.println(MessageFormat.format(BootstrapConstants.messages.getString("info.serverStartException"), serverName));
                }
            }
        }

        return rc;
    }
1143074
private static IdTagInfo__.Status convert(AuthorizationResultStatus status) {
        IdTagInfo__.Status result;

        switch (status) {
            case ACCEPTED:
                result = IdTagInfo__.Status.ACCEPTED;
                break;
            case BLOCKED:
                result = IdTagInfo__.Status.BLOCKED;
                break;
            case EXPIRED:
                result = IdTagInfo__.Status.EXPIRED;
                break;
            case INVALID:
                result = IdTagInfo__.Status.INVALID;
                break;
            default:
                throw new AssertionError("AuthorizationResultStatus has unknown status: " + status);
        }

        return result;
    }
1232508
public synchronized InstanceStatus setStatus(InstanceStatus status) {
        if (this.status != status) {
            InstanceStatus prev = this.status;
            this.status = status;
            setIsDirty();
            return prev;
        }
        return null;
    }
484183
public static String getStatusDescription(int status)
   {
      String description = "";

      Integer statusKey = new Integer(status);
      if (statusDescriptions.containsKey(statusKey))
      {
         description = statusDescriptions.get(statusKey);
      }

      return String.format("%s %d %s", WebDavConst.HTTPVER, status, description);
   }
1360841
PollingState<T> withStatus(String status, int statusCode) throws IllegalArgumentException {
        if (status == null) {
            throw new IllegalArgumentException("Status is null.");
        }
        this.status = status;
        this.statusCode = statusCode;
        return this;
    }
359230
public static String printStatus(int status)
    {
        switch (status)
        {
        case Status.STATUS_ACTIVE:
            return "Status.STATUS_ACTIVE";
        case Status.STATUS_COMMITTED:
            return "Status.STATUS_COMMITTED";
        case Status.STATUS_COMMITTING:
            return "Status.STATUS_COMMITTING";
        case Status.STATUS_MARKED_ROLLBACK:
            return "Status.STATUS_MARKED_ROLLBACK";
        case Status.STATUS_NO_TRANSACTION:
            return "Status.STATUS_NO_TRANSACTION";
        case Status.STATUS_PREPARED:
            return "Status.STATUS_PREPARED";
        case Status.STATUS_PREPARING:
            return "Status.STATUS_PREPARING";
        case Status.STATUS_ROLLEDBACK:
            return "Status.STATUS_ROLLEDBACK";
        case Status.STATUS_ROLLING_BACK:
            return "Status.STATUS_ROLLING_BACK";
        default:
            return "Status.STATUS_UNKNOWN";
        }
    }
476312
public static Action status(final HttpStatus status) {
        return new Action(input -> {
            input.setStatus(status);
            return input;
        });
    }
1214644
public StatusData<ApacheMetrics> parse(String status) {
        if (StringUtils.isEmpty(status))
            throw new IllegalArgumentException("Empty status to parse!");

        final StatusData<ApacheMetrics> result = new StatusData<>();
        String[] lines = StringUtils.tokenize(status, '\n');
        //extract hostname separately
        result.put(ApacheMetrics.HOSTNAME, lines[0]);
        lines = Arrays.copyOfRange(lines, 1, lines.length);

        for (String line : lines) {
            line = line.trim();
            final int delimIndex = line.indexOf(": ");
            if (delimIndex <= 0) {
                LOGGER.warn("ApacheStatusParser: failed to parse status line: '" + line + "'.");
            } else {
                final String metric = line.substring(0, delimIndex);
                final String value  = line.substring(2+ delimIndex);
                switch (metric) {
                    case "ServerVersion": break;
                    case "ServerMPM": break;
                    case "Server Built": break;
                    case "CurrentTime": break;
                    case "RestartTime": break;
                    case "ParentServerConfigGeneration": break;
                    case "ParentServerMPMGeneration": break;
                    case "ServerUptimeSeconds": result.put(ApacheMetrics.SERVER_UPTIME, value); break;
                    case "ServerUptime": result.put(ApacheMetrics.UPTIME, value); break;
                    case "Load1": result.put(ApacheMetrics.LOAD_1M, value); break;
                    case "Load5": result.put(ApacheMetrics.LOAD_5M, value); break;
                    case "Load15": result.put(ApacheMetrics.LOAD_15M, value); break;
                    case "Total Accesses":
                        result.put(ApacheMetrics.TOTAL_ACCESSES, value);
                        result.put(ApacheMetrics.REQUESTS_PER_SEC, value);
                        break;
                    case "Total kBytes":
                        result.put(ApacheMetrics.TOTAL_KBYTES, value);
                        result.put(ApacheMetrics.KBYTES_PER_SEC, value);
                        break;
                    case "CPUUser": result.put(ApacheMetrics.CPU_USER, value); break;
                    case "CPUSystem": result.put(ApacheMetrics.CPU_SYSTEM, value); break;
                    case "CPUChildrenUser": result.put(ApacheMetrics.CPU_CHILDREN_USER, value); break;
                    case "CPUChildrenSystem": result.put(ApacheMetrics.CPU_CHILDREN_SYSTEM, value); break;
                    case "CPULoad": result.put(ApacheMetrics.CPU_LOAD, value); break;
                    case "Uptime": break;
                    case "ReqPerSec": break;
                    case "BytesPerSec": break;
                    case "BytesPerReq": break;
                    case "BusyWorkers": result.put(ApacheMetrics.WORKERS_BUSY, value); break;
                    case "IdleWorkers": result.put(ApacheMetrics.WORKERS_IDLE, value); break;
                    case "ConnsTotal": result.put(ApacheMetrics.CONNECTIONS_TOTAL, value); break;
                    case "ConnsAsyncWriting": result.put(ApacheMetrics.CONNECTIONS_ASYNC_WRITING, value); break;
                    case "ConnsAsyncKeepAlive": result.put(ApacheMetrics.CONNECTIONS_ASYNC_KEEPALIVE, value); break;
                    case "ConnsAsyncClosing": result.put(ApacheMetrics.CONNECTIONS_ASYNC_CLOSING, value); break;
                    case "Scoreboard": parseScoreboard(result, value); break;
                    default: LOGGER.warn("ApacheStatusParser: found unhandled status line: '" + line + "'.");
                }
            }
        }
        return result;
    }
226139
def _check_status(status):
        
        if status == 0:
            # When there are no results, just return.
            return
        if status == 1:
            raise GeocoderServiceError(
                'Internal server error.'
            )
        elif status == 2:
            raise GeocoderQueryError(
                'Invalid request.'
            )
        elif status == 3:
            raise GeocoderAuthenticationFailure(
                'Authentication failure.'
            )
        elif status == 4:
            raise GeocoderQuotaExceeded(
                'Quota validate failure.'
            )
        elif status == 5:
            raise GeocoderQueryError(
                'AK Illegal or Not Exist.'
            )
        elif status == 101:
            raise GeocoderAuthenticationFailure(
                'No AK'
            )
        elif status == 102:
            raise GeocoderAuthenticationFailure(
                'MCODE Error'
            )
        elif status == 200:
            raise GeocoderAuthenticationFailure(
                'Invalid AK'
            )
        elif status == 211:
            raise GeocoderAuthenticationFailure(
                'Invalid SN'
            )
        elif 200 <= status < 300:
            raise GeocoderAuthenticationFailure(
                'Authentication Failure'
            )
        elif 300 <= status < 500:
            raise GeocoderQuotaExceeded(
                'Quota Error.'
            )
        else:
            raise GeocoderQueryError('Unknown error. Status: %r' % status)
868021
public static String getStatusText(int status) {
		switch (status) {
		case SSH_FX_OK:
			return "OK";
		case SSH_FX_EOF:
			return "EOF";
		case SSH_FX_NO_SUCH_FILE:
			return "No such file.";
		case SSH_FX_PERMISSION_DENIED:
			return "Permission denied.";
		case SSH_FX_FAILURE:
			return "Server responded with an unknown failure.";
		case SSH_FX_BAD_MESSAGE:
			return "Server responded to a bad message.";
		case SSH_FX_NO_CONNECTION:
			return "No connection available.";
		case SSH_FX_CONNECTION_LOST:
			return "Connection lost.";
		case SSH_FX_OP_UNSUPPORTED:
			return "The operation is unsupported.";
		case SSH_FX_INVALID_HANDLE:
		case INVALID_HANDLE:
			return "Invalid file handle.";
		case SSH_FX_NO_SUCH_PATH:
			return "No such path.";
		case SSH_FX_FILE_ALREADY_EXISTS:
			return "File already exists.";
		case SSH_FX_WRITE_PROTECT:
			return "Write protect error.";
		case SSH_FX_NO_MEDIA:
			return "No media at location";
		case SSH_FX_NO_SPACE_ON_FILESYSTEM:
			return "No space on filesystem";
		case SSH_FX_QUOTA_EXCEEDED:
			return "Quota exceeded";
		case SSH_FX_UNKNOWN_PRINCIPAL:
			return "Unknown principal";
		case SSH_FX_LOCK_CONFLICT:
			return "Lock conflict";
		case SSH_FX_DIR_NOT_EMPTY:
			return "Dir not empty";
		case SSH_FX_NOT_A_DIRECTORY:
			return "Not a directory";
		case SSH_FX_INVALID_FILENAME:
			return "Invalid filename";
		case SSH_FX_LINK_LOOP:
			return "Link loop";
		case SSH_FX_CANNOT_DELETE:
			return "Cannot delete";
		case SSH_FX_INVALID_PARAMETER:
			return "Invalid parameter";
		case SSH_FX_FILE_IS_A_DIRECTORY:
			return "File is a directory";
		case SSH_FX_BYTE_RANGE_LOCK_CONFLICT:
			return "Byte range lock conflict";
		case SSH_FX_BYTE_RANGE_LOCK_REFUSED:
			return "Byte range lock refused";
		case SSH_FX_DELETE_PENDING:
			return "Delete pending";
		case SSH_FX_FILE_CORRUPT:
			return "File corrupt";
		case SSH_FX_OWNER_INVALID:
			return "Owner invalid";
		case SSH_FX_GROUP_INVALID:
			return "Group invalid";
		case SSH_FX_NO_MATCHING_BYTE_RANGE_LOCK:
			return "No matching byte range lock";
		case INVALID_RESUME_STATE:
			return "Invalid resume state";
		default:
			return "Unknown status type " + String.valueOf(status);
		}
	}
615913
public StatusResponse status(String region) throws ApiException {
        ApiResponse<StatusResponse> resp = statusWithHttpInfo(region);
        return resp.getData();
    }
907717
public static String getStatusAsString(int status)
   {
      if (status >= Status.STATUS_ACTIVE && status <= Status.STATUS_ROLLING_BACK)
      {
         return TX_STATUS_STRINGS[status];
      }
      else
      {
         return "STATUS_INVALID(" + status + ")";
      }
   }
301153
public void setStatus(java.util.Collection<BulkEmailDestinationStatus> status) {
        if (status == null) {
            this.status = null;
            return;
        }

        this.status = new com.amazonaws.internal.SdkInternalList<BulkEmailDestinationStatus>(status);
    }