public static AxisService getAnonymousService(AxisConfiguration axisCfg, String serviceKey) throws AxisFault { AxisService service = axisCfg.getService(serviceKey); if (service == null) { synchronized (AnonymousServiceFactory.class) { // double locking, issue found on performance test service = axisCfg.getService(serviceKey); if (service == null) { service = getAxisServiceWithoutCallback(null, axisCfg, serviceKey); } } } return service; } }
protected void processListFaultyServices(HttpServletRequest req, HttpServletResponse res) throws IOException, ServletException { String serviceName = req.getParameter("serviceName"); if (serviceName != null) { AxisService service = configContext.getAxisConfiguration().getService(serviceName); req.setAttribute(Constants.SINGLE_SERVICE, service); } renderView(LIST_FAULTY_SERVICES_JSP_NAME, req, res); }
protected void processListFaultyServices(HttpServletRequest req, HttpServletResponse res) throws IOException, ServletException { String serviceName = req.getParameter("serviceName"); if (serviceName != null) { AxisService service = configContext.getAxisConfiguration().getService(serviceName); req.setAttribute(Constants.SINGLE_SERVICE, service); } renderView(LIST_FAULTY_SERVICES_JSP_NAME, req, res); }
public String getEndpoint(String serviceName) throws AxisFault { if (configurationContext == null) { throw new IllegalStateException(); } return configurationContext.getAxisConfiguration().getService(serviceName).getEPRs()[0]; }
private void unDeployCRUDService(GovernanceArtifactConfiguration configuration, AxisConfiguration axisConfig) { String singularLabel = configuration.getSingularLabel(); try { if (axisConfig.getService(singularLabel) != null) { axisConfig.removeService(singularLabel); } } catch (AxisFault axisFault) { log.error(axisFault); } }
public String[] getServiceUsers(String serviceName) throws AxisFault { AxisService axisService = getAxisConfig().getService(serviceName); if (axisService == null) { throw new AxisFault("invalid service name " + serviceName); } Collection users = new ArrayList(); ServiceUserDO[] userDOs = pm.getUsersForService(serviceName, ServiceIdentifierDO.EMPTY_SERVICE_VERSION); for (int i = 0; i < userDOs.length; i++) { ServiceUserDO userDO = userDOs[i]; users.add(userDO.getUsername()); } return (String[]) users.toArray(new String[users.size()]); }
public OMElement[] getDeclaredServiceParameters(String serviceId, String serviceVersion) throws AxisFault { ArrayList allParameter = new ArrayList(); AxisService axisService = getAxisConfig().getService(serviceId); if (axisService == null) { throw new AxisFault("invalid service name " + serviceId); } ArrayList params = axisService.getParameters(); for (int i = 0; i < params.size(); i++) { Parameter parameter = (Parameter) params.get(i); OMElement element = parameter.getParameterElement(); if (element != null) { allParameter.add(element); } } return (OMElement[]) allParameter.toArray(new OMElement[allParameter.size()]); }
public AxisService findService(MessageContext mc) throws AxisFault { AxisConfiguration ac = mc.getConfigurationContext().getAxisConfiguration(); return ac.getService(SynapseConstants.SYNAPSE_SERVICE_NAME); }
public AxisService findService(MessageContext mc) throws AxisFault { AxisConfiguration ac = mc.getConfigurationContext().getAxisConfiguration(); return ac.getService(SynapseConstants.SYNAPSE_SERVICE_NAME); }
/** * return all accumulated data about this operation * * @param serviceName * @param operationName * @return operation stats * @throws AxisFault */ public OperationMetaData getOperationStatistics(String serviceName, String operationName) throws AxisFault { AxisService axisService = getAxisConfig().getService(serviceName); if (axisService != null) { return getOperationMetaData(serviceName, operationName); } return null; }
public String[] getExposedTransports(String serviceId) throws AxisFault { AxisService axisService = getAxisConfig().getService(serviceId); if (!axisService.isEnableAllTransports()) { List exposedTransports = axisService.getExposedTransports(); return (String[]) exposedTransports.toArray(new String[exposedTransports.size()]); } else { HashMap transportsIn = getConfigContext().getAxisConfiguration() .getTransportsIn(); String[] transports = new String[transportsIn.size()]; int i = 0; for (Iterator transportsIter = transportsIn.values().iterator(); transportsIter.hasNext();) { TransportInDescription tiDesc = (TransportInDescription) transportsIter.next(); transports[i++] = tiDesc.getName(); } return transports; } }
protected void activate(ComponentContext ctxt) { //TODO: Modify the permission in the UI try { ConfigurationContext configContext = configContextService.getServerConfigContext(); AxisService serviceAdmin = configContext.getAxisConfiguration().getService("ServiceAdmin"); Properties props = new Properties(); props.put(CarbonConstants.AXIS2_CONFIG_SERVICE, AxisObserver.class.getName()); ctxt.getBundleContext().registerService(AxisObserver.class.getName(), new CloudMSDeploymentInterceptor(), props); // register the role player for this configuration AxisConfiguration axisConfiguration = configContext.getAxisConfiguration(); axisConfiguration.addParameter(new Parameter("rolePlayer", new SuperTenantRolePlayer())); } catch (Exception e) { log.error("CloudMSDeploymentServiceComponent activation failed", e); } }
public OMElement getPolicy(String serviceId, String serviceVersion) throws AxisFault { AxisService axisService = getAxisConfig().getService(serviceId); if (axisService == null) { throw new AxisFault("invalid service name"); } PolicyInclude servicePolicyInclude = axisService.getPolicyInclude(); Policy servicePolicy = servicePolicyInclude.getPolicy(); if (servicePolicy == null) { return PolicyUtil.getEmptyPolicyAsOMElement(); } return PolicyUtil.getPolicyAsOMElement(servicePolicy); }
@Override public AxisService findService(final MessageContext msgCtx) throws AxisFault { AxisService axisService = msgCtx.getAxisService(); if (axisService != null) return axisService; else if (msgCtx.getTo().getAddress().endsWith("msh")) return msgCtx.getConfigurationContext().getAxisConfiguration().getService("as4"); else return null; }
public void setServiceParameterElement(String serviceName, Parameter parameter) throws AxisFault { AxisService axisService = axisConfig.getService(serviceName); if (axisService == null) { throw new AxisFault("Invalid service name '" + serviceName + "'"); } Parameter p = axisService.getParameter(parameter.getName()); if (p != null) { if (!p.isLocked()) { axisService.addParameter(parameter); } } else { axisService.addParameter(parameter); } }
public void setServiceParameterElement(String serviceName, Parameter parameter) throws AxisFault { AxisService axisService = axisConfig.getService(serviceName); if (axisService == null) { throw new AxisFault("Invalid service name '" + serviceName + "'"); } Parameter p = axisService.getParameter(parameter.getName()); if (p != null) { if (!p.isLocked()) { axisService.addParameter(parameter); } } else { axisService.addParameter(parameter); } }
public void setServiceParameterElement(String serviceName, Parameter parameter) throws AxisFault { AxisService axisService = axisConfig.getService(serviceName); if (axisService == null) { throw new AxisFault("Invalid service name '" + serviceName + "'"); } Parameter p = axisService.getParameter(parameter.getName()); if (p != null) { if (!p.isLocked()) { axisService.addParameter(parameter); } } else { axisService.addParameter(parameter); } }
private void engageModules(String serviceId, String scenarioId) throws AxisFault { SecurityScenarioDO securityScenario = pm.getSecurityScenario(scenarioId); AxisService axisService = axisConfig.getService(serviceId); for (Iterator modules = securityScenario.modules.iterator(); modules.hasNext();) { ModuleDO moduleDO = (ModuleDO) modules.next(); String moduleName = moduleDO.getModuleIdentifierDO().getName(); if (!axisService.isEngaged(moduleName)) { AxisModule axisModule = axisConfig.getModule(moduleName); new ModuleAdmin(this.configCtx). engageModuleForService(axisModule.getName(), axisModule.getVersion(), serviceId, ServiceIdentifierDO.EMPTY_SERVICE_VERSION); } } }
private void disengageModules(String serviceId, String scenarioId) throws AxisFault { SecurityScenarioDO securityScenario = pm.getSecurityScenario(scenarioId); AxisService axisService = axisConfig.getService(serviceId); ModuleAdmin moduleAdmin = new ModuleAdmin(this.configCtx); for (Iterator modules = securityScenario.modules.iterator(); modules.hasNext();) { ModuleDO moduleDO = (ModuleDO) modules.next(); String moduleName = moduleDO.getModuleIdentifierDO().getName(); String moduleVersion = moduleDO.getModuleIdentifierDO().getVersion(); AxisModule axisModule = axisConfig.getModule(moduleName, moduleVersion); if (axisService.isEngaged(axisModule)) { moduleAdmin.forceDisengageModuleFromService(axisModule.getName(), axisModule.getVersion(), serviceId, ServiceIdentifierDO.EMPTY_SERVICE_VERSION); } } }
public void removeServiceParameter(String serviceName, String paramName) throws AxisFault { AxisService axisService = getAxisConfig().getService(serviceName); axisService.removeParameter(new Parameter(paramName, null)); ServiceDO serviceDO = pm.getService(serviceName, ServiceIdentifierDO.EMPTY_SERVICE_VERSION); ServiceParameterDO sp = new ServiceParameterDO(); sp.setService(serviceDO); sp.setName(paramName); serviceDO.getParameters().remove(sp); pm.updateEntity(serviceDO); }