Skip to content

Commit 8f3bd01

Browse files
authored
Merge pull request #56 from jottley/develop
Add Limits API, Bug fixes, Library updates
2 parents 3907078 + 789841f commit 8f3bd01

File tree

15 files changed

+1098
-18
lines changed

15 files changed

+1098
-18
lines changed

README.md

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
# 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)
1+
# 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)
22

3-
Spring Social Salesforce is a Spring Social extension that provides connection support and api binding for Salesforce
3+
Spring Social Salesforce is a Spring Social extension that provides connection support and api binding for the Salesforce
44
REST API.
55

66
To check out the project and build from source, do the following:
@@ -26,7 +26,7 @@ To include in your maven project use the following repository and dependency
2626
<dependency>
2727
<groupId>org.springframework.social</groupId>
2828
<artifactId>spring-social-salesforce</artifactId>
29-
<version>1.2.0.2.RELEASE</version>
29+
<version>1.2.1.RELEASE</version>
3030
</dependency>
3131
...
3232
</dependencies>
@@ -50,3 +50,5 @@ There is a spring boot quickstart app available at https://github.com/jottley/sp
5050
- Retrieve user profile
5151
- Retrieve user status
5252
- Update user status
53+
- List the limits of an org
54+
- Check the current API limit and usage

pom.xml

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
<groupId>org.springframework.social</groupId>
77
<artifactId>spring-social-salesforce</artifactId>
8-
<version>1.2.0.2.RELEASE</version>
8+
<version>1.2.1.RELEASE</version>
99
<packaging>jar</packaging>
1010

1111
<name>spring-social-salesforce</name>
@@ -16,9 +16,9 @@
1616
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
1717
<slf4j.version>1.7.7</slf4j.version>
1818
<logback.version>1.2.3</logback.version>
19-
<spring.version>4.2.2.RELEASE</spring.version>
19+
<spring.version>4.3.20.RELEASE</spring.version>
2020
<spring-social.version>1.1.4.RELEASE</spring-social.version>
21-
<httpclient.version>4.5.2</httpclient.version>
21+
<httpclient.version>4.5.3</httpclient.version>
2222
<servlet.version>3.0.1</servlet.version>
2323
<jackson.version>2.9.9.1</jackson.version>
2424
<joor.version>0.9.4</joor.version>
@@ -240,5 +240,12 @@
240240
</issueManagement>
241241
<ciManagement>
242242
<url>https://travis-ci.org/jottley/spring-social-salesforce</url>
243-
</ciManagement>
243+
</ciManagement>
244+
<distributionManagement>
245+
<repository>
246+
<id>bintray-jottley-jottley</id>
247+
<name>jottley-jottley</name>
248+
<url>https://api.bintray.com/maven/jottley/jottley/spring-social-salesforce/;publish=1</url>
249+
</repository>
250+
</distributionManagement>
244251
</project>
Lines changed: 85 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,85 @@
1+
/**
2+
* Copyright (C) 2019 https://github.com/jottley/spring-social-salesforce
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
package org.springframework.social.salesforce.api;
17+
18+
import java.io.Serializable;
19+
import java.util.HashMap;
20+
import java.util.Map;
21+
22+
import com.fasterxml.jackson.annotation.JsonAnyGetter;
23+
import com.fasterxml.jackson.annotation.JsonAnySetter;
24+
import com.fasterxml.jackson.annotation.JsonIgnore;
25+
import com.fasterxml.jackson.annotation.JsonInclude;
26+
import com.fasterxml.jackson.annotation.JsonProperty;
27+
28+
@JsonInclude(JsonInclude.Include.NON_NULL)
29+
/**
30+
* The core limits properties. Any additional limits for connected apps can call
31+
* be found in the additional properties
32+
*
33+
* @author Jared Ottley
34+
*/
35+
public class AbstractLimits implements Serializable {
36+
37+
private static final long serialVersionUID = 6213553807904726408L;
38+
39+
@JsonProperty("Max")
40+
private int max;
41+
42+
@JsonProperty("Remaining")
43+
private int remaining;
44+
45+
@JsonIgnore
46+
private Map<String, Object> additionalProperties = new HashMap<String, Object>();
47+
48+
/**
49+
* NOOP
50+
*/
51+
public AbstractLimits() {
52+
53+
}
54+
55+
/**
56+
*
57+
* @param remaining
58+
* @param max
59+
*/
60+
public AbstractLimits(int max, int remaining) {
61+
this.max = max;
62+
this.remaining = remaining;
63+
}
64+
65+
@JsonProperty("Max")
66+
public int getMax() {
67+
return max;
68+
}
69+
70+
@JsonProperty("Remaining")
71+
public int getRemaining() {
72+
return remaining;
73+
}
74+
75+
@JsonAnyGetter
76+
public Map<String, Object> getAdditionalProperties() {
77+
return this.additionalProperties;
78+
}
79+
80+
@JsonAnySetter
81+
public void setAdditionalProperty(String name, Object value) {
82+
this.additionalProperties.put(name, value);
83+
}
84+
85+
}
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
/**
2+
* Copyright (C) 2019 https://github.com/jottley/spring-social-salesforce
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
package org.springframework.social.salesforce.api;
17+
18+
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
19+
import com.fasterxml.jackson.annotation.JsonInclude;
20+
21+
import org.springframework.social.salesforce.api.AbstractLimits;
22+
23+
@JsonInclude(JsonInclude.Include.NON_NULL)
24+
@JsonIgnoreProperties(ignoreUnknown = true)
25+
/**
26+
* @author Jared Ottley
27+
*/
28+
public class LimitResult extends AbstractLimits {
29+
30+
private static final long serialVersionUID = 1L;
31+
32+
/**
33+
* No args constructor for use in serialization
34+
*
35+
*/
36+
public LimitResult() {
37+
super();
38+
}
39+
40+
/**
41+
*
42+
* @param remaining
43+
* @param max
44+
*/
45+
public LimitResult(Integer max, Integer remaining) {
46+
super(max, remaining);
47+
}
48+
}
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
/**
2+
* Copyright (C) 2019 https://github.com/jottley/spring-social-salesforce
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
package org.springframework.social.salesforce.api;
17+
18+
/**
19+
* Defines operations for interacting with the Limits API.
20+
*
21+
* @author Jared Ottley
22+
*/
23+
public interface LimitsOperations {
24+
25+
26+
/**
27+
* Retrieve the organization limits
28+
*
29+
* @return LimitsResults
30+
*/
31+
public LimitsResults getLimits();
32+
33+
/**
34+
* Get the current Daily API limit. This value is returned in a header from Salesforce. The value is persisted here after each API call.
35+
* @return
36+
*/
37+
public int getDailyApiLimit();
38+
39+
40+
/**
41+
* Get the current Daily API usage. This value is returned in a header from Salesforce. The value is persisted here after each API call.
42+
* @return
43+
*/
44+
public int getDailyApiUsed();
45+
46+
}

0 commit comments

Comments
 (0)