當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。