Package org.apache.axis2.description

Examples of org.apache.axis2.description.AxisServiceGroup


      String serviceContents) throws AxisFault {
    String dataServiceFilePath;
    ConfigurationContext configCtx = this.getConfigContext();
    AxisConfiguration axisConfig = configCtx.getAxisConfiguration();
    AxisService axisService = axisConfig.getServiceForActivation(serviceName);
    AxisServiceGroup axisServiceGroup;
    boolean hotUpdateOrFaulty = false;
   
    if (serviceHierarchy == null) {
      serviceHierarchy = "";
    }

    if (axisService == null) {
      /* new service */
      String axis2RepoDirectory = axisConfig.getRepository().getPath();
      String repoDirectory = (String) configCtx.getProperty(DBConstants.DB_SERVICE_REPO);
      String fileExtension = this.getDataServiceFileExtension();

      String dataServiceDirectory = axis2RepoDirectory + File.separator + repoDirectory
          + File.separator + serviceHierarchy;
      dataServiceFilePath = dataServiceDirectory + File.separator + serviceName + "."
          + fileExtension;

      /* create the directory, if it does not exist */
      File directory = new File(dataServiceDirectory);
      if (!directory.exists() && !directory.mkdirs()) {
        throw new AxisFault("Cannot create directory: " + directory.getAbsolutePath());
      }

      /* check if this is a faulty service */
      if (CarbonUtils.getFaultyService(serviceName, configCtx) != null) {
        hotUpdateOrFaulty = true;
      }
    } else {
      dataServiceFilePath = ((DataService) axisService.getParameter(
          DBConstants.DATA_SERVICE_OBJECT).getValue()).getDsLocation();
      axisServiceGroup = axisService.getAxisServiceGroup();
      axisServiceGroup.addParameter(CarbonConstants.KEEP_SERVICE_HISTORY_PARAM, "true");
      axisServiceGroup.addParameter(CarbonConstants.PRESERVE_SERVICE_HISTORY_PARAM, "true");
      axisService.addParameter(CarbonConstants.KEEP_SERVICE_HISTORY_PARAM, "true");
      axisService.addParameter(CarbonConstants.PRESERVE_SERVICE_HISTORY_PARAM, "true");
      hotUpdateOrFaulty = true;
    }

View Full Code Here


                                getParameterValue(Constants.Configuration.ARTIFACTS_TEMP_DIR),
                        axisConfig.isChildFirstClassLoading());
                Thread.currentThread().setContextClassLoader(classLoader);

                List<String> classList = Utils.getListOfClasses(deploymentFileData);
                AxisServiceGroup serviceGroup = deployClasses(groupName, location, classLoader, classList);
               
                if(serviceGroup == null) {
                    String msg = "Error while deploying JAX-WS jar: " +
                            location.toString() +
                            ". JAX-WS Service deployment failed.";
View Full Code Here

        int size = axisServiceList.size();
        if (size <= 0) {
            return null;
        }
        //creating service group by considering the hierarchical path also
        AxisServiceGroup serviceGroup = new AxisServiceGroup();
        serviceGroup.setServiceGroupName(serviceHierarchy + groupName);
        for (AxisService axisService : axisServiceList) {
            axisService.setName(serviceHierarchy + axisService.getName());
            serviceGroup.addService(axisService);
        }
        axisConfig.addServiceGroup(serviceGroup);
        configureAddressing(serviceGroup);
        return serviceGroup;
    }
View Full Code Here

    public void undeploy(String fileName) {
        //find the hierarchical part of the service group name
        String serviceHierarchy = Utils.getServiceHierarchy(fileName, this.directory);
        fileName = serviceHierarchy + Utils.getShortFileName(fileName);
        try {
            AxisServiceGroup serviceGroup =
                    axisConfig.removeServiceGroup(fileName);
            if(configCtx != null) {
                configCtx.removeServiceGroupContext(serviceGroup);
            }
            super.undeploy(fileName);
View Full Code Here

        List<ServiceGroupMetaData> sgList = new ArrayList<ServiceGroupMetaData>();
        TreeSet<String> serviceTypes = new TreeSet<String>();
        serviceTypes.add("axis2");

        for (Iterator sgs = getAxisConfig().getServiceGroups(); sgs.hasNext();) {
            AxisServiceGroup serviceGroup = (AxisServiceGroup) sgs.next();

            // Filtering the admin services
            if (SystemFilter.isFilteredOutService(serviceGroup)) {
                continue// No advancement of currentIndex
            }
            String serviceType = "axis2";
            Parameter serviceTypeParam;
            if (serviceGroup.getServices().hasNext()) {
                serviceTypeParam = (serviceGroup.getServices().next())
                        .getParameter(ServerConstants.SERVICE_TYPE);
                if (serviceTypeParam != null) {
                    serviceType = (String) serviceTypeParam.getValue();
                    serviceTypes.add(serviceType);
                }
            }
            if (!serviceTypeFilter.equals("ALL")) {
                if (!serviceTypeFilter.equals(serviceType)) {
                    continue;
                }
            }
            if (serviceGroupSearchString != null &&
                serviceGroupSearchString.trim().length() > 0 &&
                serviceGroup.getServiceGroupName().toLowerCase().
                        indexOf(serviceGroupSearchString.toLowerCase()) == -1) {
                continue;
            }

            ServiceGroupMetaData sgMetaData = new ServiceGroupMetaData();

            List<ServiceMetaData> services = new ArrayList<ServiceMetaData>();
            boolean isClientSide = false;
            for (Iterator serviceIter = serviceGroup.getServices(); serviceIter.hasNext();) {
                AxisService axisService = (AxisService) serviceIter.next();
                if (axisService.isClientSide()) {
                    isClientSide = true;
                    break;
                }
                ServiceMetaData service = new ServiceMetaData();
                String serviceName = axisService.getName();
                service.setName(serviceName);

                // extract service type
                serviceTypeParam = axisService.getParameter(ServerConstants.SERVICE_TYPE);
                if (serviceTypeParam != null) {
                    serviceType = (String) serviceTypeParam.getValue();
                }
                service.setServiceType(serviceType);
                AxisConfiguration axisConfiguration = getAxisConfig();
                service.setWsdlURLs(Utils.getWsdlInformation(serviceName, axisConfiguration));
                service.setTryitURL(Utils.getTryitURL(serviceName, getConfigContext()));
                service.setActive(axisService.isActive());
                Parameter parameter = axisService.getParameter(ServiceAdmin.DISABLE_TRY_IT_PARAM);
                if (parameter != null && Boolean.TRUE.toString().equalsIgnoreCase((String) parameter.getValue())) {
                    service.setDisableTryit(true);
                }
                parameter = axisService.getParameter(ServiceAdmin.DISABLE_DELETION_PARAM);
                if (parameter != null && Boolean.TRUE.toString().equalsIgnoreCase((String) parameter.getValue())) {
                    sgMetaData.setDisableDeletion(true);
                }
                services.add(service);
            }
            if (services.size() == 0 || isClientSide) {
                continue; // No advancement of currentIndex
            }

            String sgName = serviceGroup.getServiceGroupName();
            sgMetaData.setServices(services.toArray(new ServiceMetaData[services.size()]));
            sgMetaData.setServiceGroupName(sgName);
            sgMetaData.setServiceContextPath(getConfigContext().getServiceContextPath());
            Parameter parameter =
                    serviceGroup.getParameter(Constants.Configuration.ENABLE_MTOM);
            if (parameter != null) {
                sgMetaData.setMtomStatus((String) parameter.getValue());
            } else {
                sgMetaData.setMtomStatus("false");
            }
View Full Code Here

     */
    public ServiceGroupMetaData listServiceGroup(String serviceGroupName) throws Exception {
        ServiceGroupMetaData sgmd = new ServiceGroupMetaData();
        Collection engagedModules;
        String[] engagedModuleNames = null;
        AxisServiceGroup serviceGroup;
        Parameter parameter;

        serviceGroup = getAxisConfig().getServiceGroup(serviceGroupName);
        if (serviceGroup == null) {
            String msg = "Service group " + serviceGroupName + " not found";
            log.error(msg);
            throw new Exception(msg);
        }
        sgmd.setServiceGroupName(serviceGroup.getServiceGroupName());

        parameter = serviceGroup.getParameter(Constants.Configuration.ENABLE_MTOM);
        if (parameter != null) {
            sgmd.setMtomStatus((String) parameter.getValue());
        }

        engagedModules = serviceGroup.getEngagedModules();

        if (engagedModules != null && engagedModules.size() > 0) {
            int i = 0;
            engagedModuleNames = new String[engagedModules.size()];
            for (Iterator iterator = engagedModules.iterator(); iterator.hasNext();) {
                AxisModule module = (AxisModule) iterator.next();
                engagedModuleNames[i++] = module.getName();
            }
        }
        sgmd.setEngagedModules(engagedModuleNames);

        List<ServiceMetaData> services = new ArrayList<ServiceMetaData>();
        for (Iterator servicesIter = serviceGroup.getServices(); servicesIter.hasNext();) {
            AxisService service = (AxisService) servicesIter.next();
            String serviceName = service.getName();
            ServiceMetaData serviceMetaData = new ServiceMetaData();
            serviceMetaData.setName(service.getName());

View Full Code Here

     * @return ServiceGroupMetaData
     */
    public ServiceGroupMetaData configureServiceGroupMTOM(String flag, String serviceGroupName)
            throws Exception {

        AxisServiceGroup serviceGroup = null;
        ArrayList parameters = null;
        boolean found = false;

        serviceGroup = getAxisConfig().getServiceGroup(serviceGroupName);

        if (serviceGroup == null) {
            throw new AxisFault("Service group " + serviceGroupName + "cannnot be found!");
        }
        // get the declared parameters
        parameters = serviceGroup.getParameters();

        for (Iterator params = parameters.iterator(); params.hasNext();) {
            Parameter parameter = (Parameter) params.next();
            if (parameter.getParameterType() == Parameter.TEXT_PARAMETER
                && parameter.getValue().toString().equals(Constants.Configuration.ENABLE_MTOM)) {
                parameter.setValue(flag.trim());
                found = true;
                break;
            }

        }
        if (!found) {
            Parameter parameter = ParameterUtil.createParameter(
                    Constants.Configuration.ENABLE_MTOM, flag.trim());
            serviceGroup.addParameter(parameter);
        }

        Parameter parameter = serviceGroup.getParameter(Constants.Configuration.ENABLE_MTOM);

        try {
            boolean transactionStarted = Transaction.isStarted();
            if (!transactionStarted) {
                getConfigSystemRegistry().beginTransaction();
            }

            String serviceGroupResourcePath = null;
            String serviceResourcePath = null;
            String paramResourcePath = null;
            Resource paramResource = null;

            serviceGroupResourcePath = RegistryResources.SERVICE_GROUPS + serviceGroupName;

            // set it in all underline children services and operations
            for (Iterator iterator = serviceGroup.getServices(); iterator.hasNext();) {

                AxisService service = null;

                service = (AxisService) iterator.next();
                serviceResourcePath = serviceGroupResourcePath + RegistryResources.SERVICES
View Full Code Here

     * @throws ServerException
     */
    public void updateServiceGroupParamters(String serviceGroupName, ParameterMetaData[] params)
            throws ServerException {

        AxisServiceGroup serviceGroup = null;

        try {
            serviceGroup = getAxisConfig().getServiceGroup(serviceGroupName);
            Parameter parameter;

            for (ParameterMetaData paramMetaData : params) {
                parameter = serviceGroup.getParameter(paramMetaData.getName());
                if (parameter == null) {
                    parameter = new Parameter(paramMetaData.getName(), null);
                }
                parameter.setParameterType(paramMetaData.getType());
                if (paramMetaData.getType() == Parameter.OM_PARAMETER) {
View Full Code Here

     */
    public void updateServiceGroupParameter(String serviceGroupName,
                                            ParameterMetaData paramMetaData)
            throws ServerException {

        AxisServiceGroup serviceGroup = null;

        try {
            serviceGroup = getAxisConfig().getServiceGroup(serviceGroupName);
            Parameter parameter = serviceGroup.getParameter(paramMetaData.getName());
            if (parameter == null) {
                parameter = new Parameter(paramMetaData.getName(), null);
            }
            parameter.setParameterType(paramMetaData.getType());
            if (paramMetaData.getType() == Parameter.OM_PARAMETER) {
View Full Code Here

     * @return
     * @throws ServerException
     */
    public String[] getServiceGroupParameters(String serviceGroupName) throws ServerException {

        AxisServiceGroup serviceGroup = null;
        String[] params = new String[0];

        try {
            serviceGroup = getAxisConfig().getServiceGroup(serviceGroupName);
            ArrayList<Parameter> parameters = serviceGroup.getParameters();

            if (parameters == null || parameters.size() == 0) {
                return params;
            }

View Full Code Here

TOP

Related Classes of org.apache.axis2.description.AxisServiceGroup

Copyright © 2018 www.massapicom. 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.