List of usage examples for java.rmi RemoteException getMessage
public String getMessage()
From source file:org.wso2.carbon.identity.sso.saml.ui.client.SAMLSSOConfigServiceClient.java
public String[] getDigestAlgorithmURIs() throws IdentityRuntimeException { String[] digestAlgorithms;/*from ww w .ja v a2s . c o m*/ try { digestAlgorithms = stub.getDigestAlgorithmURIs(); } catch (RemoteException e) { throw new IdentityRuntimeException(e.getMessage(), e); } return digestAlgorithms; }
From source file:org.wso2.carbon.identity.sso.saml.ui.client.SAMLSSOConfigServiceClient.java
public String getDigestAlgorithmURIByConfig() throws IdentityRuntimeException { String digestAlgo;/*from w ww. j a v a 2 s .com*/ try { digestAlgo = stub.getDigestAlgorithmURIByConfig(); } catch (RemoteException e) { throw new IdentityRuntimeException(e.getMessage(), e); } return digestAlgo; }
From source file:org.wso2.carbon.logging.view.ui.LogViewerClient.java
public void downloadArchivedLogFiles(String logFile, HttpServletResponse response, String tenantDomain, String serverKey) throws RemoteException, LogViewerException { String msg = "Error occurred while getting logger data. Backend service may be " + "unavailable"; InputStream fileToDownload = null; try {/*from w w w.j a va 2 s .c om*/ logFile = logFile.replace(".gz", ""); ServletOutputStream outputStream = response.getOutputStream(); response.setContentType("application/txt"); response.setHeader("Content-Disposition", "attachment;filename=" + logFile.replaceAll("\\s", "_")); DataHandler data = stub.downloadArchivedLogFiles(logFile, tenantDomain, serverKey); fileToDownload = data.getInputStream(); int c; while ((c = fileToDownload.read()) != -1) { outputStream.write(c); } outputStream.flush(); outputStream.flush(); } catch (RemoteException e) { log.error(msg, e); throw e; } catch (LogViewerException e) { log.error(msg, e); throw e; } catch (IOException e) { String errorWhileDownloadingMsg = "Error while downloading file."; log.error(errorWhileDownloadingMsg, e); throw new LogViewerException(errorWhileDownloadingMsg, e); } finally { try { if (fileToDownload != null) { fileToDownload.close(); } } catch (IOException e) { log.error("Couldn't close the InputStream " + e.getMessage(), e); } } }
From source file:org.wso2.carbon.mediator.bam.config.ui.BamServerProfilesHelper.java
public String[] getServerProfileList(String serverProfilePath) { try {// w ww . ja va 2s . c om String[] profiles = client.getServerProfilePathList(serverProfilePath); if (profiles != null) { for (int i = 0; i < profiles.length; i++) { profiles[i] = profiles[i].split("/")[profiles[i].split("/").length - 1]; } return profiles; } } catch (RemoteException e) { String errorMsg = "Error while getting Server Profile Name List. " + e.getMessage(); log.error(errorMsg, e); } return new String[0]; }
From source file:org.wso2.carbon.mediator.bam.config.ui.BamServerProfilesHelper.java
public boolean resourceAlreadyExists(String bamServerProfileLocation) { try {//from w w w.ja va2s.co m return client.resourceAlreadyExists(this.getRealBamServerProfilePath(bamServerProfileLocation)); } catch (RemoteException e) { String errorMsg = "Error while checking the resource. " + e.getMessage(); log.error(errorMsg, e); } return true; }
From source file:org.wso2.carbon.mediator.bam.config.ui.BamServerProfilesHelper.java
public void addCollection(String path) { try {// w w w . j a v a2s . c o m client.addCollection(path); } catch (RemoteException e) { String errorMsg = "Error while adding the collection. " + e.getMessage(); log.error(errorMsg, e); } }
From source file:org.wso2.carbon.mediator.bam.config.ui.BamServerProfilesHelper.java
public boolean removeResource(String path) { try {//from ww w. j a va 2s. c o m return client.removeResource(path); } catch (RemoteException e) { String errorMsg = "Error while removing the resource. " + e.getMessage(); log.error(errorMsg, e); } return false; }
From source file:org.wso2.carbon.mediator.bam.config.ui.BamServerProfileUtils.java
public void addResource(String urlSet, String ip, String authenticationPort, String receiverPort, String userName, String password, boolean isSecure, boolean isLoadbalanced, String streamConfigurationListString, String bamServerProfileLocation) { String encryptedPassword = this.encryptPassword(password); String isSecureString, isLoadbalancedString; if (isSecure) { isSecureString = "true"; } else {//from www . jav a 2 s . c o m isSecureString = "false"; } if (isLoadbalanced) { isLoadbalancedString = "true"; } else { isLoadbalancedString = "false"; } StreamConfigListBuilder streamConfigListBuilder = new StreamConfigListBuilder(); List<StreamConfiguration> streamConfigurations = streamConfigListBuilder .getStreamConfigurationListFromString(streamConfigurationListString); BamServerConfigXml mediatorConfigurationXml = new BamServerConfigXml(); OMElement storeXml = mediatorConfigurationXml.buildServerProfile(urlSet, ip, authenticationPort, receiverPort, userName, encryptedPassword, isSecureString, isLoadbalancedString, streamConfigurations); String stringStoreXml = storeXml.toString(); try { client.saveResourceString(stringStoreXml, this.getRealBamServerProfilePath(bamServerProfileLocation)); } catch (RemoteException e) { String errorMsg = "Error while adding resource. " + e.getMessage(); log.error(errorMsg, e); } }
From source file:org.wso2.carbon.mediator.bam.config.ui.BamServerProfileUtils.java
public BamServerConfig getResource(String bamServerProfileLocation) { try {//from www. j a v a 2 s . c om String resourceString = client .getResourceString(this.getRealBamServerProfilePath(bamServerProfileLocation)); OMElement resourceElement = new StAXOMBuilder( new ByteArrayInputStream(resourceString.getBytes(Charset.forName("UTF-8")))) .getDocumentElement(); BamServerConfigBuilder bamServerConfigBuilder = new BamServerConfigBuilder(); bamServerConfigBuilder.createBamServerConfig(resourceElement); return bamServerConfigBuilder.getBamServerConfig(); } catch (RemoteException e) { String errorMsg = "Error while getting the resource. " + e.getMessage(); log.error(errorMsg, e); } catch (XMLStreamException e) { String errorMsg = "Error while creating OMElement from the string. " + e.getMessage(); log.error(errorMsg, e); } return null; }
From source file:org.wso2.carbon.mediator.bam.config.ui.BamServerProfileUtils.java
public String encryptPassword(String plainTextPassword) { try {//from www .j a va 2 s . c o m return client.encryptAndBase64Encode(plainTextPassword); } catch (RemoteException e) { String errorMsg = "Error while encrypting the password. " + e.getMessage(); log.error(errorMsg, e); } return ""; }