sdk/src/com/socialize/api/action/like/SocializeLikeSystem.java
@Override
	public void getLike(SocializeSession session, final String entityUrl, final LikeListener listener) {
		final User user = session.getUser();
		if(user != null) {
			
			final Long userId = user.getId();
			
			String endpoint = "/user/" + userId.toString() + ENDPOINT;
			listAsync(session, endpoint, entityUrl, null, null, 0, 1, new LikeListListener() {
				
				@Override
				public void onList(List<Like> items, int totalSize) {
	
					boolean is404 = false;
					if(items != null) {
						if(items != null && items.size() > 0) {
							Like like = items.get(0);
							if(like != null) {
								listener.onGet(like);
							}
							else {
								is404 = true;
							}
						}
						else {
							is404 = true;
						}
					}
					else {
						is404 = true;
					}
					
					if(is404) {
						onError(new SocializeApiError(404, "No likes found for entity with key [" +
								entityUrl +
								"] for user [" +
								userId +
								"]"));
					}
				}
				@Override
				public void onError(SocializeException error) {
					listener.onError(error);
				}
			});
		}
		else {
			if(listener != null) {
				listener.onError(new SocializeException("No user found in current session"));
			}
		}
	}
@Override
	public void getLike(SocializeSession session, final String entityUrl, final LikeListener listener) {
		final User user = session.getUser();
		if(user != null) {
			
			final Long userId = user.getId();
			
			String endpoint = "/user/" + userId.toString() + ENDPOINT;
			listAsync(session, endpoint, entityUrl, null, null, 0, 1, new LikeListListener() {
				
				@Override
				public void onList(List<Like> items, int totalSize) {
	
					boolean is404 = false;
					if(items != null) {
						if(items != null && items.size() > 0) {
							Like like = items.get(0);
							if(like != null) {
								listener.onGet(like);
							}
							else {
								is404 = true;
							}
						}
						else {
							is404 = true;
						}
					}
					else {
						is404 = true;
					}
					
					if(is404) {
						onError(new SocializeApiError(404, "No likes found for entity with key [" +
								entityUrl +
								"] for user [" +
								userId +
								"]"));
					}
				}
				@Override
				public void onError(SocializeException error) {
					listener.onError(error);
				}
			});
		}
		else {
			if(listener != null) {
				listener.onError(new SocializeException("No user found in current session"));
			}
		}
	}
@ Override public void getLike ( SocializeSession session , final String entityUrl , final LikeListener listener ) { final User user = session . getUser ( ) ; if ( user != null ) { final Long userId = user . getId ( ) ; String endpoint = "/user/" + userId . toString ( ) + ENDPOINT ; listAsync ( session , endpoint , entityUrl , null , null , 0 , 1 , new LikeListListener ( ) { @ Override public void onList ( List < Like > items , int totalSize ) { boolean is404 = false ; if ( items != null ) { if ( items != null && items . size ( ) > 0 ) { Like like = items . get ( 0 ) ; if ( like != null ) { listener . onGet ( like ) ; } else { is404 = true ; } } else { is404 = true ; } } else { is404 = true ; } if ( is404 ) { onError ( new SocializeApiError ( 404 , "No likes found for entity with key [" + entityUrl + "] for user [" + userId + "]" ) ) ; } } @ Override public void onError ( SocializeException error ) { listener . onError ( error ) ; } } ) ; } else { if ( listener != null ) { listener . onError ( new SocializeException ( "No user found in current session" ) ) ; } } }
/* (non-Javadoc)
@see com.socialize.api.action.LikeSystem#getLike(com.socialize.api.SocializeSession, java.lang.String, com.socialize.listener.like.LikeListener)
/ * ( non - Javadoc )