private MessageReceiver loadDefaultMessageReceiver(String mepURL, AxisService service) { MessageReceiver messageReceiver; if (mepURL == null) { mepURL = WSDL2Constants.MEP_URI_IN_OUT; } if (service != null) { messageReceiver = service.getMessageReceiver(mepURL); if (messageReceiver != null) { return messageReceiver; } } if (getAxisConfiguration() != null) { return getAxisConfiguration().getMessageReceiver(mepURL); } return null; }
private MessageReceiver loadDefaultMessageReceiver(String mepURL, AxisService service) { MessageReceiver messageReceiver; if (mepURL == null) { mepURL = WSDL2Constants.MEP_URI_IN_OUT; } if (service != null) { messageReceiver = service.getMessageReceiver(mepURL); if (messageReceiver != null) { return messageReceiver; } } if (getAxisConfiguration() != null) { return getAxisConfiguration().getMessageReceiver(mepURL); } return null; }
private void processEndpoints(AxisService axisService) throws AxisFault { String endpointName = axisService.getEndpointName(); if (endpointName == null || endpointName.length() == 0) { Utils.addEndpointsToService(axisService, service.getAxisConfiguration()); } }
private void processEndpoints(AxisService axisService) throws AxisFault { String endpointName = axisService.getEndpointName(); if (endpointName == null || endpointName.length() == 0) { Utils.addEndpointsToService(axisService, service.getAxisConfiguration()); } }
private String[] calculateEPRs() { try { String requestIP = org.apache.axis2.util.Utils.getIpAddress(getAxisConfiguration()); return calculateEPRs(requestIP); } catch (SocketException e) { log.error("Cannot get local IP address", e); } return new String[0]; }
private String[] calculateEPRs() { try { String requestIP = org.apache.axis2.util.Utils.getIpAddress(getAxisConfiguration()); return calculateEPRs(requestIP); } catch (SocketException e) { log.error("Cannot get local IP address", e); } return new String[0]; }
/** * {@inheritDoc} */ @Override public void serviceUpdate(AxisEvent event, AxisService service) { if (event.getEventType() == AxisEvent.SERVICE_DEPLOY && RP_SERVICE_NAME.equals(service.getName())) { try { populateRampartConfig(service.getAxisConfiguration()); } catch (Exception e) { log.error("Error while updating " + RP_SERVICE_NAME + " in RPDeploymentInterceptor", e); throw new RuntimeException(e); } } }
/** * {@inheritDoc} */ @Override public void serviceUpdate(AxisEvent event, AxisService service) { if (event.getEventType() == AxisEvent.SERVICE_DEPLOY && ServerConstants.STS_NAME.equals(service.getName())) { try { updateSTSService(service.getAxisConfiguration()); } catch (Exception e) { log.error("Error while updating " + ServerConstants.STS_NAME + " in STSDeploymentInterceptor", e); } } } /**
public void serviceUpdate(AxisEvent axisEvent, AxisService axisService) { log.debug("ThrottleObserver notified for a serviceUpdate."); AxisDescription axisDescription = axisEvent.getAxisDescription(); if (axisDescription.isEngaged(axisService.getAxisConfiguration(). getModule(ThrottleConstants.THROTTLE_MODULE_NAME))) { if (axisEvent.getEventType() == AxisEvent.POLICY_ADDED) { try { ThrottleEnguageUtils.enguage(axisDescription, configctx, defautThrottle); } catch (AxisFault axisFault) { log.error("Error while re-engaging throttling", axisFault); } } } }
public void onDisengage(AxisModule module) throws AxisFault { removeModuleOperations(module); for (Iterator operations = getChildren(); operations.hasNext();) { AxisOperation axisOperation = (AxisOperation) operations.next(); axisOperation.disengageModule(module); } AxisConfiguration config = getAxisConfiguration(); if (!config.isEngaged(module.getName())) { PhaseResolver phaseResolver = new PhaseResolver(config); phaseResolver.disengageModuleFromGlobalChains(module); } }
public void onDisengage(AxisModule module) throws AxisFault { removeModuleOperations(module); for (Iterator operations = getChildren(); operations.hasNext();) { AxisOperation axisOperation = (AxisOperation) operations.next(); axisOperation.disengageModule(module); } AxisConfiguration config = getAxisConfiguration(); if (!config.isEngaged(module.getName())) { PhaseResolver phaseResolver = new PhaseResolver(config); phaseResolver.disengageModuleFromGlobalChains(module); } }
protected boolean engageModules(String scenarioId, String serviceName, AxisService axisService) throws SecurityConfigException { boolean isRahasEngaged = false; SecurityScenario securityScenario = SecurityScenarioDatabase.get(scenarioId); String[] moduleNames = (String[]) securityScenario.getModules() .toArray(new String[securityScenario.getModules().size()]); // handle each module required try { for (String modName : moduleNames) { AxisModule module = axisService.getAxisConfiguration().getModule(modName); // engage at axis2 axisService.disengageModule(module); axisService.engageModule(module); if (SecurityConstants.TRUST_MODULE.equalsIgnoreCase(modName)) { isRahasEngaged = true; } } return isRahasEngaged; } catch (AxisFault e) { log.error(e); throw new SecurityConfigException("Error in engaging modules", e); } }
protected boolean engageModules(String scenarioId, String serviceName, AxisService axisService) throws SecurityConfigException { boolean isRahasEngaged = false; SecurityScenario securityScenario = SecurityScenarioDatabase.get(scenarioId); String[] moduleNames = (String[]) securityScenario.getModules() .toArray(new String[securityScenario.getModules().size()]); // handle each module required try { for (String modName : moduleNames) { AxisModule module = axisService.getAxisConfiguration().getModule(modName); // engage at axis2 axisService.disengageModule(module); axisService.engageModule(module); if (SecurityConstants.TRUST_MODULE.equalsIgnoreCase(modName)) { isRahasEngaged = true; } } return isRahasEngaged; } catch (AxisFault e) { log.error(e); throw new SecurityConfigException("Error in engaging modules", e); } }
public AxisDataLocator getGlobalDataLocator(String dialect) throws AxisFault { AxisConfiguration axisConfig = getAxisConfiguration(); AxisDataLocator locator = null; if (axisConfig != null) { locator = axisConfig.getDataLocator(dialect); if (locator == null) { String className = axisConfig.getDataLocatorClassName(dialect); if (className != null) { locator = loadDataLocator(className); axisConfig.addDataLocator(dialect, locator); } } } return locator; }
public void startUp(ConfigurationContext configctx, AxisService service) { AxisConfiguration config = null; List<Phase> phases = null; config = service.getAxisConfiguration(); phases = config.getInFlowPhases(); /* * Add dispatcher and security handler to inFlowPhases */ for (Iterator<Phase> iterator = phases.iterator(); iterator.hasNext();) { Phase phase = (Phase) iterator.next(); if ("Security".equals(phase.getPhaseName())) { phase.addHandler(new MyProxySecurityHandler()); phase.addHandler(new AmazonSecurityHandler()); } else if ("Dispatch".equals(phase.getPhaseName())) { phase.addHandler(new GFacURIBasedDispatcher(), 0); } } initializeRepository(configctx); }
public AxisDataLocator getGlobalDataLocator(String dialect) throws AxisFault { AxisConfiguration axisConfig = getAxisConfiguration(); AxisDataLocator locator = null; if (axisConfig != null) { locator = axisConfig.getDataLocator(dialect); if (locator == null) { String className = axisConfig.getDataLocatorClassName(dialect); if (className != null) { locator = loadDataLocator(className); axisConfig.addDataLocator(dialect, locator); } } } return locator; }
public void startUp(ConfigurationContext configctx, AxisService service) { AiravataUtils.setExecutionAsServer(); AxisConfiguration config = null; List<Phase> phases = null; config = service.getAxisConfiguration(); phases = config.getInFlowPhases(); /* * Add dispatcher and security handler to inFlowPhases */ for (Iterator<Phase> iterator = phases.iterator(); iterator.hasNext();) { Phase phase = (Phase) iterator.next(); if ("Security".equals(phase.getPhaseName())) { phase.addHandler(new MyProxySecurityHandler()); phase.addHandler(new AmazonSecurityHandler()); } else if ("Dispatch".equals(phase.getPhaseName())) { phase.addHandler(new GFacURIBasedDispatcher(), 0); } } initializeRepository(configctx); }
protected void onDisengage(AxisModule module) { AxisService service = getAxisService(); if (service == null) return; AxisConfiguration axisConfiguration = service.getAxisConfiguration(); PhaseResolver phaseResolver = new PhaseResolver(axisConfiguration); if (!service.isEngaged(module.getName()) && (axisConfiguration != null && !axisConfiguration.isEngaged(module.getName()))) { phaseResolver.disengageModuleFromGlobalChains(module); } phaseResolver.disengageModuleFromOperationChain(module, this); //removing operations added at the time of module engagemnt HashMap<QName, AxisOperation> moduleOperations = module.getOperations(); if (moduleOperations != null) { Iterator<AxisOperation> moduleOperations_itr = moduleOperations.values().iterator(); while (moduleOperations_itr.hasNext()) { AxisOperation operation = moduleOperations_itr.next(); service.removeOperation(operation.getName()); } } }
protected void onDisengage(AxisModule module) { AxisService service = getAxisService(); if (service == null) return; AxisConfiguration axisConfiguration = service.getAxisConfiguration(); PhaseResolver phaseResolver = new PhaseResolver(axisConfiguration); if (!service.isEngaged(module.getName()) && (axisConfiguration != null && !axisConfiguration.isEngaged(module.getName()))) { phaseResolver.disengageModuleFromGlobalChains(module); } phaseResolver.disengageModuleFromOperationChain(module, this); //removing operations added at the time of module engagemnt HashMap<QName, AxisOperation> moduleOperations = module.getOperations(); if (moduleOperations != null) { Iterator<AxisOperation> moduleOperations_itr = moduleOperations.values().iterator(); while (moduleOperations_itr.hasNext()) { AxisOperation operation = moduleOperations_itr.next(); service.removeOperation(operation.getName()); } } }
private String getEndpointURL(AxisEndpoint axisEndpoint) { Parameter modifyAddressParam = axisService.getParameter("modifyUserWSDLPortAddress"); String endpointURL = axisEndpoint.getEndpointURL(); if (modifyAddressParam != null && !Boolean.parseBoolean((String)modifyAddressParam.getValue())) { return endpointURL; } String hostIP; // First check the hostname parameter hostIP = Utils.getHostname(axisService.getAxisConfiguration()); //If it is not set extract the hostIP from the URL if (hostIP == null) { hostIP = WSDLSerializationUtil.extractHostIP(axisService.getEndpointURL()); } //TODO This is to prevent problems when JAVA2WSDL tool is used where there is no //Axis server running. calculateEndpointURL fails in this scenario, refer to // SimpleHTTPServer#getEPRsForService() if (hostIP != null) { return axisEndpoint.calculateEndpointURL(hostIP); } else { return endpointURL; } }