Skip to content

Commit

Permalink
Updates to handle retrieval of LinkedIn Network Updates
Browse files Browse the repository at this point in the history
  • Loading branch information
robdrysdale committed Nov 4, 2011
1 parent 4a860db commit 46f0bb5
Show file tree
Hide file tree
Showing 36 changed files with 1,344 additions and 17 deletions.
2 changes: 1 addition & 1 deletion gradle.properties
Expand Up @@ -17,7 +17,7 @@
# version to be applied to all projects in this multi-project build. this is
# the one and only location version changes need to be made.
# ------------------------------------------------------------------------------
springSocialLinkedInVersion=1.0.0.BUILD-SNAPSHOT
springSocialLinkedInVersion=1.0.1.BUILD-SNAPSHOT

# ------------------------------------------------------------------------------
# build system user roles
Expand Down
@@ -0,0 +1,22 @@
package org.springframework.social.linkedin.api;

import java.io.Serializable;

public class Company implements Serializable {
private static final long serialVersionUID = 1L;

private final String id;
private final String name;

public Company(String id, String name) {
this.id = id;
this.name = name;
}

public String getId() {
return id;
}
public String getName() {
return name;
}
}
Expand Up @@ -62,4 +62,14 @@ public interface LinkedIn extends ApiBinding {
* @return the user's connections
*/
List<LinkedInProfile> getConnections();

List<LinkedInNetworkUpdate> getNetworkUpdates();

List<LinkedInNetworkUpdate> getNetworkUpdates(int start, int count);

public String getNetworkUpdatesJson();

public String getJson(String url);

public String getNetworkUpdatesJson(int start, int count);
}
@@ -0,0 +1,96 @@
/*
* Copyright 2010 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.linkedin.api;

import java.io.Serializable;
import java.util.Date;
import java.util.List;

/**
* Model class containing a user's LinkedIn Network update information.
* @author Robert Drysdale
*/
public class LinkedInNetworkUpdate implements Serializable {

private static final long serialVersionUID = 1L;

private final Date timestamp;

private final String updateKey;

private final UpdateType updateType;

private boolean commentable;

private boolean likable;

private boolean liked;

private int numLikes;

private List<LinkedInProfile> likes;

private UpdateContent updateContent;

private List<String> updatedFields;

public LinkedInNetworkUpdate(Date timestamp, String updateKey, UpdateType updateType) {
this.timestamp = timestamp;
this.updateKey = updateKey;
this.updateType = updateType;
}

public Date getTimestamp() {
return timestamp;
}

public String getUpdateKey() {
return updateKey;
}

public UpdateType getUpdateType() {
return updateType;
}

public UpdateContent getUpdateContent() {
return updateContent;
}

public boolean isCommentable() {
return commentable;
}

public boolean isLikable() {
return likable;
}

public boolean isLiked() {
return liked;
}

public int getNumLikes() {
return numLikes;
}

public List<LinkedInProfile> getLikes() {
return likes;
}

public List<String> getUpdatedFields() {
return updatedFields;
}

}
@@ -0,0 +1,41 @@
/*
* Copyright 2010 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.linkedin.api;

import java.util.List;

/**
* A model class containing a list of a user's network updates on LinkedIn.
*
* @author Robert Drysdale
*/
public class LinkedInNetworkUpdates {

private List<LinkedInNetworkUpdate> updates;

public LinkedInNetworkUpdates(List<LinkedInNetworkUpdate> updates) {
this.updates = updates;
}

/**
* Retrieves the list of network updates
*
* @return a list of network updates
*/
public List<LinkedInNetworkUpdate> getUpdates() {
return updates;
}
}
Expand Up @@ -41,6 +41,8 @@ public class LinkedInProfile implements Serializable {

private final String profilePictureUrl;

private String summary;

public LinkedInProfile(String id, String firstName, String lastName, String headline, String industry, String publicProfileUrl, String standardProfileUrl, String profilePictureUrl) {
this.id = id;
this.firstName = firstName;
Expand Down Expand Up @@ -108,4 +110,11 @@ public String getPublicProfileUrl() {
public String getProfilePictureUrl() {
return profilePictureUrl;
}

/**
* The user's summary.
*/
public String getSummary() {
return summary;
}
}
@@ -0,0 +1,29 @@
package org.springframework.social.linkedin.api;

import java.io.Serializable;

public class MemberGroup implements Serializable {
private static final long serialVersionUID = 1L;

private final String id;
private final String name;
private final String url;

public MemberGroup(String id, String name, String url) {
this.id = id;
this.name = name;
this.url = url;
}

public String getId() {
return id;
}

public String getName() {
return name;
}

public String getUrl() {
return url;
}
}
@@ -0,0 +1,23 @@
package org.springframework.social.linkedin.api;

import java.io.Serializable;

public class PersonActivity implements Serializable {
private static final long serialVersionUID = 1L;

private final int appId;
private final String body;

public PersonActivity(int appId, String body) {
this.appId = appId;
this.body = body;
}

public int getAppId() {
return appId;
}

public String getBody() {
return body;
}
}
@@ -0,0 +1,43 @@
package org.springframework.social.linkedin.api;

import java.io.Serializable;

public class Recommendation implements Serializable {
private static final long serialVersionUID = 1L;

private final String id;
private final String recommendationSnippet;
private final RecommendationType recommendationType;
private final LinkedInProfile recommender;

public Recommendation(String id, String recommendationSnippet,
RecommendationType recommendationType, LinkedInProfile recommender) {
this.id = id;
this.recommendationSnippet = recommendationSnippet;
this.recommendationType = recommendationType;
this.recommender = recommender;
}

public String getId() {
return id;
}

public String getRecommendationSnippet() {
return recommendationSnippet;
}

public RecommendationType getRecommendationType() {
return recommendationType;
}

public LinkedInProfile getRecommender() {
return recommender;
}

public static enum RecommendationType {
BUSINESS_PARTNER,
COLLEAGUE,
EDUCATION,
SERVICE_PROVIDER
}
}
@@ -0,0 +1,15 @@
package org.springframework.social.linkedin.api;


public class UpdateContent extends LinkedInProfile {

private static final long serialVersionUID = 1L;

public UpdateContent(String id, String firstName, String lastName,
String headline, String industry, String publicProfileUrl,
String standardProfileUrl, String profilePictureUrl) {
super(id, firstName, lastName, headline, industry, publicProfileUrl,
standardProfileUrl, profilePictureUrl);
}

}
@@ -0,0 +1,24 @@
package org.springframework.social.linkedin.api;

import java.util.List;



public class UpdateContentConnection extends UpdateContent {
private static final long serialVersionUID = 1L;

private List<LinkedInProfile> connections;

public UpdateContentConnection(String id, String firstName,
String lastName, String headline, String industry,
String publicProfileUrl, String standardProfileUrl,
String profilePictureUrl) {
super(id, firstName, lastName, headline, industry, publicProfileUrl,
standardProfileUrl, profilePictureUrl);
}

public List<LinkedInProfile> getConnections() {
return connections;
}

}
@@ -0,0 +1,26 @@
package org.springframework.social.linkedin.api;

public class UpdateContentFollow extends UpdateContent {

private static final long serialVersionUID = 1L;

private String action;

private Company following;

public UpdateContentFollow(String id, String firstName, String lastName,
String headline, String industry, String publicProfileUrl,
String standardProfileUrl, String profilePictureUrl) {
super(id, firstName, lastName, headline, industry, publicProfileUrl,
standardProfileUrl, profilePictureUrl);
}

public String getAction() {
return action;
}

public Company getFollowing() {
return following;
}

}
@@ -0,0 +1,24 @@
package org.springframework.social.linkedin.api;

import java.util.List;

public class UpdateContentGroup extends UpdateContent {

private static final long serialVersionUID = 1L;

private List<MemberGroup> memberGroups;

public UpdateContentGroup(String id, String firstName, String lastName,
String headline, String industry, String publicProfileUrl,
String standardProfileUrl, String profilePictureUrl) {
super(id, firstName, lastName, headline, industry, publicProfileUrl,
standardProfileUrl, profilePictureUrl);
}

public List<MemberGroup> getMemberGroups() {
return memberGroups;
}



}

0 comments on commit 46f0bb5

Please sign in to comment.