Skip to content

Commit

Permalink
Merge pull request #56 from jottley/develop
Browse files Browse the repository at this point in the history
Add Limits API, Bug fixes, Library updates
  • Loading branch information
jottley authored Jul 29, 2019
2 parents 3907078 + 789841f commit 8f3bd01
Show file tree
Hide file tree
Showing 15 changed files with 1,098 additions and 18 deletions.
8 changes: 5 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Spring Social Salesforce [![Build Status](https://travis-ci.org/jottley/spring-social-salesforce.svg?branch=master)](https://travis-ci.org/jottley/spring-social-salesforce) [ ![Download](https://api.bintray.com/packages/jottley/jottley/spring-social-salesforce/images/download.svg?version=1.2.0.2.RELEASE) ](https://bintray.com/jottley/jottley/spring-social-salesforce/1.2.0.2.RELEASE/link)
# Spring Social Salesforce [![Build Status](https://travis-ci.org/jottley/spring-social-salesforce.svg?branch=master)](https://travis-ci.org/jottley/spring-social-salesforce) [ ![Download](https://api.bintray.com/packages/jottley/jottley/spring-social-salesforce/images/download.svg?version=1.2.1.RELEASE) ](https://bintray.com/jottley/jottley/spring-social-salesforce/1.2.1.RELEASE/link)

Spring Social Salesforce is a Spring Social extension that provides connection support and api binding for Salesforce
Spring Social Salesforce is a Spring Social extension that provides connection support and api binding for the Salesforce
REST API.

To check out the project and build from source, do the following:
Expand All @@ -26,7 +26,7 @@ To include in your maven project use the following repository and dependency
<dependency>
<groupId>org.springframework.social</groupId>
<artifactId>spring-social-salesforce</artifactId>
<version>1.2.0.2.RELEASE</version>
<version>1.2.1.RELEASE</version>
</dependency>
...
</dependencies>
Expand All @@ -50,3 +50,5 @@ There is a spring boot quickstart app available at https://github.com/jottley/sp
- Retrieve user profile
- Retrieve user status
- Update user status
- List the limits of an org
- Check the current API limit and usage
15 changes: 11 additions & 4 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

<groupId>org.springframework.social</groupId>
<artifactId>spring-social-salesforce</artifactId>
<version>1.2.0.2.RELEASE</version>
<version>1.2.1.RELEASE</version>
<packaging>jar</packaging>

<name>spring-social-salesforce</name>
Expand All @@ -16,9 +16,9 @@
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<slf4j.version>1.7.7</slf4j.version>
<logback.version>1.2.3</logback.version>
<spring.version>4.2.2.RELEASE</spring.version>
<spring.version>4.3.20.RELEASE</spring.version>
<spring-social.version>1.1.4.RELEASE</spring-social.version>
<httpclient.version>4.5.2</httpclient.version>
<httpclient.version>4.5.3</httpclient.version>
<servlet.version>3.0.1</servlet.version>
<jackson.version>2.9.9.1</jackson.version>
<joor.version>0.9.4</joor.version>
Expand Down Expand Up @@ -240,5 +240,12 @@
</issueManagement>
<ciManagement>
<url>https://travis-ci.org/jottley/spring-social-salesforce</url>
</ciManagement>
</ciManagement>
<distributionManagement>
<repository>
<id>bintray-jottley-jottley</id>
<name>jottley-jottley</name>
<url>https://api.bintray.com/maven/jottley/jottley/spring-social-salesforce/;publish=1</url>
</repository>
</distributionManagement>
</project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
/**
* Copyright (C) 2019 https://github.com/jottley/spring-social-salesforce
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.springframework.social.salesforce.api;

import java.io.Serializable;
import java.util.HashMap;
import java.util.Map;

import com.fasterxml.jackson.annotation.JsonAnyGetter;
import com.fasterxml.jackson.annotation.JsonAnySetter;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;

@JsonInclude(JsonInclude.Include.NON_NULL)
/**
* The core limits properties. Any additional limits for connected apps can call
* be found in the additional properties
*
* @author Jared Ottley
*/
public class AbstractLimits implements Serializable {

private static final long serialVersionUID = 6213553807904726408L;

@JsonProperty("Max")
private int max;

@JsonProperty("Remaining")
private int remaining;

@JsonIgnore
private Map<String, Object> additionalProperties = new HashMap<String, Object>();

/**
* NOOP
*/
public AbstractLimits() {

}

/**
*
* @param remaining
* @param max
*/
public AbstractLimits(int max, int remaining) {
this.max = max;
this.remaining = remaining;
}

@JsonProperty("Max")
public int getMax() {
return max;
}

@JsonProperty("Remaining")
public int getRemaining() {
return remaining;
}

@JsonAnyGetter
public Map<String, Object> getAdditionalProperties() {
return this.additionalProperties;
}

@JsonAnySetter
public void setAdditionalProperty(String name, Object value) {
this.additionalProperties.put(name, value);
}

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
/**
* Copyright (C) 2019 https://github.com/jottley/spring-social-salesforce
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.springframework.social.salesforce.api;

import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonInclude;

import org.springframework.social.salesforce.api.AbstractLimits;

@JsonInclude(JsonInclude.Include.NON_NULL)
@JsonIgnoreProperties(ignoreUnknown = true)
/**
* @author Jared Ottley
*/
public class LimitResult extends AbstractLimits {

private static final long serialVersionUID = 1L;

/**
* No args constructor for use in serialization
*
*/
public LimitResult() {
super();
}

/**
*
* @param remaining
* @param max
*/
public LimitResult(Integer max, Integer remaining) {
super(max, remaining);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
/**
* Copyright (C) 2019 https://github.com/jottley/spring-social-salesforce
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.springframework.social.salesforce.api;

/**
* Defines operations for interacting with the Limits API.
*
* @author Jared Ottley
*/
public interface LimitsOperations {


/**
* Retrieve the organization limits
*
* @return LimitsResults
*/
public LimitsResults getLimits();

/**
* Get the current Daily API limit. This value is returned in a header from Salesforce. The value is persisted here after each API call.
* @return
*/
public int getDailyApiLimit();


/**
* Get the current Daily API usage. This value is returned in a header from Salesforce. The value is persisted here after each API call.
* @return
*/
public int getDailyApiUsed();

}
Loading

0 comments on commit 8f3bd01

Please sign in to comment.