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.integration.common.clients.WSDL2CodeClient.java

/**
 * invoke the back-end CXF code generation methods and prompt to download the resulting zip file
 * containing generated code//from  w  w w .  j  a  va 2  s . c o  m
 *
 * @param options - code generation options
 * @throws AxisFault in case of error
 */
public DataHandler codeGenForCXF(String[] options) throws AxisFault {
    try {
        CodegenDownloadData downloadData = wsdl2CodeServiceStub.codegenForCXF(options);
        if (downloadData != null) {
            return downloadData.getCodegenFileData();
        }
    } catch (RemoteException e) {
        log.error(e.getMessage(), e);
        throw new AxisFault(e.getMessage(), e);
    }
    return null;
}

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

public String flickrPeopleFindByEmail(String email, String key, String host, String port) {

    FlickrServiceStub flickrServiceStub = getStub(host, port);
    PeopleFindByEmail peopleFindByEmail = new PeopleFindByEmail();
    peopleFindByEmail.setApi_key(key);//ww  w.  ja  v  a 2s .  c  o  m
    peopleFindByEmail.setFind_email(email);
    String output = "";
    try {
        Rsp response = flickrServiceStub.flickrPeopleFindByEmail(peopleFindByEmail);
        StatType statType = response.getStat();
        Token token = statType.getValue();
        if (token.equals(StatType._ok)) {
            OMElement[] elements = response.getExtraElement();
            for (int i = 0; i < elements.length; i++) {
                OMElement user = elements[i];
                output = "The Details of the following user was retrived\n\n";
                output = output + "Username : " + user.getFirstElement().getText() + "\n";
                output = output + "User ID : " + user.getAttributeValue(new QName("id")) + "\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 flickrPeopleFindByUsername(String name, String key, String host, String port) {

    FlickrServiceStub flickrServiceStub = getStub(host, port);
    PeopleFindByUsername peopleFindByUsername = new PeopleFindByUsername();
    peopleFindByUsername.setApi_key(key);
    peopleFindByUsername.setUsername(name);
    String output = "";
    try {/*  w w w.  j a  v  a 2  s  .c  o m*/
        Rsp response = flickrServiceStub.flickrPeopleFindByUsername(peopleFindByUsername);
        StatType statType = response.getStat();
        Token token = statType.getValue();
        if (token.equals(StatType._ok)) {
            OMElement[] elements = response.getExtraElement();
            for (int i = 0; i < elements.length; i++) {
                OMElement user = elements[i];
                OMAttribute omAttribute = user.getAttribute(new QName("id"));
                output = "The Details of the following user was retrived\n\n";
                output = output + "Username : " + user.getFirstElement().getText() + "\n";
                output = output + user.getLocalName() + " " + omAttribute.getLocalName() + " : "
                        + omAttribute.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 flickrPeopleGetInfo(String user_ID, String key, String host, String port) {

    FlickrServiceStub flickrServiceStub = getStub(host, port);
    PeopleGetInfo peopleGetInfo = new PeopleGetInfo();
    peopleGetInfo.setApi_key(key);/* w ww.j  av a 2s  .  c o  m*/
    peopleGetInfo.setUser_id(user_ID);
    String output = "";
    try {
        Rsp response = flickrServiceStub.flickrPeopleGetInfo(peopleGetInfo);
        StatType statType = response.getStat();
        Token token = statType.getValue();
        if (token.equals(StatType._ok)) {
            OMElement[] elements = response.getExtraElement();
            for (int i = 0; i < elements.length; i++) {
                OMElement user = elements[i];
                output = "The Information of the following user was retrived\n\n";
                OMAttribute omAttribute = user.getAttribute(new QName("id"));
                output = output + "The ID of the person is : " + omAttribute.getAttributeValue() + "\n";
                OMElement username = user.getFirstChildWithName(new QName("username"));
                output = output + "The name of the person is : " + username.getText() + "\n";
                OMElement realname = user.getFirstChildWithName(new QName("realname"));
                output = output + "The real name of the person is : " + realname.getText() + "\n";
                OMElement location = user.getFirstChildWithName(new QName("location"));
                output = output + "The location of the person is : " + location.getText() + "\n";
                OMElement photosurl = user.getFirstChildWithName(new QName("photosurl"));
                output = output + "The photosurl is : " + photosurl.getText() + "\n";
                OMElement profileurl = user.getFirstChildWithName(new QName("profileurl"));
                output = output + "The profileurl is : " + profileurl.getText() + "\n\n";
                output = output + "Details of photos taken\n\n";
                OMElement photos = user.getFirstChildWithName(new QName("photos"));
                OMElement firstdate = photos.getFirstChildWithName(new QName("firstdate"));
                output = output + "The First photo was taken on : " + firstdate.getText() + "\n";
                OMElement firstdatetaken = photos.getFirstChildWithName(new QName("firstdatetaken"));
                output = output + "The firstdatetaken was taken on : " + firstdatetaken.getText() + "\n";
                OMElement count = photos.getFirstChildWithName(new QName("count"));
                output = output + "The number of photos : " + count.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 flickrPeopleGetPublicGroups(String user_ID, String key, String host, String port) {

    FlickrServiceStub flickrServiceStub = getStub(host, port);
    PeopleGetPublicGroups peopleGetPublicGroups = new PeopleGetPublicGroups();
    peopleGetPublicGroups.setApi_key(key);
    peopleGetPublicGroups.setUser_id(user_ID);
    String output = "";
    try {/*  w ww  . j  a v a 2  s . co m*/
        Rsp response = flickrServiceStub.flickrPeopleGetPublicGroups(peopleGetPublicGroups);
        StatType statType = response.getStat();
        Token token = statType.getValue();
        if (token.equals(StatType._ok)) {
            OMElement[] elements = response.getExtraElement();
            for (int i = 0; i < elements.length; i++) {
                OMElement user = elements[i];
                output = "Public groups of the user\n\n";
                Iterator iterator = user.getChildElements();
                while (iterator.hasNext()) {
                    OMElement childElement = (OMElement) iterator.next();
                    output = output + "Group ID : "
                            + childElement.getAttribute(new QName("nsid")).getAttributeValue()
                            + "\nGroup name : "
                            + childElement.getAttribute(new QName("name")).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 flickrPeopleGetPublicPhotos(String user_ID, String key, String host, String port) {
    FlickrServiceStub flickrServiceStub = getStub(host, port);
    PeopleGetPublicPhotos peopleGetPublicPhotos = new PeopleGetPublicPhotos();
    peopleGetPublicPhotos.setApi_key(key);
    peopleGetPublicPhotos.setUser_id(user_ID);
    String output = "";
    try {/*from  ww w .j ava2s .c o  m*/
        Rsp response = flickrServiceStub.flickrPeopleGetPublicPhotos(peopleGetPublicPhotos);
        StatType statType = response.getStat();
        Token token = statType.getValue();
        if (token.equals(StatType._ok)) {
            OMElement[] elements = response.getExtraElement();
            for (int i = 0; i < elements.length; i++) {
                OMElement user = elements[i];
                output = "Public photos of the user\n\n";
                Iterator iterator = user.getChildElements();
                while (iterator.hasNext()) {
                    OMElement childElement = (OMElement) iterator.next();
                    output = output + "Photo ID : "
                            + childElement.getAttribute(new QName("id")).getAttributeValue() + "\nOwner ID : "
                            + childElement.getAttribute(new QName("owner")).getAttributeValue() + "\n"
                            + "Title : " + childElement.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 flickrPeopleGetUploadStatus(String sharedSecret, String token, String key, String host,
        String port) {//from  www . j a  v  a 2s .  c o m
    FlickrServiceStub flickrServiceStub = getStub(host, port);
    PeopleGetUploadStatus peopleGetUploadStatus = new PeopleGetUploadStatus();
    String sig = sharedSecret + "api_key" + key + "auth_token" + token + "formatrest" + "method"
            + "flickr.people.getUploadStatus";
    peopleGetUploadStatus.setApi_key(key);
    peopleGetUploadStatus.setAuth_token(token);
    String output = "";
    try {
        peopleGetUploadStatus.setApi_sig(DigestUtils.md5Hex(sig));
        Rsp response = flickrServiceStub.flickrPeopleGetUploadStatus(peopleGetUploadStatus);
        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 user = elements[i];
                output = "Upload status of the user\n\n";
                output = output + "User ID : " + user.getAttribute(new QName("id")).getAttributeValue() + "\n";
                OMElement usernameElement = user.getFirstChildWithName(new QName("username"));
                output = output + "The name of the person is : " + usernameElement.getText() + "\n";
                OMElement bandwidth = user.getFirstChildWithName(new QName("bandwidth"));
                output = output + "Bandwidth information\n";
                output = output + "Maximum Bytes : "
                        + bandwidth.getAttribute(new QName("maxbytes")).getAttributeValue() + "\n";
                output = output + "Maximum KiloBytes : "
                        + bandwidth.getAttribute(new QName("maxkb")).getAttributeValue() + "\n";
                output = output + "Used Bytes : "
                        + bandwidth.getAttribute(new QName("usedbytes")).getAttributeValue() + "\n";
                output = output + "Used KiloBytes : "
                        + bandwidth.getAttribute(new QName("usedkb")).getAttributeValue() + "\n";
                output = output + "Remaining Bytes : "
                        + bandwidth.getAttribute(new QName("remainingbytes")).getAttributeValue() + "\n";
                output = output + "Remaining KiloBytes : "
                        + bandwidth.getAttribute(new QName("remainingkb")).getAttributeValue() + "\n";
                OMElement filesize = user.getFirstChildWithName(new QName("filesize"));
                output = output + "FileSize information\n";
                output = output + "Maximum Bytes : "
                        + filesize.getAttribute(new QName("maxbytes")).getAttributeValue() + "\n";
                output = output + "Maximum KiloBytes : "
                        + filesize.getAttribute(new QName("maxkb")).getAttributeValue() + "\n";
                OMElement sets = user.getFirstChildWithName(new QName("sets"));
                output = output + "Information on sets\n";
                output = output + "Created : " + sets.getAttribute(new QName("created")).getAttributeValue()
                        + "\n";
                output = output + "Remaining : " + sets.getAttribute(new QName("remaining")).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 flickrPhotosSearch(String user_ID, String key, String host, String port) {
    FlickrServiceStub flickrServiceStub = getStub(host, port);
    PhotosSearch photosSearch = new PhotosSearch();
    photosSearch.setApi_key(key);/* ww  w  . ja va  2 s.  com*/
    photosSearch.setUser_id(user_ID);
    String output = "";
    try {
        Rsp response = flickrServiceStub.flickrPhotosSearch(photosSearch);
        StatType statType = response.getStat();
        Token token = statType.getValue();
        if (token.equals(StatType._ok)) {
            OMElement[] elements = response.getExtraElement();
            for (int i = 0; i < elements.length; i++) {
                OMElement user = elements[i];
                output = "Public photos of the user\n\n";
                Iterator iterator = user.getChildElements();
                while (iterator.hasNext()) {
                    OMElement childElement = (OMElement) iterator.next();
                    output = output + "Photo ID : "
                            + childElement.getAttribute(new QName("id")).getAttributeValue() + "\nOwner ID : "
                            + childElement.getAttribute(new QName("owner")).getAttributeValue() + "\n"
                            + "Title : " + childElement.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 flickrActivityUserComments(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 + "formatrest" + "method"
            + "flickr.activity.userComments";
    ActivityUserComments activityUserComments = new ActivityUserComments();
    activityUserComments.setApi_key(key);
    activityUserComments.setAuth_token(token);
    if (!"".equals(page.trim())) {
        activityUserComments.setPage(new BigInteger(page));
        sig = sig + "page" + page;
    }//from ww w  .  j  a v  a  2  s . c  om
    if (perPage != null && !"".equals(perPage.trim())) {
        activityUserComments.setPer_page(new BigInteger(perPage));
        sig = sig + "per_page" + perPage;
    }
    String output = "";
    try {
        activityUserComments.setApi_sig(DigestUtils.md5Hex(sig));
        Rsp response = flickrServiceStub.flickrActivityUserComments(activityUserComments);
        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 items = elements[i];
                output = "Activity on photos commented by calling user\n\n";
                Iterator iter = items.getChildElements();
                while (iter.hasNext()) {
                    OMElement item = (OMElement) iter.next();
                    output = output + "Item \nItem ID : "
                            + item.getAttribute(new QName("id")).getAttributeValue() + "\nOwner ID : "
                            + item.getAttribute(new QName("owner")).getAttributeValue() + "\n";
                    output = output + "Item Secret : "
                            + item.getAttribute(new QName("secret")).getAttributeValue() + "\n";
                    OMElement title = item.getFirstChildWithName(new QName("title"));
                    output = output + "Title : " + title.getText();
                    OMElement activity = item.getFirstChildWithName(new QName("activity"));
                    Iterator iter2 = activity.getChildElements();
                    while (iter2.hasNext()) {
                        OMElement event = (OMElement) iter2.next();
                        output = output + "Activity \nUser ID : "
                                + event.getAttribute(new QName("user")).getAttributeValue() + "\nUsername : "
                                + event.getAttribute(new QName("username")).getAttributeValue()
                                + "\nDate Added : "
                                + event.getAttribute(new QName("dateadded")).getAttributeValue() + "\n"
                                + "Text : " + event.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 flickrActivityUserPhotos(String page, String perPage, String timeFrame, 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.activity.userPhotos";
    ActivityUserPhotos activityUserPhotos = new ActivityUserPhotos();
    activityUserPhotos.setApi_key(key);//from www.j  ava 2s .c  o  m
    activityUserPhotos.setAuth_token(token);
    if (!"".equals(page.trim())) {
        activityUserPhotos.setPage(new BigInteger(page));
        sig = sig + "page" + page;
    }
    if (perPage != null && !"".equals(perPage.trim())) {
        activityUserPhotos.setPer_page(new BigInteger(perPage));
        sig = sig + "per_page" + perPage;
    }
    if (!"".equals(timeFrame.trim())) {
        activityUserPhotos.setTimeframe(timeFrame);
        sig = sig + "timeframe" + timeFrame;
    }
    String output = "";
    try {
        activityUserPhotos.setApi_sig(DigestUtils.md5Hex(sig));
        Rsp response = flickrServiceStub.flickrActivityUserPhotos(activityUserPhotos);
        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 items = elements[i];
                output = "Activity on photos belonging to the calling user\n\n";
                Iterator iter = items.getChildElements();
                while (iter.hasNext()) {
                    OMElement item = (OMElement) iter.next();
                    output = output + "Item \nItem ID : "
                            + item.getAttribute(new QName("id")).getAttributeValue() + "\nOwner ID : "
                            + item.getAttribute(new QName("owner")).getAttributeValue() + "\n";
                    output = output + "Item Secret : "
                            + item.getAttribute(new QName("secret")).getAttributeValue() + "\n";
                    output = output + "Old Comments : "
                            + item.getAttribute(new QName("commentsold")).getAttributeValue() + "\n";
                    output = output + "New Comments : "
                            + item.getAttribute(new QName("commentsnew")).getAttributeValue() + "\n";
                    output = output + "Views : " + item.getAttribute(new QName("views")).getAttributeValue()
                            + "\n";
                    OMElement title = item.getFirstChildWithName(new QName("title"));
                    output = output + "Title : " + title.getText();
                    OMElement activity = item.getFirstChildWithName(new QName("activity"));
                    Iterator iter2 = activity.getChildElements();
                    while (iter2.hasNext()) {
                        OMElement event = (OMElement) iter2.next();
                        output = output + "Activity \nUser ID : "
                                + event.getAttribute(new QName("user")).getAttributeValue() + "\nUsername : "
                                + event.getAttribute(new QName("username")).getAttributeValue()
                                + "\nDate Added : "
                                + event.getAttribute(new QName("dateadded")).getAttributeValue() + "\n"
                                + "Text : " + event.getText();
                    }

                }
            }
        } else {
            output = processPeopleError(response.getErr());
        }
    } catch (RemoteException e) {
        output = e.getMessage();
    }
    return output;
}