Permalink
Browse files

initial Spring Social Xing implementation. Only basic UserProfile is …

…currently supported by the client classes.
  • Loading branch information...
1 parent fb13339 commit 6ad2a9451be4baec2a6fe953e9ffdfd708ed00bc Johannes Buehler committed Mar 17, 2012
Showing with 1,480 additions and 0 deletions.
  1. +42 −0 spring-social-xing/src/main/java/org/springframework/social/xing/api/BirthDate.java
  2. +92 −0 spring-social-xing/src/main/java/org/springframework/social/xing/api/BusinessAddress.java
  3. +56 −0 spring-social-xing/src/main/java/org/springframework/social/xing/api/PhotoUrls.java
  4. +47 −0 spring-social-xing/src/main/java/org/springframework/social/xing/api/ProfileOperations.java
  5. +44 −0 spring-social-xing/src/main/java/org/springframework/social/xing/api/Xing.java
  6. +157 −0 spring-social-xing/src/main/java/org/springframework/social/xing/api/XingProfile.java
  7. +19 −0 spring-social-xing/src/main/java/org/springframework/social/xing/api/XingProfiles.java
  8. +115 −0 spring-social-xing/src/main/java/org/springframework/social/xing/api/impl/AbstractTemplate.java
  9. +80 −0 ...l-xing/src/main/java/org/springframework/social/xing/api/impl/JsonFormatHeaderRequestFactory.java
  10. +55 −0 spring-social-xing/src/main/java/org/springframework/social/xing/api/impl/ProfileTemplate.java
  11. +138 −0 spring-social-xing/src/main/java/org/springframework/social/xing/api/impl/XingTemplate.java
  12. +19 −0 spring-social-xing/src/main/java/org/springframework/social/xing/api/impl/json/BirthDateMixin.java
  13. +32 −0 ...social-xing/src/main/java/org/springframework/social/xing/api/impl/json/BusinessAddressMixin.java
  14. +24 −0 spring-social-xing/src/main/java/org/springframework/social/xing/api/impl/json/PhotoUrlsMixin.java
  15. +40 −0 spring-social-xing/src/main/java/org/springframework/social/xing/api/impl/json/XingModule.java
  16. +57 −0 spring-social-xing/src/main/java/org/springframework/social/xing/api/impl/json/XingProfileMixin.java
  17. +31 −0 ...ng-social-xing/src/main/java/org/springframework/social/xing/api/impl/json/XingProfilesMixin.java
  18. +4 −0 spring-social-xing/src/main/java/org/springframework/social/xing/api/impl/package-info.java
  19. +4 −0 spring-social-xing/src/main/java/org/springframework/social/xing/api/package-info.java
  20. +59 −0 spring-social-xing/src/main/java/org/springframework/social/xing/connect/XingAdapter.java
  21. +31 −0 spring-social-xing/src/main/java/org/springframework/social/xing/connect/XingConnectionFactory.java
  22. +40 −0 spring-social-xing/src/main/java/org/springframework/social/xing/connect/XingServiceProvider.java
  23. +4 −0 spring-social-xing/src/main/java/org/springframework/social/xing/connect/package-info.java
  24. +37 −0 spring-social-xing/src/test/java/org/springframework/social/xing/api/impl/AbstractXingApiTest.java
  25. +55 −0 spring-social-xing/src/test/java/org/springframework/social/xing/api/impl/ProfileTemplateTest.java
  26. +142 −0 spring-social-xing/src/test/java/org/springframework/social/xing/api/impl/testdata/profile.json
  27. +8 −0 spring-social-xing/src/test/java/org/springframework/social/xing/api/impl/testdata/profile.xml
  28. +48 −0 spring-social-xing/src/test/java/org/springframework/social/xing/connect/XingAdapterTest.java
@@ -0,0 +1,42 @@
+package org.springframework.social.xing.api;
+
+import java.io.Serializable;
+
+public class BirthDate implements Serializable {
+
+ private static final long serialVersionUID = -4246513491965468863L;
+ private Long day;
+ private Long year;
+ private Long month;
+
+ public BirthDate(Long day, Long year, Long month) {
+ this.day = day;
+ this.year = year;
+ this.month = month;
+ }
+
+ public Long getDay() {
+ return day;
+ }
+
+ public void setDay(Long day) {
+ this.day = day;
+ }
+
+ public Long getYear() {
+ return year;
+ }
+
+ public void setYear(Long year) {
+ this.year = year;
+ }
+
+ public Long getMonth() {
+ return month;
+ }
+
+ public void setMonth(Long month) {
+ this.month = month;
+ }
+
+}
@@ -0,0 +1,92 @@
+package org.springframework.social.xing.api;
+
+
+import java.io.Serializable;
+
+public class BusinessAddress implements Serializable {
+
+ private static final long serialVersionUID = -4301007029555241358L;
+ private String fax;
+ private String mobilePhone;
+ private String phone;
+ private String zipCode;
+ private String country;
+ private String province;
+ private String city;
+ private String street;
+ private String email;
+
+
+ public Object getFax() {
+ return fax;
+ }
+
+ public void setFax(String fax) {
+ this.fax = fax;
+ }
+
+ public String getMobilePhone() {
+ return mobilePhone;
+ }
+
+ public void setMobilePhone(String mobilePhone) {
+ this.mobilePhone = mobilePhone;
+ }
+
+ public String getPhone() {
+ return phone;
+ }
+
+ public void setPhone(String phone) {
+ this.phone = phone;
+ }
+
+ public String getZipCode() {
+ return zipCode;
+ }
+
+ public void setZipCode(String zipCode) {
+ this.zipCode = zipCode;
+ }
+
+ public String getCountry() {
+ return country;
+ }
+
+ public void setCountry(String country) {
+ this.country = country;
+ }
+
+ public Object getProvince() {
+ return province;
+ }
+
+ public void setProvince(String province) {
+ this.province = province;
+ }
+
+ public String getCity() {
+ return city;
+ }
+
+ public void setCity(String city) {
+ this.city = city;
+ }
+
+ public String getStreet() {
+ return street;
+ }
+
+ public void setStreet(String street) {
+ this.street = street;
+ }
+
+ public String getEmail() {
+ return email;
+ }
+
+ public void setEmail(String email) {
+ this.email = email;
+ }
+
+}
@@ -0,0 +1,56 @@
+package org.springframework.social.xing.api;
+
+
+import java.io.Serializable;
+
+public class PhotoUrls implements Serializable{
+
+ private static final long serialVersionUID = 1379041303608063601L;
+ private String thumb;
+ private String miniThumb;
+ private String mediumThumb;
+ private String maxiThumb;
+ private String large;
+
+
+ public String getMediumThumb() {
+ return mediumThumb;
+ }
+
+ public void setMediumThumb(String mediumThumb) {
+ this.mediumThumb = mediumThumb;
+ }
+
+ public String getThumb() {
+ return thumb;
+ }
+
+ public void setThumb(String thumb) {
+ this.thumb = thumb;
+ }
+
+ public String getMiniThumb() {
+ return miniThumb;
+ }
+
+ public void setMiniThumb(String miniThumb) {
+ this.miniThumb = miniThumb;
+ }
+
+ public String getMaxiThumb() {
+ return maxiThumb;
+ }
+
+ public void setMaxiThumb(String maxiThumb) {
+ this.maxiThumb = maxiThumb;
+ }
+
+ public String getLarge() {
+ return large;
+ }
+
+ public void setLarge(String large) {
+ this.large = large;
+ }
+
+}
@@ -0,0 +1,47 @@
+/*
+ * Copyright 2012 the original author or authors.
+ *
+ * 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.xing.api;
+
+/**
+ * Operations on Profile API
+ *
+ * @author Robert Drysdale
+ */
+public interface ProfileOperations {
+
+ /**
+ * Retrieves the user's Xing profile ID.
+ *
+ * @return the user's Xing profile ID.
+ */
+ String getProfileId();
+
+ /**
+ * Retrieves the current user's profile details.
+ *
+ * @return the user's profile data.
+ */
+ XingProfile getUserProfile();
+
+ /**
+ * Retrieves a profile by id.
+ *
+ * @return the user's profile data.
+ */
+ XingProfile getProfileById(String id);
+
+
+}
@@ -0,0 +1,44 @@
+/*
+ * Copyright 2012 the original author or authors.
+ *
+ * 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.xing.api;
+
+import org.springframework.social.ApiBinding;
+import org.springframework.web.client.RestOperations;
+
+/**
+ * Interface specifying a basic set of operations for interacting with Xing. Implemented by {@link org.springframework.social.xing.api.impl.XingTemplate}.
+ * Many of the methods contained in this interface require OAuth authentication with Xing.
+ * When a method's description speaks of the "current user", it is referring to the user for whom the access token has been issued.
+ *
+ * @author Craig Walls
+ * @author Robert Drysdale
+ */
+public interface Xing extends ApiBinding {
+
+ /**
+ * API for retrieving and performing operations on profiles
+ */
+ ProfileOperations profileOperations();
+
+
+
+ /**
+ * Returns the underlying {@link RestOperations} object allowing for consumption of Xing endpoints that may not be otherwise covered by the API binding.
+ * The RestOperations object returned is configured to include an OAuth "Authorization" header on all requests.
+ */
+ RestOperations restOperations();
+
+}
Oops, something went wrong.

0 comments on commit 6ad2a94

Please sign in to comment.