Search in sources :

Example 11 with JsonIgnore

use of org.apache.flink.shaded.jackson2.com.fasterxml.jackson.annotation.JsonIgnore in project atlasdb by palantir.

the class ConnectionConfig method getHikariConfig.

@JsonIgnore
@Value.Derived
public HikariConfig getHikariConfig() {
    // Initialize the Hikari configuration
    HikariConfig config = new HikariConfig();
    Properties props = getHikariProperties();
    config.setPoolName("db-pool-" + getConnId() + "-" + getDbLogin());
    config.setRegisterMbeans(true);
    config.setMetricRegistry(SharedMetricRegistries.getOrCreate("com.palantir.metrics"));
    config.setMinimumIdle(getMinConnections());
    config.setMaximumPoolSize(getMaxConnections());
    config.setMaxLifetime(TimeUnit.SECONDS.toMillis(getMaxConnectionAge()));
    config.setIdleTimeout(TimeUnit.SECONDS.toMillis(getMaxIdleTime()));
    config.setLeakDetectionThreshold(getUnreturnedConnectionTimeout());
    // Not a bug - we don't want to use connectionTimeout here, since Hikari uses a different terminology.
    // See https://github.com/brettwooldridge/HikariCP/wiki/Configuration - connectionTimeout = how long to wait for a connection to be opened.
    // ConnectionConfig.connectionTimeoutSeconds is passed in via getHikariProperties(), in subclasses.
    config.setConnectionTimeout(getCheckoutTimeout());
    // TODO: See if driver supports JDBC4 (isValid()) and use it.
    config.setConnectionTestQuery(getTestQuery());
    if (!props.isEmpty()) {
        config.setDataSourceProperties(props);
    }
    config.setJdbcUrl(getUrl());
    DataSource dataSource = wrapDataSourceWithVisitor(new DriverDataSource(getUrl(), getDriverClass(), props, null, null), getOnAcquireConnectionVisitor());
    config.setDataSource(dataSource);
    return config;
}
Also used : DriverDataSource(com.zaxxer.hikari.util.DriverDataSource) HikariConfig(com.zaxxer.hikari.HikariConfig) Properties(java.util.Properties) DriverDataSource(com.zaxxer.hikari.util.DriverDataSource) InterceptorDataSource(com.palantir.nexus.db.pool.InterceptorDataSource) DataSource(javax.sql.DataSource) JsonIgnore(com.fasterxml.jackson.annotation.JsonIgnore)

Example 12 with JsonIgnore

use of org.apache.flink.shaded.jackson2.com.fasterxml.jackson.annotation.JsonIgnore in project uploader by smoketurner.

the class AwsConfiguration method getCredentials.

@JsonIgnore
public AwsCredentialsProvider getCredentials() {
    final AwsCredentialsProvider credentials;
    if (!Strings.isNullOrEmpty(accessKey) && !Strings.isNullOrEmpty(secretKey)) {
        credentials = StaticCredentialsProvider.create(AwsCredentials.create(accessKey, secretKey));
    } else {
        credentials = DefaultCredentialsProvider.create();
    }
    if (Strings.isNullOrEmpty(stsRoleArn)) {
        return credentials;
    }
    final STSClient stsClient = STSClient.builder().credentialsProvider(credentials).region(region).build();
    final AssumeRoleRequest assumeRoleRequest = AssumeRoleRequest.builder().roleArn(stsRoleArn).build();
    return StsAssumeRoleCredentialsProvider.builder().stsClient(stsClient).refreshRequest(assumeRoleRequest).build();
}
Also used : AssumeRoleRequest(software.amazon.awssdk.services.sts.model.AssumeRoleRequest) STSClient(software.amazon.awssdk.services.sts.STSClient) AwsCredentialsProvider(software.amazon.awssdk.core.auth.AwsCredentialsProvider) JsonIgnore(com.fasterxml.jackson.annotation.JsonIgnore)

Example 13 with JsonIgnore

use of org.apache.flink.shaded.jackson2.com.fasterxml.jackson.annotation.JsonIgnore in project irida by phac-nml.

the class IridaSequenceFilePair method getReverseSequenceFile.

/**
 * Get the reverse oriented {@link SequenceFile}
 *
 * @return reverse {@link SequenceFile}
 */
@JsonIgnore
public default IridaSequenceFile getReverseSequenceFile() {
    IridaSequenceFile[] pair = getFiles().toArray(new IridaSequenceFile[getFiles().size()]);
    String[] filenames = { pair[0].getFile().getFileName().toString(), pair[1].getFile().getFileName().toString() };
    int index = StringUtils.indexOfDifference(filenames[0], filenames[1]);
    if (Stream.of(reverseMatches).anyMatch(x -> String.valueOf(filenames[0].charAt(index)).equals(x))) {
        return pair[0];
    } else if (Stream.of(reverseMatches).anyMatch(x -> String.valueOf(filenames[1].charAt(index)).equals(x))) {
        return pair[1];
    } else {
        throw new NoSuchElementException();
    }
}
Also used : Stream(java.util.stream.Stream) JsonIgnore(com.fasterxml.jackson.annotation.JsonIgnore) Set(java.util.Set) NoSuchElementException(java.util.NoSuchElementException) StringUtils(org.apache.commons.lang3.StringUtils) SequenceFile(ca.corefacility.bioinformatics.irida.model.sequenceFile.SequenceFile) NoSuchElementException(java.util.NoSuchElementException) JsonIgnore(com.fasterxml.jackson.annotation.JsonIgnore)

Example 14 with JsonIgnore

use of org.apache.flink.shaded.jackson2.com.fasterxml.jackson.annotation.JsonIgnore in project api-core by ca-cwds.

the class BaseAttorney method getPhones.

// =======================
// ApiMultiplePhonesAware:
// =======================
@JsonIgnore
@Override
@Transient
public ApiPhoneAware[] getPhones() {
    List<ApiPhoneAware> phones = new ArrayList<>();
    if (this.primaryPhoneNumber != null && this.messagePhoneNumber != 0) {
        phones.add(new ReadablePhone(null, String.valueOf(this.primaryPhoneNumber), this.primaryPhoneExtensionNumber != null ? this.primaryPhoneExtensionNumber.toString() : null, null));
    }
    if (this.messagePhoneNumber != null && this.messagePhoneNumber != 0) {
        LOGGER.debug("add message phone");
        phones.add(new ReadablePhone(null, String.valueOf(this.messagePhoneNumber), this.messagePhoneExtensionNumber != null ? this.messagePhoneExtensionNumber.toString() : null, ApiPhoneAware.PhoneType.Cell));
    }
    return phones.toArray(new ApiPhoneAware[0]);
}
Also used : ReadablePhone(gov.ca.cwds.data.ReadablePhone) ApiPhoneAware(gov.ca.cwds.data.std.ApiPhoneAware) ArrayList(java.util.ArrayList) JsonIgnore(com.fasterxml.jackson.annotation.JsonIgnore) Transient(java.beans.Transient)

Example 15 with JsonIgnore

use of org.apache.flink.shaded.jackson2.com.fasterxml.jackson.annotation.JsonIgnore in project SONG by overture-stack.

the class StudyWithDonors method getStudy.

@JsonIgnore
public Study getStudy() {
    val s = Study.create(getStudyId(), getName(), getOrganization(), getDescription());
    s.setInfo(getInfoAsString());
    return s;
}
Also used : lombok.val(lombok.val) JsonIgnore(com.fasterxml.jackson.annotation.JsonIgnore)

Aggregations

JsonIgnore (com.fasterxml.jackson.annotation.JsonIgnore)111 lombok.val (lombok.val)14 ArrayList (java.util.ArrayList)11 HashMap (java.util.HashMap)8 Map (java.util.Map)8 HashSet (java.util.HashSet)7 ObjectMapper (com.fasterxml.jackson.databind.ObjectMapper)5 Date (java.util.Date)5 Field (com.hortonworks.registries.common.Schema.Field)4 Set (java.util.Set)4 Schema (com.hortonworks.registries.common.Schema)3 PrimaryKey (com.hortonworks.registries.storage.PrimaryKey)3 EntitlementException (com.sun.identity.entitlement.EntitlementException)3 PolicyException (com.sun.identity.policy.PolicyException)3 JsonArray (io.vertx.core.json.JsonArray)3 List (java.util.List)3 SequenceFile (ca.corefacility.bioinformatics.irida.model.sequenceFile.SequenceFile)2 TrustAndKeyProvider (com.codingchili.core.security.TrustAndKeyProvider)2 JsonProcessingException (com.fasterxml.jackson.core.JsonProcessingException)2 TypeReference (com.fasterxml.jackson.core.type.TypeReference)2