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 flickrPhotosGetCounts(String dates, String takenDates, String sharedSecret, String token,
        String key, String host, String port) {
    FlickrServiceStub flickrServiceStub = getStub(host, port);
    PhotosGetCounts photosGetCounts = new PhotosGetCounts();
    String sig = sharedSecret + "api_key" + key + "auth_token" + token;

    photosGetCounts.setApi_key(key);/*from  w w  w . jav  a  2s . com*/
    if (dates != null && !"".equals(dates.trim())) {
        photosGetCounts.setDates(dates);
        sig = sig + "dates" + dates;
    }
    sig = sig + "formatrest" + "method" + "flickr.photos.getCounts";
    if (takenDates != null && !"".equals(takenDates.trim())) {
        photosGetCounts.setTaken_dates(takenDates);
        sig = sig + "taken_dates" + takenDates;
    }
    String output = "";
    try {
        photosGetCounts.setAuth_token(DigestUtils.md5Hex(sig));
        Rsp response = flickrServiceStub.flickrPhotosGetCounts(photosGetCounts);
        StatType statType = response.getStat();
        Token rspToken = statType.getValue();
        if (rspToken.equals(StatType._ok)) {
            OMElement[] elements = response.getExtraElement();
            for (int i = 0; i < elements.length; i++) {
                OMElement photos = elements[i];
                output = "List of photo counts for the given date ranges for the calling user.\n\n";
                Iterator iterator = photos.getChildElements();
                while (iterator.hasNext()) {
                    OMElement photocount = (OMElement) iterator.next();
                    output = output + "Photo Count\n" + "Count : "
                            + photocount.getAttribute(new QName("count")).getAttributeValue() + "\nFrom Date : "
                            + photocount.getAttribute(new QName("fromdate")).getAttributeValue() + "\n"
                            + "To Date : " + photocount.getAttribute(new QName("todate")).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 flickrPhotosGetExif(String photoID, String secret, String sharedSecret, String token, String key,
        String host, String port) {
    FlickrServiceStub flickrServiceStub = getStub(host, port);
    PhotosGetExif photosGetExif = new PhotosGetExif();
    photosGetExif.setApi_key(key);//from ww w . j  ava2s  .  c  o  m
    if (secret != null && !"".equals(secret.trim())) {
        photosGetExif.setSecret(secret);
    }
    photosGetExif.setPhoto_id(photoID);
    String output = "";
    try {
        Rsp response = flickrServiceStub.flickrPhotosGetExif(photosGetExif);
        StatType statType = response.getStat();
        Token rspToken = statType.getValue();
        if (rspToken.equals(StatType._ok)) {
            OMElement[] elements = response.getExtraElement();
            for (int i = 0; i < elements.length; i++) {
                OMElement photos = elements[i];
                output = "List of EXIF/TIFF/GPS tags for a given photo.\n\n";
                output = output + "Photo ID : " + photos.getAttribute(new QName("id")).getAttributeValue()
                        + "\nSecret : " + photos.getAttribute(new QName("secret")).getAttributeValue() + "\n";
                Iterator iterator = photos.getChildElements();
                while (iterator.hasNext()) {
                    OMElement photo = (OMElement) iterator.next();
                    OMElement raw = photo.getFirstChildWithName(new QName("raw"));
                    output = output + "Exif\nTagSpace : "
                            + photo.getAttribute(new QName("tagspace")).getAttributeValue() + "\nTag : "
                            + photo.getAttribute(new QName("tag")).getAttributeValue() + "\nLabel : "
                            + photo.getAttribute(new QName("label")).getAttributeValue() + "\n" + "Raw : "
                            + raw.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 flickrPhotosGetFavorites(String photoID, String page, String perPage, String sharedSecret,
        String token, String key, String host, String port) {
    FlickrServiceStub flickrServiceStub = getStub(host, port);
    PhotosGetFavorites photosGetFavorites = new PhotosGetFavorites();
    photosGetFavorites.setApi_key(key);/*from   w  ww.  j  av  a2s .com*/
    if (page != null && !"".equals(page.trim())) {
        photosGetFavorites.setPage(page);
    }
    if (perPage != null && !"".equals(perPage.trim())) {
        photosGetFavorites.setPer_page(perPage);
    }
    photosGetFavorites.setPhoto_id(photoID);
    String output = "";
    try {
        Rsp response = flickrServiceStub.flickrPhotosGetFavorites(photosGetFavorites);
        StatType statType = response.getStat();
        Token rspToken = statType.getValue();
        if (rspToken.equals(StatType._ok)) {
            OMElement[] elements = response.getExtraElement();
            for (int i = 0; i < elements.length; i++) {
                OMElement photos = elements[i];
                output = "List of people who have favorited this photo.\n\n" + "Photo ID : "
                        + photos.getAttribute(new QName("id")).getAttributeValue() + "\nSecret : "
                        + photos.getAttribute(new QName("secret")).getAttributeValue() + "\n" + "Page : "
                        + photos.getAttribute(new QName("page")).getAttributeValue() + "\nPages : "
                        + photos.getAttribute(new QName("pages")).getAttributeValue() + "\n" + "Per Page : "
                        + photos.getAttribute(new QName("perpage")).getAttributeValue() + "\nTotal : "
                        + photos.getAttribute(new QName("total")).getAttributeValue() + "\n";
                Iterator iterator = photos.getChildElements();
                while (iterator.hasNext()) {
                    OMElement person = (OMElement) iterator.next();
                    output = output + "\nPerson\nUser ID : "
                            + person.getAttribute(new QName("nsid")).getAttributeValue() + "\nUsername : "
                            + person.getAttribute(new QName("username")).getAttributeValue()
                            + "\nFavorited Date : "
                            + person.getAttribute(new QName("favedate")).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 flickrPhotosGetNotInSet(String minUpDate, String maxUpDate, String minTakDate, String maxTakDate,
        String privacy, ExtrasBean extrasBean, String page, String perPage, String sharedSecret, String token,
        String key, String host, String port) {
    FlickrServiceStub flickrServiceStub = getStub(host, port);
    PhotosGetNotInSet photosGetNotInSet = new PhotosGetNotInSet();
    photosGetNotInSet.setApi_key(key);// w ww. ja v a  2 s  .  co  m
    photosGetNotInSet.setAuth_token(token);
    String sig = sharedSecret + "api_key" + key + "auth_token" + token;
    String extras = processExtras(extrasBean);
    if (!"".equals(extras.trim())) {
        photosGetNotInSet.setExtras(extras);
        sig = sig + "extras" + extras;
    }
    sig = sig + "formatrest";
    if (minTakDate != null && !"".equals(minTakDate.trim())) {
        UnixTimeStamp date = new UnixTimeStamp();
        date.setUnixTimeStamp(minTakDate);
        photosGetNotInSet.setMin_taken_date(date);
        sig = sig + "min_taken_date" + minTakDate;
    }
    if (minUpDate != null && !"".equals(minUpDate.trim())) {
        UnixTimeStamp date = new UnixTimeStamp();
        date.setUnixTimeStamp(minUpDate);
        photosGetNotInSet.setMin_upload_date(date);
        sig = sig + "max_upload_date" + minUpDate;
    }
    if (maxTakDate != null && !"".equals(maxTakDate.trim())) {
        UnixTimeStamp date = new UnixTimeStamp();
        date.setUnixTimeStamp(maxTakDate);
        photosGetNotInSet.setMax_taken_date(date);
        sig = sig + "max_taken_date" + maxTakDate;
    }
    if (maxUpDate != null && !"".equals(maxUpDate.trim())) {
        UnixTimeStamp date = new UnixTimeStamp();
        date.setUnixTimeStamp(maxUpDate);
        photosGetNotInSet.setMax_upload_date(date);
        sig = sig + "max_upload_date" + maxUpDate;
    }
    sig = sig + "method" + "flickr.photos.getNotInSet";
    if (page != null && !"".equals(page.trim())) {
        photosGetNotInSet.setPage(new BigInteger(page));
        sig = sig + "page" + page;
    }
    if (perPage != null && !"".equals(perPage.trim())) {
        photosGetNotInSet.setPer_page(new BigInteger(perPage));
        sig = sig + "per_page" + perPage;
    }
    if (privacy != null && !"".equals(privacy.trim())) {
        photosGetNotInSet.setPrivacy_filter(new BigInteger(privacy));
        sig = sig + "privacy_filter" + privacy;

    }
    String output = "";
    try {
        photosGetNotInSet.setApi_sig(DigestUtils.md5Hex(sig));
        Rsp response = flickrServiceStub.flickrPhotosGetNotInSet(photosGetNotInSet);
        StatType statType = response.getStat();
        Token rspToken = statType.getValue();
        if (rspToken.equals(StatType._ok)) {
            OMElement[] elements = response.getExtraElement();
            for (int i = 0; i < elements.length; i++) {
                OMElement photos = elements[i];
                output = "List of your photos that are not part of any sets.\n\n";
                output = output + "Page : " + photos.getAttribute(new QName("page")).getAttributeValue()
                        + "\nPages : " + photos.getAttribute(new QName("pages")).getAttributeValue() + "\n"
                        + "Per Page : " + photos.getAttribute(new QName("perpage")).getAttributeValue()
                        + "\nTotal : " + photos.getAttribute(new QName("total")).getAttributeValue() + "\n";
                Iterator iterator = photos.getChildElements();
                while (iterator.hasNext()) {
                    OMElement photo = (OMElement) iterator.next();
                    output = output + "\nPhoto\nPhoto ID : "
                            + photo.getAttribute(new QName("id")).getAttributeValue() + "\nOwner ID : "
                            + photo.getAttribute(new QName("owner")).getAttributeValue() + "\nSecret : "
                            + photo.getAttribute(new QName("secret")).getAttributeValue() + "\n" + "Title : "
                            + photo.getAttribute(new QName("title")).getAttributeValue() + "\nIs Public : "
                            + photo.getAttribute(new QName("ispublic")).getAttributeValue() + "\nIs Friend : "
                            + photo.getAttribute(new QName("isfriend")).getAttributeValue() + "\n"
                            + "Is Family : " + photo.getAttribute(new QName("isfamily")).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 flickrPhotosGetPerms(String photoID, String sharedSecret, String token, String key, String host,
        String port) {/* w w  w.  j a va 2 s  .  co  m*/
    FlickrServiceStub flickrServiceStub = getStub(host, port);
    PhotosGetPerms photosGetPerms = new PhotosGetPerms();
    photosGetPerms.setApi_key(key);
    photosGetPerms.setPhoto_id(photoID);
    photosGetPerms.setAuth_token(token);
    String sig = sharedSecret + "api_key" + key + "auth_token" + token + "formatrest" + "method"
            + "flickr.photos.getPerms" + "photo_id" + photoID;

    String output = "";
    try {
        photosGetPerms.setApi_sig(DigestUtils.md5Hex(sig));
        Rsp response = flickrServiceStub.flickrPhotosGetPerms(photosGetPerms);
        StatType statType = response.getStat();
        Token rspToken = statType.getValue();
        if (rspToken.equals(StatType._ok)) {
            OMElement[] elements = response.getExtraElement();
            for (int i = 0; i < elements.length; i++) {
                OMElement photos = elements[i];
                output = "Ppermissions of this photo.\n\n";
                output = output + "ID : " + photos.getAttribute(new QName("id")).getAttributeValue()
                        + "\nIs Public : " + photos.getAttribute(new QName("ispublic")).getAttributeValue()
                        + "\nIs Friend : " + photos.getAttribute(new QName("isfriend")).getAttributeValue()
                        + "\n" + "Is Family : " + photos.getAttribute(new QName("isfamily")).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 flickrPhotosGetRecent(ExtrasBean extrasBean, String page, String perPage, String sharedSecret,
        String token, String key, String host, String port) {
    FlickrServiceStub flickrServiceStub = getStub(host, port);
    PhotosGetRecent photosGetRecent = new PhotosGetRecent();
    photosGetRecent.setApi_key(key);/*from ww w . ja  v  a2s .co  m*/
    String extras = processExtras(extrasBean);
    if (!"".equals(extras.trim())) {
        photosGetRecent.setExtras(extras);
    }
    if (page != null && !"".equals(page.trim())) {
        photosGetRecent.setPage(new BigInteger(page));
    }
    if (perPage != null && !"".equals(perPage.trim())) {
        photosGetRecent.setPer_page(new BigInteger(perPage));
    }
    String output = "";
    try {
        Rsp response = flickrServiceStub.flickrPhotosGetRecent(photosGetRecent);
        StatType statType = response.getStat();
        Token rspToken = statType.getValue();
        if (rspToken.equals(StatType._ok)) {
            OMElement[] elements = response.getExtraElement();
            for (int i = 0; i < elements.length; i++) {
                OMElement photos = elements[i];
                output = "List of the latest public photos uploaded to flickr.\n\n";
                output = output + "Page : " + photos.getAttribute(new QName("page")).getAttributeValue()
                        + "\nPages : " + photos.getAttribute(new QName("pages")).getAttributeValue() + "\n"
                        + "Per Page : " + photos.getAttribute(new QName("perpage")).getAttributeValue()
                        + "\nTotal : " + photos.getAttribute(new QName("total")).getAttributeValue() + "\n";
                Iterator iterator = photos.getChildElements();
                while (iterator.hasNext()) {
                    OMElement photo = (OMElement) iterator.next();
                    output = output + "\nPhoto\nPhoto ID : "
                            + photo.getAttribute(new QName("id")).getAttributeValue() + "\nOwner ID : "
                            + photo.getAttribute(new QName("owner")).getAttributeValue() + "\nSecret : "
                            + photo.getAttribute(new QName("secret")).getAttributeValue() + "\n" + "Title : "
                            + photo.getAttribute(new QName("title")).getAttributeValue() + "\nIs Public : "
                            + photo.getAttribute(new QName("ispublic")).getAttributeValue() + "\nIs Friend : "
                            + photo.getAttribute(new QName("isfriend")).getAttributeValue() + "\n"
                            + "Is Family : " + photo.getAttribute(new QName("isfamily")).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 flickrPhotosGetSizes(String photoID, String sharedSecret, String token, String key, String host,
        String port) {//from ww  w .ja  v a 2  s .  c  o m
    FlickrServiceStub flickrServiceStub = getStub(host, port);
    PhotosGetSizes photosGetSizes = new PhotosGetSizes();
    photosGetSizes.setApi_key(key);
    photosGetSizes.setPhoto_id(photoID);
    String output = "";
    try {
        Rsp response = flickrServiceStub.flickrPhotosGetSizes(photosGetSizes);
        StatType statType = response.getStat();
        Token rspToken = statType.getValue();
        if (rspToken.equals(StatType._ok)) {
            OMElement[] elements = response.getExtraElement();
            for (int i = 0; i < elements.length; i++) {
                OMElement photos = elements[i];
                output = "View the photo.\n\n";
                Iterator iterator = photos.getChildElements();
                while (iterator.hasNext()) {
                    OMElement size = (OMElement) iterator.next();
                    output = output + "\nSize\nLabel : "
                            + size.getAttribute(new QName("label")).getAttributeValue() + "\nWidth : "
                            + size.getAttribute(new QName("width")).getAttributeValue() + "\nHeight : "
                            + size.getAttribute(new QName("height")).getAttributeValue() + "\n" + "Source : "
                            + size.getAttribute(new QName("source")).getAttributeValue() + "\nURL : "
                            + size.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 flickrPhotosGetUntagged(String minUpDate, String maxUpDate, String minTakDate, String maxTakDate,
        String privacy, ExtrasBean extrasBean, String page, String perPage, String sharedSecret, String token,
        String key, String host, String port) {
    FlickrServiceStub flickrServiceStub = getStub(host, port);
    PhotosGetUntagged photosGetUntagged = new PhotosGetUntagged();
    photosGetUntagged.setApi_key(key);//w w w.j  a v a  2 s  .  co  m
    photosGetUntagged.setAuth_token(token);
    String sig = sharedSecret + "api_key" + key + "auth_token" + token;
    String extras = processExtras(extrasBean);
    if (!"".equals(extras.trim())) {
        photosGetUntagged.setExtras(extras);
        sig = sig + "extras" + extras;
    }
    sig = sig + "formatrest";
    if (minTakDate != null && !"".equals(minTakDate.trim())) {
        UnixTimeStamp date = new UnixTimeStamp();
        date.setUnixTimeStamp(minTakDate);
        photosGetUntagged.setMin_taken_date(date);
        sig = sig + "min_taken_date" + minTakDate;
    }
    if (minUpDate != null && !"".equals(minUpDate.trim())) {
        UnixTimeStamp date = new UnixTimeStamp();
        date.setUnixTimeStamp(minUpDate);
        photosGetUntagged.setMin_upload_date(date);
        sig = sig + "max_upload_date" + minUpDate;
    }
    if (maxTakDate != null && !"".equals(maxTakDate.trim())) {
        UnixTimeStamp date = new UnixTimeStamp();
        date.setUnixTimeStamp(maxTakDate);
        photosGetUntagged.setMax_taken_date(date);
        sig = sig + "max_taken_date" + maxTakDate;
    }
    if (maxUpDate != null && !"".equals(maxUpDate.trim())) {
        UnixTimeStamp date = new UnixTimeStamp();
        date.setUnixTimeStamp(maxUpDate);
        photosGetUntagged.setMax_upload_date(date);
        sig = sig + "max_upload_date" + maxUpDate;
    }
    sig = sig + "method" + "flickr.photos.getUntagged";
    if (page != null && !"".equals(page.trim())) {
        photosGetUntagged.setPage(new BigInteger(page));
        sig = sig + "page" + page;
    }
    if (perPage != null && !"".equals(perPage.trim())) {
        photosGetUntagged.setPer_page(new BigInteger(perPage));
        sig = sig + "per_page" + perPage;
    }
    if (privacy != null && !"".equals(privacy.trim())) {
        photosGetUntagged.setPrivacy_filter(new BigInteger(privacy));
        sig = sig + "privacy_filter" + privacy;

    }
    String output = "";
    try {
        photosGetUntagged.setApi_sig(DigestUtils.md5Hex(sig));
        Rsp response = flickrServiceStub.flickrPhotosGetUntagged(photosGetUntagged);
        StatType statType = response.getStat();
        Token rspToken = statType.getValue();
        if (rspToken.equals(StatType._ok)) {
            OMElement[] elements = response.getExtraElement();
            for (int i = 0; i < elements.length; i++) {
                OMElement photos = elements[i];
                output = "List of your photos with no tags.\n\n";
                output = output + "Page : " + photos.getAttribute(new QName("page")).getAttributeValue()
                        + "\nPages : " + photos.getAttribute(new QName("pages")).getAttributeValue() + "\n"
                        + "Per Page : " + photos.getAttribute(new QName("perpage")).getAttributeValue()
                        + "\nTotal : " + photos.getAttribute(new QName("total")).getAttributeValue() + "\n";
                Iterator iterator = photos.getChildElements();
                while (iterator.hasNext()) {
                    OMElement photo = (OMElement) iterator.next();
                    output = output + "\nPhoto\nPhoto ID : "
                            + photo.getAttribute(new QName("id")).getAttributeValue() + "\nOwner ID : "
                            + photo.getAttribute(new QName("owner")).getAttributeValue() + "\nSecret : "
                            + photo.getAttribute(new QName("secret")).getAttributeValue() + "\n" + "Title : "
                            + photo.getAttribute(new QName("title")).getAttributeValue() + "\nIs Public : "
                            + photo.getAttribute(new QName("ispublic")).getAttributeValue() + "\nIs Friend : "
                            + photo.getAttribute(new QName("isfriend")).getAttributeValue() + "\n"
                            + "Is Family : " + photo.getAttribute(new QName("isfamily")).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 flickrPhotosGetWithGeoData(String minUpDate, String maxUpDate, String minTakDate,
        String maxTakDate, String privacy, ExtrasBean extrasBean, String page, String perPage,
        String sharedSecret, String token, String key, String host, String port) {
    FlickrServiceStub flickrServiceStub = getStub(host, port);
    PhotosGetWithGeoData photosGetWithGeoData = new PhotosGetWithGeoData();
    photosGetWithGeoData.setApi_key(key);
    photosGetWithGeoData.setAuth_token(token);
    String sig = sharedSecret + "api_key" + key + "auth_token" + token;
    String extras = processExtras(extrasBean);
    if (!"".equals(extras.trim())) {
        photosGetWithGeoData.setExtras(extras);
        sig = sig + "extras" + extras;
    }//from w w w . ja va  2s  .  c om
    sig = sig + "formatrest";
    if (minTakDate != null && !"".equals(minTakDate.trim())) {
        UnixTimeStamp date = new UnixTimeStamp();
        date.setUnixTimeStamp(minTakDate);
        photosGetWithGeoData.setMin_taken_date(date);
        sig = sig + "min_taken_date" + minTakDate;
    }
    if (minUpDate != null && !"".equals(minUpDate.trim())) {
        UnixTimeStamp date = new UnixTimeStamp();
        date.setUnixTimeStamp(minUpDate);
        photosGetWithGeoData.setMin_upload_date(date);
        sig = sig + "max_upload_date" + minUpDate;
    }
    if (maxTakDate != null && !"".equals(maxTakDate.trim())) {
        UnixTimeStamp date = new UnixTimeStamp();
        date.setUnixTimeStamp(maxTakDate);
        photosGetWithGeoData.setMax_taken_date(date);
        sig = sig + "max_taken_date" + maxTakDate;
    }
    if (maxUpDate != null && !"".equals(maxUpDate.trim())) {
        UnixTimeStamp date = new UnixTimeStamp();
        date.setUnixTimeStamp(maxUpDate);
        photosGetWithGeoData.setMax_upload_date(date);
        sig = sig + "max_upload_date" + maxUpDate;
    }
    sig = sig + "method" + "flickr.photos.getWithGeoData";
    if (page != null && !"".equals(page.trim())) {
        photosGetWithGeoData.setPage(new BigInteger(page));
        sig = sig + "page" + page;
    }
    if (perPage != null && !"".equals(perPage.trim())) {
        photosGetWithGeoData.setPer_page(new BigInteger(perPage));
        sig = sig + "per_page" + perPage;
    }
    if (privacy != null && !"".equals(privacy.trim())) {
        photosGetWithGeoData.setPrivacy_filter(new BigInteger(privacy));
        sig = sig + "privacy_filter" + privacy;
    }
    String output = "";
    try {
        photosGetWithGeoData.setApi_sig(DigestUtils.md5Hex(sig));
        Rsp response = flickrServiceStub.flickrPhotosGetWithGeoData(photosGetWithGeoData);
        StatType statType = response.getStat();
        Token rspToken = statType.getValue();
        if (rspToken.equals(StatType._ok)) {
            OMElement[] elements = response.getExtraElement();
            for (int i = 0; i < elements.length; i++) {
                OMElement photos = elements[i];
                output = "List of your geo-tagged photos.\n\n";
                output = output + "Page : " + photos.getAttribute(new QName("page")).getAttributeValue()
                        + "\nPages : " + photos.getAttribute(new QName("pages")).getAttributeValue() + "\n"
                        + "Per Page : " + photos.getAttribute(new QName("perpage")).getAttributeValue()
                        + "\nTotal : " + photos.getAttribute(new QName("total")).getAttributeValue() + "\n";
                Iterator iterator = photos.getChildElements();
                while (iterator.hasNext()) {
                    OMElement photo = (OMElement) iterator.next();
                    output = output + "\nPhoto\nPhoto ID : "
                            + photo.getAttribute(new QName("id")).getAttributeValue() + "\nOwner ID : "
                            + photo.getAttribute(new QName("owner")).getAttributeValue() + "\nSecret : "
                            + photo.getAttribute(new QName("secret")).getAttributeValue() + "\n" + "Title : "
                            + photo.getAttribute(new QName("title")).getAttributeValue() + "\nIs Public : "
                            + photo.getAttribute(new QName("ispublic")).getAttributeValue() + "\nIs Friend : "
                            + photo.getAttribute(new QName("isfriend")).getAttributeValue() + "\n"
                            + "Is Family : " + photo.getAttribute(new QName("isfamily")).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 flickrPhotosGetWithoutGeoData(String minUpDate, String maxUpDate, String minTakDate,
        String maxTakDate, String privacy, ExtrasBean extrasBean, String page, String perPage,
        String sharedSecret, String token, String key, String host, String port) {
    FlickrServiceStub flickrServiceStub = getStub(host, port);
    PhotosGetWithoutGeoData photosGetWithoutGeoData = new PhotosGetWithoutGeoData();
    photosGetWithoutGeoData.setApi_key(key);
    photosGetWithoutGeoData.setAuth_token(token);
    String sig = sharedSecret + "api_key" + key + "auth_token" + token;
    String extras = processExtras(extrasBean);
    if (!"".equals(extras.trim())) {
        photosGetWithoutGeoData.setExtras(extras);
        sig = sig + "extras" + extras;
    }//from  www.j av a  2 s .  c om
    sig = sig + "formatrest";
    if (minTakDate != null && !"".equals(minTakDate.trim())) {
        UnixTimeStamp date = new UnixTimeStamp();
        date.setUnixTimeStamp(minTakDate);
        photosGetWithoutGeoData.setMin_taken_date(date);
        sig = sig + "min_taken_date" + minTakDate;
    }
    if (minUpDate != null && !"".equals(minUpDate.trim())) {
        UnixTimeStamp date = new UnixTimeStamp();
        date.setUnixTimeStamp(minUpDate);
        photosGetWithoutGeoData.setMin_upload_date(date);
        sig = sig + "max_upload_date" + minUpDate;
    }
    if (maxTakDate != null && !"".equals(maxTakDate.trim())) {
        UnixTimeStamp date = new UnixTimeStamp();
        date.setUnixTimeStamp(maxTakDate);
        photosGetWithoutGeoData.setMax_taken_date(date);
        sig = sig + "max_taken_date" + maxTakDate;
    }
    if (maxUpDate != null && !"".equals(maxUpDate.trim())) {
        UnixTimeStamp date = new UnixTimeStamp();
        date.setUnixTimeStamp(maxUpDate);
        photosGetWithoutGeoData.setMax_upload_date(date);
        sig = sig + "max_upload_date" + maxUpDate;
    }
    sig = sig + "method" + "flickr.photos.getWithoutGeoData";
    if (page != null && !"".equals(page.trim())) {
        photosGetWithoutGeoData.setPage(new BigInteger(page));
        sig = sig + "page" + page;
    }
    if (perPage != null && !"".equals(perPage.trim())) {
        photosGetWithoutGeoData.setPer_page(new BigInteger(perPage));
        sig = sig + "per_page" + perPage;
    }
    if (privacy != null && !"".equals(privacy.trim())) {
        photosGetWithoutGeoData.setPrivacy_filter(new BigInteger(privacy));
        sig = sig + "privacy_filter" + privacy;
    }
    String output = "";
    try {
        photosGetWithoutGeoData.setApi_sig(DigestUtils.md5Hex(sig));
        Rsp response = flickrServiceStub.flickrPhotosGetWithoutGeoData(photosGetWithoutGeoData);
        StatType statType = response.getStat();
        Token rspToken = statType.getValue();
        if (rspToken.equals(StatType._ok)) {
            OMElement[] elements = response.getExtraElement();
            for (int i = 0; i < elements.length; i++) {
                OMElement photos = elements[i];
                output = "List of your photos which haven't been geo-tagged.\n\n";
                output = output + "Page : " + photos.getAttribute(new QName("page")).getAttributeValue()
                        + "\nPages : " + photos.getAttribute(new QName("pages")).getAttributeValue() + "\n"
                        + "Per Page : " + photos.getAttribute(new QName("perpage")).getAttributeValue()
                        + "\nTotal : " + photos.getAttribute(new QName("total")).getAttributeValue() + "\n";
                Iterator iterator = photos.getChildElements();
                while (iterator.hasNext()) {
                    OMElement photo = (OMElement) iterator.next();
                    output = output + "\nPhoto\nPhoto ID : "
                            + photo.getAttribute(new QName("id")).getAttributeValue() + "\nOwner ID : "
                            + photo.getAttribute(new QName("owner")).getAttributeValue() + "\nSecret : "
                            + photo.getAttribute(new QName("secret")).getAttributeValue() + "\n" + "Title : "
                            + photo.getAttribute(new QName("title")).getAttributeValue() + "\nIs Public : "
                            + photo.getAttribute(new QName("ispublic")).getAttributeValue() + "\nIs Friend : "
                            + photo.getAttribute(new QName("isfriend")).getAttributeValue() + "\n"
                            + "Is Family : " + photo.getAttribute(new QName("isfamily")).getAttributeValue()
                            + "\n";
                }
            }
        } else {
            output = processPeopleError(response.getErr());
        }
    } catch (RemoteException e) {
        output = e.getMessage();
    }
    return output;
}