Package com.citrix.netscaler.nitro.resource.config.gslb

Examples of com.citrix.netscaler.nitro.resource.config.gslb.gslbvserver


        // create a 'gslbvserver' object representing a globally load balanced service
        private static void createVirtualServer(nitro_service client, String vserverName, String lbMethod,
                                         String persistenceType, long persistenceId, String serviceType)
                    throws ExecutionException {
            try {
                gslbvserver vserver;
                vserver = getVserverObject(client, vserverName);

                boolean isUpdateSite = false;
                if (vserver == null) {
                    vserver = new gslbvserver();
                } else {
                    isUpdateSite = true;
                }

                vserver.set_name(vserverName);
                if ("RoundRobin".equalsIgnoreCase(lbMethod)) {
                    vserver.set_lbmethod("ROUNDROBIN");
                } else if ("LeastConn".equalsIgnoreCase(lbMethod)) {
                    vserver.set_lbmethod("LEASTCONNECTION");
                } else if ("Proximity".equalsIgnoreCase(lbMethod)) {
                    vserver.set_lbmethod("RTT");
                } else {
                    throw new ExecutionException("Unsupported LB method");
                }
                vserver.set_persistencetype(persistenceType);
                if ("SOURCEIP".equalsIgnoreCase(persistenceType)) {
                    vserver.set_persistenceid(persistenceId);
                }
                vserver.set_servicetype(serviceType);
                vserver.set_state("ENABLED");
                vserver.set_cookietimeout(null);
                vserver.set_domainname(null);
                if (isUpdateSite) {
                    // both netmask and LB method can not be specified while update so set to null
                    vserver.set_netmask(null);
                    vserver.set_v6netmasklen(null);
                    gslbvserver.update(client, vserver);
                } else {
                    gslbvserver.add(client, vserver);
                }
View Full Code Here


        }

        // delete 'gslbvserver' object representing a globally load balanced service
        private static void deleteVirtualServer(nitro_service client, String vserverName) throws  ExecutionException {
            try {
                gslbvserver vserver = getVserverObject(client, vserverName);
                if (vserver != null) {
                    gslbvserver.delete(client, vserver);
                    if (s_logger.isDebugEnabled()) {
                        s_logger.debug("Successfully deleted GSLB virtual server: " + vserverName);
                    }
View Full Code Here

        }

        // enable 'gslbvserver' object representing a globally load balanced service
        private static void enableVirtualServer(nitro_service client, String vserverName) throws ExecutionException {
            try {
                gslbvserver vserver = getVserverObject(client, vserverName);
                if (vserver != null) {
                    gslbvserver.enable(client, vserver);
                }
            } catch (Exception e) {
                String errMsg = "Failed to enable GSLB virtual server: " + vserverName + " due to " + e.getMessage();
View Full Code Here

        }

        // disable 'gslbvserver' object representing a globally load balanced service
        private static void disableVirtualServer(nitro_service client, String vserverName) throws ExecutionException{
            try {
                gslbvserver vserver = getVserverObject(client, vserverName);
                if (vserver != null) {
                    gslbvserver.disable(client, vserver);
                }
            } catch (Exception e) {
                String errMsg =  "Failed to disable GSLB virtual server: " + vserverName + " due to " + e.getMessage();
View Full Code Here

        // update 'gslbvserver' object representing a globally load balanced service
        private static void updateVirtualServer(nitro_service client, String vserverName, String lbMethod,
                                                String persistenceType, String serviceType) throws ExecutionException {
            try {
                gslbvserver vServer = getVserverObject(client, vserverName);
                if (vServer != null) {
                    vServer.set_lbmethod(lbMethod);
                    vServer.set_persistencetype(persistenceType);
                    vServer.set_servicetype(serviceType);
                    gslbvserver.update(client, vServer);
                    if (s_logger.isDebugEnabled()) {
                        s_logger.debug("Successfully updated GSLB virtual server: " + vserverName);
                    }
                }
View Full Code Here

            return null;
        }

        private static gslbvserver getVserverObject(nitro_service client, String vserverName) {
            try {
                gslbvserver vserver = gslbvserver.get(client, vserverName);
                return vserver;
            } catch (Exception e) {
                return null;
            }
        }
View Full Code Here

        // create a 'gslbvserver' object representing a globally load balanced service
        private static void createVirtualServer(nitro_service client, String vserverName, String lbMethod,
                                         String persistenceType, long persistenceId, String serviceType)
                    throws ExecutionException {
            try {
                gslbvserver vserver;
                vserver = getVserverObject(client, vserverName);

                boolean isUpdateSite = false;
                if (vserver == null) {
                    vserver = new gslbvserver();
                } else {
                    isUpdateSite = true;
                }

                vserver.set_name(vserverName);
                if ("RoundRobin".equalsIgnoreCase(lbMethod)) {
                    vserver.set_lbmethod("ROUNDROBIN");
                } else if ("LeastConn".equalsIgnoreCase(lbMethod)) {
                    vserver.set_lbmethod("LEASTCONNECTION");
                } else if ("Proximity".equalsIgnoreCase(lbMethod)) {
                    vserver.set_lbmethod("RTT");
                } else {
                    throw new ExecutionException("Unsupported LB method");
                }
                vserver.set_persistencetype(persistenceType);
                if ("SOURCEIP".equalsIgnoreCase(persistenceType)) {
                    vserver.set_persistenceid(persistenceId);
                }
                vserver.set_servicetype(serviceType);
                vserver.set_state("ENABLED");
                vserver.set_cookietimeout(null);
                vserver.set_domainname(null);
                if (isUpdateSite) {
                    // both netmask and LB method can not be specified while update so set to null
                    vserver.set_netmask(null);
                    vserver.set_v6netmasklen(null);
                    gslbvserver.update(client, vserver);
                } else {
                    gslbvserver.add(client, vserver);
                }
View Full Code Here

        }

        // delete 'gslbvserver' object representing a globally load balanced service
        private static void deleteVirtualServer(nitro_service client, String vserverName) throws  ExecutionException {
            try {
                gslbvserver vserver = getVserverObject(client, vserverName);
                if (vserver != null) {
                    gslbvserver.delete(client, vserver);
                    if (s_logger.isDebugEnabled()) {
                        s_logger.debug("Successfully deleted GSLB virtual server: " + vserverName);
                    }
View Full Code Here

        }

        // enable 'gslbvserver' object representing a globally load balanced service
        private static void enableVirtualServer(nitro_service client, String vserverName) throws ExecutionException {
            try {
                gslbvserver vserver = getVserverObject(client, vserverName);
                if (vserver != null) {
                    gslbvserver.enable(client, vserver);
                }
            } catch (Exception e) {
                String errMsg = "Failed to enable GSLB virtual server: " + vserverName + " due to " + e.getMessage();
View Full Code Here

        }

        // disable 'gslbvserver' object representing a globally load balanced service
        private static void disableVirtualServer(nitro_service client, String vserverName) throws ExecutionException{
            try {
                gslbvserver vserver = getVserverObject(client, vserverName);
                if (vserver != null) {
                    gslbvserver.disable(client, vserver);
                }
            } catch (Exception e) {
                String errMsg =  "Failed to disable GSLB virtual server: " + vserverName + " due to " + e.getMessage();
View Full Code Here

TOP

Related Classes of com.citrix.netscaler.nitro.resource.config.gslb.gslbvserver

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.