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


Java Authentication类代码示例

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


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

示例1: ApiClient

import io.swagger.client.auth.Authentication; //导入依赖的package包/类
public ApiClient() {
  // Use ISO 8601 format for date and datetime.
  // See https://en.wikipedia.org/wiki/ISO_8601
  this.dateFormat = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSSZ");

  // Use UTC as the default time zone.
  this.dateFormat.setTimeZone(TimeZone.getTimeZone("UTC"));

  // Set default User-Agent.
  setUserAgent("Java-Swagger");

  // Setup authentications (key: authentication name, value: authentication).
  authentications = new HashMap<String, Authentication>();
  // Prevent the authentications from being modified.
  authentications = Collections.unmodifiableMap(authentications);
}
 
开发者ID:normalian,项目名称:BotDirectlineApp-Java,代码行数:17,代码来源:ApiClient.java

示例2: initializeInstance

import io.swagger.client.auth.Authentication; //导入依赖的package包/类
public static void initializeInstance(Cache cache, Network network, int threadPoolSize, ResponseDelivery delivery, int connectionTimeout) {
  INSTANCE = new ApiInvoker(cache, network, threadPoolSize, delivery, connectionTimeout);
  setUserAgent("Swagger-Codegen/1.0.0/android");

  // Setup authentications (key: authentication name, value: authentication).
  INSTANCE.authentications = new HashMap<String, Authentication>();
  // Prevent the authentications from being modified.
  INSTANCE.authentications = Collections.unmodifiableMap(INSTANCE.authentications);
}
 
开发者ID:wondenge,项目名称:payments-Android-SDK,代码行数:10,代码来源:ApiInvoker.java

示例3: setUsername

import io.swagger.client.auth.Authentication; //导入依赖的package包/类
/**
 * Helper method to set username for the first HTTP basic authentication.
 */
public void setUsername(String username) {
  for (Authentication auth : authentications.values()) {
     if (auth instanceof HttpBasicAuth) {
         ((HttpBasicAuth) auth).setUsername(username);
         return;
     }
  }
  throw new RuntimeException("No HTTP basic authentication configured!");
}
 
开发者ID:wondenge,项目名称:payments-Android-SDK,代码行数:13,代码来源:ApiInvoker.java

示例4: setPassword

import io.swagger.client.auth.Authentication; //导入依赖的package包/类
/**
 * Helper method to set password for the first HTTP basic authentication.
 */
public void setPassword(String password) {
  for (Authentication auth : authentications.values()) {
     if (auth instanceof HttpBasicAuth) {
        ((HttpBasicAuth) auth).setPassword(password);
        return;
     }
  }
  throw new RuntimeException("No HTTP basic authentication configured!");
}
 
开发者ID:wondenge,项目名称:payments-Android-SDK,代码行数:13,代码来源:ApiInvoker.java

示例5: setApiKey

import io.swagger.client.auth.Authentication; //导入依赖的package包/类
/**
 * Helper method to set API key value for the first API key authentication.
 */
public void setApiKey(String apiKey) {
  for (Authentication auth : authentications.values()) {
    if (auth instanceof ApiKeyAuth) {
      ((ApiKeyAuth) auth).setApiKey(apiKey);
      return;
    }
  }
  throw new RuntimeException("No API key authentication configured!");
}
 
开发者ID:wondenge,项目名称:payments-Android-SDK,代码行数:13,代码来源:ApiInvoker.java

示例6: setApiKeyPrefix

import io.swagger.client.auth.Authentication; //导入依赖的package包/类
/**
 * Helper method to set API key prefix for the first API key authentication.
 */
public void setApiKeyPrefix(String apiKeyPrefix) {
  for (Authentication auth : authentications.values()) {
    if (auth instanceof ApiKeyAuth) {
      ((ApiKeyAuth) auth).setApiKeyPrefix(apiKeyPrefix);
      return;
    }
  }
  throw new RuntimeException("No API key authentication configured!");
}
 
开发者ID:wondenge,项目名称:payments-Android-SDK,代码行数:13,代码来源:ApiInvoker.java

示例7: updateParamsForAuth

import io.swagger.client.auth.Authentication; //导入依赖的package包/类
/**
 * Update query and header parameters based on authentication settings.
 *
 * @param authNames The authentications to apply
 */
private void updateParamsForAuth(String[] authNames, List<Pair> queryParams, Map<String, String> headerParams) {
  for (String authName : authNames) {
    Authentication auth = authentications.get(authName);
    if (auth == null) throw new RuntimeException("Authentication undefined: " + authName);
      auth.applyToParams(queryParams, headerParams);
  }
}
 
开发者ID:wondenge,项目名称:payments-Android-SDK,代码行数:13,代码来源:ApiInvoker.java

示例8: initializeInstance

import io.swagger.client.auth.Authentication; //导入依赖的package包/类
public static void initializeInstance(Cache cache, Network network, int threadPoolSize, ResponseDelivery delivery, int connectionTimeout) {
  INSTANCE = new ApiInvoker(cache, network, threadPoolSize, delivery, connectionTimeout);
  setUserAgent("Swagger-Codegen/1.0.0/android");

  // Setup authentications (key: authentication name, value: authentication).
  INSTANCE.authentications = new HashMap<String, Authentication>();
  INSTANCE.authentications.put("jenkins_auth", new HttpBasicAuth());
  // Prevent the authentications from being modified.
  INSTANCE.authentications = Collections.unmodifiableMap(INSTANCE.authentications);
}
 
开发者ID:cliffano,项目名称:swaggy-jenkins,代码行数:11,代码来源:ApiInvoker.java

示例9: ApiClient

import io.swagger.client.auth.Authentication; //导入依赖的package包/类
public ApiClient() {
    httpClient = new OkHttpClient();

    verifyingSsl = true;

    json = new JSON(this);

    /*
     * Use RFC3339 format for date and datetime.
     * See http://xml2rfc.ietf.org/public/rfc/html/rfc3339.html#anchor14
     */
    this.dateFormat = new SimpleDateFormat("yyyy-MM-dd");
    // Always use UTC as the default time zone when dealing with date (without time).
    this.dateFormat.setTimeZone(TimeZone.getTimeZone("UTC"));
    initDatetimeFormat();

    // Be lenient on datetime formats when parsing datetime from string.
    // See <code>parseDatetime</code>.
    this.lenientDatetimeFormat = true;

    // Set default User-Agent.
    setUserAgent("Swagger-Codegen/1.0.0/java");

    // Setup authentications (key: authentication name, value: authentication).
    authentications = new HashMap<String, Authentication>();

}
 
开发者ID:Tradeshift,项目名称:tradeshift-platform-sdk,代码行数:28,代码来源:ApiClient.java

示例10: setUsername

import io.swagger.client.auth.Authentication; //导入依赖的package包/类
/**
 * Helper method to set username for the first HTTP basic authentication.
 *
 * @param username Username
 */
public void setUsername(String username) {
    for (Authentication auth : authentications.values()) {
        if (auth instanceof HttpBasicAuth) {
            ((HttpBasicAuth) auth).setUsername(username);
            return;
        }
    }
    throw new RuntimeException("No HTTP basic authentication configured!");
}
 
开发者ID:Tradeshift,项目名称:tradeshift-platform-sdk,代码行数:15,代码来源:ApiClient.java

示例11: setPassword

import io.swagger.client.auth.Authentication; //导入依赖的package包/类
/**
 * Helper method to set password for the first HTTP basic authentication.
 *
 * @param password Password
 */
public void setPassword(String password) {
    for (Authentication auth : authentications.values()) {
        if (auth instanceof HttpBasicAuth) {
            ((HttpBasicAuth) auth).setPassword(password);
            return;
        }
    }
    throw new RuntimeException("No HTTP basic authentication configured!");
}
 
开发者ID:Tradeshift,项目名称:tradeshift-platform-sdk,代码行数:15,代码来源:ApiClient.java

示例12: setApiKey

import io.swagger.client.auth.Authentication; //导入依赖的package包/类
/**
 * Helper method to set API key value for the first API key authentication.
 *
 * @param apiKey API key
 */
public void setApiKey(String apiKey) {
    for (Authentication auth : authentications.values()) {
        if (auth instanceof ApiKeyAuth) {
            ((ApiKeyAuth) auth).setApiKey(apiKey);
            return;
        }
    }
    throw new RuntimeException("No API key authentication configured!");
}
 
开发者ID:Tradeshift,项目名称:tradeshift-platform-sdk,代码行数:15,代码来源:ApiClient.java

示例13: setApiKeyPrefix

import io.swagger.client.auth.Authentication; //导入依赖的package包/类
/**
 * Helper method to set API key prefix for the first API key authentication.
 *
 * @param apiKeyPrefix API key prefix
 */
public void setApiKeyPrefix(String apiKeyPrefix) {
    for (Authentication auth : authentications.values()) {
        if (auth instanceof ApiKeyAuth) {
            ((ApiKeyAuth) auth).setApiKeyPrefix(apiKeyPrefix);
            return;
        }
    }
    throw new RuntimeException("No API key authentication configured!");
}
 
开发者ID:Tradeshift,项目名称:tradeshift-platform-sdk,代码行数:15,代码来源:ApiClient.java

示例14: updateParamsForAuth

import io.swagger.client.auth.Authentication; //导入依赖的package包/类
/**
 * Update query and header parameters based on authentication settings.
 *
 * @param authNames The authentications to apply
 * @param queryParams  List of query parameters
 * @param headerParams  Map of header parameters
 */
public void updateParamsForAuth(String[] authNames, List<Pair> queryParams, Map<String, String> headerParams) {
    for (String authName : authNames) {
        Authentication auth = authentications.get(authName);
        if (auth == null) throw new RuntimeException("Authentication undefined: " + authName);
        auth.applyToParams(queryParams, headerParams);
    }
}
 
开发者ID:Tradeshift,项目名称:tradeshift-platform-sdk,代码行数:15,代码来源:ApiClient.java

示例15: ApiClient

import io.swagger.client.auth.Authentication; //导入依赖的package包/类
public ApiClient() {
    httpClient = new OkHttpClient();

    verifyingSsl = true;

    json = new JSON(this);

    /*
     * Use RFC3339 format for date and datetime.
     * See http://xml2rfc.ietf.org/public/rfc/html/rfc3339.html#anchor14
     */
    this.dateFormat = new SimpleDateFormat("yyyy-MM-dd");
    // Always use UTC as the default time zone when dealing with date (without time).
    this.dateFormat.setTimeZone(TimeZone.getTimeZone("UTC"));
    initDatetimeFormat();

    // Be lenient on datetime formats when parsing datetime from string.
    // See <code>parseDatetime</code>.
    this.lenientDatetimeFormat = true;

    // Set default User-Agent.
    setUserAgent("Swagger-Codegen/1.0.0/java");

    // Setup authentications (key: authentication name, value: authentication).
    authentications = new HashMap<String, Authentication>();
    // Prevent the authentications from being modified.
    authentications = Collections.unmodifiableMap(authentications);
}
 
开发者ID:simplesteph,项目名称:nifi-api-client-java,代码行数:29,代码来源:ApiClient.java


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