List of usage examples for java.rmi RemoteException getMessage
public String getMessage()
From source file:org.apache.juddi.api.impl.API_170_CustodyTransferTest.java
@BeforeClass public static void setup() throws ConfigurationException { Registry.start();/*from w w w . ja v a2s .c om*/ logger.info("API_030_BusinessEntityTest"); logger.debug("Getting auth token.."); try { api010.saveJoePublisher(); api010.saveSamSyndicator(); UDDISecurityPortType security = new UDDISecurityImpl(); authInfoMary = TckSecurity.getAuthToken(security, TckPublisher.getMaryPublisherId(), TckPublisher.getMaryPassword()); authInfoSam = TckSecurity.getAuthToken(security, TckPublisher.getSamPublisherId(), TckPublisher.getSamPassword()); String authInfoUDDI = TckSecurity.getAuthToken(security, TckPublisher.getUDDIPublisherId(), TckPublisher.getUDDIPassword()); tckTModel.saveUDDIPublisherTmodel(authInfoUDDI); tckTModel.saveTModels(authInfoUDDI, TckTModel.TMODELS_XML); tckTModel.saveMaryPublisherTmodel(authInfoMary); tckTModel.saveSamSyndicatorTmodel(authInfoSam); } catch (RemoteException e) { logger.error(e.getMessage(), e); Assert.fail("Could not obtain authInfo token."); } }
From source file:org.apache.juddi.api.impl.TokenTest.java
@BeforeClass public static void startRegistry() throws ConfigurationException { Registry.start();/*from ww w . j a v a2 s. co m*/ logger.debug("Getting auth token.."); try { api010.saveJoePublisher(); api010.saveSamSyndicator(); UDDISecurityPortType security = new UDDISecurityImpl(); authInfoJoe = TckSecurity.getAuthToken(security, TckPublisher.getJoePublisherId(), TckPublisher.getJoePassword()); authInfoSam = TckSecurity.getAuthToken(security, TckPublisher.getSamPublisherId(), TckPublisher.getSamPassword()); authInfoMary = TckSecurity.getAuthToken(security, TckPublisher.getMaryPublisherId(), TckPublisher.getMaryPassword()); } catch (RemoteException e) { logger.error(e.getMessage(), e); Assert.fail("Could not obtain authInfo token."); } }
From source file:org.apache.juddi.subscription.SubscriptionNotifierTest.java
@BeforeClass public static void setup() { logger.info("SubscriptionNotifierTest setup"); logger.debug("Getting auth token.."); try {//w w w .java2s . c om DumpAllBusinesses(); //calls uddi-tck-base//rc/main/resources/uddi_data/joepublisher //setups up a JUDDI user account api010.saveJoePublisher(); //login as joe authInfoJoe = TckSecurity.getAuthToken(new UDDISecurityImpl(), TckPublisher.getJoePublisherId(), TckPublisher.getJoePassword()); //makes tmodel uddi:uddi.joepublisher.com:keygenerator tckTModel.saveJoePublisherTmodel(authInfoJoe); //saves a digitally signed business, no services //key = uddi:uddi.joepublisher.com:businessone //sournce = uddi_data/joepublisher/businessEntity.xml tckBusiness.saveJoePublisherBusiness(authInfoJoe); //saves a service and binding template //service key = uddi:uddi.joepublisher.com:serviceone //source "uddi_data/joepublisher/businessService.xml" //bt = uddi:uddi.joepublisher.com:bindingone String bindingKey = tckBusinessService.saveJoePublisherService(authInfoJoe); if (bindingKey == null || bindingKey.length() == 0) logger.fatal("Service binding key is null!"); //makes subscription key=uddi:uddi.joepublisher.com:subscriptionone //find exact match on "Service One" //callback binding key=should be set to bindingKey tckSubscription.saveJoePublisherSubscription(authInfoJoe, bindingKey); DumpAllBusinesses(); //tckSubscription.getJoePublisherSubscriptionResults(authInfoJoe); } catch (RemoteException e) { logger.error(e.getMessage(), e); Assert.fail("Could not obtain authInfo token."); } }
From source file:org.apache.juddi.v3.tck.TckBusiness.java
public void checkNumberOfServices(String businessKey, int expectedServices) { try {//ww w . ja va2s . com GetBusinessDetail gb = new GetBusinessDetail(); gb.getBusinessKey().add(businessKey); BusinessDetail bd; bd = inquiry.getBusinessDetail(gb); List<BusinessEntity> beOutList = bd.getBusinessEntity(); BusinessEntity beOut = beOutList.get(0); if (expectedServices > 0) { assertEquals(expectedServices, beOut.getBusinessServices().getBusinessService().size()); } else { Assert.assertNull(beOut.getBusinessServices()); } } catch (RemoteException e) { logger.error(e.getMessage(), e); Assert.fail("No exception should be thrown"); } }
From source file:org.apache.stratos.autoscaler.client.AutoscalerCloudControllerClient.java
public synchronized void createApplicationClusters(String appId, ApplicationClusterContext[] applicationClusterContexts) { List<org.apache.stratos.cloud.controller.stub.domain.ApplicationClusterContext> contextDTOs = new ArrayList<org.apache.stratos.cloud.controller.stub.domain.ApplicationClusterContext>(); if (applicationClusterContexts != null) { for (ApplicationClusterContext applicationClusterContext : applicationClusterContexts) { if (applicationClusterContext != null) { org.apache.stratos.cloud.controller.stub.domain.ApplicationClusterContext dto = new org.apache.stratos.cloud.controller.stub.domain.ApplicationClusterContext(); dto.setClusterId(applicationClusterContext.getClusterId()); dto.setAutoscalePolicyName(applicationClusterContext.getAutoscalePolicyName()); dto.setDeploymentPolicyName(applicationClusterContext.getDeploymentPolicyName()); dto.setCartridgeType(applicationClusterContext.getCartridgeType()); dto.setHostName(applicationClusterContext.getHostName()); dto.setTenantRange(applicationClusterContext.getTenantRange()); dto.setTextPayload(applicationClusterContext.getTextPayload()); dto.setProperties(AutoscalerUtil.toStubProperties(applicationClusterContext.getProperties())); dto.setDependencyClusterIds(applicationClusterContext.getDependencyClusterIds()); if (applicationClusterContext.getPersistenceContext() != null) { dto.setVolumeRequired(true); dto.setVolumes(convertVolumesToStubVolumes( applicationClusterContext.getPersistenceContext().getVolumes())); }//w ww. ja va 2 s .c o m contextDTOs.add(dto); } } } org.apache.stratos.cloud.controller.stub.domain.ApplicationClusterContext[] applicationClusterContextDTOs = new org.apache.stratos.cloud.controller.stub.domain.ApplicationClusterContext[contextDTOs .size()]; contextDTOs.toArray(applicationClusterContextDTOs); try { stub.createApplicationClusters(appId, applicationClusterContextDTOs); } catch (RemoteException e) { String msg = e.getMessage(); log.error(msg, e); } catch (CloudControllerServiceApplicationClusterRegistrationExceptionException e) { String msg = e.getMessage(); log.error(msg, e); } }
From source file:org.apache.stratos.autoscaler.client.cloud.controller.CloudControllerClient.java
public synchronized boolean validateDeploymentPolicy(String cartridgeType, DeploymentPolicy deploymentPolicy) throws PartitionValidationException { try {/*from w w w . jav a2s .co m*/ if (log.isInfoEnabled()) { log.info(String.format("Validating partitions of policy via cloud controller: [id] %s", deploymentPolicy.getId())); } long startTime = System.currentTimeMillis(); boolean result = stub.validateDeploymentPolicy(cartridgeType, deploymentPolicy.getAllPartitions()); if (log.isDebugEnabled()) { long endTime = System.currentTimeMillis(); log.debug(String.format("Service call validateDeploymentPolicy() returned in %dms", (endTime - startTime))); } return result; } catch (RemoteException e) { log.error(e.getMessage(), e); throw new PartitionValidationException(e.getMessage(), e); } catch (CloudControllerServiceInvalidPartitionExceptionException e) { log.error(e.getFaultMessage().getInvalidPartitionException().getMessage(), e); throw new PartitionValidationException(e.getFaultMessage().getInvalidPartitionException().getMessage()); } catch (CloudControllerServiceInvalidCartridgeTypeExceptionException e) { log.error(e.getFaultMessage().getInvalidCartridgeTypeException().getMessage(), e); throw new PartitionValidationException( e.getFaultMessage().getInvalidCartridgeTypeException().getMessage()); } }
From source file:org.apache.stratos.autoscaler.client.cloud.controller.CloudControllerClient.java
public synchronized boolean validatePartition(Partition partition) throws PartitionValidationException { try {/*from w w w . j av a 2s .co m*/ if (log.isInfoEnabled()) { log.info(String.format("Validating partition via cloud controller: [id] %s", partition.getId())); } long startTime = System.currentTimeMillis(); boolean result = stub.validatePartition(partition); if (log.isDebugEnabled()) { long endTime = System.currentTimeMillis(); log.debug( String.format("Service call validatePartition() returned in %dms", (endTime - startTime))); } return result; } catch (RemoteException e) { log.error(e.getMessage(), e); throw new PartitionValidationException(e.getMessage(), e); } catch (CloudControllerServiceInvalidPartitionExceptionException e) { log.error(e.getFaultMessage().getInvalidPartitionException().getMessage(), e); throw new PartitionValidationException(e.getFaultMessage().getInvalidPartitionException().getMessage(), e); } }
From source file:org.apache.stratos.autoscaler.client.cloud.controller.CloudControllerClient.java
public synchronized void terminateAllInstances(String clusterId) throws TerminationException { try {//w w w .j av a2 s .c o m if (log.isInfoEnabled()) { log.info(String.format("Terminating all instances of cluster via cloud controller: [cluster] %s", clusterId)); } long startTime = System.currentTimeMillis(); stub.terminateAllInstances(clusterId); if (log.isDebugEnabled()) { long endTime = System.currentTimeMillis(); log.debug(String.format("Service call terminateAllInstances() returned in %dms", (endTime - startTime))); } } catch (RemoteException e) { String msg = e.getMessage(); log.error(msg, e); throw new TerminationException(msg, e); } catch (CloudControllerServiceInvalidClusterExceptionException e) { String message = e.getFaultMessage().getInvalidClusterException().getMessage(); log.error(message, e); throw new TerminationException(message, e); } }
From source file:org.apache.stratos.autoscaler.client.cloud.controller.CloudControllerClient.java
public synchronized void terminate(String memberId) throws TerminationException { try {/*from ww w . ja v a 2s . co m*/ if (log.isInfoEnabled()) { log.info(String.format("Terminating instance via cloud controller: [member] %s", memberId)); } long startTime = System.currentTimeMillis(); stub.terminateInstance(memberId); if (log.isDebugEnabled()) { long endTime = System.currentTimeMillis(); log.debug( String.format("Service call terminateInstance() returned in %dms", (endTime - startTime))); } } catch (RemoteException e) { String msg = e.getMessage(); log.error(msg, e); throw new TerminationException(msg, e); } catch (CloudControllerServiceInvalidMemberExceptionException e) { String msg = e.getFaultMessage().getInvalidMemberException().getMessage(); log.error(msg, e); throw new TerminationException(msg, e); } catch (CloudControllerServiceInvalidCartridgeTypeExceptionException e) { String msg = e.getFaultMessage().getInvalidCartridgeTypeException().getMessage(); log.error(msg, e); throw new TerminationException(msg, e); } }
From source file:org.apache.stratos.autoscaler.client.CloudControllerClient.java
public synchronized boolean validateDeploymentPolicy(String cartridgeType, org.apache.stratos.autoscaler.pojo.policy.deployment.partition.network.Partition[] partitions) throws PartitionValidationException { try {/*from w w w . j a v a 2 s .co m*/ if (log.isInfoEnabled()) { log.info(String.format("Validating partitions of policy via cloud controller: [cartridge-type] %s", cartridgeType)); } long startTime = System.currentTimeMillis(); boolean result = stub.validateDeploymentPolicy(cartridgeType, AutoscalerObjectConverter.convertASPartitionsToCCStubPartitions(partitions)); if (log.isDebugEnabled()) { long endTime = System.currentTimeMillis(); log.debug(String.format("Service call validateDeploymentPolicy() returned in %dms", (endTime - startTime))); } return result; } catch (RemoteException e) { log.error(e.getMessage(), e); throw new PartitionValidationException(e.getMessage(), e); } catch (CloudControllerServiceInvalidPartitionExceptionException e) { log.error(e.getFaultMessage().getInvalidPartitionException().getMessage(), e); throw new PartitionValidationException(e.getFaultMessage().getInvalidPartitionException().getMessage()); } catch (CloudControllerServiceInvalidCartridgeTypeExceptionException e) { log.error(e.getFaultMessage().getInvalidCartridgeTypeException().getMessage(), e); throw new PartitionValidationException( e.getFaultMessage().getInvalidCartridgeTypeException().getMessage()); } }