Codota Logo
SessionOptions$Builder
Code IndexAdd Codota to your IDE (free)

How to use
SessionOptions$Builder
in
com.jimmoores.quandl

Best Java code snippets using com.jimmoores.quandl.SessionOptions$Builder (Showing top 10 results out of 315)

  • Add the Codota plugin to your IDE and get smart completions
private void myMethod () {
Connection c =
  • Codota IconDataSource dataSource;dataSource.getConnection()
  • Codota IconString url;DriverManager.getConnection(url)
  • Codota IconIdentityDatabaseUtil.getDBConnection()
  • Smart code suggestions by Codota
}
origin: jimmoores/quandl4j

/**
 * Create a Quandl session without an authorization token (authToken). An attempt will be made to read the java property
 * <em>quandl.auth.token</em> and use that if available. Any resulting SecurityException is logged at debug level, otherwise it is ignored
 * and no auth token is used. Using a token means you can make more requests. Note creating this object does not make any actual API
 * requests, the token is used in subsequent requests.
 * 
 * @return an instance of the Quandl session, not null.
 */
public static QuandlSession create() {
 try {
  String authToken = System.getProperty(GenericQuandlSession.QUANDL_AUTH_TOKEN_PROPERTY_NAME);
  if (authToken != null) {
   return new QuandlSession(SessionOptions.Builder.withAuthToken(authToken).build());
  }
 } catch (SecurityException se) {
  s_logger.debug("Error accessing system property " + GenericQuandlSession.QUANDL_AUTH_TOKEN_PROPERTY_NAME + ", falling back to not using an auth token",
    se);
 }
 return new QuandlSession(SessionOptions.Builder.withoutAuthToken().build());
}
origin: jimmoores/quandl4j

private void runTests(final ClassicRESTDataProvider restDataProvider, final ResultProcessor resultProcessor, final RetryPolicy retryPolicy) {
 SessionOptions options;
 if (_apiKey != null) {
  s_logger.info("Creating Quandl Session using API key {}", _apiKey);
  options = SessionOptions.Builder
   .withAuthToken(_apiKey)
   .withRetryPolicy(retryPolicy)
   .build();
 } else {
  s_logger.warn("Creating Quandl Session without an API key");
  options = SessionOptions.Builder
    .withoutAuthToken()
    .withRetryPolicy(retryPolicy)
    .build();
 }
 ClassicQuandlSessionInterface session = ClassicQuandlSession.create(options, restDataProvider);
 Set<String> quandlCodes = sampleSearch(session, resultProcessor);
 fuzzDataSetRequests(session, resultProcessor, quandlCodes);
 //fuzzDataSetsRequests(session, resultProcessor, quandlCodes);
 runMetaDataRequests(session, resultProcessor, quandlCodes);
 //runMultiMetaDataRequests(session, resultProcessor, quandlCodes);
 if (restDataProvider instanceof RecordingRESTDataProvider) {
  RecordingRESTDataProvider recordingRESTDataProvider = (RecordingRESTDataProvider) restDataProvider;
  recordingRESTDataProvider.close(); // a somewhat unpleasant special-case hack, 
                    // probably not even necessary as each entry 
                    // is flushed to disk, but being careful.
 }
}
origin: jimmoores/quandl4j

private QuandlSession getTestSession(final String expectedURL) {
 return QuandlSession.create(
      SessionOptions.Builder.withoutAuthToken()
                 .withRESTDataProvider(
                   new TestRESTDataProvider(expectedURL))
                 .build());
}
origin: jimmoores/quandl4j

/**
 * Specify no auth token.
 * 
 * @return a Builder object for chaining, call build() to complete
 */
public static Builder withoutAuthToken() {
 return new Builder(null);
}
origin: jimmoores/quandl4j

/**
 * Create a Quandl session to use a specific authorization token (authToken) with all requests. Using a token means you can make more
 * requests. Note that this method does not check the quandl.auth.token property. Creating this object does not make any actual API
 * requests, the token is used in subsequent requests.
 * 
 * @param authToken a Quandl API authorization token
 * @return an instance of the Quandl session with an embedded authorization token
 */
public static QuandlSession create(final String authToken) {
 ArgumentChecker.notNull(authToken, "authToken");
 return new QuandlSession(SessionOptions.Builder.withAuthToken(authToken).build());
}
origin: jimmoores/quandl4j

private ClassicQuandlSessionInterface getTestSession(final String expectedURL) {
 return ClassicQuandlSession.create(
      SessionOptions.Builder.withoutAuthToken().build(), 
      new TestRESTDataProvider(expectedURL));
}
origin: jimmoores/quandl4j

/**
 * Specify a specific auth token.
 * 
 * @param authToken your auth token
 * @return a Builder object for chaining, call build() to complete
 */
public static Builder withAuthToken(final String authToken) {
 ArgumentChecker.notNull(authToken, "authToken");
 return new Builder(authToken);
}
origin: jimmoores/quandl4j

/**
 * Create a Quandl session without an authorization token (authToken). An attempt will be made to read the java property
 * <em>quandl.auth.token</em> and use that if available. Any resulting SecurityException is logged at debug level, otherwise it is ignored
 * and no auth token is used. Using a token means you can make more requests. Note creating this object does not make any actual API
 * requests, the token is used in subsequent requests.
 * 
 * @return an instance of the Quandl session, not null.
 */
public static ClassicQuandlSession create() {
 try {
  String authToken = System.getProperty(QUANDL_AUTH_TOKEN_PROPERTY_NAME);
  if (authToken != null) {
   return new ClassicQuandlSession(
     SessionOptions.Builder.withAuthToken(authToken).build(), 
     new JSONTabularResultRESTDataProvider(), 
     new ClassicMetaDataPackager());
  }
 } catch (SecurityException se) {
  LOGGER.debug("Error accessing system property " + QUANDL_AUTH_TOKEN_PROPERTY_NAME + ", falling back to not using an auth token",
    se);
 }
 return new ClassicQuandlSession(SessionOptions.Builder.withoutAuthToken().build(), new JSONTabularResultRESTDataProvider(), new ClassicMetaDataPackager());
}
origin: jimmoores/quandl4j

/**
 * Create a Quandl session without an authorization token (authToken). An attempt will be made to read the java property
 * <em>quandl.auth.token</em> and use that if available. Any resulting SecurityException is logged at debug level, otherwise it is ignored
 * and no auth token is used. Using a token means you can make more requests. Note creating this object does not make any actual API
 * requests, the token is used in subsequent requests.
 * 
 * @return an instance of the Quandl session, not null.
 */
public static TableSawQuandlSession create() {
 try {
  String authToken = System.getProperty(QUANDL_AUTH_TOKEN_PROPERTY_NAME);
  if (authToken != null) {
   return new TableSawQuandlSession(
     SessionOptions.Builder.withAuthToken(authToken).build(), 
     new JSONTableSawRESTDataProvider(), 
     new ClassicMetaDataPackager());
  }
 } catch (SecurityException se) {
  LOGGER.debug("Error accessing system property " + QUANDL_AUTH_TOKEN_PROPERTY_NAME + ", falling back to not using an auth token",
    se);
 }
 return new TableSawQuandlSession(SessionOptions.Builder.withoutAuthToken().build(), 
   new JSONTableSawRESTDataProvider(), new ClassicMetaDataPackager());
}
origin: jimmoores/quandl4j

 s_logger.info("Creating Quandl Session using API key {}", _apiKey);
 options = SessionOptions.Builder
  .withAuthToken(_apiKey)
  .withRESTDataProvider(restDataProvider)
  .withRetryPolicy(retryPolicy)
  .build();
} else {
 s_logger.warn("Creating Quandl Session without an API key");
 options = SessionOptions.Builder
   .withoutAuthToken()
   .withRESTDataProvider(restDataProvider)
   .withRetryPolicy(retryPolicy)
   .build();
com.jimmoores.quandlSessionOptions$Builder

Javadoc

Internal Builder class.

Most used methods

  • build
    Build an instance of QuandlOptions using the parameters in this builder instance.
  • withAuthToken
    Specify a specific auth token.
  • withoutAuthToken
    Specify no auth token.
  • <init>
  • withRESTDataProvider
    Specify a custom RESTDataProvider for the session to use when sending requests, intended for testing
  • withRetryPolicy
    Specify the number of retries to execute before giving up on a request.

Popular in Java

  • Parsing JSON documents to java classes using gson
  • getSystemService (Context)
  • getOriginalFilename (MultipartFile)
    Return the original filename in the client's filesystem.This may contain path information depending
  • requestLocationUpdates (LocationManager)
  • Graphics2D (java.awt)
    This Graphics2D class extends the Graphics class to provide more sophisticated control overgraphics
  • File (java.io)
    An "abstract" representation of a file system entity identified by a pathname. The pathname may be a
  • FileNotFoundException (java.io)
    Thrown when a file specified by a program cannot be found.
  • HttpURLConnection (java.net)
    An URLConnection for HTTP (RFC 2616 [http://tools.ietf.org/html/rfc2616]) used to send and receive d
  • ResultSet (java.sql)
    An interface for an object which represents a database table entry, returned as the result of the qu
  • NoSuchElementException (java.util)
    Thrown when trying to retrieve an element past the end of an Enumeration or Iterator.
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now