Examples of ServiceConfiguration


Examples of org.apache.stratos.lb.common.conf.LoadBalancerConfiguration.ServiceConfiguration

    public final void testCreateServicesConfig() {

        /* Tests relavant to loadbalancer.conf file */
       
        ServiceConfiguration asServiceConfig =
                                               lbConfig.getServiceConfig("wso2.as1.domain",
                                                                         "worker");

        assertEquals(1, asServiceConfig.getInstancesPerScaleUp());
        assertEquals(5, asServiceConfig.getMaxAppInstances());
        assertEquals(0, asServiceConfig.getMinAppInstances());
        assertEquals(60000, asServiceConfig.getMessageExpiryTime());
        assertEquals(400, asServiceConfig.getMaxRequestsPerSecond());
        assertEquals(0.65, asServiceConfig.getAlarmingUpperRate());
        assertEquals(10, asServiceConfig.getRoundsToAverage());
        assertEquals("worker", asServiceConfig.getSubDomain());

        asServiceConfig = lbConfig.getServiceConfig("wso2.as2.domain", "worker1");
        assertEquals("worker1", asServiceConfig.getSubDomain());

        asServiceConfig = lbConfig.getServiceConfig("wso2.esb.domain", "mgt");
        assertEquals("mgt", asServiceConfig.getSubDomain());

        assertEquals(2, lbConfig.getHostNamesTracker().keySet().size());
        assertEquals(3, lbConfig.getHostNamesTracker().get("appserver").size());
        assertEquals(2, lbConfig.getHostNamesTracker().get("esb").size());

View Full Code Here

Examples of org.apache.stratos.lb.common.conf.LoadBalancerConfiguration.ServiceConfiguration

        for (Iterator iterator = lbConfig.getServiceConfigurations().values().iterator(); iterator.hasNext();) {
            Map<String, ServiceConfiguration> valuesMap = (Map<String, ServiceConfiguration>) iterator.next();
           
            for (Iterator iterator2 = valuesMap.values().iterator(); iterator2.hasNext();) {
                ServiceConfiguration oldServiceConfig = (ServiceConfiguration) iterator2.next();
               
                if(!currentServiceConfigs.contains(oldServiceConfig)){
                    // if the ServiceConfiguration is not there any more in the latest topology
                    lbConfig.removeServiceConfiguration(oldServiceConfig.getDomain(), oldServiceConfig.getSubDomain());
                    GroupMgtAgentBuilder.resetGroupMgtAgent(oldServiceConfig.getDomain(), oldServiceConfig.getSubDomain());
                }
            }
        }
    }
View Full Code Here

Examples of org.apache.stratos.lb.common.conf.LoadBalancerConfiguration.ServiceConfiguration

      int roundsToAverage = cluster.getRoundsToAverage();
      double alarmingUpperRate = cluster.getAlarmingUpperRate();
      double alarmingLowerRate = cluster.getAlarmingLowerRate();
      double scaleDownFactor = cluster.getScaleDownFactor();
       
        ServiceConfiguration serviceConfig ;
       
        if((serviceConfig = lbConfig.getServiceConfig(domain, subDomain)) == null){
            serviceConfig = lbConfig.new ServiceConfiguration();
        }
       
        // we simply override the attributes with new values
        serviceConfig.setDomain(domain);
        serviceConfig.setSub_domain(subDomain);
        serviceConfig.setTenant_range(tenantRange);
        serviceConfig.setHosts(hostName);
        serviceConfig.setMin_app_instances(minInstances);
        serviceConfig.setMax_app_instances(maxInstances);
        serviceConfig.setMax_requests_per_second(maxRequestsPerSecond);
        serviceConfig.setRounds_to_average(roundsToAverage);
        serviceConfig.setAlarming_upper_rate(alarmingUpperRate);
        serviceConfig.setAlarming_lower_rate(alarmingLowerRate);
        serviceConfig.setScale_down_factor(scaleDownFactor);
       
        // add to host name tracker
        lbConfig.addToHostNameTrackerMap(service, serviceConfig.getHosts());
       
        // add to host contexts
        lbConfig.addToHostContextMap(hostName, ctxt);
       
        // finally add this service config
View Full Code Here

Examples of org.apache.stratos.lb.common.conf.LoadBalancerConfiguration.ServiceConfiguration

        Assert.assertEquals(true, map.get("wso2.as1.domain").get("worker") != null);
    }

    @Test
    public void testAddition(){
        ServiceConfiguration config1 = lbConfig.new ServiceConfiguration();
        config1.setDomain("wso2.as3.domain");
        config1.setSub_domain("mgt");
        lbConfig.addServiceConfiguration(config1);
        clusteringAgent.addGroupManagementAgent(new SubDomainAwareGroupManagementAgent(
                "mgt"),
                "wso2.as3.domain", "mgt", -1);
        map = AutoscaleUtil.getAppDomainContexts(configCtx, lbConfig);
View Full Code Here

Examples of org.apache.stratos.lb.common.conf.LoadBalancerConfiguration.ServiceConfiguration

        for (Iterator<?> iterator = lbConfig.getServiceConfigurations().values().iterator(); iterator.hasNext();) {
            @SuppressWarnings("unchecked")
            Map<String, ServiceConfiguration> valuesMap = (Map<String, ServiceConfiguration>) iterator.next();

            for (Iterator<ServiceConfiguration> iterator2 = valuesMap.values().iterator(); iterator2.hasNext();) {
                ServiceConfiguration oldServiceConfig = (ServiceConfiguration) iterator2.next();

                if (!currentServiceConfigs.contains(oldServiceConfig)) {
                    // if the ServiceConfiguration is not there any more in the latest topology
                    lbConfig.removeServiceConfiguration(oldServiceConfig.getDomain(), oldServiceConfig.getSubDomain());
                    GroupMgtAgentBuilder.resetGroupMgtAgent(oldServiceConfig.getDomain(), oldServiceConfig.getSubDomain());
                }
            }
        }
    }
View Full Code Here

Examples of org.drools.grid.timer.impl.ServiceConfiguration

                                  addresses.length );
            }

            newAddresses[addresses.length] = new InetSocketAddress( ip,
                                                                    port );
            ServiceConfiguration conf = new WhitePagesServiceConfiguration( newAddresses );
            service.setData( conf );
        } else {
            InetSocketAddress[] newAddress = new InetSocketAddress[ 1 ];
            newAddress[0] = new InetSocketAddress( ip,
                                                   port );
            address.setObject( newAddress );
            ServiceConfiguration conf = new WhitePagesServiceConfiguration( newAddress );
            service.setData( conf );
        }
    }
View Full Code Here

Examples of org.drools.grid.timer.impl.ServiceConfiguration

                                  addresses.length );
            }

            newAddresses[addresses.length] = new InetSocketAddress( ip,
                                                                    port );
            ServiceConfiguration conf = new WhitePagesServiceConfiguration( newAddresses );
            service.setData( conf );
        } else {
            InetSocketAddress[] newAddress = new InetSocketAddress[ 1 ];
            newAddress[0] = new InetSocketAddress( ip,
                                                   port );
            address.setObject( newAddress );
            ServiceConfiguration conf = new WhitePagesServiceConfiguration( newAddress );
            service.setData( conf );
        }
    }
View Full Code Here

Examples of org.ejbca.core.model.services.ServiceConfiguration

      HashMap h = (HashMap) decoder.readObject();
      decoder.close();
      // Handle Base64 encoded string values
      HashMap data = new Base64GetHashMap(h);
      float oldversion = ((Float) data.get(UpgradeableDataHashMap.VERSION)).floatValue();
      ServiceConfiguration serviceConfiguration = new ServiceConfiguration();
      serviceConfiguration.loadData(data);
      if ( ((serviceConfiguration != null) && (Float.compare(oldversion, serviceConfiguration.getVersion()) != 0))) {
        // Upgrade in version 4 of ServiceConfiguration. If we do not have nextRunTimeStamp and runTimeStamp set in
        // the database, but we have them in serviceConfiguration, we will simply copy the values over.
        // After this we will not use the values in ServiceConfiguration any more
        final String NEXTRUNTIMESTAMP = "NEXTRUNTIMESTAMP";
        final String OLDRUNTIMESTAMP = "OLDRUNTIMESTAMP";
View Full Code Here

Examples of org.ejbca.core.model.services.ServiceConfiguration

  /**
   * Method that populates a service configuration from a
   * GUI data.
   */
  public ServiceConfiguration getServiceConfiguration(ArrayList<String> errorMessages) throws IOException{
    ServiceConfiguration retval = new ServiceConfiguration();
    retval.setActive(isActive());
    retval.setHidden(isHidden());
    retval.setDescription(getDescription());
    retval.setActionClassPath(getActionType().getClassPath());
    retval.setActionProperties(getActionType().getProperties(errorMessages));
    retval.setIntervalClassPath(getIntervalType().getClassPath());
    retval.setIntervalProperties(getIntervalType().getProperties(errorMessages));
    retval.setWorkerClassPath(getWorkerType().getClassPath());
    retval.setWorkerProperties(getWorkerType().getProperties(errorMessages));
    retval.setPinToNodes(getPinToNodes());
    return retval;
  }
View Full Code Here

Examples of org.ejbca.core.model.services.ServiceConfiguration

    List<SortableSelectItem> availableServices = new ArrayList<SortableSelectItem>();
      Collection<Integer> availableServicesIds = ejb.getServiceSession().getAuthorizedVisibleServiceIds(getAdmin());
      Iterator<Integer> iter = availableServicesIds.iterator();
      while (iter.hasNext()) {
        Integer id = (Integer) iter.next();
        ServiceConfiguration serviceConfig =  ejb.getServiceSession().getServiceConfiguration(getAdmin(), id.intValue());
        String serviceName = ejb.getServiceSession().getServiceName(getAdmin(), id.intValue());
        String hidden = "";
        if (serviceConfig.isHidden()) {
          hidden = "<Hidden, Debug mode>";
        }
        if (serviceConfig.isActive()) {
          availableServices.add(new SortableSelectItem(serviceName, serviceName+ " (" + EjbcaJSFHelper.getBean().getText().get("ACTIVE") + ")" + hidden));
        } else {
          availableServices.add(new SortableSelectItem(serviceName, serviceName + " (" + EjbcaJSFHelper.getBean().getText().get("INACTIVE") + ")" + hidden));
        }
      }
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.