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 flickrFavoritesGetPublicList(String userID, String page, String perPage, ExtrasBean extras,
        String sharedSecret, String token, String key, String host, String port) {
    FlickrServiceStub flickrServiceStub = getStub(host, port);
    FavoritesGetPublicList favoritesGetPublicList = new FavoritesGetPublicList();
    favoritesGetPublicList.setApi_key(key);
    String extrasString = processExtras(extras);
    if (!"".equals(extrasString.trim())) {
        favoritesGetPublicList.setExtras(extrasString);
    }/*from  ww w. j av a2 s. co m*/
    if (!"".equals(page.trim())) {
        favoritesGetPublicList.setPage(new BigInteger(page));
    }
    if (perPage != null && !"".equals(perPage.trim())) {
        favoritesGetPublicList.setPer_page(new BigInteger(perPage));
    }
    if (userID != null && !"".equals(userID.trim())) {
        favoritesGetPublicList.setUser_id(userID);
    }
    String output = "";
    try {
        Rsp response = flickrServiceStub.flickrFavoritesGetPublicList(favoritesGetPublicList);
        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 public photos for a given 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;
}

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

public String flickrFavoritesRemove(String photoID, String sharedSecret, String token, String key, String host,
        String port) {//from   w  w w . j  a v a2  s . co  m
    FlickrServiceStub flickrServiceStub = getStub(host, port);
    FavoritesRemove favoritesRemove = new FavoritesRemove();
    favoritesRemove.setApi_key(key);
    favoritesRemove.setPhoto_id(photoID);
    String output = "";
    try {
        Rsp response = flickrServiceStub.flickrFavoritesRemove(favoritesRemove);
        StatType statType = response.getStat();
        Token retToken = statType.getValue();
        if (retToken.equals(StatType._ok)) {
            output = "Removed from 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 flickrPhotosGeoGetLocation(String photoID, String sharedSecret, String token, String key,
        String host, String port) {
    FlickrServiceStub flickrServiceStub = getStub(host, port);
    PhotosGeoGetLocation photosGeoGetLocation = new PhotosGeoGetLocation();
    photosGeoGetLocation.setApi_key(key);
    photosGeoGetLocation.setPhoto_id(photoID);
    String output = "";
    try {//from   ww w . ja v  a 2  s .  com
        Rsp response = flickrServiceStub.flickrPhotosGeoGetLocation(photosGeoGetLocation);
        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 photo = elements[i];
                OMElement location = photo.getFirstChildWithName(new QName("location"));
                output = "Geo data of the requested photo\n\n" + "Photo ID : "
                        + photo.getAttribute(new QName("id")) + "\n" + "Latitude : "
                        + location.getAttribute(new QName("latitude")) + "\n" + "Longitude : "
                        + location.getAttribute(new QName("longitude")) + "\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 flickrPhotosGeoGetPerms(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 + "formatrest" + "method"
            + "flickr.photos.geo.getPerms";
    PhotosGeoGetPerms photosGeoGetPerms = new PhotosGeoGetPerms();
    photosGeoGetPerms.setApi_key(key);/* w  w  w. ja v  a2  s . c  om*/
    photosGeoGetPerms.setAuth_token(token);
    photosGeoGetPerms.setPhoto_id(photoID);
    sig = sig + "photo_id" + photoID;
    String output = "";
    try {
        photosGeoGetPerms.setApi_sig(DigestUtils.md5Hex(sig));
        Rsp response = flickrServiceStub.flickrPhotosGeoGetPerms(photosGeoGetPerms);
        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 perms = elements[i];
                output = "Permissions for who may view geo data of this photo\n\n" + "Photo ID : "
                        + perms.getAttribute(new QName("id")) + "\n" + "Is Public : "
                        + perms.getAttribute(new QName("ispublic")) + "\n" + "Is Contact : "
                        + perms.getAttribute(new QName("iscontact")) + "\n" + "Is Friend : "
                        + perms.getAttribute(new QName("isfriend")) + "\n" + "Is Family : "
                        + perms.getAttribute(new QName("isfamily")) + "\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 flickrPhotosGeoRemoveLocation(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 + "formatrest" + "method"
            + "flickr.photos.geo.removeLocation";
    PhotosGeoRemoveLocation photosGeoRemoveLocation = new PhotosGeoRemoveLocation();
    photosGeoRemoveLocation.setApi_key(key);
    photosGeoRemoveLocation.setPhoto_id(photoID);
    sig = sig + "photo_id" + photoID;
    String output = "";
    try {//  ww  w  .j a  v a2  s . c o m
        photosGeoRemoveLocation.setApi_sig(DigestUtils.md5Hex(sig));
        Rsp response = flickrServiceStub.flickrPhotosGeoRemoveLocation(photosGeoRemoveLocation);
        StatType statType = response.getStat();
        Token retToken = statType.getValue();
        if (retToken.equals(StatType._ok)) {
            output = "Geo tags removed 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 flickrPhotosGeoSetLocation(String photoID, String lat, String lon, String accuracy,
        String sharedSecret, String token, String key, String host, String port) {
    FlickrServiceStub flickrServiceStub = getStub(host, port);
    String sig = sharedSecret + "api_key" + key;
    PhotosGeoSetLocation photosGeoSetLocation = new PhotosGeoSetLocation();
    photosGeoSetLocation.setApi_key(key);
    photosGeoSetLocation.setAuth_token(token);
    if (accuracy != null && !"".equals(accuracy.trim())) {
        photosGeoSetLocation.setAccuracy(new BigInteger(accuracy));
        sig = sig + "accuracy" + accuracy;
    }//from  ww  w  . ja v a  2  s . co  m
    sig = sig + "auth_token" + token + "formatrest";
    photosGeoSetLocation.setLat(lat);
    photosGeoSetLocation.setLon(lon);
    sig = sig + "lat" + lat + " lon" + lon + "method" + "flickr.photos.geo.setLocation";
    photosGeoSetLocation.setPhoto_id(photoID);
    sig = sig + "photo_id" + photoID;
    String output = "";
    try {
        photosGeoSetLocation.setApi_sig(DigestUtils.md5Hex(sig));
        Rsp response = flickrServiceStub.flickrPhotosGeoSetLocation(photosGeoSetLocation);
        StatType statType = response.getStat();
        Token retToken = statType.getValue();
        if (retToken.equals(StatType._ok)) {
            output = "Geo tags 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 flickrPhotosGeoSetPerms(String photoID, boolean isPublic, boolean isContact, boolean isFriend,
        boolean isFamily, 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";
    PhotosGeoSetPerms photosGeoSetPerms = new PhotosGeoSetPerms();
    photosGeoSetPerms.setApi_key(key);/*from   www . j  a v  a2  s .  c om*/
    photosGeoSetPerms.setAuth_token(token);
    photosGeoSetPerms.setPhoto_id(photoID);

    if (isContact) {
        photosGeoSetPerms.setIs_contact(new BigInteger("1"));
        sig = sig + "is_contact1";
    }
    if (isFamily) {
        photosGeoSetPerms.setIs_contact(new BigInteger("1"));
        sig = sig + "is_family1";
    }
    if (isFriend) {
        photosGeoSetPerms.setIs_contact(new BigInteger("1"));
        sig = sig + "is_friend1";
    }
    if (isPublic) {
        photosGeoSetPerms.setIs_contact(new BigInteger("1"));
        sig = sig + "is_public1";
    }
    sig = sig + "method" + "flickr.photos.geo.setPerms" + "photo_id" + photoID;
    String output = "";
    try {
        photosGeoSetPerms.setApi_sig(DigestUtils.md5Hex(sig));
        Rsp response = flickrServiceStub.flickrPhotosGeoSetPerms(photosGeoSetPerms);
        StatType statType = response.getStat();
        Token retToken = statType.getValue();
        if (retToken.equals(StatType._ok)) {
            output = "Permissions set 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 flickrGroupsBrowse(String catID, String sharedSecret, String token, String key, String host,
        String port) {//  w w w  .  jav a  2 s .c  o m
    FlickrServiceStub flickrServiceStub = getStub(host, port);
    String sig = sharedSecret + "api_key" + key + "auth_token" + token;
    GroupsBrowse groupsBrowse = new GroupsBrowse();
    groupsBrowse.setApi_key(key);
    groupsBrowse.setAuth_token(token);
    if (catID != null && !"".equals(catID.trim())) {
        groupsBrowse.setCat_id(catID);
        sig = sig + "cat_id" + catID;
    }
    sig = sig + "formatrest" + "method" + "flickr.groups.browse";
    String output = "";
    try {
        groupsBrowse.setApi_sig(DigestUtils.md5Hex(sig));
        Rsp response = flickrServiceStub.flickrGroupsBrowse(groupsBrowse);
        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 category = elements[i];
                output = "Group Category tree details\n\n" + "Category Name : "
                        + category.getAttribute(new QName("name")) + "\n" + "Category Path : "
                        + category.getAttribute(new QName("path")) + "\n";
                Iterator iterator = category.getChildrenWithName(new QName("subcat"));
                while (iterator.hasNext()) {
                    OMElement subCats = (OMElement) iterator.next();
                    output = output + "Sub Category\n" + "Sub Category ID : "
                            + subCats.getAttribute(new QName("id")) + "\n" + "Sub Category Name : "
                            + subCats.getAttribute(new QName("name")) + "\n" + "Sub Category Count : "
                            + subCats.getAttribute(new QName("count")) + "\n";
                }
                Iterator iterator2 = category.getChildrenWithName(new QName("group"));
                while (iterator2.hasNext()) {
                    OMElement group = (OMElement) iterator2.next();
                    output = output + "Group\n" + "Group ID : " + group.getAttribute(new QName("id")) + "\n"
                            + "Group Name : " + group.getAttribute(new QName("name")) + "\n"
                            + "Number of members : " + group.getAttribute(new QName("members")) + "\n"
                            + "Number of members currently online : " + group.getAttribute(new QName("online"))
                            + "\n" + "Number of people in groups chat : "
                            + group.getAttribute(new QName("inchat")) + "\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 flickrGroupsGetInfo(String groupID, String sharedSecret, String token, String key, String host,
        String port) {/*from   w w w.j  a  v  a  2 s .c  o  m*/
    FlickrServiceStub flickrServiceStub = getStub(host, port);
    GroupsGetInfo groupsGetInfo = new GroupsGetInfo();
    groupsGetInfo.setApi_key(key);
    groupsGetInfo.setGroup_id(groupID);
    String output = "";
    try {
        Rsp response = flickrServiceStub.flickrGroupsGetInfo(groupsGetInfo);
        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 group = elements[i];
                output = "Information about this group\n\n";
                output = output + "Group ID : " + group.getAttribute(new QName("id")) + "\n";
                output = output + "Group Name : " + group.getFirstChildWithName(new QName("name")).getText();
                output = output + "Group members : "
                        + group.getFirstChildWithName(new QName("members")).getText();
                output = output + "Group Privacy : "
                        + group.getFirstChildWithName(new QName("privacy")).getText();
                OMElement throttle = group.getFirstChildWithName(new QName("throttle"));
                output = output + "Count : " + throttle.getFirstChildWithName(new QName("count")).getText();
                output = output + "Mode : " + throttle.getFirstChildWithName(new QName("mode")).getText();
                output = output + "Remaining : "
                        + throttle.getFirstChildWithName(new QName("remaining")).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 flickrGroupsSearch(String text, String page, String perPage, String sharedSecret, String token,
        String key, String host, String port) {
    FlickrServiceStub flickrServiceStub = getStub(host, port);
    GroupsSearch groupsSearch = new GroupsSearch();
    groupsSearch.setApi_key(key);/*from w w  w .j a  v a2 s  .  c  om*/
    groupsSearch.setText(text);
    if (!"".equals(page.trim())) {
        groupsSearch.setPage(new BigInteger(page));
    }
    if (perPage != null && !"".equals(perPage.trim())) {
        groupsSearch.setPer_page(new BigInteger(perPage));
    }
    String output = "";
    try {
        Rsp response = flickrServiceStub.flickrGroupsSearch(groupsSearch);
        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 = "Search results\n\n";
                Iterator iterator = photos.getChildElements();
                output = output + "Total results : "
                        + photos.getAttribute(new QName("total")).getAttributeValue() + "\n";
                while (iterator.hasNext()) {
                    output = output + "Group\n";
                    OMElement group = (OMElement) iterator.next();
                    output = output + "Group ID : " + group.getAttribute(new QName("nsid")).getAttributeValue()
                            + "\nGroup Name : " + group.getAttribute(new QName("name")).getAttributeValue()
                            + "\n";
                    output = output + "Is 18+ : "
                            + group.getAttribute(new QName("eighteenplus")).getAttributeValue() + "\n\n";
                }
            }
        } else {
            output = processPeopleError(response.getErr());
        }
    } catch (RemoteException e) {
        output = e.getMessage();
    }
    return output;
}