Display the javax.xa.XAResource recover flag constant corresponding to the
value supplied.

@param level a valid javax.xa.XAResource recover flag constant.

@return the name of the constant, or a string indicating the constant is unknown.
438341
public static String getXAResourceRecoverFlagString(int flag) {
        switch (flag) {
            case XAResource.TMENDRSCAN:
                return "TMENDRSCAN (" + flag + ')'; 

            case XAResource.TMNOFLAGS:
                return "TMNOFLAGS (" + flag + ')'; 

            case XAResource.TMSTARTRSCAN:
                return "TMSTARTRSCAN (" + flag + ')'; 

            case XAResource.TMSTARTRSCAN + XAResource.TMENDRSCAN:
                return "TMSTARTRSCAN + TMENDRSCAN (" + flag + ')'; 

        }

        return "UNKNOWN XA RESOURCE RECOVER FLAG (" + flag + ')'; 
    }
157259
public function getXmlClassificationName($level)
    {
        if ($this->getXmlData()->processInformation->dataSetInformation->classificationInformation->classification->class) {
            foreach ($this->getXmlData()->processInformation->dataSetInformation->classificationInformation->classification->class as $classification) {
                if ($classification->attributes()->level == $level) {
                    return (string) $classification;
                }
            }
        }

        return null;
    }
696525
public static function toMonologLevel($level): int
    {
        if (is_string($level)) {
            if (defined(__CLASS__.'::'.strtoupper($level))) {
                return constant(__CLASS__.'::'.strtoupper($level));
            }

            throw new InvalidArgumentException('Level "'.$level.'" is not defined, use one of: '.implode(', ', array_keys(static::$levels)));
        }

        return $level;
    }
680206
@Nullable
    public static Level getLevelProperty(@Nonnull LogManager manager, @Nonnull String name, @Nullable Level defaultValue) {
        if (name == null) {
            return defaultValue;
        }
        String val = manager.getProperty(name);
        if (val == null) {
            return defaultValue;
        }
        Level l = LevelHelper.findLevel(val.trim());
        return l != null ? l : defaultValue;
    }
60699
public static int getIsolationLevelFor(String isoLevel)
    {
        if(isoLevel == null || StringUtils.isEmpty(isoLevel))
        {
            LoggerFactory.getDefaultLogger().debug(
                    "[LockHelper] Specified isolation level string is 'null', using the default isolation level");
            return IsolationLevels.IL_DEFAULT;
        }
        if (isoLevel.equalsIgnoreCase(IsolationLevels.LITERAL_IL_READ_UNCOMMITTED))
        {
            return IsolationLevels.IL_READ_UNCOMMITTED;
        }
        else if (isoLevel.equalsIgnoreCase(IsolationLevels.LITERAL_IL_READ_COMMITTED))
        {
            return IsolationLevels.IL_READ_COMMITTED;
        }
        else if (isoLevel.equalsIgnoreCase(IsolationLevels.LITERAL_IL_REPEATABLE_READ))
        {
            return IsolationLevels.IL_REPEATABLE_READ;
        }
        else if (isoLevel.equalsIgnoreCase(IsolationLevels.LITERAL_IL_SERIALIZABLE))
        {
            return IsolationLevels.IL_SERIALIZABLE;
        }
        else if (isoLevel.equalsIgnoreCase(IsolationLevels.LITERAL_IL_OPTIMISTIC))
        {
            return IsolationLevels.IL_OPTIMISTIC;
        }
        else if (isoLevel.equalsIgnoreCase(IsolationLevels.LITERAL_IL_NONE))
        {
            return IsolationLevels.IL_NONE;
        }
        LoggerFactory.getDefaultLogger().warn("[LockHelper] Unknown isolation-level '" + isoLevel + "', using default isolation level");
        return IsolationLevels.IL_DEFAULT;
    }
1072254
protected static Event.Level getLevel(Level level) {
        if (level.intValue() >= Level.SEVERE.intValue()) {
            return Event.Level.ERROR;
        } else if (level.intValue() >= Level.WARNING.intValue()) {
            return Event.Level.WARNING;
        } else if (level.intValue() >= Level.INFO.intValue()) {
            return Event.Level.INFO;
        } else if (level.intValue() >= Level.ALL.intValue()) {
            return Event.Level.DEBUG;
        } else {
            return null;
        }
    }
942487
private String getPropertyValue(String level, String name)
    {
        return getDefForLevel(level).getProperty(name);
    }
284792
public static function getLevelName(int $level): string
    {
        if (!isset(static::$levels[$level])) {
            throw new InvalidArgumentException('Level "'.$level.'" is not defined, use one of: '.implode(', ', array_keys(static::$levels)));
        }

        return static::$levels[$level];
    }
1212934
public String xaFlagsToString(int flags)
    {
        StringBuilder retval = new StringBuilder("Flags=");
        retval.append(Integer.toHexString(flags));
        retval.append("( ");

        if (flags == XAResource.TMNOFLAGS)
        {
            retval.append("TMNOFLAGS ");
        }
        else
        {
            if ((flags & XAResource.TMENDRSCAN)   != 0) retval.append("TMENDRSCAN ");
            if ((flags & XAResource.TMFAIL)       != 0) retval.append("TMFAIL ");
            if ((flags & XAResource.TMJOIN)       != 0) retval.append("TMJOIN ");
            if ((flags & XAResource.TMONEPHASE)   != 0) retval.append("TMONEPHASE ");
            if ((flags & XAResource.TMRESUME)     != 0) retval.append("TMRESUME ");
            if ((flags & XAResource.TMSTARTRSCAN) != 0) retval.append("TMSTARTRSCAN ");
            if ((flags & XAResource.TMSUCCESS)    != 0) retval.append("TMSUCCESS ");
            if ((flags & XAResource.TMSUSPEND)    != 0) retval.append("TMSUSPEND ");
        }

        retval.append(")");
        return retval.toString();
    }
986293
XAResource reconnectRM() throws XAException
    {
        if (tc.isEntryEnabled())
            Tr.entry(tc, "reconnectRM");

        XAResource resource = null;

        XARecoveryWrapper wrapper = null;

        if (_recoveryData != null)
        {
            wrapper = _recoveryData.getXARecoveryWrapper();
        }

        if (wrapper == null && _recovery)
        {
            // We've not yet deserialized the log data - retry later "quietly"
            final XAException xae = new XAException(XAException.XA_RETRY);
            if (tc.isEntryEnabled())
                Tr.exit(tc, "reconnectRM", xae);
            throw xae;
        }

        // If we have already created an XAResource by this method we need to destroy it
        if (_recoveredRM != null)
        {
            _recoveredRM.closeConnection();
            _recoveredRM = null;
        }

        if (wrapper != null)
        {
            try
            {
                _recoveredRM = _recoveryData.getXARminst();
            } catch (XAException e)
            {
                FFDCFilter.processException(e, "com.ibm.ws.Transaction.JTA.JTAXAResourceImpl.reconnectRM", "607", this);
                if (tc.isEntryEnabled())
                    Tr.exit(tc, "reconnectRM", XAReturnCodeHelper.convertXACode(e.errorCode));
                XAException xae = e;
                // We will convert any RMERR from getXARminst to RMFAIL. We do not want to return RMERR on commit/rollback
                // unless it has come from the resource as that then implies completion and we can then end the tran. An error
                // trying to get the resource should not allow the tran to complete since we may leave a resource in-doubt.
                // The downside of this is that we may retry forever - so the user needs to zap the tran via the console.
                // We need to allow some heuristic error codes through if the RM has been installed.
                if (e.errorCode == XAException.XAER_RMERR)
                {
                    xae = (XAException) (new XAException(XAException.XAER_RMFAIL).initCause(e));
                }
                if (tc.isEntryEnabled())
                    Tr.exit(tc, "reconnectRM", xae);
                throw xae;
            } catch (Throwable t) // @D666666C
            {
                // Catch throwable in case we get OOM etc as we want to retry in this case.
                FFDCFilter.processException(t, "com.ibm.ws.Transaction.JTA.JTAXAResourceImpl.reconnectRM", "524", this);
                if (tc.isDebugEnabled())
                    Tr.debug(tc, "reconnectRM caught ", t);
                final XAException xae = (XAException) (new XAException(XAException.XAER_RMFAIL).initCause(t));
                if (tc.isEntryEnabled())
                    Tr.exit(tc, "reconnectRM", xae);
                throw xae;
            }
            // If we successfully created an XARmist, then get the XAResource to work with
            if (_recoveredRM != null)
                resource = _recoveredRM.getXaResource();
            // Update state from FAILED to IDLE so we dont reconnect unnecessarily
            if (resource != null)
                _state = IDLE; // D419307A
        }

        if (tc.isEntryEnabled())
            Tr.exit(tc, "reconnectRM", resource);
        return resource;
    }
491853
public static int getIsolationLevel(SynchronizationRegistryUOWScope txKey) {
        ContainerTx ctx = (ContainerTx) txKey.getResource(containerTxResourceKey);
        if (ctx == null) {
            if (TraceComponent.isAnyTracingEnabled() && tc.isEventEnabled())
                Tr.event(tc, "ContainerTx is null, returning default");
            return com.ibm.websphere.csi.Defaults.DEFAULT_ISOLATION_LEVEL;
        } else {
            int isolationLevel = ctx.getIsolationLevel();
            // The new code may return NONE, so convert to old default.   d107762
            if (isolationLevel == java.sql.Connection.TRANSACTION_NONE)
                isolationLevel = com.ibm.websphere.csi.Defaults.DEFAULT_ISOLATION_LEVEL;
            return isolationLevel;
        }
    }
1206042
static java.util.logging.Level getPriorityForLevel(Level level) {
        switch  (level) {
            case DEBUG:
                return java.util.logging.Level.FINEST;
            case ERROR:
                return java.util.logging.Level.SEVERE;
            case FATAL:
                return java.util.logging.Level.SEVERE;
            case INFO:
                return java.util.logging.Level.INFO;
            case TRACE:
                return java.util.logging.Level.FINER;
            case WARN:
                return java.util.logging.Level.WARNING;
            default:
                return null;
        }
    }
259595
public static function psrToPhpLevel($level, $default = LOG_DEBUG): string
    {
        $psrLevel = array_search($level, self::$psrLogLevels);

        return $psrLevel ?: $default;
    }
1066458
private SIXAResource getXaResource() throws ResourceException
    {
        final String methodName = "getXaResource";
        if (TraceComponent.isAnyTracingEnabled() && TRACE.isEntryEnabled())
        {
            SibTr.entry(this, TRACE, methodName);
        }

        if (_xaResource == null)
        {
            try
            {
              _xaResource = _connection.getSIXAResource();
            }
            catch (final SIException exception)
            {
                FFDCFilter.processException(exception, CLASS_NAME + "."
                        + methodName, FFDC_PROBE_1, this);
                if (TraceComponent.isAnyTracingEnabled() && TRACE.isEventEnabled())
                {
                    SibTr.exception(this, TRACE, exception);
                }
                throw new ResourceException(NLS.getFormattedMessage(
                        ("XARESOURCE_EXCEPTION_CWSIV0650"), new Object[] {
                                exception, _connection }, null), exception);
            }
            catch (final SIErrorException exception)
            {
                FFDCFilter.processException(exception, CLASS_NAME + "."
                        + methodName, FFDC_PROBE_3, this);
                if (TraceComponent.isAnyTracingEnabled() && TRACE.isEventEnabled()) {
                    SibTr.exception(this, TRACE, exception);
                }
                throw new ResourceException(NLS.getFormattedMessage(
                        ("XARESOURCE_EXCEPTION_CWSIV0650"), new Object[] {
                                exception, _connection }, null), exception);
            }
        }

        if (TraceComponent.isAnyTracingEnabled() && TRACE.isEntryEnabled())
        {
            SibTr.exit(this, TRACE, methodName, _xaResource);
        }
        return _xaResource;
    }
280301
public String getResource(final int level) {
        if (level < resource.length) {
            return resource[level];
        }
        // offset is out of bounds...
        throw new IndexOutOfBoundsException("Index: " + level + ", Size: " + resource.length);
    }
601433
public static function toNumberLevel($level)
    {
        if (\is_string($level) && \defined(__CLASS__ . '::' . strtoupper($level))) {
            return \constant(__CLASS__ . '::' . strtoupper($level));
        }

        return $level;
    }
1050342
Level getLevelProperty(String name, Level defaultValue) {
        LogManager manager = LogManager.getLogManager();
        String val = manager.getProperty(name);
        if (val == null) {
            return defaultValue;
        }
        Level l = Level.parse(val.trim());
        return l != null ? l : defaultValue;
    }