Package com.alibaba.citrus.util

Examples of com.alibaba.citrus.util.ToStringBuilder$MapBuilder


        // 排序cookie。
        Collections.sort(cookiesInfo.cookieList);

        if (log.isDebugEnabled()) {
            ToStringBuilder buf = new ToStringBuilder();

            buf.format("[%s] Loading cookies: %d cookies found", getStoreName(), cookiesInfo.cookieList.size());

            if (isEmptyArray(cookiesInfo.checksumList)) {
                if (checksum) {
                    buf.append("\n No checksum cookie");
                }
            } else {
                buf.format("\n %s[expected cookies=%d]=%s", checksumName, cookiesInfo.checksumList.length,
                           ObjectUtil.toString(cookiesInfo.checksumList));
            }

            for (CookieInfo cookieInfo : cookiesInfo.cookieList) {
                int length = 0;

                if (cookieInfo.value != null) {
                    length = cookieInfo.value.length();
                }

                buf.format("\n %s[length=%d]=%s", cookieInfo.name, length, cookieInfo.value);
            }

            log.debug(buf.toString());
        }

        return cookiesInfo;
    }
View Full Code Here


        mb.append("sessionID", sessionID);
        mb.append("creationTime", creationTime <= 0 ? "n/a" : fmt.format(new Date(creationTime)));
        mb.append("lastAccessedTime", lastAccessedTime <= 0 ? "n/a" : fmt.format(new Date(lastAccessedTime)));
        mb.append("maxInactiveInterval", maxInactiveInterval);

        return new ToStringBuilder().append("SessionModel").append(mb).toString();
    }
View Full Code Here

        }

        // 如果失败,记录日志
        if (attrs.isEmpty() && encoderExceptions != null) {
            if (log.isWarnEnabled()) {
                ToStringBuilder buf = new ToStringBuilder();

                buf.append("Failed to decode cookie value: ").append(cookieValue);

                int i = 0;
                for (Exception e : encoderExceptions) {
                    buf.format("\n  Encoder #%d - %s threw %s", i + 1, encoders[i].getClass().getSimpleName(), e);
                }

                log.warn(buf.toString());
            }
        } else {
            if (log.isDebugEnabled()) {
                int attrCount = attrs.size();
                ToStringBuilder buf = new ToStringBuilder();

                buf.format("Found %d attributes:", attrCount);

                if (!attrs.isEmpty()) {
                    buf.append(new MapBuilder().setPrintCount(true).setSortKeys(true).appendAll(attrs));
                }

                log.debug(buf.toString());
            }
        }

        return attrs;
    }
View Full Code Here

        mb.append("value", value);
        mb.append("storeName", storeName);
        mb.append("loaded", loaded);
        mb.append("modified", modified);

        return new ToStringBuilder().append("SessionAttribute").append(mb).toString();
    }
View Full Code Here

        mb.append("type:name", key);
        mb.append("beanName", beanName);
        mb.append("source", source);

        return new ToStringBuilder().append("Module").append(mb).toString();
    }
View Full Code Here

        mb.append("request", getRequest());
        mb.append("response", getResponse());
        mb.append("webapp", getServletContext());

        return new ToStringBuilder().append(getClass().getSimpleName()).append(mb).toString();
    }
View Full Code Here

    public final String toString() {
        MapBuilder mb = new MapBuilder();

        toString(mb);

        return new ToStringBuilder().append("CookieStore").append(mb).toString();
    }
View Full Code Here

        attrsBuilder.appendAll(attrs);
        attrsBuilder.remove(modelKey);

        mb.append("attrs", attrsBuilder);

        return new ToStringBuilder().append("HttpSession").append(mb).toString();
    }
View Full Code Here

            mb.append("conditions", conditions);
        }

        mb.append("substitution", substitution);

        return new ToStringBuilder().append("RewriteRule").append(mb).toString();
    }
View Full Code Here

        return buf.toString();
    }

    @Override
    public String toString() {
        return new ToStringBuilder().append("RandomSessionIDGenerator[length=").append(length).append("]").toString();
    }
View Full Code Here

TOP

Related Classes of com.alibaba.citrus.util.ToStringBuilder$MapBuilder

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.