Example usage for org.apache.commons.lang.builder ToStringStyle SHORT_PREFIX_STYLE

List of usage examples for org.apache.commons.lang.builder ToStringStyle SHORT_PREFIX_STYLE

Introduction

In this page you can find the example usage for org.apache.commons.lang.builder ToStringStyle SHORT_PREFIX_STYLE.

Prototype

ToStringStyle SHORT_PREFIX_STYLE

To view the source code for org.apache.commons.lang.builder ToStringStyle SHORT_PREFIX_STYLE.

Click Source Link

Document

The short prefix toString style.

Usage

From source file:com.norconex.collector.http.sitemap.impl.DefaultSitemapResolver.java

@Override
public String toString() {
    return new ToStringBuilder(this, ToStringStyle.SHORT_PREFIX_STYLE)
            .append("sitemapLocations", sitemapLocations).append("lenient", lenient).toString();
}

From source file:edu.internet2.middleware.psp.util.PSPUtil.java

public static String toString(ModifyRequest modifyRequest) {
    ToStringBuilder toStringBuilder = new ToStringBuilder(modifyRequest, ToStringStyle.SHORT_PREFIX_STYLE);
    toStringBuilder.append("psoID", PSPUtil.toString(modifyRequest.getPsoID()));
    for (Modification modification : modifyRequest.getModifications()) {
        for (Object object : modification.getOpenContentElements(DSMLModification.class)) {
            toStringBuilder.append("mod", PSPUtil.toString((DSMLModification) object));
        }/*from   www .j ava2  s  .c o m*/
        try {
            Map<String, List<Reference>> references = PSPUtil.getReferences(modification.getCapabilityData());
            for (String typeOfReference : references.keySet()) {
                toStringBuilder.append("typeOfReference", typeOfReference);
            }
        } catch (PspException e) {
            // (Probably not a good idea, but this should never happen. ;-)
            throw new RuntimeException(e);
        }
    }
    toStringBuilder.append("returnData", modifyRequest.getReturnData());
    toStringBuilder.appendSuper(PSPUtil.toString((Request) modifyRequest));
    return toStringBuilder.toString();
}

From source file:io.horizondb.io.buffers.CompositeBuffer.java

/**
 * {@inheritDoc}//  w w w .ja  v a  2s .c  o  m
 */
@Override
public String toString() {
    return new ToStringBuilder(this, ToStringStyle.SHORT_PREFIX_STYLE).append("endianness", this.endianness)
            .append("offset", this.offset).append("readerIndex", this.readerIndex)
            .append("buffers", this.buffers).toString();
}

From source file:edu.internet2.middleware.psp.util.PSPUtil.java

public static String toString(ModifyResponse modifyResponse) {
    ToStringBuilder toStringBuilder = new ToStringBuilder(modifyResponse, ToStringStyle.SHORT_PREFIX_STYLE);
    toStringBuilder.append("pso", PSPUtil.toString(modifyResponse.getPso()));
    toStringBuilder.appendSuper(PSPUtil.toString((Response) modifyResponse));
    return toStringBuilder.toString();
}

From source file:edu.internet2.middleware.psp.util.PSPUtil.java

public static String toString(PSO pso) {
    ToStringBuilder toStringBuilder = new ToStringBuilder(pso, ToStringStyle.SHORT_PREFIX_STYLE);
    if (pso != null) {
        toStringBuilder.append("psoID", PSPUtil.toString(pso.getPsoID()));
        // TODO data ? or leave for trace xml
        // TODO capability ?
        List<AlternateIdentifier> altIds = pso.getOpenContentElements(AlternateIdentifier.class);
        if (!altIds.isEmpty()) {
            toStringBuilder.append("alternateIdentifiers", altIds);
        }/*w  ww .j  av  a 2  s  .c  o m*/
    }
    return toStringBuilder.toString();
}

From source file:com.datatorrent.stram.plan.physical.PTOperator.java

/**
 *
 * @return String/*from   ww  w.java 2 s .  c o m*/
 */
@Override
public String toString() {
    return new ToStringBuilder(this, ToStringStyle.SHORT_PREFIX_STYLE).append("id", id).append("name", name)
            .toString();
}

From source file:jp.primecloud.auto.process.nifty.NiftyInstanceProcess.java

protected void init(NiftyProcessClient niftyProcessClient, Long instanceNo) {
    NiftyInstance niftyInstance = niftyInstanceDao.read(instanceNo);
    NiftyKeyPair niftyKeyPair = niftyKeyPairDao.read(niftyInstance.getKeyPairNo());

    // //from  w  ww  .  ja va  2s. c  o m
    String instanceId = niftyInstance.getInstanceId();
    Instance instance = instanceDao.read(instanceNo);
    Platform platform = platformDao.read(niftyProcessClient.getPlatformNo());
    processLogger.writeLogSupport(ProcessLogger.LOG_DEBUG, null, instance, "NiftyInstanceInitialize",
            new Object[] { platform.getPlatformName(), instanceId });

    // SSH?
    Session session = JSchUtils.createSessionByPrivateKey("root", niftyKeyPair.getPrivateKey(),
            niftyKeyPair.getPassphrase(), niftyInstance.getIpAddress());

    try {
        // ??
        Image image = imageDao.read(instance.getImageNo());
        File imageFile = new File(imageDir, image.getImageName() + ".tar");
        FileInputStream input = null;
        try {
            input = new FileInputStream(imageFile);
            JSchUtils.sftpPut(session, input, "/tmp/image.tar");
        } catch (IOException e) {
            throw new RuntimeException(e);
        } finally {
            IOUtils.closeQuietly(input);
        }

        // ?
        String userData = createUserData(instanceNo);

        // ?
        String command = "mkdir -p /tmp/image/ && tar xvf /tmp/image.tar -C /tmp/image/ && /tmp/image/init.sh \""
                + userData + "\"";
        long timeout = 60 * 30 * 1000L;
        if (initTimeout != null) {
            timeout = initTimeout;
        }
        JSchResult result = JSchUtils.executeCommand(session, command, "UTF-8", timeout, true);

        if (result.getExitStatus() != 0) {
            // ???
            AutoException exception = new AutoException("EPROCESS-000616", instanceNo);
            exception.addDetailInfo(
                    "result=" + ReflectionToStringBuilder.toString(result, ToStringStyle.SHORT_PREFIX_STYLE));
            throw exception;
        }

    } finally {
        if (session != null) {
            session.disconnect();
        }
    }

    // 
    processLogger.writeLogSupport(ProcessLogger.LOG_DEBUG, null, instance, "NiftyInstanceInitializeFinish",
            new Object[] { platform.getPlatformName(), instanceId });

    // 
    niftyInstance = niftyInstanceDao.read(instanceNo);
    niftyInstance.setInitialized(true);
    niftyInstanceDao.update(niftyInstance);
}

From source file:edu.internet2.middleware.psp.util.PSPUtil.java

public static String toString(PSOIdentifier psoIdentifier) {
    if (psoIdentifier == null) {
        return null;
    }/*  ww w. j  av a2  s  . c o m*/
    ToStringBuilder toStringBuilder = new ToStringBuilder(psoIdentifier, ToStringStyle.SHORT_PREFIX_STYLE);
    toStringBuilder.append("id", "'" + psoIdentifier.getID() + "'");
    toStringBuilder.append("targetID", psoIdentifier.getTargetID());
    toStringBuilder.append("containerID", PSPUtil.getString(psoIdentifier.getContainerID()));
    return toStringBuilder.toString();
}

From source file:de.iteratec.iteraplan.model.attribute.BBAttribute.java

@Override
public String toString() {
    ToStringBuilder builder = new ToStringBuilder(this, ToStringStyle.SHORT_PREFIX_STYLE);
    builder.append("name", name);
    builder.append("type", type);

    return builder.toString();
}

From source file:edu.internet2.middleware.psp.util.PSPUtil.java

public static String toString(Query query) {
    if (query == null) {
        return null;
    }/*w  w  w . j  av a2 s . co  m*/
    ToStringBuilder toStringBuilder = new ToStringBuilder(query, ToStringStyle.SHORT_PREFIX_STYLE);
    if (query.getQueryClauses() != null) {
        for (QueryClause queryClause : query.getQueryClauses()) {
            if (queryClause != null) {
                if (queryClause instanceof HasReference) {
                    HasReference hasReference = (HasReference) queryClause;
                    ToStringBuilder hasReferenceBuilder = new ToStringBuilder(hasReference,
                            ToStringStyle.SHORT_PREFIX_STYLE);
                    hasReferenceBuilder.append("toPsoID", PSPUtil.toString(hasReference.getToPsoID()));
                    hasReferenceBuilder.append("typeOfReference", hasReference.getTypeOfReference());
                    toStringBuilder.append("hasReference", hasReferenceBuilder.toString());
                } else if (queryClause instanceof Filter) {
                    try {
                        Filter filter = (Filter) queryClause;
                        toStringBuilder.append("filter", newLinePattern.matcher(filter.toXML()).replaceAll(""));
                    } catch (DSMLProfileException e) {
                        // ignore
                    }
                }
            }
        }
    }
    toStringBuilder.append("basePsoID", PSPUtil.toString(query.getBasePsoID()));
    toStringBuilder.append("scope", query.getScope());
    toStringBuilder.append("targetID", query.getTargetID());
    return toStringBuilder.toString();
}