From 44e3e5ebe0d0a55c0e7d103515e2397ca7bd0366 Mon Sep 17 00:00:00 2001 From: Murali Reddy Date: Fri, 8 Feb 2013 17:25:01 +0530 Subject: [PATCH] add some more stub's --- .../GlobalLoadBalancerConfigAnswer.java | 26 +++++ .../GlobalLoadBalancerConfigCommand.java | 25 +++++ .../network/resource/NetscalerResource.java | 98 +++++++++++++++++++ 3 files changed, 149 insertions(+) create mode 100644 api/src/com/cloud/agent/api/routing/GlobalLoadBalancerConfigAnswer.java create mode 100644 api/src/com/cloud/agent/api/routing/GlobalLoadBalancerConfigCommand.java diff --git a/api/src/com/cloud/agent/api/routing/GlobalLoadBalancerConfigAnswer.java b/api/src/com/cloud/agent/api/routing/GlobalLoadBalancerConfigAnswer.java new file mode 100644 index 00000000000..dbf57aa656b --- /dev/null +++ b/api/src/com/cloud/agent/api/routing/GlobalLoadBalancerConfigAnswer.java @@ -0,0 +1,26 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. +package com.cloud.agent.api.routing; + +import com.cloud.agent.api.Answer; + +public class GlobalLoadBalancerConfigAnswer extends Answer{ + + protected GlobalLoadBalancerConfigAnswer() { + super(); + } +} diff --git a/api/src/com/cloud/agent/api/routing/GlobalLoadBalancerConfigCommand.java b/api/src/com/cloud/agent/api/routing/GlobalLoadBalancerConfigCommand.java new file mode 100644 index 00000000000..ac18d2c6979 --- /dev/null +++ b/api/src/com/cloud/agent/api/routing/GlobalLoadBalancerConfigCommand.java @@ -0,0 +1,25 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + +package com.cloud.agent.api.routing; + +/** + * GlobalLoadBalancerConfigCommand used for sending the GSLB configuration to GSLB service provider + */ +public class GlobalLoadBalancerConfigCommand extends NetworkElementCommand { + +} diff --git a/plugins/network-elements/netscaler/src/com/cloud/network/resource/NetscalerResource.java b/plugins/network-elements/netscaler/src/com/cloud/network/resource/NetscalerResource.java index abea4649dbe..ae79d9e4994 100644 --- a/plugins/network-elements/netscaler/src/com/cloud/network/resource/NetscalerResource.java +++ b/plugins/network-elements/netscaler/src/com/cloud/network/resource/NetscalerResource.java @@ -14,6 +14,7 @@ // KIND, either express or implied. See the License for the // specific language governing permissions and limitations // under the License. + package com.cloud.network.resource; import java.util.Formatter; @@ -396,6 +397,8 @@ public class NetscalerResource implements ServerResource { return execute((DestroyLoadBalancerApplianceCommand) cmd, numRetries); } else if (cmd instanceof SetStaticNatRulesCommand) { return execute((SetStaticNatRulesCommand) cmd, numRetries); + } else if (cmd instanceof GlobalLoadBalancerConfigCommand) { + return execute((GlobalLoadBalancerConfigCommand) cmd, numRetries); } else { return Answer.createUnsupportedCommandAnswer(cmd); } @@ -787,6 +790,101 @@ public class NetscalerResource implements ServerResource { } } + private void execute(GlobalLoadBalancerConfigCommand cmd, numRetries) { + /* + * 1. domain name for which NetScale will act as authoritative DNS server + * 2. DNS record type + * 3. service type, virtual server name + * 4. Configure GSLB method + * 5. Configure Persistence + * 6. + */ + return new GlobalLoadBalancerConfigAnswer(); + } + + /* + * convineance class for GSLB functionality that includes methods to + * - create, delete, update, get the GSLB sites + * - create, delete, update, get the GSLB services + * - create, delete, update, get the GSLB virtual servers + * - create, delete GSLB virtual server and GSLB service bindings + */ + private static class GSLB { + + private void createSite() { + + } + + private void deleteSite() { + + } + + private gslbsite getSite() { + + } + + private boolean checkSiteExists() { + return true; + } + + private void createService() { + + } + + private void deleteService() { + + } + + private void getService() { + + } + + private boolean checkServiceExists() { + return true; + } + + private void createVirtualServer() { + + } + + private void deleteVirtualServer() { + + } + + private void enableVirtualServer() { + + } + + private void disableVirtualServer() { + + } + + private void createVserverServiceBinding() { + + } + + private void deleteVserverServiceBinding() { + + } + + private void updateVserverServiceBinding() { + + } + + private void createVserverDomainBinding() { + + } + + private void deleteVserverDomainBinding() { + + } + + private void updateVserverDomainBinding() { + + } + } + + private void enableVPXInterfaces(String publicIf, String privateIf, ns ns_obj) { // enable VPX to use 10 gigabit Ethernet interfaces if public/private interface // on SDX is a 10Gig interface