当前位置: 首页>>代码示例>>Java>>正文


Java ReflectionToStringBuilder类代码示例

本文整理汇总了Java中org.apache.commons.lang3.builder.ReflectionToStringBuilder的典型用法代码示例。如果您正苦于以下问题:Java ReflectionToStringBuilder类的具体用法?Java ReflectionToStringBuilder怎么用?Java ReflectionToStringBuilder使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


ReflectionToStringBuilder类属于org.apache.commons.lang3.builder包,在下文中一共展示了ReflectionToStringBuilder类的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: getTGT

import org.apache.commons.lang3.builder.ReflectionToStringBuilder; //导入依赖的package包/类
/**
 * Get a Ticket Granting Ticket (TGT) from Authentication Server (AS) with required keytab file.
 *
 * 1. Create and send AS-REQ
 * 2. Receive KRB ERROR (PRE-AUTH is mandatory in Kerberos v5)
 * 3. Re-send AS-REQ
 * 4. Receive AS-REP
 * 5. Return TGT credentials ticket in Java object
 *
 * @param keytabFileName Path file name to keytab (required already on disk storage, for instance
 *                       /etc/bob.keytab)
 * @param userName user name principal (UPN) (ex: [email protected])
 * @param realm Kerberos domain of the Authentication Server (ex: EXAMPLE.COM)
 * @return TGT credentials
 * @throws KrbException
 * @throws IOException
 *
 * Note: 
 * - For system administrator it is like the command: kinit -kt keytab upn 
 * - [WARNING] dependencies with internal proprietary API and may be removed in a future release
 */
public static Credentials getTGT(String keytabFileName, String userName, String realm)
    throws KrbException, IOException {

  KrbAsReqBuilder builder = null;
  try {

    PrincipalName userPrincipalName = new PrincipalName(userName);
    KeyTab keyTab = KeyTab.getInstance(new File(keytabFileName));
    builder = new KrbAsReqBuilder(userPrincipalName, keyTab);

    PrincipalName tgsPrincipalName = PrincipalName.tgsService(realm, realm);
    builder.setTarget(tgsPrincipalName);

    // see http://hg.openjdk.java.net/jdk8/jdk8/jdk/file/default/src/share/classes/sun/security/krb5/KdcComm.java#l145
    // for default parameters (timeout, max retries ...)
    builder.action();

    Credentials tgtCredentials = builder.getCCreds();
    if (DEBUG) {
      System.out.println(">>>TGT credentials : " +
          ReflectionToStringBuilder.toString(tgtCredentials));
    }
    return tgtCredentials;

  } finally {

    if (builder != null) {
      builder.destroy();
    }

  }

}
 
开发者ID:criteo,项目名称:kerberos-docker,代码行数:55,代码来源:KerberosTicketManager.java

示例2: toString

import org.apache.commons.lang3.builder.ReflectionToStringBuilder; //导入依赖的package包/类
@Override
public String toString() {
    return ReflectionToStringBuilder.toString(this);
}
 
开发者ID:3wks,项目名称:generator-thundr-gae-react,代码行数:5,代码来源:BaseDto.java

示例3: toString

import org.apache.commons.lang3.builder.ReflectionToStringBuilder; //导入依赖的package包/类
@Override
public String toString() {
    return ReflectionToStringBuilder.toString(this, ourStyle());
}
 
开发者ID:hmcts,项目名称:cmc-claim-store,代码行数:5,代码来源:Offer.java

示例4: toString

import org.apache.commons.lang3.builder.ReflectionToStringBuilder; //导入依赖的package包/类
@Override
public String toString() {
    return ReflectionToStringBuilder.toString(this, ToStringStyle.JSON_STYLE);
}
 
开发者ID:aartiPl,项目名称:SDI,代码行数:5,代码来源:CreatorParams.java

示例5: toString

import org.apache.commons.lang3.builder.ReflectionToStringBuilder; //导入依赖的package包/类
@Override
public String toString() {
	return ReflectionToStringBuilder.toString(this, ToStringStyle.MULTI_LINE_STYLE);
}
 
开发者ID:damianwajser,项目名称:spring-rest-commons-options,代码行数:5,代码来源:CollectionResources.java

示例6: toString

import org.apache.commons.lang3.builder.ReflectionToStringBuilder; //导入依赖的package包/类
@Override
public String toString() {
    return new ReflectionToStringBuilder(this, RecursiveToStringStyle.JSON_STYLE)
        .toString();
}
 
开发者ID:ExpediaDotCom,项目名称:haystack-client-java,代码行数:6,代码来源:TextMapPropagator.java


注:本文中的org.apache.commons.lang3.builder.ReflectionToStringBuilder类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。