Example usage for java.rmi RemoteException getMessage

List of usage examples for java.rmi RemoteException getMessage

Introduction

In this page you can find the example usage for java.rmi RemoteException getMessage.

Prototype

public String getMessage() 

Source Link

Document

Returns the detail message, including the message from the cause, if any, of this exception.

Usage

From source file:org.wso2.appserver.sample.flickr.client.FlickrServiceClient.java

public String flickrBlogsGetList(String sharedSecret, String token, String key, String host, String port) {
    FlickrServiceStub flickrServiceStub = getStub(host, port);
    String sig = sharedSecret + "api_key" + key + "auth_token" + token + "formatrest" + "method"
            + "flickr.blogs.getList";
    BlogsGetList blogsGetList = new BlogsGetList();
    AuthenticatedFlickrRequest authenticatedFlickrRequest = new AuthenticatedFlickrRequest();
    authenticatedFlickrRequest.setApi_key(key);
    authenticatedFlickrRequest.setAuth_token(token);
    String output = "";
    try {/* w w  w .  ja v a2  s .co m*/
        authenticatedFlickrRequest.setApi_sig(DigestUtils.md5Hex(sig));
        blogsGetList.setBlogsGetList(authenticatedFlickrRequest);
        Rsp response = flickrServiceStub.flickrBlogsGetList(blogsGetList);
        StatType statType = response.getStat();
        Token retToken = statType.getValue();
        if (retToken.equals(StatType._ok)) {
            OMElement[] elements = response.getExtraElement();
            for (int i = 0; i < elements.length; i++) {
                OMElement blogs = elements[i];
                output = "List of configured blogs for the calling user\n\n";
                Iterator iter = blogs.getChildElements();
                while (iter.hasNext()) {
                    OMElement blog = (OMElement) iter.next();
                    output = output + "Blog \nBlog ID : "
                            + blog.getAttribute(new QName("id")).getAttributeValue() + "\nName : "
                            + blog.getAttribute(new QName("name")).getAttributeValue() + "\n" + "URL : "
                            + blog.getAttribute(new QName("url")).getAttributeValue() + "\n";
                }
            }
        } else {
            output = processPeopleError(response.getErr());
        }
    } catch (RemoteException e) {
        output = e.getMessage();
    }
    return output;
}

From source file:org.wso2.appserver.sample.flickr.client.FlickrServiceClient.java

public String flickrBlogsPostPhoto(String blogID, String photoID, String title, String description,
        String password, String sharedSecret, String token, String key, String host, String port) {
    FlickrServiceStub flickrServiceStub = getStub(host, port);
    String sig = sharedSecret + "api_key" + key + "auth_token" + token + "blog_id" + blogID;
    BlogsPostPhoto blogsPostPhoto = new BlogsPostPhoto();
    if ("".equals(password.trim())) {
        blogsPostPhoto.setBlog_password(password);
        sig = sig + "blog_password" + password;
    }/*  w  ww.  j  av  a2  s  . c o  m*/
    sig = sig + "description" + description + "formatrest" + "method" + "flickr.blogs.postPhoto" + "photo_id"
            + photoID + "title" + title;
    blogsPostPhoto.setApi_key(key);
    blogsPostPhoto.setAuth_token(token);
    blogsPostPhoto.setBlog_id(blogID);
    blogsPostPhoto.setPhoto_id(photoID);
    blogsPostPhoto.setTitle(title);
    blogsPostPhoto.setDescription(description);
    String output;
    try {
        blogsPostPhoto.setApi_sig(DigestUtils.md5Hex(sig));
        Rsp response = flickrServiceStub.flickrBlogsPostPhoto(blogsPostPhoto);
        StatType statType = response.getStat();
        Token retToken = statType.getValue();
        if (retToken.equals(StatType._ok)) {
            output = "Photo ID added succesfully";
        } else {
            output = processPeopleError(response.getErr());
        }
    } catch (RemoteException e) {
        output = e.getMessage();
    }
    return output;
}

From source file:org.wso2.appserver.sample.flickr.client.FlickrServiceClient.java

public String flickrPhotosetsCommentsAddComment(String comment, String photoID, String sharedSecret,
        String token, String key, String host, String port) {
    FlickrServiceStub flickrServiceStub = getStub(host, port);
    String sig = sharedSecret + "api_key" + key + "auth_token" + token + "comment_text" + comment + "formatrest"
            + "method" + "flickr.photosets.comments.addComment" + "photoset_id" + photoID;
    PhotosetsCommentsAddComment photosetsCommentsAddComment = new PhotosetsCommentsAddComment();
    photosetsCommentsAddComment.setApi_key(key);
    photosetsCommentsAddComment.setAuth_token(token);
    photosetsCommentsAddComment.setComment_text(comment);
    photosetsCommentsAddComment.setPhotoset_id(photoID);
    String output = "";
    try {/*from w  w w.  j  av a  2  s  . com*/
        photosetsCommentsAddComment.setApi_sig(DigestUtils.md5Hex(sig));
        Rsp response = flickrServiceStub.flickrPhotosetsCommentsAddComment(photosetsCommentsAddComment);
        StatType statType = response.getStat();
        Token retToken = statType.getValue();
        if (retToken.equals(StatType._ok)) {
            OMElement[] elements = response.getExtraElement();
            for (int i = 0; i < elements.length; i++) {
                OMElement commentEle = elements[i];
                output = "Comment added succesfully\n\n" + "comment ID : "
                        + commentEle.getAttribute(new QName("id")).getAttributeValue();
            }
        } else {
            output = processPeopleError(response.getErr());
        }
    } catch (RemoteException e) {
        output = e.getMessage();
    }
    return output;
}

From source file:org.wso2.appserver.sample.flickr.client.FlickrServiceClient.java

public String flickrPhotosetsCommentsDeleteComment(String commentID, String sharedSecret, String token,
        String key, String host, String port) {
    FlickrServiceStub flickrServiceStub = getStub(host, port);
    String sig = sharedSecret + "api_key" + key + "auth_token" + token + "comment_id" + commentID + "formatrest"
            + "method" + "flickr.photosets.comments.deleteComment";
    PhotosetsCommentsDeleteComment photosetsCommentsDeleteComment = new PhotosetsCommentsDeleteComment();
    photosetsCommentsDeleteComment.setApi_key(key);
    photosetsCommentsDeleteComment.setAuth_token(token);
    photosetsCommentsDeleteComment.setComment_id(commentID);
    String output = "";
    try {//  ww  w.ja  va 2 s .  c o m
        photosetsCommentsDeleteComment.setApi_sig(DigestUtils.md5Hex(sig));
        Rsp response = flickrServiceStub.flickrPhotosetsCommentsDeleteComment(photosetsCommentsDeleteComment);
        StatType statType = response.getStat();
        Token retToken = statType.getValue();
        if (retToken.equals(StatType._ok)) {
            output = "Comment deleted succesfully\n\n";
        } else {
            output = processPeopleError(response.getErr());
        }
    } catch (RemoteException e) {
        output = e.getMessage();
    }
    return output;
}

From source file:org.wso2.appserver.sample.flickr.client.FlickrServiceClient.java

public String flickrPhotosetsCommentsEditComment(String comment, String commentID, String sharedSecret,
        String token, String key, String host, String port) {
    FlickrServiceStub flickrServiceStub = getStub(host, port);
    String sig = sharedSecret + "api_key" + key + "auth_token" + token + "comment_id" + commentID
            + "comment_text" + comment + "formatrest" + "method" + "flickr.photosets.comments.editComment";
    PhotosetsCommentsEditComment photosetsCommentsEditComment = new PhotosetsCommentsEditComment();
    photosetsCommentsEditComment.setApi_key(key);
    photosetsCommentsEditComment.setAuth_token(token);
    photosetsCommentsEditComment.setComment_text(comment);
    photosetsCommentsEditComment.setComment_id(commentID);
    String output = "";
    try {/*from w  w w .  j  a v  a  2  s . c  o m*/
        photosetsCommentsEditComment.setApi_sig(DigestUtils.md5Hex(sig));
        Rsp response = flickrServiceStub.flickrPhotosetsCommentsEditComment(photosetsCommentsEditComment);
        StatType statType = response.getStat();
        Token retToken = statType.getValue();
        if (retToken.equals(StatType._ok)) {
            output = "Comment edited succesfully\n\n";
        } else {
            output = processPeopleError(response.getErr());
        }
    } catch (RemoteException e) {
        output = e.getMessage();
    }
    return output;
}

From source file:org.wso2.appserver.sample.flickr.client.FlickrServiceClient.java

public String flickrPhotosetsCommentsGetList(String photoID, String sharedSecret, String token, String key,
        String host, String port) {
    FlickrServiceStub flickrServiceStub = getStub(host, port);
    PhotosetsCommentsGetList photosetsCommentsGetList = new PhotosetsCommentsGetList();
    photosetsCommentsGetList.setApi_key(key);
    photosetsCommentsGetList.setPhotoset_id(photoID);
    String output = "";
    try {/*from w w  w  .  j  a  va  2 s  .c  o  m*/
        Rsp response = flickrServiceStub.flickrPhotosetsCommentsGetList(photosetsCommentsGetList);
        StatType statType = response.getStat();
        Token retToken = statType.getValue();
        if (retToken.equals(StatType._ok)) {
            OMElement[] elements = response.getExtraElement();
            for (int i = 0; i < elements.length; i++) {
                OMElement commentsEle = elements[i];
                output = "Comment for the specified Photoset\n\n";
                output = output + "Photoset ID : "
                        + commentsEle.getAttribute(new QName("id")).getAttributeValue() + "\n";
                Iterator iter = commentsEle.getChildElements();
                while (iter.hasNext()) {
                    OMElement commentEle = (OMElement) iter.next();
                    output = output + "Comment ID : "
                            + commentEle.getAttribute(new QName("id")).getAttributeValue() + "\n";
                    output = output + "Author ID : "
                            + commentEle.getAttribute(new QName("author")).getAttributeValue() + "\n";
                    output = output + "Author Name : "
                            + commentEle.getAttribute(new QName("authorname")).getAttributeValue() + "\n";
                    output = output + "Date Created : "
                            + commentEle.getAttribute(new QName("date_create")).getAttributeValue() + "\n";
                    output = output + "Permanant Link : "
                            + commentEle.getAttribute(new QName("permalink")).getAttributeValue() + "\n";
                    output = output + "Comment : " + commentEle.getText();
                }
            }
        } else {
            output = processPeopleError(response.getErr());
        }
    } catch (RemoteException e) {
        output = e.getMessage();
    }
    return output;
}

From source file:org.wso2.appserver.sample.flickr.client.FlickrServiceClient.java

public String flickrContactsGetList(Object filterValue, String page, String perPage, String sharedSecret,
        String token, String key, String host, String port) {
    FlickrServiceStub flickrServiceStub = getStub(host, port);
    String sig = sharedSecret + "api_key" + key + "auth_token" + token;
    ContactsGetList contactsGetList = new ContactsGetList();
    contactsGetList.setApi_key(key);/*w ww .  j  a  va  2  s.co  m*/
    contactsGetList.setAuth_token(token);
    if (filterValue instanceof Filter) {
        contactsGetList.setFilter((Filter) filterValue);
        sig = sig + "filter" + filterValue.toString();
    }
    sig = sig + "formatrest" + "method" + "flickr.contacts.getList";
    if (!"".equals(page.trim())) {
        contactsGetList.setPage(new BigInteger(page));
        sig = sig + "page" + page;
    }
    if (perPage != null && !"".equals(perPage.trim())) {
        contactsGetList.setPer_page(new BigInteger(perPage));
        sig = sig + "per_page" + perPage;
    }
    String output = "";
    try {
        contactsGetList.setApi_sig(DigestUtils.md5Hex(sig));
        Rsp response = flickrServiceStub.flickrContactsGetList(contactsGetList);
        StatType statType = response.getStat();
        Token retToken = statType.getValue();
        if (retToken.equals(StatType._ok)) {
            OMElement[] elements = response.getExtraElement();
            for (int i = 0; i < elements.length; i++) {
                OMElement contacts = elements[i];
                output = "Contacts of the calling user\n\n";
                output = output + "Total number of contacts : "
                        + contacts.getAttribute(new QName("total")).getAttributeValue() + "\n";
                Iterator iter = contacts.getChildElements();
                while (iter.hasNext()) {
                    OMElement contact = (OMElement) iter.next();
                    output = output + "Contact\n";
                    output = output + "Contact ID : "
                            + contact.getAttribute(new QName("nsid")).getAttributeValue() + "\n";
                    output = output + "Username : "
                            + contact.getAttribute(new QName("username")).getAttributeValue() + "\n";
                    output = output + "Real Name : "
                            + contact.getAttribute(new QName("realname")).getAttributeValue() + "\n";
                    output = output + "Friend : "
                            + contact.getAttribute(new QName("friend")).getAttributeValue() + "\n";
                    output = output + "Family : "
                            + contact.getAttribute(new QName("family")).getAttributeValue() + "\n";
                    output = output + "Ignored : "
                            + contact.getAttribute(new QName("ignored")).getAttributeValue() + "\n";
                }
            }
        } else {
            output = processPeopleError(response.getErr());
        }
    } catch (RemoteException e) {
        output = e.getMessage();
    }
    return output;
}

From source file:org.wso2.appserver.sample.flickr.client.FlickrServiceClient.java

public String flickrContactsGetPublicList(String userID, String page, String perPage, String sharedSecret,
        String token, String key, String host, String port) {
    FlickrServiceStub flickrServiceStub = getStub(host, port);
    ContactsGetPublicList contactsGetPublicList = new ContactsGetPublicList();
    contactsGetPublicList.setApi_key(key);
    contactsGetPublicList.setUser_id(userID);
    if (!"".equals(page.trim())) {
        contactsGetPublicList.setPage(new BigInteger(page));
    }/*  w  w w  . j a v  a2s  .c o m*/
    if (perPage != null && !"".equals(perPage.trim())) {
        contactsGetPublicList.setPer_page(new BigInteger(perPage));
    }
    String output = "";
    try {
        Rsp response = flickrServiceStub.flickrContactsGetPublicList(contactsGetPublicList);
        StatType statType = response.getStat();
        Token retToken = statType.getValue();
        if (retToken.equals(StatType._ok)) {
            OMElement[] elements = response.getExtraElement();
            for (int i = 0; i < elements.length; i++) {
                OMElement contacts = elements[i];
                output = "Contacts list for a user\n\n";
                output = output + "Total number of contacts : "
                        + contacts.getAttribute(new QName("total")).getAttributeValue() + "\n";
                Iterator iter = contacts.getChildElements();
                while (iter.hasNext()) {
                    OMElement contact = (OMElement) iter.next();
                    output = output + "Contact\n";
                    output = output + "Contact ID : "
                            + contact.getAttribute(new QName("nsid")).getAttributeValue() + "\n";
                    output = output + "Username : "
                            + contact.getAttribute(new QName("username")).getAttributeValue() + "\n";
                    output = output + "Ignored : "
                            + contact.getAttribute(new QName("ignored")).getAttributeValue() + "\n";
                }
            }
        } else {
            output = processPeopleError(response.getErr());
        }
    } catch (RemoteException e) {
        output = e.getMessage();
    }
    return output;
}

From source file:org.wso2.appserver.sample.flickr.client.FlickrServiceClient.java

public String flickrFavoritesAdd(String photoID, String sharedSecret, String token, String key, String host,
        String port) {//from   ww  w.ja va2  s .c o m
    FlickrServiceStub flickrServiceStub = getStub(host, port);
    String sig = sharedSecret + "api_key" + key + "auth_token" + token + "formatrest" + "method"
            + "flickr.favorites.add";
    FavoritesAdd favoritesAdd = new FavoritesAdd();
    favoritesAdd.setApi_key(key);
    favoritesAdd.setAuth_token(token);
    favoritesAdd.setPhoto_id(photoID);
    sig = sig + "photo_id" + photoID;
    String output = "";
    try {
        favoritesAdd.setApi_sig(DigestUtils.md5Hex(sig));
        Rsp response = flickrServiceStub.flickrFavoritesAdd(favoritesAdd);
        StatType statType = response.getStat();
        Token retToken = statType.getValue();
        if (retToken.equals(StatType._ok)) {
            output = "Added to favorites succesfully";
        } else {
            output = processPeopleError(response.getErr());
        }
    } catch (RemoteException e) {
        output = e.getMessage();
    }
    return output;
}

From source file:org.wso2.appserver.sample.flickr.client.FlickrServiceClient.java

public String flickrFavoritesGetList(String userID, String page, String perPage, ExtrasBean extras,
        String sharedSecret, String token, String key, String host, String port) {
    FlickrServiceStub flickrServiceStub = getStub(host, port);
    String sig = sharedSecret + "api_key" + key + "auth_token" + token;
    FavoritesGetList favoritesGetList = new FavoritesGetList();
    favoritesGetList.setApi_key(key);//from  ww w . ja va2s.c om
    favoritesGetList.setAuth_token(token);
    String extrasString = processExtras(extras);
    if (!"".equals(extrasString.trim())) {
        favoritesGetList.setExtras(extrasString);
        sig = sig + "extras" + extrasString;
    }
    sig = sig + "formatrest" + "method" + "flickr.favorites.getList";
    if (!"".equals(page.trim())) {
        favoritesGetList.setPage(new BigInteger(page));
        sig = sig + "page" + page;
    }
    if (perPage != null && !"".equals(perPage.trim())) {
        favoritesGetList.setPer_page(new BigInteger(perPage));
        sig = sig + "per_page" + perPage;
    }
    if (userID != null && !"".equals(userID.trim())) {
        favoritesGetList.setUser_id(userID);
        sig = sig + "user_id" + userID;
    }
    String output = "";
    try {
        favoritesGetList.setApi_sig(DigestUtils.md5Hex(sig));
        Rsp response = flickrServiceStub.flickrFavoritesGetList(favoritesGetList);
        StatType statType = response.getStat();
        Token retToken = statType.getValue();
        if (retToken.equals(StatType._ok)) {
            OMElement[] elements = response.getExtraElement();
            for (int i = 0; i < elements.length; i++) {
                OMElement photos = elements[i];
                output = "Favorite photos of the user\n\n";
                Iterator iterator = photos.getChildElements();
                output = output + "Total Photos : "
                        + photos.getAttribute(new QName("total")).getAttributeValue() + "\n";
                while (iterator.hasNext()) {
                    output = output + "Photo\n";
                    OMElement photo = (OMElement) iterator.next();
                    output = output + "Photo ID : " + photo.getAttribute(new QName("id")).getAttributeValue()
                            + "\nOwner ID : " + photo.getAttribute(new QName("owner")).getAttributeValue()
                            + "\n" + "Secret : " + photo.getAttribute(new QName("secret")).getAttributeValue()
                            + "\n" + "Title : " + photo.getAttribute(new QName("title")).getAttributeValue()
                            + "\n\n";
                }
            }
        } else {
            output = processPeopleError(response.getErr());
        }
    } catch (RemoteException e) {
        output = e.getMessage();
    }
    return output;
}