eg.com.espace.wenear.client
Class WeNearClient

java.lang.Object
  extended by eg.com.espace.wenear.client.WeNearClient

public class WeNearClient
extends java.lang.Object

Important Note:

Although the weNear Client API is available for several programming languages, the documentation is only available officially for Java. Nevertheless, the documentation of the Java version can be used as a reliable source of information about the API for any other language. The client APIs are machine-generated and are intentionally kept almost identical to each other except, of course, when language features dictate otherwise. For instance, languages that don't support generic collections lack the ability to identify precisely the type of elements in a certain collection, but you can safely assume that the type is similar to what is contained in this documentation.

If you happen to encounter a bug, please contact bugs@wenear.com.

Want to request a client in a different language, or implement it yourself? Contact us at dev@wenear.com.

Introduction:

The client API consists of a single root class, WeNearClient, that includes a set of inner Service classes. Multiple instances of the client can exist simultaneously in the application, whether they're all using the same login credentials or not. The role of service classes is simply to group related operations together. All methods of the client API employ a custom RPC mechanism that is completely transparent to the programmer, and which exploits the RESTful HTTP interface offered by the weNear servers.

To get a more clear idea about weNear, you are advised to read this document.

Usage Example:

This code snippet shows how to instantiate a weNear client, create a user account, and then post an announcement.

(In your application, exceptions should be handled properly).

    WeNearClient client = new WeNearClient(20000, null);
    client.getUserService().createUser("wenearuser", "123456", "Full Name", "user@email.com", "secret question?", "secret answer");
    client.setCredentials("wenearuser", "123456");
    client.getBroadcasterService().createPost("title", "body", 1800, new int[] {1, 2, 3});


Nested Class Summary
static class WeNearClient.AnnouncerService
          Service interface for operations on announcer accounts.
static class WeNearClient.BadRequestException
           
static class WeNearClient.BadResponseException
           
static class WeNearClient.BroadcasterService
          Service interface for broadcaster operations.
static class WeNearClient.ClientService
          Service interface for operations common to all client types.
static class WeNearClient.DataConversionErrorException
           
static class WeNearClient.DuplicateNameException
           
static class WeNearClient.ForbiddenException
           
static class WeNearClient.InterestService
          Service interface for operations on interests.
static class WeNearClient.InvalidArgumentsException
           
static interface WeNearClient.Listener
           
static class WeNearClient.NoSuchCategoryException
           
static class WeNearClient.NoSuchClientException
           
static class WeNearClient.NoSuchInvitationException
           
static class WeNearClient.NoSuchPostException
           
static class WeNearClient.NotAllowedException
           
static class WeNearClient.NotAuthorizedException
           
static class WeNearClient.NotFoundException
           
static class WeNearClient.NotSupportedException
           
static class WeNearClient.UnknownErrorException
           
static class WeNearClient.UserFriendsService
          Service interface for managing friendship associations.
static class WeNearClient.UserInterestsService
          Service interface for managing user interests
static class WeNearClient.UserLocationService
          Service interface for managing user location information.
static class WeNearClient.UserPostsService
          Service interface for managing incoming posts.
static class WeNearClient.UserService
          Service interface for operations on user accounts.
static class WeNearClient.WeNearException
           
static class WeNearClient.WeNearServiceException
           
 
Constructor Summary
WeNearClient(int timeoutInMilliseconds, WeNearClient.Listener listener)
          Creates a new client.
 
Method Summary
 WeNearClient.AnnouncerService getAnnouncerService()
           
 WeNearClient.BroadcasterService getBroadcasterService()
           
 WeNearClient.ClientService getClientService()
           
 WeNearClient.InterestService getInterestService()
           
 WeNearClient.UserFriendsService getUserFriendsService()
           
 WeNearClient.UserInterestsService getUserInterestsService()
           
 WeNearClient.UserLocationService getUserLocationService()
           
 WeNearClient.UserPostsService getUserPostsService()
           
 WeNearClient.UserService getUserService()
           
 void setCredentials(java.lang.String login, java.lang.String password)
          Sets the user name and password used by the client.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

WeNearClient

public WeNearClient(int timeoutInMilliseconds,
                    WeNearClient.Listener listener)
Creates a new client.

Parameters:
timeoutInMilliseconds - how long to wait for the server to respond.
listener - gets notified of errors encountered by the client (may be null).
Method Detail

setCredentials

public void setCredentials(java.lang.String login,
                           java.lang.String password)
Sets the user name and password used by the client. Access to private resources (such as user location, list of friends, etc.) will be denied unless valid credentials are supplied. On the other hand, public resources (such as the public list of interests stored at the server) can be accessed freely even before this method is called.


getAnnouncerService

public WeNearClient.AnnouncerService getAnnouncerService()

getUserService

public WeNearClient.UserService getUserService()

getBroadcasterService

public WeNearClient.BroadcasterService getBroadcasterService()

getClientService

public WeNearClient.ClientService getClientService()

getInterestService

public WeNearClient.InterestService getInterestService()

getUserFriendsService

public WeNearClient.UserFriendsService getUserFriendsService()

getUserInterestsService

public WeNearClient.UserInterestsService getUserInterestsService()

getUserLocationService

public WeNearClient.UserLocationService getUserLocationService()

getUserPostsService

public WeNearClient.UserPostsService getUserPostsService()