Package com.sun.enterprise.config.serverbeans

Examples of com.sun.enterprise.config.serverbeans.Domain


                throw new InstanceException(_strMgr.getString("clusterNotEmpty",
                    clusterName, ServerHelper.getServersAsString(servers)));
            }                                              
           
            //Remove the the cluster. This is the last thing we want to do.
            Domain domain = ConfigAPIHelper.getDomainConfigBean(configContext);
            Clusters clusters = domain.getClusters();                      
                         
            //If the cluster is stand-alone, we must remove its stand alone
            //configuration. Only non-referenced configurations can be deleted,
            //this is why the configuration is first deleted. Unfortunately, if
            //this fails, we leave an unreferenced standalone configuration.
View Full Code Here


            }
                          
            //Ensure that cluster specified by clusterName does not already exist.
            //Given that we've already checked for uniqueness earlier, this should never
            //be the case, but we'll be extra safe here.
            Domain domain = ConfigAPIHelper.getDomainConfigBean(configContext);           
            Clusters clusters = domain.getClusters();
            Cluster cluster = clusters.getClusterByName(clusterName);
            if (cluster != null) {
                throw new InstanceException(_strMgr.getString("clusterAlreadyExists",
                    clusterName));
            }
View Full Code Here

        return heartbeatAddressBfr.toString();
    }

    private boolean addrAlreadyAssigned ( final String heartbeatAddress ) throws ConfigException {
        boolean exists = false;
        final Domain domain = ConfigAPIHelper.getDomainConfigBean(getConfigContext());
        final Clusters clusters = domain.getClusters();
        String cHbAddress;
        for(Cluster c : clusters.getCluster()){
            cHbAddress = c.getHeartbeatAddress();
            if(cHbAddress != null && heartbeatAddress.equals( cHbAddress)){
                exists = true;
View Full Code Here

            configContext);           
       
        final Properties result = new Properties();
        if (target.getType() == TargetType.DOMAIN) {
            //list domain properties
            final Domain domain = ConfigAPIHelper.getDomainConfigBean(configContext);
            addProperties(result, domain.getSystemProperty());
        } else if (target.getType() == TargetType.CONFIG) {
            //list config properties
            if (inherit) {
                final Domain domain = ConfigAPIHelper.getDomainConfigBean(configContext);
                addProperties(result, domain.getSystemProperty());
            }
            final Config config = ConfigAPIHelper.getConfigByName(configContext,
                target.getName());
            addProperties(result, config.getSystemProperty());           
        } else if (target.getType() == TargetType.CLUSTER) {           
            //list cluster properties
            if (inherit) {
                final Domain domain = ConfigAPIHelper.getDomainConfigBean(configContext);         
                addProperties(result, domain.getSystemProperty());
                final Config config = ClusterHelper.getConfigForCluster(configContext,
                    target.getName());
                addProperties(result, config.getSystemProperty());
            }
            final Cluster cluster = ClusterHelper.getClusterByName(configContext,
                target.getName());
            addProperties(result, cluster.getSystemProperty());
        } else if (target.getType() == TargetType.SERVER ||
            target.getType() == TargetType.DAS) {           
            //list server properties
            final Server server = ServerHelper.getServerByName(configContext,
                target.getName());
            if (inherit) {
                final Domain domain = ConfigAPIHelper.getDomainConfigBean(configContext);           
                addProperties(result, domain.getSystemProperty());

                final Config config = ConfigAPIHelper.getConfigByName(configContext, server.getConfigRef());
                addProperties(result, config.getSystemProperty());
                if (ServerHelper.isServerClustered(configContext, target.getName()))  {
                    final Cluster cluster = ClusterHelper.getClusterForInstance(configContext,
View Full Code Here

            final ConfigContext configContext = getConfigContext();
            final Target target = TargetBuilder.INSTANCE.createTarget(VALID_TYPES, targetName,
                configContext);                          
            if (target.getType() == TargetType.DOMAIN) {
                //create domain property
                final Domain domain = ConfigAPIHelper.getDomainConfigBean(configContext);                  
                //Add the properties
                for (Enumeration e = props.propertyNames(); e.hasMoreElements();) {
                    final String name = (String)e.nextElement();
                    //If the property exists, remove it
                    final SystemProperty sysProp = domain.getSystemPropertyByName(name);
                    if (sysProp != null) {
                        domain.removeSystemProperty(sysProp, OVERWRITE);
                    }
                    domain.addSystemProperty(getSystemProperty(props, name),
                        OVERWRITE);
                }     
            } else if (target.getType() == TargetType.CONFIG) {
                final Config config = ConfigAPIHelper.getConfigByName(configContext, 
                    target.getName());                  
View Full Code Here

            final ConfigContext configContext = getConfigContext();
            final Target target = TargetBuilder.INSTANCE.createTarget(VALID_TYPES, targetName,
                configContext);                          
            if (target.getType().equals(TargetType.DOMAIN)) {
                //create domain property
                final Domain domain = ConfigAPIHelper.getDomainConfigBean(configContext);
                final SystemProperty sysProp = domain.getSystemPropertyByName(propertyName);
                //Ensure that the property specified exists
                if (sysProp == null) {
                    throw new ConfigException(_strMgr.getString("propertyDoesNotExist",
                        propertyName, target.getName()));
                }
                //Remove the property
                domain.removeSystemProperty(sysProp, OVERWRITE);
            } else if (target.getType().equals(TargetType.CONFIG)){
                //create configuration property           
                final Config config = ConfigAPIHelper.getConfigByName(configContext, 
                    target.getName());  
                final SystemProperty sysProp = config.getSystemPropertyByName(propertyName);
View Full Code Here

     * Return all the clusters in the domain or a zero length list.
     */
    public static Cluster[] getClustersInDomain(ConfigContext configContext)
        throws ConfigException
    {
        final Domain domain = getDomainConfigBean(configContext)
        final Clusters clusters = domain.getClusters();
        if (clusters != null) {
            if (clusters.getCluster() != null) {
                return clusters.getCluster();
            }
        }           
View Full Code Here

     * Return true if the given clusterName corresponds to the name of a cluster.
     */
    public static boolean isACluster(ConfigContext configContext, String clusterName)
        throws ConfigException
    {       
        final Domain domain = getDomainConfigBean(configContext);       
        final Clusters clusters = domain.getClusters();
        if (clusters == null) {
            return false;
        }
        final Cluster cluster = clusters.getClusterByName(clusterName);
        return (cluster != null ? true : false);
View Full Code Here

     * be thrown.
     */
    public static Cluster getClusterByName(ConfigContext configContext, String clusterName)
        throws ConfigException
    {
        final Domain domain = getDomainConfigBean(configContext);         
        final Cluster cluster = domain.getClusters().getClusterByName(clusterName);
        if (cluster == null) {
            throw new ConfigException(_strMgr.getString("noSuchCluster",
                clusterName));
        }
        return cluster;
View Full Code Here

     */
    public static Config getConfigForCluster(ConfigContext configContext, String clusterName)
        throws ConfigException
    {
        final Cluster cluster = getClusterByName(configContext, clusterName);               
        final Domain domain = getDomainConfigBean(configContext);                 
        final Config config = domain.getConfigs().getConfigByName(cluster.getConfigRef());
        if (config == null) {
            throw new ConfigException(_strMgr.getString("noSuchClusterConfig",
                cluster.getConfigRef(), clusterName));
        }
        return config;
View Full Code Here

TOP

Related Classes of com.sun.enterprise.config.serverbeans.Domain

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.