Examples of AxisServiceGroup


Examples of org.apache.axis2.description.AxisServiceGroup

        if (service == null) {
            log.error("Service " + serviceName + "cannnot be found!");
            throw new ModuleMgtException(ModuleMgtException.ERROR, ModuleMgtMessageKeys.SERVICE_NOT_FOUND);
        }

        AxisServiceGroup serviceGroup = service.getAxisServiceGroup();
        ModuleMetaData[] modules = listModules();

        for (ModuleMetaData module : modules) {
            String moduleId = module.getModuleId();
            module.setEngagedServiceGroupLevel(serviceGroup.isEngaged(moduleId));
            module.setEngagedServiceLevel(service.isEngaged(moduleId));
        }

        return modules;
View Full Code Here

Examples of org.apache.axis2.description.AxisServiceGroup

    }

    public ModuleMetaData[] listModulesForServiceGroup(String serviceGroupName) throws ModuleMgtException {

        AxisServiceGroup serviceGroup = axisConfig.getServiceGroup(serviceGroupName);
        if (serviceGroup == null) {
            log.error("Service group " + serviceGroupName + "cannnot be found!");
            throw new ModuleMgtException(ModuleMgtException.ERROR, ModuleMgtMessageKeys.SERVICE_GROUP_NOT_FOUND);
        }

        ModuleMetaData[] modules = listModules();

        for (ModuleMetaData module : modules) {
            String moduleId = module.getModuleId();
            module.setEngagedServiceGroupLevel(serviceGroup.isEngaged(moduleId));
        }

        return modules;
    }
View Full Code Here

Examples of org.apache.axis2.description.AxisServiceGroup

    }

    public boolean engageModuleForServiceGroup(String moduleID, String serviceGroupName)
            throws ModuleMgtException {

        AxisServiceGroup serviceGroup = axisConfig.getServiceGroup(serviceGroupName);
        if (serviceGroup == null) {
            log.error("Service group " + serviceGroupName + "cannnot be found!");
            throw new ModuleMgtException(ModuleMgtException.ERROR, ModuleMgtMessageKeys.SERVICE_GROUP_NOT_FOUND);
        }

        AxisModule module = axisConfig.getModule(moduleID);
        if (module == null) {
            log.error("Module " + moduleID + " cannnot be found!");
            throw new ModuleMgtException(ModuleMgtException.ERROR, ModuleMgtMessageKeys.MODULE_NOT_FOUND);
        }

        if (axisConfig.isEngaged(module)) {
            // Module is already engaged so just return the value;
            throw new ModuleMgtException(ModuleMgtException.WARNING, ModuleMgtMessageKeys.ALREADY_ENGAGED_GLOBALLY);
        }

        if (serviceGroup.isEngaged(module)) {
            // Module is already engaged so just return the value;
            throw new ModuleMgtException(ModuleMgtException.WARNING, ModuleMgtMessageKeys.ALREADY_ENGAGED_SERVICE_GROUP);
        }

        try {
            if (RAHAS_MODULE_NAME.equals(module.getName())) {
                AxisModule rampartModule = axisConfig.getModule(RAMPART_MODULE_NAME);
                if (rampartModule == null) {
                    log.error("Rampart module not found when engaging Rampart");
                    throw new ModuleMgtException(ModuleMgtException.ERROR, ModuleMgtMessageKeys.RAHAS_RAMPART_NOT_FOUND);
                }
                if (!serviceGroup.isEngaged(rampartModule)) {
                    pf.getServiceGroupPM().engageModuleForServiceGroup(rampartModule, serviceGroup);
                    serviceGroup.disengageModule(rampartModule);
                    serviceGroup.engageModule(rampartModule);
                }
            }

            pf.getServiceGroupPM().engageModuleForServiceGroup(module, serviceGroup);
            serviceGroup.disengageModule(module);
            serviceGroup.engageModule(module);

            return true;

        } catch (Exception e) {
            log.error("Error occured while engaging the module " + module, e);
View Full Code Here

Examples of org.apache.axis2.description.AxisServiceGroup

    }

    public boolean disengageModuleForServiceGroup(String moduleId, String serviceGroupName)
            throws ModuleMgtException {

        AxisServiceGroup serviceGroup = axisConfig.getServiceGroup(serviceGroupName);
        if (serviceGroup == null) {
            log.error("Service group " + serviceGroupName + "cannnot be found!");
            throw new ModuleMgtException(ModuleMgtException.ERROR, ModuleMgtMessageKeys.SERVICE_GROUP_NOT_FOUND);
        }

        AxisModule module = axisConfig.getModule(moduleId);
        if (module == null) {
            log.error("Module " + moduleId + " cannnot be found!");
            throw new ModuleMgtException(ModuleMgtException.ERROR, ModuleMgtMessageKeys.MODULE_NOT_FOUND);
        }

        if (serviceGroup.isEngaged(module)) {
            if (RAMPART_MODULE_NAME.equalsIgnoreCase(module.getName())) {
                // Check whether it is possible to disengage Rampart
                AxisModule rahasModule = axisConfig.getModule(RAHAS_MODULE_NAME);
                if (serviceGroup.isEngaged(rahasModule)) {
                    throw new ModuleMgtException(ModuleMgtException.WARNING, ModuleMgtMessageKeys.RAHAS_RAMPART_DISENGAGE);
                }
            }

            if (RAMPART_MODULE_NAME.equalsIgnoreCase(module.getName()) || RAHAS_MODULE_NAME.equalsIgnoreCase(module.getName())) {
                // Check any of the services in the service group has a security scenario applied
                // if there is a security scenario give a warning saying cannot disengage rampart
                Iterator<AxisService> servicesIterator = serviceGroup.getServices();
                while (servicesIterator.hasNext()) {
                    AxisService service = servicesIterator.next();
                    if (isRequiredForSecurityScenario(service.getName(),module.getName())) {
                        throw new ModuleMgtException(ModuleMgtException.WARNING,
                                ModuleMgtMessageKeys.SERVICES_WITH_SECURITY_SCENARIOS);
                    }
                }
            }

            try {
                pf.getServiceGroupPM().disengageModuleForServiceGroup(module, serviceGroup);
                serviceGroup.disengageModule(module);
            } catch (Exception e) {
                log.error("Error occured while disengaging the module " + module, e);
                throw new ModuleMgtException(e, ModuleMgtException.ERROR, ModuleMgtMessageKeys.ERROR_DISENGAGE);
            }
View Full Code Here

Examples of org.apache.axis2.description.AxisServiceGroup

        if (axisConfig.isEngaged(module)) {
            throw new ModuleMgtException(ModuleMgtException.WARNING, ModuleMgtMessageKeys.ALREADY_ENGAGED_GLOBALLY);
        }

        AxisServiceGroup axisServiceGroup = service.getAxisServiceGroup();
        if (axisServiceGroup.isEngaged(module)) {
            // Module is already engaged so just return the value;
            throw new ModuleMgtException(ModuleMgtException.WARNING, ModuleMgtMessageKeys.ALREADY_ENGAGED_SERVICE_GROUP);
        }

        if (service.isEngaged(module)) {
View Full Code Here

Examples of org.apache.axis2.description.AxisServiceGroup

        if (axisConfig.isEngaged(module)) {
            throw new ModuleMgtException(ModuleMgtException.WARNING, ModuleMgtMessageKeys.ALREADY_ENGAGED_GLOBALLY);
        }

        AxisServiceGroup axisServiceGroup = service.getAxisServiceGroup();
        if (axisServiceGroup.isEngaged(module)) {
            // Module is already engaged so just return the value;
            throw new ModuleMgtException(ModuleMgtException.WARNING, ModuleMgtMessageKeys.ALREADY_ENGAGED_SERVICE_GROUP);
        }

        if (service.isEngaged(module)) {
View Full Code Here

Examples of org.apache.axis2.description.AxisServiceGroup

    private boolean isEngaged(AxisModule module) {
        if(axisConfig.isEngaged(module)) {
            return true;
        }
        for(Iterator serviceGroups = axisConfig.getServiceGroups(); serviceGroups.hasNext(); ){
            AxisServiceGroup serviceGroup = (AxisServiceGroup) serviceGroups.next();
            if(serviceGroup.isEngaged(module)) {
                return true;
            }
        }
        Map services = axisConfig.getServices();
        for (Iterator iter = services.values().iterator(); iter.hasNext();) {
View Full Code Here

Examples of org.apache.axis2.description.AxisServiceGroup

        int activeServices = 0;
        for (Iterator services = axisConfig.getServices().values().iterator();
             services.hasNext();) {
            AxisService axisService = (AxisService) services.next();
            AxisServiceGroup asGroup = (AxisServiceGroup) axisService.getParent();
            if (axisService.isActive() &&
                    !axisService.isClientSide() &&
                    !SystemFilter.isFilteredOutService(asGroup)) {
                activeServices++;
            }
View Full Code Here

Examples of org.apache.axis2.description.AxisServiceGroup

    public boolean isFilteredOutService(AxisService service, RelayConfiguration relConf) {
        if (relConf.getServices().contains(service.getName())) {
            return true;
        }

        AxisServiceGroup axisServiceGroup = (AxisServiceGroup) service.getParent();
        String adminParamValue =
                (String) axisServiceGroup.getParameterValue(ADMIN_SERVICE_PARAM_NAME);
        if (adminParamValue == null) {
            adminParamValue = (String) service.getParameterValue(ADMIN_SERVICE_PARAM_NAME);
        }

        String hiddenParamValue =
                (String) axisServiceGroup.getParameterValue(HIDDEN_SERVICE_PARAM_NAME);
        if (hiddenParamValue == null) {
            hiddenParamValue = (String) service.getParameterValue(HIDDEN_SERVICE_PARAM_NAME);
        }

        if (adminParamValue != null && adminParamValue.length() != 0) {
View Full Code Here

Examples of org.apache.axis2.description.AxisServiceGroup

    }

    public void run() {
        synchronized (axisConfig) {
            try {
                AxisServiceGroup proxyAxisServiceGroup =
                        axisConfig.getServiceGroup(WSDL2FormGenerator.TRYIT_SG_NAME);
                if (proxyAxisServiceGroup != null) {
                    List removeServiceList = new ArrayList();
                    for (Iterator iterator = proxyAxisServiceGroup.getServices();
                         iterator.hasNext();) {
                        AxisService axisServce = (AxisService) iterator.next();
                        Long longTime =
                                (Long) axisServce
                                        .getParameterValue(WSDL2FormGenerator.LAST_TOUCH_TIME);
                        if ((System.currentTimeMillis() - longTime.longValue()) > WSDL2FormGenerator
                                .PERIOD) {
                            removeServiceList.add(axisServce.getName());
                        }

                    }
                    if (removeServiceList.size() > 0) {
                        for (Iterator iterator = removeServiceList.iterator(); iterator.hasNext();)
                        {
                            String axisServiceName = (String) iterator.next();
                            proxyAxisServiceGroup.removeService(axisServiceName);
                        }
                    }
                    boolean isLast = proxyAxisServiceGroup.getServices().hasNext();
                    if (!isLast) {
                        axisConfig.removeServiceGroup(WSDL2FormGenerator.TRYIT_SG_NAME);
                    }
                }
            } catch (AxisFault axisFault) {
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.