@@ -138,69 +138,59 @@ public Answer executeRequest(final Command cmd) {
138138 return new Answer (cmd , false , rc .getDetails ());
139139 }
140140
141- Answer answer ;
142141 if (cmd instanceof SetPortForwardingRulesVpcCommand ) {
143- answer = execute ((SetPortForwardingRulesVpcCommand )cmd );
142+ return execute ((SetPortForwardingRulesVpcCommand )cmd );
144143 } else if (cmd instanceof SetPortForwardingRulesCommand ) {
145- answer = execute ((SetPortForwardingRulesCommand )cmd );
144+ return execute ((SetPortForwardingRulesCommand )cmd );
146145 } else if (cmd instanceof SetStaticRouteCommand ) {
147- answer = execute ((SetStaticRouteCommand )cmd );
146+ return execute ((SetStaticRouteCommand )cmd );
148147 } else if (cmd instanceof SetStaticNatRulesCommand ) {
149- answer = execute ((SetStaticNatRulesCommand )cmd );
148+ return execute ((SetStaticNatRulesCommand )cmd );
150149 } else if (cmd instanceof LoadBalancerConfigCommand ) {
151- answer = execute ((LoadBalancerConfigCommand )cmd );
150+ return execute ((LoadBalancerConfigCommand )cmd );
152151 } else if (cmd instanceof SavePasswordCommand ) {
153- answer = execute ((SavePasswordCommand )cmd );
152+ return execute ((SavePasswordCommand )cmd );
154153 } else if (cmd instanceof DhcpEntryCommand ) {
155- answer = execute ((DhcpEntryCommand )cmd );
154+ return execute ((DhcpEntryCommand )cmd );
156155 } else if (cmd instanceof CreateIpAliasCommand ) {
157- answer = execute ((CreateIpAliasCommand )cmd );
156+ return execute ((CreateIpAliasCommand )cmd );
158157 } else if (cmd instanceof DnsMasqConfigCommand ) {
159- answer = execute ((DnsMasqConfigCommand )cmd );
158+ return execute ((DnsMasqConfigCommand )cmd );
160159 } else if (cmd instanceof DeleteIpAliasCommand ) {
161- answer = execute ((DeleteIpAliasCommand )cmd );
160+ return execute ((DeleteIpAliasCommand )cmd );
162161 } else if (cmd instanceof VmDataCommand ) {
163- answer = execute ((VmDataCommand )cmd );
162+ return execute ((VmDataCommand )cmd );
164163 } else if (cmd instanceof CheckRouterCommand ) {
165- answer = execute ((CheckRouterCommand )cmd );
164+ return execute ((CheckRouterCommand )cmd );
166165 } else if (cmd instanceof SetFirewallRulesCommand ) {
167- answer = execute ((SetFirewallRulesCommand )cmd );
166+ return execute ((SetFirewallRulesCommand )cmd );
168167 } else if (cmd instanceof BumpUpPriorityCommand ) {
169- answer = execute ((BumpUpPriorityCommand )cmd );
168+ return execute ((BumpUpPriorityCommand )cmd );
170169 } else if (cmd instanceof RemoteAccessVpnCfgCommand ) {
171- answer = execute ((RemoteAccessVpnCfgCommand )cmd );
170+ return execute ((RemoteAccessVpnCfgCommand )cmd );
172171 } else if (cmd instanceof VpnUsersCfgCommand ) {
173- answer = execute ((VpnUsersCfgCommand )cmd );
172+ return execute ((VpnUsersCfgCommand )cmd );
174173 } else if (cmd instanceof GetDomRVersionCmd ) {
175- answer = execute ((GetDomRVersionCmd )cmd );
174+ return execute ((GetDomRVersionCmd )cmd );
176175 } else if (cmd instanceof Site2SiteVpnCfgCommand ) {
177- answer = execute ((Site2SiteVpnCfgCommand )cmd );
176+ return execute ((Site2SiteVpnCfgCommand )cmd );
178177 } else if (cmd instanceof CheckS2SVpnConnectionsCommand ) {
179- answer = execute ((CheckS2SVpnConnectionsCommand )cmd );
178+ return execute ((CheckS2SVpnConnectionsCommand )cmd );
180179 } else if (cmd instanceof SetMonitorServiceCommand ) {
181- answer = execute ((SetMonitorServiceCommand )cmd );
180+ return execute ((SetMonitorServiceCommand )cmd );
182181 } else if (cmd instanceof SetupGuestNetworkCommand ) {
183- answer = execute ((SetupGuestNetworkCommand )cmd );
182+ return execute ((SetupGuestNetworkCommand )cmd );
184183 } else if (cmd instanceof SetNetworkACLCommand ) {
185- answer = execute ((SetNetworkACLCommand )cmd );
184+ return execute ((SetNetworkACLCommand )cmd );
186185 } else if (cmd instanceof SetSourceNatCommand ) {
187- answer = execute ((SetSourceNatCommand )cmd );
186+ return execute ((SetSourceNatCommand )cmd );
188187 } else if (cmd instanceof IpAssocVpcCommand ) {
189- answer = execute ((IpAssocVpcCommand )cmd );
188+ return execute ((IpAssocVpcCommand )cmd );
190189 } else if (cmd instanceof IpAssocCommand ) {
191- answer = execute ((IpAssocCommand )cmd );
190+ return execute ((IpAssocCommand )cmd );
192191 } else {
193- answer = Answer .createUnsupportedCommandAnswer (cmd );
192+ return Answer .createUnsupportedCommandAnswer (cmd );
194193 }
195-
196- rc = _vrDeployer .cleanupCommand ((NetworkElementCommand )cmd );
197- if (!rc .isSuccess ()) {
198- s_logger .error ("Failed to clean up VR command due to " + rc .getDetails ());
199- // TODO fail it more properly in the future, some commands may need specific answer rather than generic answer
200- answer = new Answer (cmd , false , rc .getDetails ());
201- }
202-
203- return answer ;
204194 } catch (final IllegalArgumentException e ) {
205195 return new Answer (cmd , false , e .getMessage ());
206196 } finally {
0 commit comments