[GitHub] cloudstack pull request: README: happy holidays!

2015-12-23 Thread jburwell
Github user jburwell commented on the pull request:

https://github.com/apache/cloudstack/pull/1281#issuecomment-166934017
  
+1 LGTM


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] cloudstack pull request: CLOUDSTACK-9099: SecretKey is returned fr...

2016-01-03 Thread jburwell
Github user jburwell commented on the pull request:

https://github.com/apache/cloudstack/pull/1152#issuecomment-168570237
  
@DaanHoogland I complete agree with you regarding exposing credential 
information.  The best practice when credentials are lost is to require that 
they be changed.  This approach makes the access to the sensitive information 
obvious to all users -- making it impossible for an attacker to hide such a 
breach.

In the past, we have removed sensitive data from existing API responses.  
For example, for CVE-2015-3251, we removed exposure of KVM credentials from the 
[listHosts call](https://github.com/apache/cloudstack/pull/682).  Therefore, as 
a project, we have previously determined that security should trump API 
backwards compatibility.  It should most certainly be prioritized over making 
the task of integration testing easier.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] cloudstack pull request: CLOUDSTACK-9054 use of google-optional as...

2016-01-16 Thread jburwell
Github user jburwell commented on the pull request:

https://github.com/apache/cloudstack/pull/1060#issuecomment-172203787
  
@DaanHoogland I lost track of the mailing list thread until this PR.  In 
summary, I am -1 on the use Optional based on past experiences.  Please see my 
[response](http://markmail.org/message/t36u3gkvvh4l6o56) on the dev@ for a more 
detailed explanation.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] cloudstack pull request: [4.9+] WIP: Support Java 8, Maven 3.3, Up...

2016-01-27 Thread jburwell
Github user jburwell commented on the pull request:

https://github.com/apache/cloudstack/pull/1370#issuecomment-175490258
  
To ease transition, it seems like the first step should be to support 
running ACS built to 1.7 on a 1.8 runtime.  This approach would allow customers 
unprepared to transition to continue using Java7.  We would then notify users 
that Java7 support has been deprecated and will be removed in two releases (two 
months).


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] cloudstack pull request: [4.9+] WIP: Support Java 8, Maven 3.3, Up...

2016-01-27 Thread jburwell
Github user jburwell commented on the pull request:

https://github.com/apache/cloudstack/pull/1370#issuecomment-175523813
  
@bhaisaab if we make the packaging require Java 1.8, then users will be 
automatically upgraded -- defeating the purpose of the deprecation.  It seems 
like an appropriate first step is to audit all dependencies for Java8 support, 
and upgrade all affected dependencies.  For example, we need to upgrade to 
Spring 4 because (Spring 3 does not support Java 
8)[http://spring.io/blog/2013/05/21/spring-framework-4-0-m1-3-2-3-available/].  
In my opinion, we should perform the dependency upgrades as part of 4.9.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] cloudstack pull request: CLOUDSTACK-8566: Filter sensitive details...

2015-06-26 Thread jburwell
Github user jburwell commented on a diff in the pull request:

https://github.com/apache/cloudstack/pull/536#discussion_r33399534
  
--- Diff: 
api/src/org/apache/cloudstack/api/command/admin/host/ListHostsCmd.java ---
@@ -203,9 +201,22 @@ public void execute() {
 hostResponse.setObjectName("host");
 hostResponses.add(hostResponse);
 }
-
 response.setResponses(hostResponses, result.second());
 }
+// Remove sensitive details from host response
+List hostResponsesList = response.getResponses();
+for (HostResponse hostResponse: hostResponsesList) {
+Map hostDetails = hostResponse.getDetails();
+if (hostDetails == null) continue;
+if (hostDetails.containsKey("username")) {
+hostDetails.remove("username");
+}
+if (hostDetails.containsKey("password")) {
+hostDetails.remove("password");
+}
+hostResponse.setDetails(hostDetails);
--- End diff --

Why not perform this filtering on a defensive copy of the map in 
HostResponse.setDetails()?  I am also concerned about directly manipulating the 
details map in this method as it changes the view for any other objects holding 
references to it.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] cloudstack pull request: findbugs equals(obj) implementations go a...

2015-06-26 Thread jburwell
Github user jburwell commented on a diff in the pull request:

https://github.com/apache/cloudstack/pull/535#discussion_r33406307
  
--- Diff: 
framework/config/src/org/apache/cloudstack/framework/config/ConfigKey.java ---
@@ -122,6 +122,13 @@ public boolean equals(Object obj) {
 if (obj instanceof ConfigKey) {
 ConfigKey that = (ConfigKey)obj;
 return this._name.equals(that._name);
+}
+return false;
+}
+
+public boolean isSameKeyAs(Object obj) {
+if(this.equals(obj)) {
+return true;
 } else if (obj instanceof String) {
--- End diff --

``this.getClass().equals(obj.getClass())`` is preferred over ``instanceof`` 
because ``instanceof`` only verifies that the two objects are the compatible 
types, not that the classes themselves are loaded from a common class loader.  
If two objects have the same type but their underlying classes are loaded from 
different class loaders, casting the objects will fail.  Given that web 
containers play games with class loaders and often load the same jar multiple 
times, unexpected behavior and runtime exceptions (e.g. apparent duplicate Map 
entries, ClassCastExceptions, etc) occurs.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] cloudstack pull request: CLOUDSTACK-8566: Filter sensitive details...

2015-06-30 Thread jburwell
Github user jburwell commented on a diff in the pull request:

https://github.com/apache/cloudstack/pull/536#discussion_r33625103
  
--- Diff: 
api/src/org/apache/cloudstack/api/command/admin/host/ListHostsCmd.java ---
@@ -203,9 +201,22 @@ public void execute() {
 hostResponse.setObjectName("host");
 hostResponses.add(hostResponse);
 }
-
 response.setResponses(hostResponses, result.second());
 }
+// Remove sensitive details from host response
+List hostResponsesList = response.getResponses();
+for (HostResponse hostResponse: hostResponsesList) {
+Map hostDetails = hostResponse.getDetails();
+if (hostDetails == null) continue;
+if (hostDetails.containsKey("username")) {
+hostDetails.remove("username");
+}
+if (hostDetails.containsKey("password")) {
+hostDetails.remove("password");
+}
+hostResponse.setDetails(hostDetails);
--- End diff --

@bhaisaab I incorrectly assumed the HostResponse was only be used to create 
the ListHostCmd result to the client.  Based on the scope described, the 
location of this filtering is the narrowest scope possible.  We should avoid 
assumptions about how the ``HostDetails`` object is being consumed across 
threads, and make a defensive copy of it before modifying it.  Also, the code 
can be simplified by to remove the ``containsKey`` if blocks.



---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] cloudstack pull request: findbugs equals(obj) implementations go a...

2015-06-30 Thread jburwell
Github user jburwell commented on a diff in the pull request:

https://github.com/apache/cloudstack/pull/535#discussion_r33650706
  
--- Diff: 
framework/config/src/org/apache/cloudstack/framework/config/ConfigKey.java ---
@@ -122,6 +122,13 @@ public boolean equals(Object obj) {
 if (obj instanceof ConfigKey) {
 ConfigKey that = (ConfigKey)obj;
 return this._name.equals(that._name);
+}
+return false;
+}
+
+public boolean isSameKeyAs(Object obj) {
+if(this.equals(obj)) {
+return true;
 } else if (obj instanceof String) {
--- End diff --

@DaanHoogland we shouldn't make assumptions about the loading behavior of a 
class.  We should write our equals implementations defensively.  Another issue 
with instanceof is that it returns true for compatible subclasses which is also 
incorrect from an equals perspective.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] cloudstack pull request: findbugs equals(obj) implementations go a...

2015-06-30 Thread jburwell
Github user jburwell commented on the pull request:

https://github.com/apache/cloudstack/pull/535#issuecomment-117444526
  
@wilderrodrigues Guava provides 
[EqualsTester](http://guava-libraries.googlecode.com/svn-history/r144/trunk/javadoc/com/google/common/testing/EqualsTester.html)
 to verify that an ``equals(thatObject)`` is correct.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] cloudstack pull request: Quota

2015-10-12 Thread jburwell
Github user jburwell commented on a diff in the pull request:

https://github.com/apache/cloudstack/pull/768#discussion_r41748496
  
--- Diff: 
framework/quota/src/org/apache/cloudstack/quota/dao/QuotaTariffDaoImpl.java ---
@@ -0,0 +1,137 @@
+//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 org.apache.cloudstack.quota.dao;
+
+import com.cloud.utils.db.Filter;
+import com.cloud.utils.db.GenericDaoBase;
+import com.cloud.utils.db.SearchBuilder;
+import com.cloud.utils.db.SearchCriteria;
+import com.cloud.utils.db.TransactionLegacy;
+
+import com.cloud.utils.exception.CloudRuntimeException;
+import org.apache.cloudstack.quota.constant.QuotaTypes;
+import org.apache.cloudstack.quota.vo.QuotaTariffVO;
+import org.apache.log4j.Logger;
+import org.springframework.stereotype.Component;
+
+import javax.ejb.Local;
+
+import java.util.ArrayList;
+import java.util.Date;
+import java.util.List;
+
+@Component
+@Local(value = { QuotaTariffDao.class })
+public class QuotaTariffDaoImpl extends GenericDaoBase implements QuotaTariffDao {
+private static final Logger s_logger = 
Logger.getLogger(QuotaTariffDaoImpl.class.getName());
+
+private final SearchBuilder searchUsageType;
+private final SearchBuilder listAllIncludedUsageType;
+
+public QuotaTariffDaoImpl() {
+super();
+searchUsageType = createSearchBuilder();
+searchUsageType.and("usage_type", 
searchUsageType.entity().getUsageType(), SearchCriteria.Op.EQ);
+searchUsageType.done();
+
+listAllIncludedUsageType = createSearchBuilder();
+listAllIncludedUsageType.and("onorbefore", 
listAllIncludedUsageType.entity().getEffectiveOn(), SearchCriteria.Op.LTEQ);
+listAllIncludedUsageType.and("quotatype", 
listAllIncludedUsageType.entity().getUsageType(), SearchCriteria.Op.EQ);
+listAllIncludedUsageType.done();
+}
+
+@Override
+public QuotaTariffVO findTariffPlanByUsageType(final int quotaType, 
final Date effectiveDate) {
+final short opendb = 
TransactionLegacy.currentTxn().getDatabaseId();
+List result = new ArrayList<>();
+try (TransactionLegacy txn = 
TransactionLegacy.open(TransactionLegacy.USAGE_DB)) {
+final Filter filter = new Filter(QuotaTariffVO.class, 
"effectiveOn", false, 0L, 1L);
+final SearchCriteria sc = 
listAllIncludedUsageType.create();
+sc.setParameters("onorbefore", effectiveDate);
+sc.setParameters("quotatype", quotaType);
+result = search(sc, filter);
+} catch (Exception e) {
+throw new CloudRuntimeException("Unable to find tariff plan by 
usage type");
+} finally {
+TransactionLegacy.open(opendb).close();
+}
+if (result.size() > 0) {
+if (s_logger.isDebugEnabled()){
+
s_logger.debug("QuotaTariffDaoImpl::findTariffPlanByUsageType: " + 
effectiveDate + "quota type " + quotaType  + " val=" + 
result.get(0).getCurrencyValue());
+}
+return result.get(0);
+} else {
+if (s_logger.isDebugEnabled()){
+
s_logger.info("QuotaTariffDaoImpl::findTariffPlanByUsageType: Missing quota 
type " + quotaType);
+}
+return null;
+}
+}
+
+@Override
+public List listAllTariffPlans(final Date 
effectiveDate) {
+final short opendb = 
TransactionLegacy.currentTxn().getDatabaseId();
+List tariffs = new ArrayList();
+try (TransactionLegacy txn = 
TransactionLegacy.open(TransactionLegacy.USAGE_DB)) {
+final Filter filter = new Filter(QuotaTariffVO.class, 
"effectiveOn", false, 0L, 1L);
+final SearchCrit

[GitHub] cloudstack pull request: Quota

2015-10-12 Thread jburwell
Github user jburwell commented on a diff in the pull request:

https://github.com/apache/cloudstack/pull/768#discussion_r41748725
  
--- Diff: 
plugins/database/quota/src/org/apache/cloudstack/api/response/QuotaBalanceResponse.java
 ---
@@ -0,0 +1,153 @@
+//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 org.apache.cloudstack.api.response;
+
+import java.math.BigDecimal;
+import java.math.RoundingMode;
+import java.util.ArrayList;
+import java.util.Date;
+import java.util.List;
+
+import com.google.gson.annotations.SerializedName;
+
+import org.apache.cloudstack.api.BaseResponse;
+import org.apache.cloudstack.quota.vo.QuotaBalanceVO;
+
+import com.cloud.serializer.Param;
+
+public class QuotaBalanceResponse extends BaseResponse {
+
+@SerializedName("accountid")
+@Param(description = "account id")
+private Long accountId;
+
+@SerializedName("account")
+@Param(description = "account name")
+private String accountName;
+
+@SerializedName("domain")
+@Param(description = "domain id")
+private Long domainId;
+
+@SerializedName("startquota")
+@Param(description = "quota started with")
+private BigDecimal startQuota;
+
+@SerializedName("endquota")
+@Param(description = "quota by end of this period")
+private BigDecimal endQuota;
+
+@SerializedName("credits")
+@Param(description = "list of credits made during this period")
+private List credits = null;
+
+@SerializedName("startdate")
+@Param(description = "start date")
+private Date startDate = null;
+
+@SerializedName("enddate")
+@Param(description = "end date")
+private Date endDate = null;
+
+@SerializedName("currency")
+@Param(description = "currency")
+private String currency;
+
+public QuotaBalanceResponse() {
+super();
+credits = new ArrayList();
+}
+
+public Long getAccountId() {
+return accountId;
+}
+
+public void setAccountId(Long accountId) {
+this.accountId = accountId;
+}
+
+public String getAccountName() {
+return accountName;
+}
+
+public void setAccountName(String accountName) {
+this.accountName = accountName;
+}
+
+public Long getDomainId() {
+return domainId;
+}
+
+public void setDomainId(Long domainId) {
+this.domainId = domainId;
+}
+
+public BigDecimal getStartQuota() {
+return startQuota;
+}
+
+public void setStartQuota(BigDecimal startQuota) {
+this.startQuota = startQuota.setScale(2, RoundingMode.HALF_EVEN);
+}
+
+public BigDecimal getEndQuota() {
+return endQuota;
+}
+
+public void setEndQuota(BigDecimal endQuota) {
+this.endQuota = endQuota.setScale(2, RoundingMode.HALF_EVEN);
--- End diff --

@bhaisaab you are correct -- no side effect to the caller.  Odd naming, but 
definitely immutable per 
(JavaDocs)[http://docs.oracle.com/javase/7/docs/api/java/math/BigDecimal.html#setScale(int)].


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] cloudstack pull request: Quota

2015-10-12 Thread jburwell
Github user jburwell commented on a diff in the pull request:

https://github.com/apache/cloudstack/pull/768#discussion_r41748859
  
--- Diff: 
plugins/database/quota/src/org/apache/cloudstack/api/response/QuotaBalanceResponse.java
 ---
@@ -0,0 +1,153 @@
+//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 org.apache.cloudstack.api.response;
+
+import java.math.BigDecimal;
+import java.math.RoundingMode;
+import java.util.ArrayList;
+import java.util.Date;
+import java.util.List;
+
+import com.google.gson.annotations.SerializedName;
+
+import org.apache.cloudstack.api.BaseResponse;
+import org.apache.cloudstack.quota.vo.QuotaBalanceVO;
+
+import com.cloud.serializer.Param;
+
+public class QuotaBalanceResponse extends BaseResponse {
+
+@SerializedName("accountid")
+@Param(description = "account id")
+private Long accountId;
+
+@SerializedName("account")
+@Param(description = "account name")
+private String accountName;
+
+@SerializedName("domain")
+@Param(description = "domain id")
+private Long domainId;
+
+@SerializedName("startquota")
+@Param(description = "quota started with")
+private BigDecimal startQuota;
+
+@SerializedName("endquota")
+@Param(description = "quota by end of this period")
+private BigDecimal endQuota;
+
+@SerializedName("credits")
+@Param(description = "list of credits made during this period")
+private List credits = null;
+
+@SerializedName("startdate")
+@Param(description = "start date")
+private Date startDate = null;
+
+@SerializedName("enddate")
+@Param(description = "end date")
+private Date endDate = null;
+
+@SerializedName("currency")
+@Param(description = "currency")
+private String currency;
+
+public QuotaBalanceResponse() {
+super();
+credits = new ArrayList();
+}
+
+public Long getAccountId() {
+return accountId;
+}
+
+public void setAccountId(Long accountId) {
+this.accountId = accountId;
+}
+
+public String getAccountName() {
+return accountName;
+}
+
+public void setAccountName(String accountName) {
+this.accountName = accountName;
+}
+
+public Long getDomainId() {
+return domainId;
+}
+
+public void setDomainId(Long domainId) {
+this.domainId = domainId;
+}
+
+public BigDecimal getStartQuota() {
+return startQuota;
+}
+
+public void setStartQuota(BigDecimal startQuota) {
+this.startQuota = startQuota.setScale(2, RoundingMode.HALF_EVEN);
--- End diff --

@bhaisaab you are correct -- no side effect to the caller.  Odd naming, but 
definitely immutable per 
[JavaDocs](http://docs.oracle.com/javase/7/docs/api/java/math/BigDecimal.html#setScale(int)).

I notice that we are adjusting the passed quota values in the same manner 
in both the ``setStartQuota`` and ``setEndQuota`` methods.  We should extract 
that logic to a common private method to ensure consistency in all adjustments. 
 


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] cloudstack pull request: Quota

2015-10-12 Thread jburwell
Github user jburwell commented on a diff in the pull request:

https://github.com/apache/cloudstack/pull/768#discussion_r41749126
  
--- Diff: 
plugins/database/quota/src/org/apache/cloudstack/api/response/QuotaStatementResponse.java
 ---
@@ -0,0 +1,130 @@
+//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 org.apache.cloudstack.api.response;
+
+import com.cloud.serializer.Param;
+import com.google.gson.annotations.SerializedName;
+import org.apache.cloudstack.api.BaseResponse;
+
+import java.math.BigDecimal;
+import java.math.RoundingMode;
+import java.util.Date;
+import java.util.List;
+
+public class QuotaStatementResponse  extends BaseResponse {
+
+@SerializedName("accountid")
+@Param(description = "account id")
+private Long accountId;
+
+@SerializedName("account")
+@Param(description = "account name")
+private String accountName;
+
+@SerializedName("domain")
+@Param(description = "domain id")
+private Long domainId;
+
+@SerializedName("quotausage")
+@Param(description = "list of quota usage under various types", 
responseObject = QuotaStatementItemResponse.class)
+private List lineItem;
+
+@SerializedName("totalquota")
+@Param(description = "total quota used during this period")
+private BigDecimal totalQuota;
+
+@SerializedName("startdate")
+@Param(description = "start date")
+private Date startDate = null;
+
+@SerializedName("enddate")
+@Param(description = "end date")
+private Date endDate = null;
+
+@SerializedName("currency")
+@Param(description = "currency")
+private String currency;
+
+public QuotaStatementResponse() {
--- End diff --

@bhaisaab it doesn't need to be specified -- the compiler will 
automatically generate a default, public, no-arg constructor when no 
constructors are specified.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] cloudstack pull request: Quota

2015-10-12 Thread jburwell
Github user jburwell commented on a diff in the pull request:

https://github.com/apache/cloudstack/pull/768#discussion_r41749582
  
--- Diff: usage/src/org/apache/cloudstack/quota/QuotaManagerImpl.java ---
@@ -0,0 +1,397 @@
+//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 org.apache.cloudstack.quota;
+
+import com.cloud.usage.UsageVO;
+import com.cloud.usage.dao.UsageDao;
+import com.cloud.user.AccountVO;
+import com.cloud.user.dao.AccountDao;
+import com.cloud.utils.Pair;
+import com.cloud.utils.component.ManagerBase;
+import com.cloud.utils.db.DB;
+import com.cloud.utils.db.TransactionLegacy;
+import org.apache.cloudstack.framework.config.dao.ConfigurationDao;
+import org.apache.cloudstack.quota.constant.QuotaTypes;
+import org.apache.cloudstack.quota.dao.QuotaAccountDao;
+import org.apache.cloudstack.quota.dao.QuotaBalanceDao;
+import org.apache.cloudstack.quota.dao.QuotaTariffDao;
+import org.apache.cloudstack.quota.dao.QuotaUsageDao;
+import org.apache.cloudstack.quota.dao.ServiceOfferingDao;
+import org.apache.cloudstack.quota.vo.QuotaAccountVO;
+import org.apache.cloudstack.quota.vo.QuotaBalanceVO;
+import org.apache.cloudstack.quota.vo.QuotaTariffVO;
+import org.apache.cloudstack.quota.vo.QuotaUsageVO;
+import org.apache.cloudstack.quota.vo.ServiceOfferingVO;
+import org.apache.cloudstack.utils.usage.UsageUtils;
+import org.apache.log4j.Logger;
+import org.springframework.stereotype.Component;
+
+import javax.ejb.Local;
+import javax.inject.Inject;
+import javax.naming.ConfigurationException;
+import java.math.BigDecimal;
+import java.math.RoundingMode;
+import java.util.ArrayList;
+import java.util.Date;
+import java.util.List;
+import java.util.Map;
+import java.util.TimeZone;
+
+@Component
+@Local(value = QuotaManager.class)
+public class QuotaManagerImpl extends ManagerBase implements QuotaManager {
+private static final Logger s_logger = 
Logger.getLogger(QuotaManagerImpl.class.getName());
+
+@Inject
+private AccountDao _accountDao;
+@Inject
+private QuotaAccountDao _quotaAcc;
+@Inject
+private UsageDao _usageDao;
+@Inject
+private QuotaTariffDao _quotaTariffDao;
+@Inject
+private QuotaUsageDao _quotaUsageDao;
+@Inject
+private ServiceOfferingDao _serviceOfferingDao;
+@Inject
+private QuotaBalanceDao _quotaBalanceDao;
+@Inject
+private ConfigurationDao _configDao;
+
+private TimeZone _usageTimezone;
+private int _aggregationDuration = 0;
+
+final static BigDecimal s_hoursInMonth = new BigDecimal(30 * 24);
+final static BigDecimal s_minutesInMonth = new BigDecimal(30 * 24 * 
60);
+final static BigDecimal s_gb = new BigDecimal(1024 * 1024 * 1024);
+
+int _pid = 0;
+
+public QuotaManagerImpl() {
+super();
+}
+
+private void mergeConfigs(Map dbParams, Map xmlParams) {
+for (Map.Entry param : xmlParams.entrySet()) {
+dbParams.put(param.getKey(), (String) param.getValue());
+}
+}
+
+@Override
+public boolean configure(String name, Map params) 
throws ConfigurationException {
+super.configure(name, params);
+
+Map configs = _configDao.getConfiguration(params);
+
+if (params != null) {
+mergeConfigs(configs, params);
+}
+
+String aggregationRange = 
configs.get("usage.stats.job.aggregation.range");
+String timeZoneStr = configs.get("usage.aggregation.timezone");
+
+if (timeZoneStr == null) {
+timeZoneStr = "GMT";
+}
+_usageTimezone = TimeZone.getTimeZone(timeZoneStr);
+
+_aggregationDuration = Integer.parseInt(aggregationRange);
+if (_aggregationDuration < UsageUtils.USAGE_AGGREGATIO

[GitHub] cloudstack pull request: Quota

2015-10-12 Thread jburwell
Github user jburwell commented on a diff in the pull request:

https://github.com/apache/cloudstack/pull/768#discussion_r41749843
  
--- Diff: 
usage/test/org/apache/cloudstack/quota/QuotaAlertManagerImplTest.java ---
@@ -0,0 +1,239 @@
+// 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 org.apache.cloudstack.quota;
+
+import com.cloud.domain.DomainVO;
+import com.cloud.domain.dao.DomainDao;
+import com.cloud.user.Account;
+import com.cloud.user.AccountVO;
+import com.cloud.user.UserVO;
+import com.cloud.user.dao.AccountDao;
+import com.cloud.user.dao.UserDao;
+import com.cloud.utils.db.TransactionLegacy;
+import junit.framework.TestCase;
+import org.apache.cloudstack.framework.config.dao.ConfigurationDao;
+import org.apache.cloudstack.quota.constant.QuotaConfig;
+import org.apache.cloudstack.quota.dao.QuotaAccountDao;
+import org.apache.cloudstack.quota.dao.QuotaEmailTemplatesDao;
+import org.apache.cloudstack.quota.dao.QuotaUsageDao;
+import org.apache.cloudstack.quota.vo.QuotaAccountVO;
+import org.apache.cloudstack.quota.vo.QuotaEmailTemplatesVO;
+import org.joda.time.DateTime;
+import org.junit.Before;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.mockito.Mock;
+import org.mockito.Mockito;
+import org.mockito.Spy;
+import org.mockito.runners.MockitoJUnitRunner;
+
+import javax.mail.MessagingException;
+import javax.naming.ConfigurationException;
+import java.io.UnsupportedEncodingException;
+import java.lang.reflect.Field;
+import java.math.BigDecimal;
+import java.util.ArrayList;
+import java.util.Calendar;
+import java.util.Date;
+import java.util.List;
+
+@RunWith(MockitoJUnitRunner.class)
+public class QuotaAlertManagerImplTest extends TestCase {
+
+@Mock
+AccountDao accountDao;
+@Mock
+QuotaAccountDao quotaAcc;
+@Mock
+UserDao userDao;
+@Mock
+DomainDao domainDao;
+@Mock
+QuotaEmailTemplatesDao quotaEmailTemplateDao;
+@Mock
+ConfigurationDao configDao;
+@Mock
+QuotaUsageDao quotaUsage;
+@Mock
+QuotaAlertManagerImpl.EmailQuotaAlert emailQuotaAlert;
+
+@Spy
+QuotaAlertManagerImpl quotaAlertManager = new QuotaAlertManagerImpl();
+
+private void injectMockToField(Object mock, String fieldName) throws 
NoSuchFieldException, IllegalAccessException {
+Field f = QuotaAlertManagerImpl.class.getDeclaredField(fieldName);
+f.setAccessible(true);
+f.set(quotaAlertManager, mock);
+}
+
+@Before
+public void setup() throws IllegalAccessException, 
NoSuchFieldException, ConfigurationException {
+// Dummy transaction stack setup
+TransactionLegacy.open("QuotaAlertManagerImplTest");
+
+injectMockToField(accountDao, "_accountDao");
+injectMockToField(quotaAcc, "_quotaAcc");
+injectMockToField(userDao, "_userDao");
+injectMockToField(domainDao, "_domainDao");
+injectMockToField(quotaEmailTemplateDao, "_quotaEmailTemplateDao");
+injectMockToField(configDao, "_configDao");
+injectMockToField(quotaUsage, "_quotaUsage");
+injectMockToField(emailQuotaAlert, "_emailQuotaAlert");
+}
+
+@Test
+public void testStartStop() {
+try {
+quotaAlertManager.start(); // expected to fail as pid is not 
available
--- End diff --

So it should fail if the ``start`` call did not throw an exception.  
Therefore, immediately following that call to start, you should call ``fail`` 
because it should never reach that point in the code if an exception is thrown.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this

[GitHub] cloudstack pull request: Quota

2015-10-12 Thread jburwell
Github user jburwell commented on a diff in the pull request:

https://github.com/apache/cloudstack/pull/768#discussion_r41749931
  
--- Diff: usage/test/org/apache/cloudstack/quota/QuotaManagerImplTest.java 
---
@@ -0,0 +1,203 @@
+// 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 org.apache.cloudstack.quota;
+
+import com.cloud.usage.UsageVO;
+import com.cloud.usage.dao.UsageDao;
+import com.cloud.user.Account;
+import com.cloud.user.AccountVO;
+import com.cloud.user.dao.AccountDao;
+import com.cloud.utils.Pair;
+import com.cloud.utils.db.TransactionLegacy;
+import junit.framework.TestCase;
+import org.apache.cloudstack.framework.config.dao.ConfigurationDao;
+import org.apache.cloudstack.quota.dao.QuotaAccountDao;
+import org.apache.cloudstack.quota.dao.QuotaBalanceDao;
+import org.apache.cloudstack.quota.dao.QuotaTariffDao;
+import org.apache.cloudstack.quota.dao.QuotaUsageDao;
+import org.apache.cloudstack.quota.dao.ServiceOfferingDao;
+import org.apache.cloudstack.quota.vo.QuotaAccountVO;
+import org.apache.cloudstack.quota.vo.QuotaTariffVO;
+import org.apache.cloudstack.quota.vo.QuotaUsageVO;
+import org.apache.cloudstack.usage.UsageTypes;
+import org.junit.Before;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.mockito.Mock;
+import org.mockito.Mockito;
+import org.mockito.Spy;
+import org.mockito.runners.MockitoJUnitRunner;
+
+import javax.naming.ConfigurationException;
+import java.lang.reflect.Field;
+import java.math.BigDecimal;
+import java.util.ArrayList;
+import java.util.Date;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+@RunWith(MockitoJUnitRunner.class)
+public class QuotaManagerImplTest extends TestCase {
+
+@Mock
+private AccountDao accountDao;
+@Mock
+private QuotaAccountDao quotaAcc;
+@Mock
+private UsageDao usageDao;
+@Mock
+private QuotaTariffDao quotaTariffDao;
+@Mock
+private QuotaUsageDao quotaUsageDao;
+@Mock
+private ServiceOfferingDao serviceOfferingDao;
+@Mock
+private QuotaBalanceDao quotaBalanceDao;
+@Mock
+private ConfigurationDao configDao;
+
+@Spy
+QuotaManagerImpl quotaManager = new QuotaManagerImpl();
+
+private void injectMockToField(Object mock, String fieldName) throws 
NoSuchFieldException, IllegalAccessException {
+Field f = QuotaManagerImpl.class.getDeclaredField(fieldName);
+f.setAccessible(true);
+f.set(quotaManager, mock);
+}
+
+@Before
+public void setup() throws IllegalAccessException, 
NoSuchFieldException, ConfigurationException {
+// Dummy transaction stack setup
+TransactionLegacy.open("QuotaManagerImplTest");
+
+injectMockToField(accountDao, "_accountDao");
+injectMockToField(quotaAcc, "_quotaAcc");
+injectMockToField(usageDao, "_usageDao");
+injectMockToField(quotaTariffDao, "_quotaTariffDao");
+injectMockToField(quotaUsageDao, "_quotaUsageDao");
+injectMockToField(serviceOfferingDao, "_serviceOfferingDao");
+injectMockToField(quotaBalanceDao, "_quotaBalanceDao");
+injectMockToField(configDao, "_configDao");
+}
+
+@Test
+public void testStartStop() {
+try {
+quotaManager.start(); // expected to fail as pid is not 
available
--- End diff --

See note above.  If execution does not enter the catch, then the test 
fails.  However, there is no call to fail immediately `start()`` to verify that 
behavior.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the featur

[GitHub] cloudstack pull request: CLOUDSTACK-8832 : Update Nuage VSP plugin...

2015-10-12 Thread jburwell
Github user jburwell commented on a diff in the pull request:

https://github.com/apache/cloudstack/pull/801#discussion_r41772602
  
--- Diff: 
plugins/network-elements/nuage-vsp/src/com/cloud/network/guru/NuageVspGuestNetworkGuru.java
 ---
@@ -201,51 +234,82 @@ public NicProfile allocate(Network network, 
NicProfile nic, VirtualMachineProfil
 @Override
 public void reserve(NicProfile nic, Network network, 
VirtualMachineProfile vm, DeployDestination dest, ReservationContext context)
 throws InsufficientVirtualNetworkCapacityException, 
InsufficientAddressCapacityException {
-nic.setBroadcastUri(network.getBroadcastUri());
-nic.setIsolationUri(network.getBroadcastUri());
-
-s_logger.debug("Handling reserve() call back to with Create a new 
VM or add an interface to existing VM in network " + network.getName());
-DataCenter dc = _dcDao.findById(network.getDataCenterId());
-Account networksAccount = 
_accountDao.findById(network.getAccountId());
-DomainVO networksDomain = 
_domainDao.findById(network.getDomainId());
-//Get the Account details and find the type
-long networkOwnedBy = network.getAccountId();
-AccountVO neworkAccountDetails = 
_accountDao.findById(networkOwnedBy);
-if (neworkAccountDetails.getType() == 
Account.ACCOUNT_TYPE_PROJECT) {
-throw new InsufficientVirtualNetworkCapacityException("CS 
project support is " + "not yet implemented in NuageVsp", DataCenter.class, 
dc.getId());
+boolean lockedNetwork = lockNetworkForUserVm(network, vm);
+if (lockedNetwork) {
+s_logger.debug("Locked network " + network.getId() + " for 
creation of user VM " + vm.getInstanceName());
 }
 
-//NicProfile does not contain the NIC UUID. We need this 
information to set it in the VMInterface and VPort
-//that we create in VSP
-NicVO nicFrmDB = _nicDao.findById(nic.getId());
-long networkOfferingId = 
_ntwkOfferingDao.findById(network.getNetworkOfferingId()).getId();
-boolean isL3Network = isL3Network(networkOfferingId);
-Long vpcId = network.getVpcId();
-String vpcUuid = null;
-if (vpcId != null) {
-Vpc vpcObj = _vpcDao.findById(vpcId);
-vpcUuid = vpcObj.getUuid();
-}
-HostVO nuageVspHost = 
getNuageVspHost(network.getPhysicalNetworkId());
-ReserveVmInterfaceVspCommand cmd = new 
ReserveVmInterfaceVspCommand(nicFrmDB.getUuid(), nic.getMacAddress(), 
network.getUuid(), isL3Network, vpcUuid,
-networksDomain.getUuid(), networksAccount.getUuid(), 
vm.getType().equals(VirtualMachine.Type.DomainRouter), 
network.getBroadcastUri().getPath().substring(1),
-vm.getInstanceName(), vm.getUuid(), 
networksDomain.getUuid(), networksAccount.getUuid());
-ReserveVmInterfaceVspAnswer answer = 
(ReserveVmInterfaceVspAnswer)_agentMgr.easySend(nuageVspHost.getId(), cmd);
-
-if (answer == null || !answer.getResult()) {
-s_logger.error("ReserveVmInterfaceNuageVspCommand failed");
-if ((null != answer) && (null != answer.getDetails())) {
-s_logger.error(answer.getDetails());
+try {
+nic.setBroadcastUri(network.getBroadcastUri());
+nic.setIsolationUri(network.getBroadcastUri());
+
+s_logger.debug("Handling reserve() call back to with Create a 
new VM or add an interface to existing VM in network " + network.getName());
+DataCenter dc = _dcDao.findById(network.getDataCenterId());
+Account networksAccount = 
_accountDao.findById(network.getAccountId());
+DomainVO networksDomain = 
_domainDao.findById(network.getDomainId());
+//Get the Account details and find the type
+long networkOwnedBy = network.getAccountId();
+AccountVO neworkAccountDetails = 
_accountDao.findById(networkOwnedBy);
+if (neworkAccountDetails.getType() == 
Account.ACCOUNT_TYPE_PROJECT) {
+throw new InsufficientVirtualNetworkCapacityException("CS 
project support is " + "not yet implemented in NuageVsp", DataCenter.class, 
dc.getId());
+}
+
+//NicProfile does not contain the NIC UUID. We need this 
information to set it in the VMInterface and VPort
+//that we create in VSP
+NicVO nicFrmDB = _nicDao.findById(nic.getId());
+NetworkOffering networkOffering = 
_ntwkOfferingDao.findById(network.getNetworkOfferingId());
+boolean isDomainRouter = 
vm.getType().equals(VirtualMachi

[GitHub] cloudstack pull request: CLOUDSTACK-8832 : Update Nuage VSP plugin...

2015-10-12 Thread jburwell
Github user jburwell commented on a diff in the pull request:

https://github.com/apache/cloudstack/pull/801#discussion_r41773186
  
--- Diff: 
plugins/network-elements/nuage-vsp/src/com/cloud/network/guru/NuageVspGuestNetworkGuru.java
 ---
@@ -358,19 +441,22 @@ private String getVirtualRouterIP(Network network, 
Collection addressRan
 Set allIPsInCidr = NetUtils.getAllIpsFromCidr(subnet, 
cidrSize, new HashSet());
 
 if (allIPsInCidr.size() > 3) {
+//get the second IP and see if it the networks GatewayIP
 Iterator ipIterator = allIPsInCidr.iterator();
 long vip = ipIterator.next();
--- End diff --

@danielvsimoes the return type declared for ``NetUtils.getAllIpsFromCidr`` 
is ``Set`` not ``TreeSet``.  This implicit assumption would break badly if the 
internal implementation of the utility method were to change.  Therefore, 
please add a check at line 359 such as following:

```
if (allIPsInCidr == null or (allIPsInCidr != null and !(allIPsInCidr 
instanceof TreeSet))) {
   throw new InvalidStateException("The IPs in CIDR for subnet " + subnet + 
" where null or returned in a non-ordered set.");
}
```


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] cloudstack pull request: CLOUDSTACK-8832 : Update Nuage VSP plugin...

2015-10-12 Thread jburwell
Github user jburwell commented on a diff in the pull request:

https://github.com/apache/cloudstack/pull/801#discussion_r41773461
  
--- Diff: 
plugins/network-elements/nuage-vsp/src/net/nuage/vsp/acs/NuageVspPluginClientLoader.java
 ---
@@ -19,28 +19,86 @@
 
 package net.nuage.vsp.acs;
 
+import net.nuage.vsp.acs.client.NuageVspApiClient;
+import net.nuage.vsp.acs.client.NuageVspElementClient;
+import net.nuage.vsp.acs.client.NuageVspGuruClient;
+import net.nuage.vsp.acs.client.NuageVspManagerClient;
+import net.nuage.vsp.acs.client.NuageVspSyncClient;
+
 import java.net.MalformedURLException;
 import java.net.URL;
 import java.net.URLClassLoader;
 
 public class NuageVspPluginClientLoader {
 
-private static NuageVspPluginClientLoader 
nuageVspPluginClientClassloader;
-private ClassLoader loader = null;
+private ClassLoader _loader = null;
+
+private NuageVspApiClient _nuageVspApiClient;
+private NuageVspElementClient _nuageVspElementClient;
+private NuageVspGuruClient _nuageVspGuruClient;
+private NuageVspManagerClient _nuageVspManagerClient;
+private NuageVspSyncClient _nuageVspSyncClient;
+
+public static final String NUAGE_PLUGIN_CLIENT_JAR_FILE = 
"/usr/share/nuagevsp/lib/nuage-vsp-acs-client.jar";
--- End diff --

Seems the location of the client jar should be configurable.  I am also 
concerned that we are included a plugin into the open source project that has 
an implicit requirement for a non open source library.  The expectation is that 
any plugin built in the open source release has all dependencies to run 
included in the build.  I will open a discussion on the mailing list to discuss 
further.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] cloudstack pull request: CLOUDSTACK-8832 : Update Nuage VSP plugin...

2015-10-12 Thread jburwell
Github user jburwell commented on a diff in the pull request:

https://github.com/apache/cloudstack/pull/801#discussion_r41775527
  
--- Diff: 
plugins/network-elements/nuage-vsp/src/com/cloud/agent/api/element/ApplyStaticNatVspAnswer.java
 ---
@@ -31,4 +31,13 @@ public ApplyStaticNatVspAnswer(ApplyStaticNatVspCommand 
cmd, Exception e) {
 super(cmd, e);
 }
 
+@Override
+public boolean equals(Object obj) {
+return super.equals(obj);
+}
+
+@Override
+public int hashCode() {
+return super.hashCode();
+}
--- End diff --

Why does this class exist?  It adds no state or behavior to the ``Answer`` 
base class.  Why not simply use ``Answer`` in this circumstance?


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] cloudstack pull request: CLOUDSTACK-8832 : Update Nuage VSP plugin...

2015-10-12 Thread jburwell
Github user jburwell commented on a diff in the pull request:

https://github.com/apache/cloudstack/pull/801#discussion_r41775611
  
--- Diff: 
plugins/network-elements/nuage-vsp/src/com/cloud/agent/api/element/ImplementVspAnswer.java
 ---
@@ -17,18 +17,27 @@
 // under the License.
 //
 
-package com.cloud.agent.api.guru;
+package com.cloud.agent.api.element;
 
 import com.cloud.agent.api.Answer;
-import com.cloud.agent.api.Command;
 
-public class ReleaseVmVspAnswer extends Answer {
+public class ImplementVspAnswer extends Answer {
--- End diff --

Why does this class exist?  It adds no state or behavior to the ``Answer`` 
base class.  Why not simply use ``Answer`` in this circumstance?


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] cloudstack pull request: CLOUDSTACK-8832 : Update Nuage VSP plugin...

2015-10-12 Thread jburwell
Github user jburwell commented on a diff in the pull request:

https://github.com/apache/cloudstack/pull/801#discussion_r41775675
  
--- Diff: 
plugins/network-elements/nuage-vsp/src/com/cloud/agent/api/element/ShutDownVpcVspAnswer.java
 ---
@@ -31,4 +31,13 @@ public ShutDownVpcVspAnswer(ShutDownVpcVspCommand cmd, 
Exception e) {
 super(cmd, e);
 }
 
+@Override
+public boolean equals(Object obj) {
+return super.equals(obj);
+}
+
+@Override
+public int hashCode() {
+return super.hashCode();
+}
--- End diff --

Why does this class exist?  It adds no state or behavior to the ``Answer`` 
base class.  Why not simply use ``Answer`` in this circumstance?


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] cloudstack pull request: CLOUDSTACK-8832 : Update Nuage VSP plugin...

2015-10-12 Thread jburwell
Github user jburwell commented on a diff in the pull request:

https://github.com/apache/cloudstack/pull/801#discussion_r41775751
  
--- Diff: 
plugins/network-elements/nuage-vsp/src/com/cloud/agent/api/guru/ReserveVmInterfaceVspAnswer.java
 ---
@@ -19,26 +19,26 @@
 
 package com.cloud.agent.api.guru;
 
-import java.util.List;
-import java.util.Map;
-
 import com.cloud.agent.api.Answer;
 import com.cloud.agent.api.Command;
 
 public class ReserveVmInterfaceVspAnswer extends Answer {
 
-public List> _interfaceDetails;
-
-public ReserveVmInterfaceVspAnswer(Command cmd, List> interfaceDetails, String details) {
+public ReserveVmInterfaceVspAnswer(Command cmd, String details) {
--- End diff --

Why does this class exist?  It adds no state or behavior to the ``Answer`` 
base class.  Why not simply use ``Answer`` in this circumstance?


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] cloudstack pull request: CLOUDSTACK-8832 : Update Nuage VSP plugin...

2015-10-12 Thread jburwell
Github user jburwell commented on a diff in the pull request:

https://github.com/apache/cloudstack/pull/801#discussion_r41775797
  
--- Diff: 
plugins/network-elements/nuage-vsp/src/com/cloud/agent/api/guru/TrashNetworkVspAnswer.java
 ---
@@ -31,4 +31,14 @@ public TrashNetworkVspAnswer(Command command, Exception 
e) {
 public TrashNetworkVspAnswer(TrashNetworkVspCommand cmd, boolean 
success, String details) {
 super(cmd, success, details);
 }
+
+@Override
+public boolean equals(Object obj) {
+return super.equals(obj);
+}
+
+@Override
+public int hashCode() {
+return super.hashCode();
+}
--- End diff --

Why does this class exist?  It adds no state or behavior to the ``Answer`` 
base class.  Why not simply use ``Answer`` in this circumstance?


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] cloudstack pull request: CLOUDSTACK-8832 : Update Nuage VSP plugin...

2015-10-12 Thread jburwell
Github user jburwell commented on a diff in the pull request:

https://github.com/apache/cloudstack/pull/801#discussion_r41775998
  
--- Diff: 
plugins/network-elements/nuage-vsp/src/com/cloud/agent/api/manager/SupportedApiVersionAnswer.java
 ---
@@ -0,0 +1,43 @@
+//
+// 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.manager;
+
+import com.cloud.agent.api.Answer;
+
+public class SupportedApiVersionAnswer extends Answer {
--- End diff --

Why does this class exist?  It adds no state or behavior to the ``Answer`` 
base class.  Why not simply use ``Answer`` in this circumstance?


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] cloudstack pull request: CLOUDSTACK-8832 : Update Nuage VSP plugin...

2015-10-12 Thread jburwell
Github user jburwell commented on a diff in the pull request:

https://github.com/apache/cloudstack/pull/801#discussion_r41775987
  
--- Diff: 
plugins/network-elements/nuage-vsp/src/com/cloud/agent/api/manager/GetClientDefaultsCommand.java
 ---
@@ -17,38 +17,28 @@
 // under the License.
 //
 
-package com.cloud.agent.api.guru;
+package com.cloud.agent.api.manager;
 
 import com.cloud.agent.api.Command;
 
-public class ReleaseVmVspCommand extends Command {
+public class GetClientDefaultsCommand extends Command {
 
-String _networkUuid;
-String _vmUuid;
-String _vmInstanceName;
-
-public ReleaseVmVspCommand(String networkUuid, String vmUuid, String 
vmInstanceName) {
+public GetClientDefaultsCommand() {
 super();
-this._networkUuid = networkUuid;
-this._vmUuid = vmUuid;
-this._vmInstanceName = vmInstanceName;
-}
-
-public String getNetworkUuid() {
-return _networkUuid;
 }
 
-public String getVmUuid() {
-return _vmUuid;
+@Override
+public boolean executeInSequence() {
+return false;
 }
 
-public String getVmInstanceName() {
-return _vmInstanceName;
+@Override
+public boolean equals(Object obj) {
+return super.equals(obj);
 }
 
 @Override
-public boolean executeInSequence() {
-return false;
+public int hashCode() {
+return super.hashCode();
 }
-
-}
+}
--- End diff --

No need to override ``equals`` or ``hashCode``.  Simply add a comment that 
the super class implementations are acceptable because this class does not 
track any state in addition to the super class.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] cloudstack pull request: CLOUDSTACK-8832 : Update Nuage VSP plugin...

2015-10-12 Thread jburwell
Github user jburwell commented on a diff in the pull request:

https://github.com/apache/cloudstack/pull/801#discussion_r41776079
  
--- Diff: 
plugins/network-elements/nuage-vsp/src/com/cloud/agent/api/sync/SyncDomainAnswer.java
 ---
@@ -0,0 +1,54 @@
+//
+// 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.sync;
+
+import com.cloud.agent.api.Answer;
+
+public class SyncDomainAnswer extends Answer {
+
+private final boolean _success;
+
+public SyncDomainAnswer(boolean success) {
+super();
+this._success = success;
+}
+
+public boolean getSuccess() {
+return _success;
+}
+
+
+@Override
+public boolean equals(Object o) {
+if (this == o) return true;
+if (o == null || getClass() != o.getClass()) return false;
+
+SyncDomainAnswer that = (SyncDomainAnswer) o;
+
+if (_success != that._success) return false;
+
+return true;
+}
+
+@Override
+public int hashCode() {
+return (_success ? 1 : 0);
+}
--- End diff --

Please add a ``toString()`` method to provide debugging state information 
for debugging purposes.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] cloudstack pull request: CLOUDSTACK-8832 : Update Nuage VSP plugin...

2015-10-12 Thread jburwell
Github user jburwell commented on a diff in the pull request:

https://github.com/apache/cloudstack/pull/801#discussion_r41776115
  
--- Diff: 
plugins/network-elements/nuage-vsp/src/com/cloud/agent/api/manager/SupportedApiVersionCommand.java
 ---
@@ -0,0 +1,58 @@
+//
+// 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.manager;
+
+import com.cloud.agent.api.Command;
+
+public class SupportedApiVersionCommand extends Command {
+
+private final String _apiVersion;
+
+public SupportedApiVersionCommand(String apiVersion) {
+super();
+this._apiVersion = apiVersion;
+}
+
+public String getApiVersion() {
+return _apiVersion;
+}
+
+@Override
+public boolean executeInSequence() {
+return false;
+}
+
+@Override
+public boolean equals(Object o) {
+if (this == o) return true;
+if (o == null || getClass() != o.getClass()) return false;
+
+SupportedApiVersionCommand that = (SupportedApiVersionCommand) o;
+
+if (_apiVersion != null ? !_apiVersion.equals(that._apiVersion) : 
that._apiVersion != null) return false;
+
+return true;
+}
+
+@Override
+public int hashCode() {
+return _apiVersion != null ? _apiVersion.hashCode() : 0;
+}
--- End diff --

Please implement ``toString()`` to provide debugging state information for 
debugging purposes.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] cloudstack pull request: CLOUDSTACK-8832 : Update Nuage VSP plugin...

2015-10-12 Thread jburwell
Github user jburwell commented on a diff in the pull request:

https://github.com/apache/cloudstack/pull/801#discussion_r41776144
  
--- Diff: 
plugins/network-elements/nuage-vsp/src/com/cloud/agent/api/guru/TrashNetworkVspCommand.java
 ---
@@ -48,13 +53,93 @@ public boolean isL3Network() {
 return _isL3Network;
 }
 
+public boolean isSharedNetwork() {
+return _isSharedNetwork;
+}
+
 public String getVpcUuid() {
 return _vpcUuid;
 }
 
+public String getDomainTemplateName() {
+return _domainTemplateName;
+}
+
+public static class Builder extends CmdBuilder 
{
+private String _domainUuid;
+private String _networkUuid;
+private boolean _isL3Network;
+private boolean _isSharedNetwork;
+private String _vpcUuid;
+private String _domainTemplateName;
+
+public Builder domainUuid(String domainUuid) {
+this._domainUuid = domainUuid;
+return this;
+}
+
+public Builder networkUuid(String networkUuid) {
+this._networkUuid = networkUuid;
+return this;
+}
+
+public Builder isL3Network(boolean isL3Network) {
+this._isL3Network = isL3Network;
+return this;
+}
+
+public Builder isSharedNetwork(boolean isSharedNetwork) {
+this._isSharedNetwork = isSharedNetwork;
+return this;
+}
+
+public Builder vpcUuid(String vpcUuid) {
+this._vpcUuid = vpcUuid;
+return this;
+}
+
+public Builder domainTemplateName(String domainTemplateName) {
+this._domainTemplateName = domainTemplateName;
+return this;
+}
+
+@Override
+public TrashNetworkVspCommand build() {
+return new TrashNetworkVspCommand(_domainUuid, _networkUuid, 
_isL3Network, _isSharedNetwork, _vpcUuid, _domainTemplateName);
+}
+}
+
 @Override
 public boolean executeInSequence() {
 return false;
 }
 
+@Override
+public boolean equals(Object o) {
+if (this == o) return true;
+if (o == null || getClass() != o.getClass()) return false;
+
+TrashNetworkVspCommand that = (TrashNetworkVspCommand) o;
+
+if (_isL3Network != that._isL3Network) return false;
+if (_isSharedNetwork != that._isSharedNetwork) return false;
+if (_domainTemplateName != null ? 
!_domainTemplateName.equals(that._domainTemplateName) : 
that._domainTemplateName != null)
+return false;
+if (_domainUuid != null ? !_domainUuid.equals(that._domainUuid) : 
that._domainUuid != null) return false;
+if (_networkUuid != null ? !_networkUuid.equals(that._networkUuid) 
: that._networkUuid != null) return false;
+if (_vpcUuid != null ? !_vpcUuid.equals(that._vpcUuid) : 
that._vpcUuid != null) return false;
+
+return true;
+}
+
+@Override
+public int hashCode() {
+int result = _domainUuid != null ? _domainUuid.hashCode() : 0;
+result = 31 * result + (_networkUuid != null ? 
_networkUuid.hashCode() : 0);
+result = 31 * result + (_isL3Network ? 1 : 0);
+result = 31 * result + (_isSharedNetwork ? 1 : 0);
+result = 31 * result + (_vpcUuid != null ? _vpcUuid.hashCode() : 
0);
+result = 31 * result + (_domainTemplateName != null ? 
_domainTemplateName.hashCode() : 0);
+return result;
+}
--- End diff --

Please implement ``toString()`` to provide debugging state information for 
debugging purposes.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] cloudstack pull request: CLOUDSTACK-8832 : Update Nuage VSP plugin...

2015-10-12 Thread jburwell
Github user jburwell commented on a diff in the pull request:

https://github.com/apache/cloudstack/pull/801#discussion_r41776134
  
--- Diff: 
plugins/network-elements/nuage-vsp/src/com/cloud/agent/api/manager/GetClientDefaultsAnswer.java
 ---
@@ -0,0 +1,79 @@
+//
+// 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.manager;
+
+import com.cloud.agent.api.Answer;
+
+import java.util.Map;
+
+public class GetClientDefaultsAnswer extends Answer {
+
+private String _currentApiVersion;
+private Integer _apiRetryCount;
+private Long _apiRetryInterval;
+
+public GetClientDefaultsAnswer(GetClientDefaultsCommand cmd, 
Map defaults) {
+super(cmd);
+this._currentApiVersion = (String) 
defaults.get("CURRENT_API_VERSION");
+this._apiRetryCount = (Integer) 
defaults.get("DEFAULT_API_RETRY_COUNT");
+this._apiRetryInterval = (Long) 
defaults.get("DEFAULT_API_RETRY_INTERVAL");
+}
+
+public GetClientDefaultsAnswer(GetClientDefaultsCommand cmd, Exception 
e) {
+super(cmd, e);
+}
+
+public String getCurrentApiVersion() {
+return _currentApiVersion;
+}
+
+public Integer getApiRetryCount() {
+return _apiRetryCount;
+}
+
+public Long getApiRetryInterval() {
+return _apiRetryInterval;
+}
+
+@Override
+public boolean equals(Object o) {
+if (this == o) return true;
+if (o == null || getClass() != o.getClass()) return false;
+
+GetClientDefaultsAnswer that = (GetClientDefaultsAnswer) o;
+
+if (_apiRetryCount != null ? 
!_apiRetryCount.equals(that._apiRetryCount) : that._apiRetryCount != null)
+return false;
+if (_apiRetryInterval != null ? 
!_apiRetryInterval.equals(that._apiRetryInterval) : that._apiRetryInterval != 
null)
+return false;
+if (_currentApiVersion != null ? 
!_currentApiVersion.equals(that._currentApiVersion) : that._currentApiVersion 
!= null)
+return false;
+
+return true;
+}
+
+@Override
+public int hashCode() {
+int result = _currentApiVersion != null ? 
_currentApiVersion.hashCode() : 0;
+result = 31 * result + (_apiRetryCount != null ? 
_apiRetryCount.hashCode() : 0);
+result = 31 * result + (_apiRetryInterval != null ? 
_apiRetryInterval.hashCode() : 0);
+return result;
+}
--- End diff --

Please implement ``toString()`` to provide debugging state information for 
debugging purposes.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] cloudstack pull request: CLOUDSTACK-8832 : Update Nuage VSP plugin...

2015-10-12 Thread jburwell
Github user jburwell commented on a diff in the pull request:

https://github.com/apache/cloudstack/pull/801#discussion_r41776155
  
--- Diff: 
plugins/network-elements/nuage-vsp/src/com/cloud/agent/api/guru/ReserveVmInterfaceVspCommand.java
 ---
@@ -87,29 +114,285 @@ public boolean isDomainRouter() {
 return _isDomainRouter;
 }
 
-public String _getDomainRouterIp() {
+public String getDomainRouterIp() {
 return _domainRouterIp;
 }
 
-public String _getVmInstanceName() {
+public String getVmInstanceName() {
 return _vmInstanceName;
 }
 
-public String _getVmUuid() {
+public String getVmUuid() {
 return _vmUuid;
 }
 
-public String _getVmUserName() {
+public String getVmUserName() {
 return _vmUserName;
 }
 
-public String _getVmUserDomainName() {
+public String getVmUserDomainName() {
 return _vmUserDomainName;
 }
 
+public boolean useStaticIp() {
+return _useStaticIp;
+}
+
+public String getStaticIp() {
+return _staticIp;
+}
+
+public String getStaticNatIpUuid() {
+return _staticNatIpUuid;
+}
+
+public String getStaticNatIpAddress() {
+return _staticNatIpAddress;
+}
+
+public boolean isStaticNatIpAllocated() {
+return _isStaticNatIpAllocated;
+}
+
+public boolean isOneToOneNat() {
+return _isOneToOneNat;
+}
+
+public String getStaticNatVlanUuid() {
+return _staticNatVlanUuid;
+}
+
+public String getStaticNatVlanGateway() {
+return _staticNatVlanGateway;
+}
+
+public String getStaticNatVlanNetmask() {
+return _staticNatVlanNetmask;
+}
+
+public static class Builder extends 
CmdBuilder {
+private String _nicUuid;
+private String _nicMacAddress;
+private String _networkUuid;
+private boolean _isL3Network;
+private boolean _isSharedNetwork;
+private String _vpcUuid;
+private String _networkDomainUuid;
+private String _networksAccountUuid;
+private boolean _isDomainRouter;
+private String _domainRouterIp;
+private String _vmInstanceName;
+private String _vmUuid;
+private String _vmUserName;
+private String _vmUserDomainName;
+private boolean _useStaticIp;
+private String _staticIp;
+private String _staticNatIpUuid;
+private String _staticNatIpAddress;
+private boolean _isStaticNatIpAllocated;
+private boolean _isOneToOneNat;
+private String _staticNatVlanUuid;
+private String _staticNatVlanGateway;
+private String _staticNatVlanNetmask;
+
+public Builder nicUuid(String nicUuid) {
+this._nicUuid = nicUuid;
+return this;
+}
+
+public Builder nicMacAddress(String nicMacAddress) {
+this._nicMacAddress = nicMacAddress;
+return this;
+}
+
+public Builder networkUuid(String networkUuid) {
+this._networkUuid = networkUuid;
+return this;
+}
+
+public Builder isL3Network(boolean isL3Network) {
+this._isL3Network = isL3Network;
+return this;
+}
+
+public Builder isSharedNetwork(boolean isSharedNetwork) {
+this._isSharedNetwork = isSharedNetwork;
+return this;
+}
+
+public Builder vpcUuid(String vpcUuid) {
+this._vpcUuid = vpcUuid;
+return this;
+}
+
+public Builder networkDomainUuid(String networkDomainUuid) {
+this._networkDomainUuid = networkDomainUuid;
+return this;
+}
+
+public Builder networksAccountUuid(String networksAccountUuid) {
+this._networksAccountUuid = networksAccountUuid;
+return this;
+}
+
+public Builder isDomainRouter(boolean isDomainRouter) {
+this._isDomainRouter = isDomainRouter;
+return this;
+}
+
+public Builder domainRouterIp(String domainRouterIp) {
+this._domainRouterIp = domainRouterIp;
+return this;
+}
+
+public Builder vmInstanceName(String vmInstanceName) {
+this._vmInstanceName = vmInstanceName;
+return this;
+}
+
+public Builder

[GitHub] cloudstack pull request: CLOUDSTACK-8832 : Update Nuage VSP plugin...

2015-10-12 Thread jburwell
Github user jburwell commented on a diff in the pull request:

https://github.com/apache/cloudstack/pull/801#discussion_r41776195
  
--- Diff: 
plugins/network-elements/nuage-vsp/src/com/cloud/agent/api/guru/ImplementNetworkVspCommand.java
 ---
@@ -112,13 +147,212 @@ public boolean isDefaultEgressPolicy() {
 return _defaultEgressPolicy;
 }
 
-public Collection getIpAddressRange() {
+public Collection getIpAddressRange() {
 return _ipAddressRange;
 }
 
+public String getDomainTemplateName() {
+return _domainTemplateName;
+}
+
+public static class Builder extends 
CmdBuilder {
+private String _networkDomainName;
+private String _networkDomainPath;
+private String _networkDomainUuid;
+private String _networkAccountName;
+private String _networkAccountUuid;
+private String _networkName;
+private String _networkCidr;
+private String _networkGateway;
+private Long _networkAclId;
+private List _dnsServers;
+private List _gatewaySystemIds;
+private String _networkUuid;
+private boolean _isL3Network;
+private boolean _isVpc;
+private boolean _isSharedNetwork;
+private String _vpcName;
+private String _vpcUuid;
+private boolean _defaultEgressPolicy;
+private List _ipAddressRange;
+private String _domainTemplateName;
+
+public Builder networkDomainName(String networkDomainName) {
+this._networkDomainName = networkDomainName;
+return this;
+}
+
+public Builder networkDomainPath(String networkDomainPath) {
+this._networkDomainPath = networkDomainPath;
+return this;
+}
+
+public Builder networkDomainUuid(String networkDomainUuid) {
+this._networkDomainUuid = networkDomainUuid;
+return this;
+}
+
+public Builder networkAccountName(String networkAccountName) {
+this._networkAccountName = networkAccountName;
+return this;
+}
+
+public Builder networkAccountUuid(String networkAccountUuid) {
+this._networkAccountUuid = networkAccountUuid;
+return this;
+}
+
+public Builder networkName(String networkName) {
+this._networkName = networkName;
+return this;
+}
+
+public Builder networkCidr(String networkCidr) {
+this._networkCidr = networkCidr;
+return this;
+}
+
+public Builder networkGateway(String networkGateway) {
+this._networkGateway = networkGateway;
+return this;
+}
+
+public Builder networkAclId(Long networkAclId) {
+this._networkAclId = networkAclId;
+return this;
+}
+
+public Builder dnsServers(List dnsServers) {
+this._dnsServers = dnsServers;
+return this;
+}
+
+public Builder gatewaySystemIds(List gatewaySystemIds) {
+this._gatewaySystemIds = gatewaySystemIds;
+return this;
+}
+
+public Builder networkUuid(String networkUuid) {
+this._networkUuid = networkUuid;
+return this;
+}
+
+public Builder isL3Network(boolean isL3Network) {
+this._isL3Network = isL3Network;
+return this;
+}
+
+public Builder isVpc(boolean isVpc) {
+this._isVpc = isVpc;
+return this;
+}
+
+public Builder isSharedNetwork(boolean isSharedNetwork) {
+this._isSharedNetwork = isSharedNetwork;
+return this;
+}
+
+public Builder vpcName(String vpcName) {
+this._vpcName = vpcName;
+return this;
+}
+
+public Builder vpcUuid(String vpcUuid) {
+this._vpcUuid = vpcUuid;
+return this;
+}
+
+public Builder defaultEgressPolicy(boolean defaultEgressPolicy) {
+this._defaultEgressPolicy = defaultEgressPolicy;
+return this;
+}
+
+public Builder ipAddressRange(List ipAddressRange) {
+this._ipAddressRange = ipAddressRange;
+return this;
+}
+
+public Builder domainTemplateName(String domainTemplateName) {
+this._domainTemplateName = domainTemplateName

[GitHub] cloudstack pull request: CLOUDSTACK-8832 : Update Nuage VSP plugin...

2015-10-12 Thread jburwell
Github user jburwell commented on a diff in the pull request:

https://github.com/apache/cloudstack/pull/801#discussion_r41776261
  
--- Diff: 
plugins/network-elements/nuage-vsp/src/com/cloud/agent/api/guru/DeallocateVmVspCommand.java
 ---
@@ -83,9 +92,130 @@ public String getVmUuid() {
 return _vmUuid;
 }
 
+public boolean isExpungingState() {
+return _isExpungingState;
+}
+
+public static class Builder extends CmdBuilder 
{
+private String _networkUuid;
+private String _nicFromDdUuid;
+private String _nicMacAddress;
+private String _nicIp4Address;
+private boolean _isL3Network;
+private boolean _isSharedNetwork;
+private String _vpcUuid;
+private String _networksDomainUuid;
+private String _vmInstanceName;
+private String _vmUuid;
+private boolean _isExpungingState;
+
+public Builder networkUuid(String networkUuid) {
+this._networkUuid = networkUuid;
+return this;
+}
+
+public Builder nicFromDbUuid(String nicFromDbUuid) {
+this._nicFromDdUuid = nicFromDbUuid;
+return this;
+}
+
+public Builder nicMacAddress(String nicMacAddress) {
+this._nicMacAddress = nicMacAddress;
+return this;
+}
+
+public Builder nicIp4Address(String nicIp4Address) {
+this._nicIp4Address = nicIp4Address;
+return this;
+}
+
+public Builder isL3Network(boolean isL3Network) {
+this._isL3Network = isL3Network;
+return this;
+}
+
+public Builder isSharedNetwork(boolean isSharedNetwork) {
+this._isSharedNetwork = isSharedNetwork;
+return this;
+}
+
+public Builder vpcUuid(String vpcUuid) {
+this._vpcUuid = vpcUuid;
+return this;
+}
+
+public Builder networksDomainUuid(String networksDomainUuid) {
+this._networksDomainUuid = networksDomainUuid;
+return this;
+}
+
+public Builder vmInstanceName(String vmInstanceName) {
+this._vmInstanceName = vmInstanceName;
+return this;
+}
+
+public Builder vmUuid(String vmUuid) {
+this._vmUuid = vmUuid;
+return this;
+}
+
+public Builder isExpungingState(boolean isExpungingState) {
+this._isExpungingState = isExpungingState;
+return this;
+}
+
+@Override
+public DeallocateVmVspCommand build() {
+return new DeallocateVmVspCommand(_networkUuid,_nicFromDdUuid, 
_nicMacAddress, _nicIp4Address, _isL3Network, _isSharedNetwork, _vpcUuid,
+_networksDomainUuid, _vmInstanceName, _vmUuid, 
_isExpungingState);
+}
+}
+
 @Override
 public boolean executeInSequence() {
 return false;
 }
 
+@Override
+public boolean equals(Object o) {
+if (this == o) return true;
+if (o == null || getClass() != o.getClass()) return false;
+
+DeallocateVmVspCommand that = (DeallocateVmVspCommand) o;
+
+if (_isExpungingState != that._isExpungingState) return false;
+if (_isL3Network != that._isL3Network) return false;
+if (_isSharedNetwork != that._isSharedNetwork) return false;
+if (_networkUuid != null ? !_networkUuid.equals(that._networkUuid) 
: that._networkUuid != null) return false;
+if (_networksDomainUuid != null ? 
!_networksDomainUuid.equals(that._networksDomainUuid) : 
that._networksDomainUuid != null)
+return false;
+if (_nicFromDdUuid != null ? 
!_nicFromDdUuid.equals(that._nicFromDdUuid) : that._nicFromDdUuid != null)
+return false;
+if (_nicIp4Address != null ? 
!_nicIp4Address.equals(that._nicIp4Address) : that._nicIp4Address != null)
+return false;
+if (_nicMacAddress != null ? 
!_nicMacAddress.equals(that._nicMacAddress) : that._nicMacAddress != null)
+return false;
+if (_vmInstanceName != null ? 
!_vmInstanceName.equals(that._vmInstanceName) : that._vmInstanceName != null)
+return false;
+if (_vmUuid != null ? !_vmUuid.equals(that._vmUuid) : that._vmUuid 
!= null) return false;
+if (_vpcUuid != null ? !_vpcUuid.equals(that._vpcUuid) : 
that._vpcUuid != null) return false;
+
+return true;
+}
+
+@Override
+public int hashCode

[GitHub] cloudstack pull request: CLOUDSTACK-8832 : Update Nuage VSP plugin...

2015-10-12 Thread jburwell
Github user jburwell commented on a diff in the pull request:

https://github.com/apache/cloudstack/pull/801#discussion_r41776309
  
--- Diff: 
plugins/network-elements/nuage-vsp/src/com/cloud/agent/api/guru/DeallocateVmVspAnswer.java
 ---
@@ -31,4 +31,14 @@ public DeallocateVmVspAnswer(Command command, Exception 
e) {
 public DeallocateVmVspAnswer(DeallocateVmVspCommand cmd, boolean 
success, String details) {
 super(cmd, success, details);
 }
+
+@Override
+public boolean equals(Object obj) {
+return super.equals(obj);
+}
+
+@Override
+public int hashCode() {
+return super.hashCode();
+}
--- End diff --

Why does this class exist?  It adds no state or behavior to the ``Answer`` 
base class.  Why not simply use ``Answer`` in this circumstance?


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] cloudstack pull request: CLOUDSTACK-8832 : Update Nuage VSP plugin...

2015-10-12 Thread jburwell
Github user jburwell commented on a diff in the pull request:

https://github.com/apache/cloudstack/pull/801#discussion_r41776281
  
--- Diff: 
plugins/network-elements/nuage-vsp/src/com/cloud/agent/api/element/ShutDownVpcVspCommand.java
 ---
@@ -40,9 +43,61 @@ public String getVpcUuid() {
 return _vpcUuid;
 }
 
+public String getDomainTemplateName() {
+return _domainTemplateName;
+}
+
+public static class Builder extends CmdBuilder {
+private String _domainUuid;
+private String _vpcUuid;
+private String _domainTemplateName;
+
+public Builder domainUuid(String domainUuid) {
+this._domainUuid = domainUuid;
+return this;
+}
+
+public Builder vpcUuid(String vpcUuid) {
+this._vpcUuid = vpcUuid;
+return this;
+}
+
+public Builder domainTemplateName(String domainTemplateName) {
+this._domainTemplateName = domainTemplateName;
+return this;
+}
+
+@Override
+public ShutDownVpcVspCommand build() {
+return new ShutDownVpcVspCommand(_domainUuid, _vpcUuid, 
_domainTemplateName);
+}
+}
+
 @Override
 public boolean executeInSequence() {
 return false;
 }
 
+@Override
+public boolean equals(Object o) {
+if (this == o) return true;
+if (o == null || getClass() != o.getClass()) return false;
+
+ShutDownVpcVspCommand that = (ShutDownVpcVspCommand) o;
+
+if (_domainTemplateName != null ? 
!_domainTemplateName.equals(that._domainTemplateName) : 
that._domainTemplateName != null)
+return false;
+if (_domainUuid != null ? !_domainUuid.equals(that._domainUuid) : 
that._domainUuid != null) return false;
+if (_vpcUuid != null ? !_vpcUuid.equals(that._vpcUuid) : 
that._vpcUuid != null) return false;
+
+return true;
+}
+
+@Override
+public int hashCode() {
+int result = _domainUuid != null ? _domainUuid.hashCode() : 0;
+result = 31 * result + (_vpcUuid != null ? _vpcUuid.hashCode() : 
0);
+result = 31 * result + (_domainTemplateName != null ? 
_domainTemplateName.hashCode() : 0);
+return result;
+}
--- End diff --

Please implement ``toString()`` to provide debugging state information for 
debugging purposes.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] cloudstack pull request: CLOUDSTACK-8832 : Update Nuage VSP plugin...

2015-10-12 Thread jburwell
Github user jburwell commented on a diff in the pull request:

https://github.com/apache/cloudstack/pull/801#discussion_r41776343
  
--- Diff: 
plugins/network-elements/nuage-vsp/src/com/cloud/agent/api/element/ImplementVspCommand.java
 ---
@@ -0,0 +1,295 @@
+//
+// 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.element;
+
+import com.cloud.agent.api.CmdBuilder;
+import com.cloud.agent.api.Command;
+
+import java.util.List;
+import java.util.Map;
+
+public class ImplementVspCommand extends Command {
+
+private final long _networkId;
+private final String _networkDomainUuid;
+private final String _networkUuid;
+private final String _networkName;
+private final String _vpcOrSubnetUuid;
+private final boolean _isL2Network;
+private final boolean _isL3Network;
+private final boolean _isVpc;
+private final boolean _isShared;
+private final String _domainTemplateName;
+private final boolean _isFirewallServiceSupported;
+private final List _dnsServers;
+private final List> _ingressFirewallRules;
+private final List> _egressFirewallRules;
+private final List _acsFipUuid;
+private final boolean _egressDefaultPolicy;
+
+private ImplementVspCommand(long networkId, String networkDomainUuid, 
String networkUuid, String networkName, String vpcOrSubnetUuid, boolean 
isL2Network, boolean isL3Network,
+boolean isVpc, boolean isShared, String domainTemplateName, 
boolean isFirewallServiceSupported, List dnsServers, List> ingressFirewallRules,
+List> egressFirewallRules, List 
acsFipUuid, boolean egressDefaultPolicy) {
+super();
+this._networkId = networkId;
+this._networkDomainUuid = networkDomainUuid;
+this._networkUuid = networkUuid;
+this._networkName = networkName;
+this._vpcOrSubnetUuid = vpcOrSubnetUuid;
+this._isL2Network = isL2Network;
+this._isL3Network = isL3Network;
+this._isVpc = isVpc;
+this._isShared = isShared;
+this._domainTemplateName = domainTemplateName;
+this._isFirewallServiceSupported = isFirewallServiceSupported;
+this._dnsServers = dnsServers;
+this._ingressFirewallRules = ingressFirewallRules;
+this._egressFirewallRules = egressFirewallRules;
+this._acsFipUuid = acsFipUuid;
+this._egressDefaultPolicy = egressDefaultPolicy;
+}
+
+public long getNetworkId() {
+return _networkId;
+}
+
+public String getNetworkDomainUuid() {
+return _networkDomainUuid;
+}
+
+public String getNetworkUuid() {
+return _networkUuid;
+}
+
+public String getNetworkName() {
+return _networkName;
+}
+
+public String getVpcOrSubnetUuid() {
+return _vpcOrSubnetUuid;
+}
+
+public boolean isL2Network() {
+return _isL2Network;
+}
+
+public boolean isL3Network() {
+return _isL3Network;
+}
+
+public boolean isVpc() {
+return _isVpc;
+}
+
+public boolean isShared() {
+return _isShared;
+}
+
+public String getDomainTemplateName() {
+return _domainTemplateName;
+}
+
+public boolean isFirewallServiceSupported() {
+return _isFirewallServiceSupported;
+}
+
+public List getDnsServers() {
+return _dnsServers;
+}
+
+public List> getIngressFirewallRules() {
+return _ingressFirewallRules;
+}
+
+public List> getEgressFirewallRules() {
+return _egressFirewallRules;
+}
+
+public List getAcsFipUuid() {
+return _acsFipUuid;
+}
+
+  

[GitHub] cloudstack pull request: CLOUDSTACK-8832 : Update Nuage VSP plugin...

2015-10-12 Thread jburwell
Github user jburwell commented on a diff in the pull request:

https://github.com/apache/cloudstack/pull/801#discussion_r41776381
  
--- Diff: 
plugins/network-elements/nuage-vsp/src/com/cloud/agent/api/element/ApplyAclRuleVspCommand.java
 ---
@@ -79,4 +191,47 @@ public boolean executeInSequence() {
 return false;
 }
 
+@Override
+public boolean equals(Object o) {
+if (this == o) return true;
+if (o == null || getClass() != o.getClass()) return false;
+
+ApplyAclRuleVspCommand that = (ApplyAclRuleVspCommand) o;
+
+if (_egressDefaultPolicy != that._egressDefaultPolicy) return 
false;
+if (_isL2Network != that._isL2Network) return false;
+if (_networkAcl != that._networkAcl) return false;
+if (_networkId != that._networkId) return false;
+if (_networkReset != that._networkReset) return false;
+if (_aclRules != null ? !_aclRules.equals(that._aclRules) : 
that._aclRules != null) return false;
+if (_acsIngressAcl != null ? 
!_acsIngressAcl.equals(that._acsIngressAcl) : that._acsIngressAcl != null)
+return false;
+if (_domainTemplateName != null ? 
!_domainTemplateName.equals(that._domainTemplateName) : 
that._domainTemplateName != null)
+return false;
+if (_networkDomainUuid != null ? 
!_networkDomainUuid.equals(that._networkDomainUuid) : that._networkDomainUuid 
!= null)
+return false;
+if (_networkName != null ? !_networkName.equals(that._networkName) 
: that._networkName != null) return false;
+if (_networkUuid != null ? !_networkUuid.equals(that._networkUuid) 
: that._networkUuid != null) return false;
+if (_vpcOrSubnetUuid != null ? 
!_vpcOrSubnetUuid.equals(that._vpcOrSubnetUuid) : that._vpcOrSubnetUuid != null)
+return false;
+
+return true;
+}
+
+@Override
+public int hashCode() {
+int result = (_networkAcl ? 1 : 0);
+result = 31 * result + (_networkUuid != null ? 
_networkUuid.hashCode() : 0);
+result = 31 * result + (_networkDomainUuid != null ? 
_networkDomainUuid.hashCode() : 0);
+result = 31 * result + (_vpcOrSubnetUuid != null ? 
_vpcOrSubnetUuid.hashCode() : 0);
+result = 31 * result + (_networkName != null ? 
_networkName.hashCode() : 0);
+result = 31 * result + (_isL2Network ? 1 : 0);
+result = 31 * result + (_aclRules != null ? _aclRules.hashCode() : 
0);
+result = 31 * result + (int) (_networkId ^ (_networkId >>> 32));
+result = 31 * result + (_egressDefaultPolicy ? 1 : 0);
+result = 31 * result + (_acsIngressAcl != null ? 
_acsIngressAcl.hashCode() : 0);
+result = 31 * result + (_networkReset ? 1 : 0);
+result = 31 * result + (_domainTemplateName != null ? 
_domainTemplateName.hashCode() : 0);
+return result;
+}
--- End diff --

Please implement ``toString()`` to provide debugging state information for 
debugging purposes.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] cloudstack pull request: CLOUDSTACK-8832 : Update Nuage VSP plugin...

2015-10-12 Thread jburwell
Github user jburwell commented on a diff in the pull request:

https://github.com/apache/cloudstack/pull/801#discussion_r41776369
  
--- Diff: 
plugins/network-elements/nuage-vsp/src/com/cloud/agent/api/element/ApplyStaticNatVspCommand.java
 ---
@@ -51,13 +61,91 @@ public boolean isL3Network() {
 return _isL3Network;
 }
 
+public boolean isVpc() {
+return _isVpc;
+}
+
 public List> getStaticNatDetails() {
 return _staticNatDetails;
 }
 
+public static class Builder extends 
CmdBuilder {
+private String _networkDomainUuid;
+private String _networkUuid;
+private String _vpcOrSubnetUuid;
+private boolean _isL3Network;
+private boolean _isVpc;
+private List> _staticNatDetails;
+
+public Builder networkDomainUuid(String networkDomainUuid) {
+this._networkDomainUuid = networkDomainUuid;
+return this;
+}
+
+public Builder networkUuid(String networkUuid) {
+this._networkUuid = networkUuid;
+return this;
+}
+
+public Builder vpcOrSubnetUuid(String vpcOrSubnetUuid) {
+this._vpcOrSubnetUuid = vpcOrSubnetUuid;
+return this;
+}
+
+public Builder isL3Network(boolean isL3Network) {
+this._isL3Network = isL3Network;
+return this;
+}
+
+public Builder isVpc(boolean isVpc) {
+this._isVpc = isVpc;
+return this;
+}
+
+public Builder staticNatDetails(List> 
staticNatDetails) {
+this._staticNatDetails = staticNatDetails;
+return this;
+}
+
+@Override
+public ApplyStaticNatVspCommand build() {
+return new ApplyStaticNatVspCommand(_networkDomainUuid, 
_networkUuid, _vpcOrSubnetUuid, _isL3Network, _isVpc, _staticNatDetails);
+}
+}
+
 @Override
 public boolean executeInSequence() {
 return false;
 }
 
+@Override
+public boolean equals(Object o) {
+if (this == o) return true;
+if (o == null || getClass() != o.getClass()) return false;
+
+ApplyStaticNatVspCommand that = (ApplyStaticNatVspCommand) o;
+
+if (_isL3Network != that._isL3Network) return false;
+if (_isVpc != that._isVpc) return false;
+if (_networkDomainUuid != null ? 
!_networkDomainUuid.equals(that._networkDomainUuid) : that._networkDomainUuid 
!= null)
+return false;
+if (_networkUuid != null ? !_networkUuid.equals(that._networkUuid) 
: that._networkUuid != null) return false;
+if (_staticNatDetails != null ? 
!_staticNatDetails.equals(that._staticNatDetails) : that._staticNatDetails != 
null)
+return false;
+if (_vpcOrSubnetUuid != null ? 
!_vpcOrSubnetUuid.equals(that._vpcOrSubnetUuid) : that._vpcOrSubnetUuid != null)
+return false;
+
+return true;
+}
+
+@Override
+public int hashCode() {
+int result = _networkDomainUuid != null ? 
_networkDomainUuid.hashCode() : 0;
+result = 31 * result + (_networkUuid != null ? 
_networkUuid.hashCode() : 0);
+result = 31 * result + (_vpcOrSubnetUuid != null ? 
_vpcOrSubnetUuid.hashCode() : 0);
+result = 31 * result + (_isL3Network ? 1 : 0);
+result = 31 * result + (_isVpc ? 1 : 0);
+result = 31 * result + (_staticNatDetails != null ? 
_staticNatDetails.hashCode() : 0);
+return result;
+}
--- End diff --

Please implement ``toString()`` to provide debugging state information for 
debugging purposes.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] cloudstack pull request: CLOUDSTACK-8832 : Update Nuage VSP plugin...

2015-10-12 Thread jburwell
Github user jburwell commented on a diff in the pull request:

https://github.com/apache/cloudstack/pull/801#discussion_r41776405
  
--- Diff: 
plugins/network-elements/nuage-vsp/src/com/cloud/agent/api/VspResourceCommand.java
 ---
@@ -79,4 +79,41 @@ public String getProxyUserDomainuuid() {
 public boolean executeInSequence() {
 return false;
 }
+
+@Override
+public boolean equals(Object o) {
+if (this == o) return true;
+if (o == null || getClass() != o.getClass()) return false;
+
+VspResourceCommand that = (VspResourceCommand) o;
+
+if (_childResource != null ? 
!_childResource.equals(that._childResource) : that._childResource != null)
+return false;
+if (_entityDetails != null ? 
!_entityDetails.equals(that._entityDetails) : that._entityDetails != null)
+return false;
+if (_method != null ? !_method.equals(that._method) : that._method 
!= null) return false;
+if (_proxyUserDomainuuid != null ? 
!_proxyUserDomainuuid.equals(that._proxyUserDomainuuid) : 
that._proxyUserDomainuuid != null)
+return false;
+if (_proxyUserUuid != null ? 
!_proxyUserUuid.equals(that._proxyUserUuid) : that._proxyUserUuid != null)
+return false;
+if (_resource != null ? !_resource.equals(that._resource) : 
that._resource != null) return false;
+if (_resourceFilter != null ? 
!_resourceFilter.equals(that._resourceFilter) : that._resourceFilter != null)
+return false;
+if (_resourceId != null ? !_resourceId.equals(that._resourceId) : 
that._resourceId != null) return false;
+
+return true;
+}
+
+@Override
+public int hashCode() {
+int result = _method != null ? _method.hashCode() : 0;
+result = 31 * result + (_resource != null ? _resource.hashCode() : 
0);
+result = 31 * result + (_resourceId != null ? 
_resourceId.hashCode() : 0);
+result = 31 * result + (_childResource != null ? 
_childResource.hashCode() : 0);
+result = 31 * result + (_entityDetails != null ? 
_entityDetails.hashCode() : 0);
+result = 31 * result + (_resourceFilter != null ? 
_resourceFilter.hashCode() : 0);
+result = 31 * result + (_proxyUserUuid != null ? 
_proxyUserUuid.hashCode() : 0);
+result = 31 * result + (_proxyUserDomainuuid != null ? 
_proxyUserDomainuuid.hashCode() : 0);
+return result;
+}
--- End diff --

Please implement ``toString()`` to provide debugging state information for 
debugging purposes.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] cloudstack pull request: CLOUDSTACK-8832 : Update Nuage VSP plugin...

2015-10-12 Thread jburwell
Github user jburwell commented on a diff in the pull request:

https://github.com/apache/cloudstack/pull/801#discussion_r41776439
  
--- Diff: 
plugins/network-elements/nuage-vsp/src/com/cloud/agent/api/element/ApplyAclRuleVspAnswer.java
 ---
@@ -31,4 +31,13 @@ public ApplyAclRuleVspAnswer(ApplyAclRuleVspCommand cmd, 
Exception e) {
 super(cmd, e);
 }
 
+@Override
+public boolean equals(Object obj) {
+return super.equals(obj);
+}
+
+@Override
+public int hashCode() {
+return super.hashCode();
+}
--- End diff --

Why does this class exist?  It adds no state or behavior to the ``Answer`` 
base class.  Why not simply use ``Answer`` in this circumstance?


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] cloudstack pull request: CLOUDSTACK-8832 : Update Nuage VSP plugin...

2015-10-12 Thread jburwell
Github user jburwell commented on a diff in the pull request:

https://github.com/apache/cloudstack/pull/801#discussion_r41776505
  
--- Diff: 
plugins/network-elements/nuage-vsp/src/com/cloud/agent/api/UpdateNuageVspDeviceCommand.java
 ---
@@ -0,0 +1,60 @@
+//
+// 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;
+
+import java.util.Collections;
+import java.util.Map;
+
+public class UpdateNuageVspDeviceCommand extends Command {
+
+private final Map _parametersToBeUpdated;
+
+public UpdateNuageVspDeviceCommand(Map 
parametersToBeUpdated) {
+super();
+this._parametersToBeUpdated = parametersToBeUpdated;
+}
+
+public Map getParametersToBeUpdated() {
+return Collections.unmodifiableMap(_parametersToBeUpdated);
+}
+
+@Override
+public boolean executeInSequence() {
+return false;
+}
+
+@Override
+public boolean equals(Object o) {
+if (this == o) return true;
+if (o == null || getClass() != o.getClass()) return false;
+
+UpdateNuageVspDeviceCommand that = (UpdateNuageVspDeviceCommand) o;
+
+if (_parametersToBeUpdated != null ? 
!_parametersToBeUpdated.equals(that._parametersToBeUpdated) : 
that._parametersToBeUpdated != null)
+return false;
+
+return true;
+}
+
+@Override
+public int hashCode() {
+return _parametersToBeUpdated != null ? 
_parametersToBeUpdated.hashCode() : 0;
+}
--- End diff --

Please implement ``toString()`` to provide debugging state information for 
debugging purposes.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] cloudstack pull request: CLOUDSTACK-8832 : Update Nuage VSP plugin...

2015-10-12 Thread jburwell
Github user jburwell commented on a diff in the pull request:

https://github.com/apache/cloudstack/pull/801#discussion_r41776472
  
--- Diff: 
plugins/network-elements/nuage-vsp/src/com/cloud/agent/api/VspResourceAnswer.java
 ---
@@ -39,4 +39,22 @@ public VspResourceAnswer(VspResourceCommand cmd, 
Exception e) {
 public String getResourceInfo() {
 return this._resourceInfo;
 }
+
+@Override
+public boolean equals(Object o) {
+if (this == o) return true;
+if (o == null || getClass() != o.getClass()) return false;
+
+VspResourceAnswer that = (VspResourceAnswer) o;
+
+if (_resourceInfo != null ? 
!_resourceInfo.equals(that._resourceInfo) : that._resourceInfo != null)
+return false;
+
+return true;
+}
+
+@Override
+public int hashCode() {
+return _resourceInfo != null ? _resourceInfo.hashCode() : 0;
+}
--- End diff --

Please implement ``toString()`` to provide debugging state information for 
debugging purposes.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] cloudstack pull request: CLOUDSTACK-8832 : Update Nuage VSP plugin...

2015-10-12 Thread jburwell
Github user jburwell commented on a diff in the pull request:

https://github.com/apache/cloudstack/pull/801#discussion_r41776891
  
--- Diff: 
plugins/network-elements/nuage-vsp/src/com/cloud/agent/api/UpdateNuageVspDeviceCommand.java
 ---
@@ -0,0 +1,60 @@
+//
+// 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;
+
+import java.util.Collections;
+import java.util.Map;
+
+public class UpdateNuageVspDeviceCommand extends Command {
+
+private final Map _parametersToBeUpdated;
+
+public UpdateNuageVspDeviceCommand(Map 
parametersToBeUpdated) {
+super();
+this._parametersToBeUpdated = parametersToBeUpdated;
--- End diff --

To prevent the impact of side-effects from changes to the 
``parametersToBeUpdated`` in post construction behavior, copy the ``Map`` and 
wrap it in an unmodifiable as follows:
```
this._parametersToBeUpdated = Collections.unmodifiableMap(new 
HashMap(parametersToBeUpdated));
```
This change will allow the return of the parameter in 
``getParametersToBeUpdated`` without modification.

An alternative, cleaner approach (which I prefer, but not commonly used in 
the CloudStack codebase) is to use Guava's ``ImmutableMap``.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] cloudstack pull request: CLOUDSTACK-8832 : Update Nuage VSP plugin...

2015-10-12 Thread jburwell
Github user jburwell commented on a diff in the pull request:

https://github.com/apache/cloudstack/pull/801#discussion_r41776942
  
--- Diff: 
plugins/network-elements/nuage-vsp/src/com/cloud/agent/api/UpdateNuageVspDeviceAnswer.java
 ---
@@ -0,0 +1,41 @@
+//
+// 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;
+
+public class UpdateNuageVspDeviceAnswer extends Answer {
--- End diff --

Why does this class exist?  It adds no state or behavior to the ``Answer`` 
base class.  Why not simply use ``Answer`` in this circumstance?


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] cloudstack pull request: CLOUDSTACK-8832 : Update Nuage VSP plugin...

2015-10-12 Thread jburwell
Github user jburwell commented on a diff in the pull request:

https://github.com/apache/cloudstack/pull/801#discussion_r41776980
  
--- Diff: 
plugins/network-elements/nuage-vsp/src/com/cloud/agent/api/StartupVspCommand.java
 ---
@@ -26,4 +26,14 @@
 public StartupVspCommand() {
 super(Host.Type.L2Networking);
 }
+
+@Override
+public boolean equals(Object obj) {
+return super.equals(obj);
+}
+
+@Override
+public int hashCode() {
+return super.hashCode();
+}
--- End diff --

Please implement ``toString()`` to provide debugging state information for 
debugging purposes.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] cloudstack pull request: CLOUDSTACK-8832 : Update Nuage VSP plugin...

2015-10-12 Thread jburwell
Github user jburwell commented on a diff in the pull request:

https://github.com/apache/cloudstack/pull/801#discussion_r41777315
  
--- Diff: 
plugins/network-elements/nuage-vsp/src/com/cloud/agent/api/CmdBuilder.java ---
@@ -0,0 +1,24 @@
+//
+// 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;
+
+public abstract class CmdBuilder {
--- End diff --

Why is ``CmdBuilder`` an abstract class and not an interface?  Since it 
defines no behavior, it feels like it should be an interface.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] cloudstack pull request: CLOUDSTACK-8832 : Update Nuage VSP plugin...

2015-10-12 Thread jburwell
Github user jburwell commented on a diff in the pull request:

https://github.com/apache/cloudstack/pull/801#discussion_r41777414
  
--- Diff: plugins/network-elements/nuage-vsp/pom.xml ---
@@ -28,6 +28,13 @@
 4.6.0-SNAPSHOT
 ../../pom.xml
   
+  
+
+  org.apache.commons
+  commons-lang3
+  ${cs.lang3.version}
+
+  
--- End diff --

Is ``commons-lang3`` required by the nuage client jar?  If not, please use 
the equivalent facilities in Guava as that is the project's standard, common 
utility library.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] cloudstack pull request: CLOUDSTACK-8832 : Update Nuage VSP plugin...

2015-10-12 Thread jburwell
Github user jburwell commented on a diff in the pull request:

https://github.com/apache/cloudstack/pull/801#discussion_r41777590
  
--- Diff: 
plugins/network-elements/nuage-vsp/src/com/cloud/agent/api/sync/SyncDomainCommand.java
 ---
@@ -0,0 +1,91 @@
+//
+// 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.sync;
+
+import com.cloud.agent.api.Command;
+
+public class SyncDomainCommand extends Command {
+
+private final String _domainUuid;
+private final String _domainName;
+private final String _domainPath;
+private final boolean _toAdd;
+private final boolean _toRemove;
+
+public SyncDomainCommand(String domainUuid, String domainName, String 
domainPath, boolean toAdd, boolean toRemove) {
+super();
+this._domainUuid = domainUuid;
+this._domainName = domainName;
+this._domainPath = domainPath;
+this._toAdd = toAdd;
+this._toRemove = toRemove;
+}
+
+public String getDomainUuid() {
+return _domainUuid;
+}
+
+public String getDomainName() {
+return _domainName;
+}
+
+public String getDomainPath() {
+return _domainPath;
+}
+
+public boolean isToAdd() {
+return _toAdd;
+}
+
+public boolean isToRemove() {
+return _toRemove;
+}
+
+@Override
+public boolean executeInSequence() {
+return false;
+}
+
+@Override
+public boolean equals(Object o) {
+if (this == o) return true;
+if (o == null || getClass() != o.getClass()) return false;
+
+SyncDomainCommand that = (SyncDomainCommand) o;
+
+if (_toAdd != that._toAdd) return false;
+if (_toRemove != that._toRemove) return false;
+if (_domainName != null ? !_domainName.equals(that._domainName) : 
that._domainName != null) return false;
+if (_domainPath != null ? !_domainPath.equals(that._domainPath) : 
that._domainPath != null) return false;
+if (_domainUuid != null ? !_domainUuid.equals(that._domainUuid) : 
that._domainUuid != null) return false;
+
+return true;
+}
+
+@Override
+public int hashCode() {
+int result = _domainUuid != null ? _domainUuid.hashCode() : 0;
+result = 31 * result + (_domainName != null ? 
_domainName.hashCode() : 0);
+result = 31 * result + (_domainPath != null ? 
_domainPath.hashCode() : 0);
+result = 31 * result + (_toAdd ? 1 : 0);
+result = 31 * result + (_toRemove ? 1 : 0);
+return result;
+}
--- End diff --

Please implement ``toString()`` to provide debugging state information for 
debugging purposes.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] cloudstack pull request: CLOUDSTACK-8832 : Update Nuage VSP plugin...

2015-10-12 Thread jburwell
Github user jburwell commented on a diff in the pull request:

https://github.com/apache/cloudstack/pull/801#discussion_r41777596
  
--- Diff: 
plugins/network-elements/nuage-vsp/src/com/cloud/agent/api/sync/SyncNuageVspCmsIdAnswer.java
 ---
@@ -0,0 +1,71 @@
+//
+// 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.sync;
+
+import com.cloud.agent.api.Answer;
+
+public class SyncNuageVspCmsIdAnswer extends Answer {
+
+private final boolean _success;
+private final String _nuageVspCmsId;
+private final SyncNuageVspCmsIdCommand.SyncType _syncType;
+
+public SyncNuageVspCmsIdAnswer(boolean success, String nuageVspCmsId, 
SyncNuageVspCmsIdCommand.SyncType syncType) {
+super();
+this._success = success;
+this._nuageVspCmsId = nuageVspCmsId;
+this._syncType = syncType;
+}
+
+public boolean getSuccess() {
+return _success;
+}
+
+public String getNuageVspCmsId() {
+return _nuageVspCmsId;
+}
+
+public SyncNuageVspCmsIdCommand.SyncType getSyncType() {
+return _syncType;
+}
+
+@Override
+public boolean equals(Object o) {
+if (this == o) return true;
+if (o == null || getClass() != o.getClass()) return false;
+
+SyncNuageVspCmsIdAnswer that = (SyncNuageVspCmsIdAnswer) o;
+
+if (_success != that._success) return false;
+if (_nuageVspCmsId != null ? 
!_nuageVspCmsId.equals(that._nuageVspCmsId) : that._nuageVspCmsId != null)
+return false;
+if (_syncType != that._syncType) return false;
+
+return true;
+}
+
+@Override
+public int hashCode() {
+int result = (_success ? 1 : 0);
+result = 31 * result + (_nuageVspCmsId != null ? 
_nuageVspCmsId.hashCode() : 0);
+result = 31 * result + (_syncType != null ? _syncType.hashCode() : 
0);
+return result;
+}
--- End diff --

Please implement ``toString()`` to provide debugging state information for 
debugging purposes.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] cloudstack pull request: CLOUDSTACK-8832 : Update Nuage VSP plugin...

2015-10-12 Thread jburwell
Github user jburwell commented on a diff in the pull request:

https://github.com/apache/cloudstack/pull/801#discussion_r41777608
  
--- Diff: 
plugins/network-elements/nuage-vsp/src/com/cloud/agent/api/sync/SyncNuageVspCmsIdCommand.java
 ---
@@ -0,0 +1,70 @@
+//
+// 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.sync;
+
+import com.cloud.agent.api.Command;
+
+public class SyncNuageVspCmsIdCommand extends Command {
+
+public static enum SyncType { AUDIT, AUDIT_ONLY, REGISTER, UNREGISTER }
+
+private final SyncType _syncType;
+private final String _nuageVspCmsId;
+
+public SyncNuageVspCmsIdCommand(SyncType syncType, String 
nuageVspCmsId) {
+super();
+this._syncType = syncType;
+this._nuageVspCmsId = nuageVspCmsId;
+}
+
+public SyncType getSyncType() {
+return _syncType;
+}
+
+public String getNuageVspCmsId() {
+return _nuageVspCmsId;
+}
+
+@Override
+public boolean executeInSequence() {
+return false;
+}
+
+@Override
+public boolean equals(Object o) {
+if (this == o) return true;
+if (o == null || getClass() != o.getClass()) return false;
+
+SyncNuageVspCmsIdCommand that = (SyncNuageVspCmsIdCommand) o;
+
+if (_nuageVspCmsId != null ? 
!_nuageVspCmsId.equals(that._nuageVspCmsId) : that._nuageVspCmsId != null)
+return false;
+if (_syncType != that._syncType) return false;
+
+return true;
+}
+
+@Override
+public int hashCode() {
+int result = _syncType != null ? _syncType.hashCode() : 0;
+result = 31 * result + (_nuageVspCmsId != null ? 
_nuageVspCmsId.hashCode() : 0);
+return result;
+}
--- End diff --

Please implement ``toString()`` to provide debugging state information for 
debugging purposes.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] cloudstack pull request: CLOUDSTACK-8832 : Update Nuage VSP plugin...

2015-10-12 Thread jburwell
Github user jburwell commented on a diff in the pull request:

https://github.com/apache/cloudstack/pull/801#discussion_r41777672
  
--- Diff: 
plugins/network-elements/nuage-vsp/src/com/cloud/agent/api/sync/SyncVspAnswer.java
 ---
@@ -31,4 +31,13 @@ public SyncVspAnswer(SyncVspCommand cmd, Exception e) {
 super(cmd, e);
 }
 
+@Override
+public boolean equals(Object obj) {
+return super.equals(obj);
+}
+
+@Override
+public int hashCode() {
+return super.hashCode();
+}
--- End diff --

Why does this class exist?  It adds no state or behavior to the ``Answer`` 
base class.  Why not simply use ``Answer`` in this circumstance?


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] cloudstack pull request: CLOUDSTACK-8832 : Update Nuage VSP plugin...

2015-10-12 Thread jburwell
Github user jburwell commented on a diff in the pull request:

https://github.com/apache/cloudstack/pull/801#discussion_r4115
  
--- Diff: 
plugins/network-elements/nuage-vsp/src/com/cloud/agent/api/sync/SyncVspCommand.java
 ---
@@ -39,4 +39,21 @@ public String getNuageVspEntity() {
 return _nuageVspEntity;
 }
 
+@Override
+public boolean equals(Object o) {
+if (this == o) return true;
+if (o == null || getClass() != o.getClass()) return false;
+
+SyncVspCommand that = (SyncVspCommand) o;
+
+if (_nuageVspEntity != null ? 
!_nuageVspEntity.equals(that._nuageVspEntity) : that._nuageVspEntity != null)
+return false;
+
+return true;
+}
+
+@Override
+public int hashCode() {
+return _nuageVspEntity != null ? _nuageVspEntity.hashCode() : 0;
+}
--- End diff --

Please implement ``toString()`` to provide debugging state information for 
debugging purposes.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] cloudstack pull request: CLOUDSTACK-8832 : Update Nuage VSP plugin...

2015-10-12 Thread jburwell
Github user jburwell commented on a diff in the pull request:

https://github.com/apache/cloudstack/pull/801#discussion_r41777825
  
--- Diff: 
plugins/network-elements/nuage-vsp/src/com/cloud/network/dao/NuageVspDaoImpl.java
 ---
@@ -36,11 +34,16 @@
 implements NuageVspDao {
 
 protected final SearchBuilder 
physicalNetworkIdSearch;
+protected final SearchBuilder hostIdSearch;
--- End diff --

Why are these attributes declared as ``protected`` instead of ``private``?


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] cloudstack pull request: CLOUDSTACK-8832 : Update Nuage VSP plugin...

2015-10-12 Thread jburwell
Github user jburwell commented on a diff in the pull request:

https://github.com/apache/cloudstack/pull/801#discussion_r41778039
  
--- Diff: 
plugins/network-elements/nuage-vsp/src/com/cloud/network/element/NuageVspElement.java
 ---
@@ -205,9 +254,79 @@ public boolean implement(Network network, 
NetworkOffering offering, DeployDestin
 return false;
 }
 
+final boolean egressDefaultPolicy = 
offering.getEgressDefaultPolicy();
+Domain networkDomain = _domainDao.findById(network.getDomainId());
+boolean isFirewallServiceSupported = 
_networkModel.areServicesSupportedByNetworkOffering(offering.getId(), 
Service.Firewall);
+List dnsServers = _nuageVspManager.getDnsDetails(network);
+
+boolean isL2Network = false, isL3Network = false, isShared = false;
+String subnetUuid = network.getUuid();
+if (offering.getGuestType() == Network.GuestType.Shared) {
+isShared = true;
+subnetUuid = networkDomain.getUuid();
+} else if 
(_ntwkOfferingSrvcDao.areServicesSupportedByNetworkOffering(offering.getId(), 
Service.SourceNat)
+|| 
_ntwkOfferingSrvcDao.areServicesSupportedByNetworkOffering(offering.getId(), 
Service.StaticNat)
+|| 
_ntwkOfferingSrvcDao.areServicesSupportedByNetworkOffering(offering.getId(), 
Service.Connectivity)) {
+isL3Network = true;
+} else {
+isL2Network = true;
+}
+
+String preConfiguredDomainTemplateName = 
NuageVspUtil.getPreConfiguredDomainTemplateName(_configDao, network, offering);
+List firewallIngressRulesToApply = 
getFirewallRulesToApply(network.getId(), FirewallRule.TrafficType.Ingress);
+List firewallEgressRulesToApply = 
getFirewallRulesToApply(network.getId(), FirewallRule.TrafficType.Egress);
+
+List> ingressFirewallRules = 
Lists.transform(firewallIngressRulesToApply, new Function>() {
+@Override
+public Map apply(FirewallRuleVO 
firewallRuleVO) {
+return getACLRuleDetails(firewallRuleVO, 
egressDefaultPolicy);
+}
+});
+
+List> egressFirewallRules = 
Lists.transform(firewallEgressRulesToApply, new Function>() {
+@Override
+public Map apply(FirewallRuleVO 
firewallRuleVO) {
+return getACLRuleDetails(firewallRuleVO, 
egressDefaultPolicy);
+}
+});
+
+List ips = 
_ipAddressDao.listStaticNatPublicIps(network.getId());
+List acsFipUuid = new ArrayList();
+for (IPAddressVO ip : ips) {
+acsFipUuid.add(ip.getUuid());
+}
+
+try {
+HostVO nuageVspHost = 
getNuageVspHost(network.getPhysicalNetworkId());
+ImplementVspCommand.Builder cmdBuilder = new 
ImplementVspCommand.Builder().networkId(network.getId()).networkDomainUuid(networkDomain.getUuid())
+
.networkUuid(network.getUuid()).networkName(network.getName()).vpcOrSubnetUuid(subnetUuid).isL2Network(isL2Network).isL3Network(isL3Network)
+
.isVpc(false).isShared(isShared).domainTemplateName(preConfiguredDomainTemplateName).isFirewallServiceSupported(isFirewallServiceSupported)
+
.dnsServers(dnsServers).ingressFirewallRules(ingressFirewallRules).egressFirewallRules(egressFirewallRules).acsFipUuid(acsFipUuid)
+.egressDefaultPolicy(egressDefaultPolicy);
+ImplementVspAnswer answer = (ImplementVspAnswer) 
_agentMgr.easySend(nuageVspHost.getId(), cmdBuilder.build());
+if (answer == null || !answer.getResult()) {
+s_logger.error("ImplementVspCommand for network " + 
network.getUuid() + " failed");
+if ((null != answer) && (null != answer.getDetails())) {
+throw new 
ResourceUnavailableException(answer.getDetails(), Network.class, 
network.getId());
+}
+}
+} catch (Exception e) {
--- End diff --

Why are all checked and unchecked exceptions being caught here?  Why not 
catch the subset of expected checked exceptions?


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] cloudstack pull request: CLOUDSTACK-8832 : Update Nuage VSP plugin...

2015-10-12 Thread jburwell
Github user jburwell commented on a diff in the pull request:

https://github.com/apache/cloudstack/pull/801#discussion_r41778327
  
--- Diff: 
plugins/network-elements/nuage-vsp/src/com/cloud/network/element/NuageVspElement.java
 ---
@@ -205,9 +254,79 @@ public boolean implement(Network network, 
NetworkOffering offering, DeployDestin
 return false;
 }
 
+final boolean egressDefaultPolicy = 
offering.getEgressDefaultPolicy();
+Domain networkDomain = _domainDao.findById(network.getDomainId());
+boolean isFirewallServiceSupported = 
_networkModel.areServicesSupportedByNetworkOffering(offering.getId(), 
Service.Firewall);
+List dnsServers = _nuageVspManager.getDnsDetails(network);
+
+boolean isL2Network = false, isL3Network = false, isShared = false;
+String subnetUuid = network.getUuid();
+if (offering.getGuestType() == Network.GuestType.Shared) {
+isShared = true;
+subnetUuid = networkDomain.getUuid();
+} else if 
(_ntwkOfferingSrvcDao.areServicesSupportedByNetworkOffering(offering.getId(), 
Service.SourceNat)
+|| 
_ntwkOfferingSrvcDao.areServicesSupportedByNetworkOffering(offering.getId(), 
Service.StaticNat)
+|| 
_ntwkOfferingSrvcDao.areServicesSupportedByNetworkOffering(offering.getId(), 
Service.Connectivity)) {
+isL3Network = true;
+} else {
+isL2Network = true;
+}
+
+String preConfiguredDomainTemplateName = 
NuageVspUtil.getPreConfiguredDomainTemplateName(_configDao, network, offering);
+List firewallIngressRulesToApply = 
getFirewallRulesToApply(network.getId(), FirewallRule.TrafficType.Ingress);
+List firewallEgressRulesToApply = 
getFirewallRulesToApply(network.getId(), FirewallRule.TrafficType.Egress);
+
+List> ingressFirewallRules = 
Lists.transform(firewallIngressRulesToApply, new Function>() {
+@Override
+public Map apply(FirewallRuleVO 
firewallRuleVO) {
+return getACLRuleDetails(firewallRuleVO, 
egressDefaultPolicy);
+}
+});
+
+List> egressFirewallRules = 
Lists.transform(firewallEgressRulesToApply, new Function>() {
+@Override
+public Map apply(FirewallRuleVO 
firewallRuleVO) {
+return getACLRuleDetails(firewallRuleVO, 
egressDefaultPolicy);
+}
+});
+
+List ips = 
_ipAddressDao.listStaticNatPublicIps(network.getId());
+List acsFipUuid = new ArrayList();
+for (IPAddressVO ip : ips) {
+acsFipUuid.add(ip.getUuid());
+}
+
+try {
+HostVO nuageVspHost = 
getNuageVspHost(network.getPhysicalNetworkId());
+ImplementVspCommand.Builder cmdBuilder = new 
ImplementVspCommand.Builder().networkId(network.getId()).networkDomainUuid(networkDomain.getUuid())
+
.networkUuid(network.getUuid()).networkName(network.getName()).vpcOrSubnetUuid(subnetUuid).isL2Network(isL2Network).isL3Network(isL3Network)
+
.isVpc(false).isShared(isShared).domainTemplateName(preConfiguredDomainTemplateName).isFirewallServiceSupported(isFirewallServiceSupported)
+
.dnsServers(dnsServers).ingressFirewallRules(ingressFirewallRules).egressFirewallRules(egressFirewallRules).acsFipUuid(acsFipUuid)
+.egressDefaultPolicy(egressDefaultPolicy);
+ImplementVspAnswer answer = (ImplementVspAnswer) 
_agentMgr.easySend(nuageVspHost.getId(), cmdBuilder.build());
+if (answer == null || !answer.getResult()) {
+s_logger.error("ImplementVspCommand for network " + 
network.getUuid() + " failed");
+if ((null != answer) && (null != answer.getDetails())) {
+throw new 
ResourceUnavailableException(answer.getDetails(), Network.class, 
network.getId());
+}
+}
+} catch (Exception e) {
+s_logger.warn("Failed to implement network in Vsp", e);
--- End diff --

Why is this message being logged to ``WARN`` instead of ``ERROR``.  The 
behavior indicates that this condition halts operation.  Also, please add 
context information about the VSP to help admins determine instance encountered 
a problem.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] cloudstack pull request: CLOUDSTACK-8832 : Update Nuage VSP plugin...

2015-10-12 Thread jburwell
Github user jburwell commented on a diff in the pull request:

https://github.com/apache/cloudstack/pull/801#discussion_r41778455
  
--- Diff: 
plugins/network-elements/nuage-vsp/src/com/cloud/network/element/NuageVspElement.java
 ---
@@ -303,13 +422,17 @@ protected boolean canHandle(Network network, Service 
service) {
 }
 
 if (!_networkModel.isProviderForNetwork(getProvider(), 
network.getId())) {
-s_logger.debug("NuageElement is not a provider for network " + 
network.getDisplayText());
+if (s_logger.isDebugEnabled()) {
+s_logger.debug("NuageElement is not a provider for network 
" + network.getDisplayText());
--- End diff --

Please provide identifying/context information of Nuage element to assist 
debugging.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] cloudstack pull request: CLOUDSTACK-8832 : Update Nuage VSP plugin...

2015-10-12 Thread jburwell
Github user jburwell commented on a diff in the pull request:

https://github.com/apache/cloudstack/pull/801#discussion_r41778375
  
--- Diff: 
plugins/network-elements/nuage-vsp/src/com/cloud/network/element/NuageVspElement.java
 ---
@@ -205,6 +250,75 @@ public boolean implement(Network network, 
NetworkOffering offering, DeployDestin
 return false;
 }
 
+final boolean egressDefaultPolicy = 
offering.getEgressDefaultPolicy();
+Domain networkDomain = _domainDao.findById(network.getDomainId());
+boolean isFirewallServiceSupported = 
_networkModel.areServicesSupportedByNetworkOffering(offering.getId(), 
Service.Firewall);
+List dnsServers = _nuageVspManager.getDnsDetails(network);
+
+boolean isL2Network = false, isL3Network = false, isShared = false;
+String subnetUuid = network.getUuid();
+if (offering.getGuestType() == Network.GuestType.Shared) {
+isShared = true;
+subnetUuid = networkDomain.getUuid();
+} else if 
(_ntwkOfferingSrvcDao.areServicesSupportedByNetworkOffering(offering.getId(), 
Service.SourceNat)
+|| 
_ntwkOfferingSrvcDao.areServicesSupportedByNetworkOffering(offering.getId(), 
Service.StaticNat)
+|| 
_ntwkOfferingSrvcDao.areServicesSupportedByNetworkOffering(offering.getId(), 
Service.Connectivity)) {
+isL3Network = true;
+} else {
+isL2Network = true;
+}
+
+String preConfiguredDomainTemplateName = 
getPreConfiguredDomainTemplateName(network, offering);
+List firewallIngressRulesToApply =
+
_firewallRulesDao.listByNetworkPurposeTrafficType(network.getId(), 
FirewallRule.Purpose.Firewall, FirewallRule.TrafficType.Ingress);
+for (FirewallRuleVO rule : firewallIngressRulesToApply) {
+// load cidrs if any
+
rule.setSourceCidrList(_firewallRulesCidrsDao.getSourceCidrs(rule.getId()));
+}
+
+List firewallEgressRulesToApply =
+
_firewallRulesDao.listByNetworkPurposeTrafficType(network.getId(), 
FirewallRule.Purpose.Firewall, FirewallRule.TrafficType.Egress);
+for (FirewallRuleVO rule : firewallEgressRulesToApply) {
+// load cidrs if any
+
rule.setSourceCidrList(_firewallRulesCidrsDao.getSourceCidrs(rule.getId()));
+}
+
+List> ingressFirewallRules = 
Lists.transform(firewallIngressRulesToApply, new Function>() {
+@Override
+public Map apply(FirewallRuleVO 
firewallRuleVO) {
+return getACLRuleDetails(firewallRuleVO, 
egressDefaultPolicy);
+}
+});
+
+List> egressFirewallRules = 
Lists.transform(firewallEgressRulesToApply, new Function>() {
--- End diff --

What is the status of addressing this comment?


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] cloudstack pull request: CLOUDSTACK-8832 : Update Nuage VSP plugin...

2015-10-12 Thread jburwell
Github user jburwell commented on a diff in the pull request:

https://github.com/apache/cloudstack/pull/801#discussion_r41778472
  
--- Diff: 
plugins/network-elements/nuage-vsp/src/com/cloud/network/element/NuageVspElement.java
 ---
@@ -303,13 +422,17 @@ protected boolean canHandle(Network network, Service 
service) {
 }
 
 if (!_networkModel.isProviderForNetwork(getProvider(), 
network.getId())) {
-s_logger.debug("NuageElement is not a provider for network " + 
network.getDisplayText());
+if (s_logger.isDebugEnabled()) {
+s_logger.debug("NuageElement is not a provider for network 
" + network.getDisplayText());
+}
 return false;
 }
 
 if (service != null) {
 if 
(!_ntwkSrvcDao.canProviderSupportServiceInNetwork(network.getId(), service, 
getProvider())) {
-s_logger.debug("NuageElement can't provide the " + 
service.getName() + " service on network " + network.getDisplayText());
+if (s_logger.isDebugEnabled()) {
+s_logger.debug("NuageElement can't provide the " + 
service.getName() + " service on network " + network.getDisplayText());
--- End diff --

Please provide identifying/context information of Nuage element to assist 
debugging.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] cloudstack pull request: CLOUDSTACK-8832 : Update Nuage VSP plugin...

2015-10-12 Thread jburwell
Github user jburwell commented on a diff in the pull request:

https://github.com/apache/cloudstack/pull/801#discussion_r41778534
  
--- Diff: 
plugins/network-elements/nuage-vsp/src/com/cloud/network/element/NuageVspElement.java
 ---
@@ -368,18 +492,15 @@ public boolean applyStaticNats(Network config, List rules)
 sourceNatDetails.add(sourceNatDetail);
 }
 try {
-try {
-HostVO nuageVspHost = 
getNuageVspHost(config.getPhysicalNetworkId());
-ApplyStaticNatVspCommand cmd = new 
ApplyStaticNatVspCommand(networkDomain.getUuid(), vpcOrSubnetUuid, isL3Network, 
sourceNatDetails);
-ApplyStaticNatVspAnswer answer = 
(ApplyStaticNatVspAnswer)_agentMgr.easySend(nuageVspHost.getId(), cmd);
-if (answer == null || !answer.getResult()) {
-s_logger.error("ApplyStaticNatNuageVspCommand for 
network " + config.getUuid() + " failed");
-if ((null != answer) && (null != answer.getDetails())) 
{
-throw new 
ResourceUnavailableException(answer.getDetails(), Network.class, 
config.getId());
-}
+HostVO nuageVspHost = 
getNuageVspHost(config.getPhysicalNetworkId());
+ApplyStaticNatVspCommand.Builder cmdBuilder = new 
ApplyStaticNatVspCommand.Builder().networkDomainUuid(networkDomain.getUuid())
+
.networkUuid(config.getUuid()).vpcOrSubnetUuid(vpcOrSubnetUuid).isL3Network(isL3Network).isVpc(vpcId
 != null).staticNatDetails(sourceNatDetails);
+ApplyStaticNatVspAnswer answer = 
(ApplyStaticNatVspAnswer)_agentMgr.easySend(nuageVspHost.getId(), 
cmdBuilder.build());
+if (answer == null || !answer.getResult()) {
+s_logger.error("ApplyStaticNatNuageVspCommand for network 
" + config.getUuid() + " failed");
+if ((null != answer) && (null != answer.getDetails())) {
+throw new 
ResourceUnavailableException(answer.getDetails(), Network.class, 
config.getId());
 }
-} catch (Exception e) {
-s_logger.warn("Failed to apply static Nat in Vsp " + 
e.getMessage());
 }
 } catch (Exception e) {
--- End diff --

Why are all checked and unchecked exceptions being caught here?  Why not 
catch the subset of expected checked exceptions?


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] cloudstack pull request: CLOUDSTACK-8832 : Update Nuage VSP plugin...

2015-10-12 Thread jburwell
Github user jburwell commented on a diff in the pull request:

https://github.com/apache/cloudstack/pull/801#discussion_r41778623
  
--- Diff: 
plugins/network-elements/nuage-vsp/src/com/cloud/network/element/NuageVspElement.java
 ---
@@ -447,13 +568,95 @@ protected boolean applyACLRules(Network network, 
List

[GitHub] cloudstack pull request: CLOUDSTACK-8832 : Update Nuage VSP plugin...

2015-10-12 Thread jburwell
Github user jburwell commented on a diff in the pull request:

https://github.com/apache/cloudstack/pull/801#discussion_r41778678
  
--- Diff: 
plugins/network-elements/nuage-vsp/src/com/cloud/network/element/NuageVspElement.java
 ---
@@ -454,6 +563,80 @@ protected boolean applyACLRules(Network network, 
List rules) throws ResourceUnavailableException {
+if (rules == null || rules.isEmpty()) {
+s_logger.debug("No rules to apply. So, delete all the existing 
ACL in VSP from Subnet with uuid " + config.getUuid());
+} else {
+s_logger.debug("New rules has to applied. So, delete all the 
existing ACL in VSP from Subnet with uuid " + config.getUuid());
+}
+if (rules != null) {
+s_logger.debug("Handling applyNetworkACLs for network " + 
config.getName() + " with " + rules.size() + " Network ACLs");
+applyACLRules(config, rules, true, null, rules.isEmpty());
+}
+return true;
+}
+
+@Override
+public boolean implementVpc(Vpc vpc, DeployDestination dest, 
ReservationContext context) throws ConcurrentOperationException, 
ResourceUnavailableException, InsufficientCapacityException {
+return true;
+}
+
+@Override
+public boolean shutdownVpc(Vpc vpc, ReservationContext context) throws 
ConcurrentOperationException, ResourceUnavailableException {
+if (vpc.getState().equals(Vpc.State.Inactive)) {
+try {
+Domain vpcDomain = _domainDao.findById(vpc.getDomainId());
+HostVO nuageVspHost = 
getNuageVspHost(getPhysicalNetworkId(vpc.getZoneId()));
+String preConfiguredDomainTemplateName = 
_configDao.getValue(NuageVspManager.NuageVspVpcDomainTemplateName.key());
+ShutDownVpcVspCommand cmd = new 
ShutDownVpcVspCommand(vpcDomain.getUuid(), vpc.getUuid(), 
preConfiguredDomainTemplateName);
+ShutDownVpcVspAnswer answer = (ShutDownVpcVspAnswer) 
_agentMgr.easySend(nuageVspHost.getId(), cmd);
+if (answer == null || !answer.getResult()) {
+s_logger.error("ShutDownVpcVspCommand for VPC " + 
vpc.getUuid() + " failed");
+if ((null != answer) && (null != answer.getDetails())) 
{
+throw new 
ResourceUnavailableException(answer.getDetails(), Vpc.class, vpc.getId());
+}
+}
+} catch (Exception e) {
--- End diff --

What's the status of addressing this comment?


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] cloudstack pull request: CLOUDSTACK-8832 : Update Nuage VSP plugin...

2015-10-12 Thread jburwell
Github user jburwell commented on a diff in the pull request:

https://github.com/apache/cloudstack/pull/801#discussion_r41778652
  
--- Diff: 
plugins/network-elements/nuage-vsp/src/com/cloud/network/element/NuageVspElement.java
 ---
@@ -454,6 +563,80 @@ protected boolean applyACLRules(Network network, 
List rules) throws ResourceUnavailableException {
--- End diff --

@nlivens I apologize for the oversight.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] cloudstack pull request: CLOUDSTACK-8832 : Update Nuage VSP plugin...

2015-10-12 Thread jburwell
Github user jburwell commented on a diff in the pull request:

https://github.com/apache/cloudstack/pull/801#discussion_r41778777
  
--- Diff: 
plugins/network-elements/nuage-vsp/src/com/cloud/network/guru/NuageVspGuestNetworkGuru.java
 ---
@@ -114,7 +117,9 @@ public Network design(NetworkOffering offering, 
DeploymentPlan plan, Network use
 PhysicalNetworkVO physnet = 
_physicalNetworkDao.findById(plan.getPhysicalNetworkId());
 DataCenter dc = _dcDao.findById(plan.getDataCenterId());
 if (!canHandle(offering, dc.getNetworkType(), physnet)) {
-s_logger.debug("Refusing to design this network");
+if (s_logger.isDebugEnabled()) {
+s_logger.debug("Refusing to design this network");
--- End diff --

Please provide identifying/context information about the network for 
debugging purposes.  Also, why isn't logged as an ``ERROR``.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] cloudstack pull request: CLOUDSTACK-8832 : Update Nuage VSP plugin...

2015-10-12 Thread jburwell
Github user jburwell commented on a diff in the pull request:

https://github.com/apache/cloudstack/pull/801#discussion_r41778939
  
--- Diff: 
plugins/network-elements/nuage-vsp/src/com/cloud/network/guru/NuageVspGuestNetworkGuru.java
 ---
@@ -129,66 +134,94 @@ public Network design(NetworkOffering offering, 
DeploymentPlan plan, Network use
 
 @Override
 public Network implement(Network network, NetworkOffering offering, 
DeployDestination dest, ReservationContext context) throws 
InsufficientVirtualNetworkCapacityException {
+long networkId = network.getId();
+network = _networkDao.acquireInLockTable(network.getId(), 1200);
+if (network == null) {
+throw new ConcurrentOperationException("Unable to acquire lock 
on network " + networkId);
+}
 
-assert (network.getState() == State.Implementing) : "Why are we 
implementing " + network;
+NetworkVO implemented = null;
+try {
+assert (network.getState() == State.Implementing) : "Why are 
we implementing " + network;
+
+long dcId = dest.getDataCenter().getId();
+//Get physical network id
+Long physicalNetworkId = network.getPhysicalNetworkId();
+//Physical network id can be null in Guest Network in Basic 
zone, so locate the physical network
+if (physicalNetworkId == null) {
+physicalNetworkId = 
_networkModel.findPhysicalNetworkId(dcId, offering.getTags(), 
offering.getTrafficType());
+}
+implemented = new NetworkVO(network.getTrafficType(), 
network.getMode(), network.getBroadcastDomainType(), 
network.getNetworkOfferingId(), State.Allocated,
+network.getDataCenterId(), physicalNetworkId, 
offering.getRedundantRouter());
+if (network.getGateway() != null) {
+implemented.setGateway(network.getGateway());
+}
+if (network.getCidr() != null) {
+implemented.setCidr(network.getCidr());
+}
+List ipAddressRanges = new ArrayList();
+String virtualRouterIp = getVirtualRouterIP(network, 
ipAddressRanges);
+String networkUuid = implemented.getUuid();
+String tenantId = context.getDomain().getName() + "-" + 
context.getAccount().getAccountId();
+String broadcastUriStr = networkUuid + "/" + virtualRouterIp;
+
implemented.setBroadcastUri(Networks.BroadcastDomainType.Vsp.toUri(broadcastUriStr));
+
implemented.setBroadcastDomainType(Networks.BroadcastDomainType.Vsp);
+//Check if the network is associated to a VPC
+Long vpcId = network.getVpcId();
+boolean isVpc = (vpcId != null);
+//Check owner of the Network
+Domain networksDomain = 
_domainDao.findById(network.getDomainId());
+//Get the Account details and find the type
+AccountVO networksAccount = 
_accountDao.findById(network.getAccountId());
+if (networksAccount.getType() == Account.ACCOUNT_TYPE_PROJECT) 
{
+String errorMessage = "CS project support is not yet 
implemented in NuageVsp";
+if (s_logger.isDebugEnabled()) {
--- End diff --

Why not log to ``ERROR`` instead of ``DEBUG`` as it appears that this 
condition has halted processing?


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] cloudstack pull request: CLOUDSTACK-8832 : Update Nuage VSP plugin...

2015-10-12 Thread jburwell
Github user jburwell commented on a diff in the pull request:

https://github.com/apache/cloudstack/pull/801#discussion_r41778993
  
--- Diff: 
plugins/network-elements/nuage-vsp/src/com/cloud/network/guru/NuageVspGuestNetworkGuru.java
 ---
@@ -129,66 +134,94 @@ public Network design(NetworkOffering offering, 
DeploymentPlan plan, Network use
 
 @Override
 public Network implement(Network network, NetworkOffering offering, 
DeployDestination dest, ReservationContext context) throws 
InsufficientVirtualNetworkCapacityException {
+long networkId = network.getId();
+network = _networkDao.acquireInLockTable(network.getId(), 1200);
+if (network == null) {
+throw new ConcurrentOperationException("Unable to acquire lock 
on network " + networkId);
+}
 
-assert (network.getState() == State.Implementing) : "Why are we 
implementing " + network;
+NetworkVO implemented = null;
+try {
+assert (network.getState() == State.Implementing) : "Why are 
we implementing " + network;
+
+long dcId = dest.getDataCenter().getId();
+//Get physical network id
+Long physicalNetworkId = network.getPhysicalNetworkId();
+//Physical network id can be null in Guest Network in Basic 
zone, so locate the physical network
+if (physicalNetworkId == null) {
+physicalNetworkId = 
_networkModel.findPhysicalNetworkId(dcId, offering.getTags(), 
offering.getTrafficType());
+}
+implemented = new NetworkVO(network.getTrafficType(), 
network.getMode(), network.getBroadcastDomainType(), 
network.getNetworkOfferingId(), State.Allocated,
+network.getDataCenterId(), physicalNetworkId, 
offering.getRedundantRouter());
+if (network.getGateway() != null) {
+implemented.setGateway(network.getGateway());
+}
+if (network.getCidr() != null) {
+implemented.setCidr(network.getCidr());
+}
+List ipAddressRanges = new ArrayList();
+String virtualRouterIp = getVirtualRouterIP(network, 
ipAddressRanges);
+String networkUuid = implemented.getUuid();
+String tenantId = context.getDomain().getName() + "-" + 
context.getAccount().getAccountId();
+String broadcastUriStr = networkUuid + "/" + virtualRouterIp;
+
implemented.setBroadcastUri(Networks.BroadcastDomainType.Vsp.toUri(broadcastUriStr));
+
implemented.setBroadcastDomainType(Networks.BroadcastDomainType.Vsp);
+//Check if the network is associated to a VPC
+Long vpcId = network.getVpcId();
+boolean isVpc = (vpcId != null);
+//Check owner of the Network
+Domain networksDomain = 
_domainDao.findById(network.getDomainId());
+//Get the Account details and find the type
+AccountVO networksAccount = 
_accountDao.findById(network.getAccountId());
+if (networksAccount.getType() == Account.ACCOUNT_TYPE_PROJECT) 
{
+String errorMessage = "CS project support is not yet 
implemented in NuageVsp";
--- End diff --

It would be useful to add information about the account and device being 
configured in order to assist with operational debugging.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] cloudstack pull request: CLOUDSTACK-8832 : Update Nuage VSP plugin...

2015-10-12 Thread jburwell
Github user jburwell commented on a diff in the pull request:

https://github.com/apache/cloudstack/pull/801#discussion_r41779077
  
--- Diff: 
plugins/network-elements/nuage-vsp/src/com/cloud/network/guru/NuageVspGuestNetworkGuru.java
 ---
@@ -129,66 +134,94 @@ public Network design(NetworkOffering offering, 
DeploymentPlan plan, Network use
 
 @Override
 public Network implement(Network network, NetworkOffering offering, 
DeployDestination dest, ReservationContext context) throws 
InsufficientVirtualNetworkCapacityException {
+long networkId = network.getId();
+network = _networkDao.acquireInLockTable(network.getId(), 1200);
+if (network == null) {
+throw new ConcurrentOperationException("Unable to acquire lock 
on network " + networkId);
+}
 
-assert (network.getState() == State.Implementing) : "Why are we 
implementing " + network;
+NetworkVO implemented = null;
+try {
+assert (network.getState() == State.Implementing) : "Why are 
we implementing " + network;
+
+long dcId = dest.getDataCenter().getId();
+//Get physical network id
+Long physicalNetworkId = network.getPhysicalNetworkId();
+//Physical network id can be null in Guest Network in Basic 
zone, so locate the physical network
+if (physicalNetworkId == null) {
+physicalNetworkId = 
_networkModel.findPhysicalNetworkId(dcId, offering.getTags(), 
offering.getTrafficType());
+}
+implemented = new NetworkVO(network.getTrafficType(), 
network.getMode(), network.getBroadcastDomainType(), 
network.getNetworkOfferingId(), State.Allocated,
+network.getDataCenterId(), physicalNetworkId, 
offering.getRedundantRouter());
+if (network.getGateway() != null) {
+implemented.setGateway(network.getGateway());
+}
+if (network.getCidr() != null) {
+implemented.setCidr(network.getCidr());
+}
+List ipAddressRanges = new ArrayList();
+String virtualRouterIp = getVirtualRouterIP(network, 
ipAddressRanges);
+String networkUuid = implemented.getUuid();
+String tenantId = context.getDomain().getName() + "-" + 
context.getAccount().getAccountId();
+String broadcastUriStr = networkUuid + "/" + virtualRouterIp;
+
implemented.setBroadcastUri(Networks.BroadcastDomainType.Vsp.toUri(broadcastUriStr));
+
implemented.setBroadcastDomainType(Networks.BroadcastDomainType.Vsp);
+//Check if the network is associated to a VPC
+Long vpcId = network.getVpcId();
+boolean isVpc = (vpcId != null);
+//Check owner of the Network
+Domain networksDomain = 
_domainDao.findById(network.getDomainId());
+//Get the Account details and find the type
+AccountVO networksAccount = 
_accountDao.findById(network.getAccountId());
+if (networksAccount.getType() == Account.ACCOUNT_TYPE_PROJECT) 
{
+String errorMessage = "CS project support is not yet 
implemented in NuageVsp";
+if (s_logger.isDebugEnabled()) {
+s_logger.debug(errorMessage);
+}
+throw new 
InsufficientVirtualNetworkCapacityException(errorMessage, Account.class, 
network.getAccountId());
+}
+String vpcName = null;
+String vpcUuid = null;
+String preConfiguredDomainTemplateName = 
NuageVspUtil.getPreConfiguredDomainTemplateName(_configDao, network, offering);
+boolean isSharedNetwork = offering.getGuestType() == 
GuestType.Shared;
+boolean isL3Network = !isVpc && (isSharedNetwork || 
isL3Network(network));
 
-long dcId = dest.getDataCenter().getId();
-//Get physical network id
-Long physicalNetworkId = network.getPhysicalNetworkId();
-//Physical network id can be null in Guest Network in Basic zone, 
so locate the physical network
-if (physicalNetworkId == null) {
-physicalNetworkId = _networkModel.findPhysicalNetworkId(dcId, 
offering.getTags(), offering.getTrafficType());
-}
-NetworkVO implemented = new NetworkVO(network.getTrafficType(), 
network.getMode(), network.getBroadcastDomainType(), 
network.getNetworkOfferingId(), State.Allocated,
-network.getDataCenterId(), physicalNetworkId, 
offering.getRedundantRouter());
-if (network.getGateway() != null) {
-implemented.setGateway(ne

[GitHub] cloudstack pull request: CLOUDSTACK-8832 : Update Nuage VSP plugin...

2015-10-12 Thread jburwell
Github user jburwell commented on a diff in the pull request:

https://github.com/apache/cloudstack/pull/801#discussion_r41779218
  
--- Diff: 
plugins/network-elements/nuage-vsp/src/com/cloud/network/guru/NuageVspGuestNetworkGuru.java
 ---
@@ -322,35 +389,52 @@ public void shutdown(NetworkProfile profile, 
NetworkOffering offering) {
 
 @Override
 public boolean trash(Network network, NetworkOffering offering) {
-
-s_logger.debug("Handling trash() call back to delete the network " 
+ network.getName() + " with uuid " + network.getUuid() + " from VSP");
-long domainId = network.getDomainId();
-Domain domain = _domainDao.findById(domainId);
-Long vpcId = network.getVpcId();
-String vpcUuid = null;
-if (vpcId != null) {
-Vpc vpcObj = _vpcDao.findById(vpcId);
-vpcUuid = vpcObj.getUuid();
+long networkId = network.getId();
+network = _networkDao.acquireInLockTable(networkId, 1200);
+if (network == null) {
+throw new ConcurrentOperationException("Unable to acquire lock 
on network " + networkId);
 }
+
 try {
-HostVO nuageVspHost = 
getNuageVspHost(network.getPhysicalNetworkId());
-TrashNetworkVspCommand cmd = new 
TrashNetworkVspCommand(domain.getUuid(), network.getUuid(), 
isL3Network(offering.getId()), vpcUuid);
-TrashNetworkVspAnswer answer = 
(TrashNetworkVspAnswer)_agentMgr.easySend(nuageVspHost.getId(), cmd);
-if (answer == null || !answer.getResult()) {
-s_logger.error("TrashNetworkNuageVspCommand for network " 
+ network.getUuid() + " failed");
-if ((null != answer) && (null != answer.getDetails())) {
-s_logger.error(answer.getDetails());
+if (s_logger.isDebugEnabled()) {
+s_logger.debug("Handling trash() call back to delete the 
network " + network.getName() + " with uuid " + network.getUuid() + " from 
VSP");
+}
+long domainId = network.getDomainId();
+Domain domain = _domainDao.findById(domainId);
+boolean isL3Network = isL3Network(network);
+boolean isSharedNetwork = offering.getGuestType() == 
GuestType.Shared;
+Long vpcId = network.getVpcId();
+String vpcUuid = null;
+if (vpcId != null) {
+Vpc vpcObj = _vpcDao.findById(vpcId);
+vpcUuid = vpcObj.getUuid();
+}
+
+String preConfiguredDomainTemplateName = 
NuageVspUtil.getPreConfiguredDomainTemplateName(_configDao, network, offering);
+try {
+HostVO nuageVspHost = 
getNuageVspHost(network.getPhysicalNetworkId());
+TrashNetworkVspCommand.Builder cmdBuilder = new 
TrashNetworkVspCommand.Builder().domainUuid(domain.getUuid()).networkUuid(network.getUuid())
+
.isL3Network(isL3Network).isSharedNetwork(isSharedNetwork).vpcUuid(vpcUuid).domainTemplateName(preConfiguredDomainTemplateName);
+TrashNetworkVspAnswer answer = 
(TrashNetworkVspAnswer)_agentMgr.easySend(nuageVspHost.getId(), 
cmdBuilder.build());
+if (answer == null || !answer.getResult()) {
+s_logger.error("TrashNetworkNuageVspCommand for 
network " + network.getUuid() + " failed");
+if ((null != answer) && (null != answer.getDetails())) 
{
+s_logger.error(answer.getDetails());
+}
 }
+} catch (Exception e) {
--- End diff --

Why are all checked and unchecked exceptions being caught here?  Why not 
catch the subset of expected checked exceptions?


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] cloudstack pull request: CLOUDSTACK-8832 : Update Nuage VSP plugin...

2015-10-12 Thread jburwell
Github user jburwell commented on a diff in the pull request:

https://github.com/apache/cloudstack/pull/801#discussion_r41779432
  
--- Diff: 
plugins/network-elements/nuage-vsp/src/com/cloud/network/guru/NuageVspGuestNetworkGuru.java
 ---
@@ -358,19 +442,28 @@ private String getVirtualRouterIP(Network network, 
Collection addressRan
 Set allIPsInCidr = NetUtils.getAllIpsFromCidr(subnet, 
cidrSize, new HashSet());
 
 if (allIPsInCidr.size() > 3) {
+//get the second IP and see if it the networks GatewayIP
 Iterator ipIterator = allIPsInCidr.iterator();
 long vip = ipIterator.next();
 if (NetUtils.ip2Long(network.getGateway()) == vip) {
-s_logger.debug("Gateway of the Network(" + 
network.getUuid() + ") has the first IP " + NetUtils.long2Ip(vip));
+if (s_logger.isDebugEnabled()) {
+s_logger.debug("Gateway of the Network(" + 
network.getName() + ") has the first IP " + NetUtils.long2Ip(vip));
+}
 vip = ipIterator.next();
 virtualRouterIp = NetUtils.long2Ip(vip);
-s_logger.debug("So, reserving the 2nd IP " + 
virtualRouterIp + " for the Virtual Router IP in Network(" + network.getUuid() 
+ ")");
+if (s_logger.isDebugEnabled()) {
+s_logger.debug("So, reserving the 2nd IP " + 
virtualRouterIp + " for the Virtual Router IP in Network(" + network.getName() 
+ ")");
--- End diff --

This log message assumes context from the previous message.  This message 
will likely not appear directly after the previous nor will is it easy to 
associate with the previous message.  Please change the message to usable 
without information from the previous message.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] cloudstack pull request: CLOUDSTACK-8832 : Update Nuage VSP plugin...

2015-10-12 Thread jburwell
Github user jburwell commented on a diff in the pull request:

https://github.com/apache/cloudstack/pull/801#discussion_r41779931
  
--- Diff: 
plugins/network-elements/nuage-vsp/src/com/cloud/network/manager/NuageVspManagerImpl.java
 ---
@@ -67,25 +74,76 @@
 import com.cloud.network.dao.PhysicalNetworkVO;
 import com.cloud.network.resource.NuageVspResource;
 import com.cloud.network.sync.NuageVspSync;
+import com.cloud.network.vpc.VpcManager;
+import com.cloud.network.vpc.VpcOffering;
+import com.cloud.network.vpc.VpcOfferingServiceMapVO;
+import com.cloud.network.vpc.VpcOfferingVO;
 import com.cloud.network.vpc.dao.VpcDao;
 import com.cloud.network.vpc.dao.VpcOfferingDao;
 import com.cloud.network.vpc.dao.VpcOfferingServiceMapDao;
+import com.cloud.network.vpc.dao.VpcServiceMapDao;
+import com.cloud.offering.NetworkOffering;
+import com.cloud.offerings.NetworkOfferingServiceMapVO;
+import com.cloud.offerings.NetworkOfferingVO;
+import com.cloud.offerings.dao.NetworkOfferingDao;
+import com.cloud.offerings.dao.NetworkOfferingServiceMapDao;
 import com.cloud.resource.ResourceManager;
 import com.cloud.resource.ResourceState;
 import com.cloud.resource.ServerResource;
+import com.cloud.user.AccountManager;
+import com.cloud.user.DomainManager;
 import com.cloud.utils.component.ManagerBase;
+import com.cloud.utils.db.DB;
 import com.cloud.utils.db.Transaction;
 import com.cloud.utils.db.TransactionCallback;
+import com.cloud.utils.db.TransactionCallbackNoReturn;
 import com.cloud.utils.db.TransactionStatus;
 import com.cloud.utils.exception.CloudRuntimeException;
+import com.cloud.utils.fsm.StateListener;
+import com.cloud.utils.fsm.StateMachine2;
+import com.google.common.base.MoreObjects;
+import com.google.common.base.Strings;
+import com.google.common.collect.Maps;
+import com.google.common.collect.Sets;
+import net.nuage.vsp.acs.NuageVspPluginClientLoader;
+import org.apache.cloudstack.framework.config.ConfigKey;
+import org.apache.cloudstack.framework.config.Configurable;
+import org.apache.cloudstack.framework.config.dao.ConfigurationDao;
+import org.apache.cloudstack.framework.config.impl.ConfigurationVO;
+import org.apache.cloudstack.framework.messagebus.MessageBus;
+import org.apache.cloudstack.framework.messagebus.MessageSubscriber;
+import org.apache.cloudstack.network.ExternalNetworkDeviceManager;
+import org.apache.commons.codec.binary.Base64;
+import org.apache.commons.collections.CollectionUtils;
+import org.apache.log4j.Logger;
+
+import javax.ejb.Local;
+import javax.inject.Inject;
+import javax.naming.ConfigurationException;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+import java.util.StringTokenizer;
+import java.util.UUID;
+import java.util.concurrent.ScheduledExecutorService;
+
+import static com.cloud.agent.api.sync.SyncNuageVspCmsIdCommand.SyncType;
 
 @Local(value = {NuageVspManager.class})
-public class NuageVspManagerImpl extends ManagerBase implements 
NuageVspManager, Configurable {
+public class NuageVspManagerImpl extends ManagerBase implements 
NuageVspManager, Configurable, StateListener {
 
 private static final Logger s_logger = 
Logger.getLogger(NuageVspManagerImpl.class);
 
 private static final int ONE_MINUTE_MULTIPLIER = 60 * 1000;
 
+private static final Set NUAGE_VSP_PROVIDERS;
+private static final Map> 
NUAGE_VSP_VPC_SERVICE_MAP;
+private static final ConfigKey[] NUAGE_VSP_CONFIG_KEYS = new 
ConfigKey[] { NuageVspConfigDns, NuageVspDnsExternal, NuageVspConfigGateway,
--- End diff --

Why not use an ``ImmutableSet`` instead of an array?  An ``final`` array is 
mutable and does not guarantee element uniqueness.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] cloudstack pull request: CLOUDSTACK-8832 : Update Nuage VSP plugin...

2015-10-12 Thread jburwell
Github user jburwell commented on a diff in the pull request:

https://github.com/apache/cloudstack/pull/801#discussion_r41779445
  
--- Diff: 
plugins/network-elements/nuage-vsp/src/com/cloud/network/guru/NuageVspGuestNetworkGuru.java
 ---
@@ -358,19 +442,28 @@ private String getVirtualRouterIP(Network network, 
Collection addressRan
 Set allIPsInCidr = NetUtils.getAllIpsFromCidr(subnet, 
cidrSize, new HashSet());
 
 if (allIPsInCidr.size() > 3) {
+//get the second IP and see if it the networks GatewayIP
 Iterator ipIterator = allIPsInCidr.iterator();
 long vip = ipIterator.next();
 if (NetUtils.ip2Long(network.getGateway()) == vip) {
-s_logger.debug("Gateway of the Network(" + 
network.getUuid() + ") has the first IP " + NetUtils.long2Ip(vip));
+if (s_logger.isDebugEnabled()) {
+s_logger.debug("Gateway of the Network(" + 
network.getName() + ") has the first IP " + NetUtils.long2Ip(vip));
+}
 vip = ipIterator.next();
 virtualRouterIp = NetUtils.long2Ip(vip);
-s_logger.debug("So, reserving the 2nd IP " + 
virtualRouterIp + " for the Virtual Router IP in Network(" + network.getUuid() 
+ ")");
+if (s_logger.isDebugEnabled()) {
+s_logger.debug("So, reserving the 2nd IP " + 
virtualRouterIp + " for the Virtual Router IP in Network(" + network.getName() 
+ ")");
+}
 } else {
 virtualRouterIp = NetUtils.long2Ip(vip);
-s_logger.debug("1nd IP is not used as the gateway IP. So, 
reserving" + virtualRouterIp + " for the Virtual Router IP for " + "Network(" + 
network.getUuid() + ")");
+if (s_logger.isDebugEnabled()) {
+s_logger.debug("1nd IP is not used as the gateway IP. 
So, reserving" + virtualRouterIp + " for the Virtual Router IP for " + 
"Network(" + network.getName() + ")");
--- End diff --

This log message assumes context from the previous message.  This message 
will likely not appear directly after the previous nor will is it easy to 
associate with the previous message.  Please change the message to usable 
without information from the previous message.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] cloudstack pull request: CLOUDSTACK-8832 : Update Nuage VSP plugin...

2015-10-12 Thread jburwell
Github user jburwell commented on a diff in the pull request:

https://github.com/apache/cloudstack/pull/801#discussion_r41780074
  
--- Diff: 
plugins/network-elements/nuage-vsp/src/com/cloud/network/manager/NuageVspManagerImpl.java
 ---
@@ -109,12 +163,49 @@
 @Inject
 VpcDao _vpcDao;
 @Inject
-NuageVspDao nuageVspDao;
+VpcManager _vpcManager;
+@Inject
+NuageVspDao _nuageVspDao;
+@Inject
+NuageVspSync _nuageVspSync;
+@Inject
+DataCenterDao _dataCenterDao;
+@Inject
+ConfigurationDao _configDao;
+@Inject
+NetworkModel _ntwkModel;
+@Inject
+AccountManager _accountMgr;
+@Inject
+IPAddressDao _ipAddressDao;
+@Inject
+FirewallRulesDao _firewallDao;
+@Inject
+VpcServiceMapDao _vpcSrvcDao;
+@Inject
+AgentManager _agentMgr;
+@Inject
+private DomainDao _domainDao;
 @Inject
-NuageVspSync nuageVspSync;
+NetworkOfferingDao _networkOfferingDao;
+@Inject
+NetworkOfferingServiceMapDao _networkOfferingServiceMapDao;
 
 private ScheduledExecutorService scheduler;
 
+@Inject
+MessageBus _messageBus;
+
+static {
+NUAGE_VSP_PROVIDERS = Sets.newHashSet(Network.Provider.NuageVsp);
+NUAGE_VSP_VPC_SERVICE_MAP = Maps.newHashMap();
--- End diff --

Use an ``ImmutableMap`` to ensure the constant cannot be accidentally 
modified.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] cloudstack pull request: CLOUDSTACK-8832 : Update Nuage VSP plugin...

2015-10-12 Thread jburwell
Github user jburwell commented on a diff in the pull request:

https://github.com/apache/cloudstack/pull/801#discussion_r41780040
  
--- Diff: 
plugins/network-elements/nuage-vsp/src/com/cloud/network/manager/NuageVspManagerImpl.java
 ---
@@ -109,12 +163,49 @@
 @Inject
 VpcDao _vpcDao;
 @Inject
-NuageVspDao nuageVspDao;
+VpcManager _vpcManager;
+@Inject
+NuageVspDao _nuageVspDao;
+@Inject
+NuageVspSync _nuageVspSync;
+@Inject
+DataCenterDao _dataCenterDao;
+@Inject
+ConfigurationDao _configDao;
+@Inject
+NetworkModel _ntwkModel;
+@Inject
+AccountManager _accountMgr;
+@Inject
+IPAddressDao _ipAddressDao;
+@Inject
+FirewallRulesDao _firewallDao;
+@Inject
+VpcServiceMapDao _vpcSrvcDao;
+@Inject
+AgentManager _agentMgr;
+@Inject
+private DomainDao _domainDao;
 @Inject
-NuageVspSync nuageVspSync;
+NetworkOfferingDao _networkOfferingDao;
+@Inject
+NetworkOfferingServiceMapDao _networkOfferingServiceMapDao;
 
 private ScheduledExecutorService scheduler;
 
+@Inject
+MessageBus _messageBus;
+
+static {
+NUAGE_VSP_PROVIDERS = Sets.newHashSet(Network.Provider.NuageVsp);
--- End diff --

Use an ``ImmutableSet`` to ensure that the constant cannot be accidentally 
modified.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] cloudstack pull request: CLOUDSTACK-8832 : Update Nuage VSP plugin...

2015-10-12 Thread jburwell
Github user jburwell commented on a diff in the pull request:

https://github.com/apache/cloudstack/pull/801#discussion_r41780153
  
--- Diff: 
plugins/network-elements/nuage-vsp/src/com/cloud/network/manager/NuageVspManagerImpl.java
 ---
@@ -122,13 +213,13 @@
 cmdList.add(DeleteNuageVspDeviceCmd.class);
 cmdList.add(ListNuageVspDevicesCmd.class);
 cmdList.add(IssueNuageVspResourceRequestCmd.class);
-
+cmdList.add(UpdateNuageVspDeviceCmd.class);
--- End diff --

Consider using ``com.google.guava.collect.Lists#newHashMap`` for a more 
succinct way to build the list.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] cloudstack pull request: CLOUDSTACK-8832 : Update Nuage VSP plugin...

2015-10-12 Thread jburwell
Github user jburwell commented on a diff in the pull request:

https://github.com/apache/cloudstack/pull/801#discussion_r41780424
  
--- Diff: 
plugins/network-elements/nuage-vsp/src/com/cloud/network/manager/NuageVspManagerImpl.java
 ---
@@ -152,50 +243,179 @@ public NuageVspDeviceVO 
addNuageVspDevice(AddNuageVspDeviceCmd cmd) {
 throw new CloudRuntimeException("A NuageVsp device is already 
configured on this physical network");
 }
 
-Map params = new HashMap();
-params.put("guid", UUID.randomUUID().toString());
-params.put("zoneId", 
String.valueOf(physicalNetwork.getDataCenterId()));
-params.put("physicalNetworkId", 
String.valueOf(physicalNetwork.getId()));
-params.put("name", "Nuage VSD - " + cmd.getHostName());
-params.put("hostname", cmd.getHostName());
-params.put("cmsuser", cmd.getUserName());
-String cmsUserPasswordBase64 = 
org.apache.commons.codec.binary.StringUtils.newStringUtf8(Base64.encodeBase64(cmd.getPassword().getBytes(Charset.forName("UTF-8";
-params.put("cmsuserpass", cmsUserPasswordBase64);
-int port = cmd.getPort();
-if (0 == port) {
-port = 443;
-}
-params.put("port", String.valueOf(port));
-params.put("apirelativepath", "/nuage/api/" + cmd.getApiVersion());
-params.put("retrycount", String.valueOf(cmd.getApiRetryCount()));
-params.put("retryinterval", 
String.valueOf(cmd.getApiRetryInterval()));
+try {
+NuageVspPluginClientLoader clientLoader = 
NuageVspPluginClientLoader.getClientLoader(null, null, 1, 1, null);
 
-Map hostdetails = new HashMap();
-hostdetails.putAll(params);
+Map clientDefaults = 
clientLoader.getNuageVspManagerClient().getClientDefaults();
+String apiVersion = 
MoreObjects.firstNonNull(cmd.getApiVersion(), (String) 
clientDefaults.get("CURRENT_API_VERSION"));
+if 
(!clientLoader.getNuageVspManagerClient().isSupportedApiVersion(apiVersion)) {
+throw new CloudRuntimeException("Unsupported API version : 
" + apiVersion);
+}
 
-try {
+Map params = new HashMap();
+params.put("guid", UUID.randomUUID().toString());
+params.put("zoneId", 
String.valueOf(physicalNetwork.getDataCenterId()));
+params.put("physicalNetworkId", 
String.valueOf(physicalNetwork.getId()));
+params.put("name", "Nuage VSD - " + cmd.getHostName());
+params.put("hostname", cmd.getHostName());
+params.put("cmsuser", cmd.getUserName());
+String cmsUserPasswordBase64 = 
org.apache.commons.codec.binary.StringUtils.newStringUtf8(Base64.encodeBase64(cmd.getPassword().getBytes()));
+params.put("cmsuserpass", cmsUserPasswordBase64);
+int port = cmd.getPort();
+if (0 == port) {
+port = 8443;
+}
+params.put("port", String.valueOf(port));
+params.put("apiversion", apiVersion);
+params.put("apirelativepath", "/nuage/api/" + apiVersion);
+params.put("retrycount", 
String.valueOf(MoreObjects.firstNonNull(cmd.getApiRetryCount(), 
clientDefaults.get("DEFAULT_API_RETRY_COUNT";
+params.put("retryinterval", 
String.valueOf(MoreObjects.firstNonNull(cmd.getApiRetryInterval(), 
clientDefaults.get("DEFAULT_API_RETRY_INTERVAL";
+
+final Map hostdetails = new HashMap();
+hostdetails.putAll(params);
 resource.configure(cmd.getHostName(), hostdetails);
 
-final Host host = _resourceMgr.addHost(zoneId, resource, 
Host.Type.L2Networking, params);
+Host host = _resourceMgr.addHost(zoneId, resource, 
Host.Type.L2Networking, params);
 if (host != null) {
-return Transaction.execute(new 
TransactionCallback() {
-@Override
-public NuageVspDeviceVO 
doInTransaction(TransactionStatus status) {
-NuageVspDeviceVO nuageVspDevice = new 
NuageVspDeviceVO(host.getId(), physicalNetworkId, 
ntwkSvcProvider.getProviderName(), deviceName);
-_nuageVspDao.persist(nuageVspDevice);
+NuageVspDeviceVO nuageVspDevice = new 
NuageVspDeviceVO(host.getId(), physicalNetworkId, 
ntwkSvc

[GitHub] cloudstack pull request: CLOUDSTACK-8832 : Update Nuage VSP plugin...

2015-10-12 Thread jburwell
Github user jburwell commented on a diff in the pull request:

https://github.com/apache/cloudstack/pull/801#discussion_r41803394
  
--- Diff: 
plugins/network-elements/nuage-vsp/src/com/cloud/network/manager/NuageVspManagerImpl.java
 ---
@@ -152,50 +243,179 @@ public NuageVspDeviceVO 
addNuageVspDevice(AddNuageVspDeviceCmd cmd) {
 throw new CloudRuntimeException("A NuageVsp device is already 
configured on this physical network");
 }
 
-Map params = new HashMap();
-params.put("guid", UUID.randomUUID().toString());
-params.put("zoneId", 
String.valueOf(physicalNetwork.getDataCenterId()));
-params.put("physicalNetworkId", 
String.valueOf(physicalNetwork.getId()));
-params.put("name", "Nuage VSD - " + cmd.getHostName());
-params.put("hostname", cmd.getHostName());
-params.put("cmsuser", cmd.getUserName());
-String cmsUserPasswordBase64 = 
org.apache.commons.codec.binary.StringUtils.newStringUtf8(Base64.encodeBase64(cmd.getPassword().getBytes(Charset.forName("UTF-8";
-params.put("cmsuserpass", cmsUserPasswordBase64);
-int port = cmd.getPort();
-if (0 == port) {
-port = 443;
-}
-params.put("port", String.valueOf(port));
-params.put("apirelativepath", "/nuage/api/" + cmd.getApiVersion());
-params.put("retrycount", String.valueOf(cmd.getApiRetryCount()));
-params.put("retryinterval", 
String.valueOf(cmd.getApiRetryInterval()));
+try {
+NuageVspPluginClientLoader clientLoader = 
NuageVspPluginClientLoader.getClientLoader(null, null, 1, 1, null);
 
-Map hostdetails = new HashMap();
-hostdetails.putAll(params);
+Map clientDefaults = 
clientLoader.getNuageVspManagerClient().getClientDefaults();
+String apiVersion = 
MoreObjects.firstNonNull(cmd.getApiVersion(), (String) 
clientDefaults.get("CURRENT_API_VERSION"));
+if 
(!clientLoader.getNuageVspManagerClient().isSupportedApiVersion(apiVersion)) {
+throw new CloudRuntimeException("Unsupported API version : 
" + apiVersion);
+}
 
-try {
+Map params = new HashMap();
+params.put("guid", UUID.randomUUID().toString());
+params.put("zoneId", 
String.valueOf(physicalNetwork.getDataCenterId()));
+params.put("physicalNetworkId", 
String.valueOf(physicalNetwork.getId()));
+params.put("name", "Nuage VSD - " + cmd.getHostName());
+params.put("hostname", cmd.getHostName());
+params.put("cmsuser", cmd.getUserName());
+String cmsUserPasswordBase64 = 
org.apache.commons.codec.binary.StringUtils.newStringUtf8(Base64.encodeBase64(cmd.getPassword().getBytes()));
+params.put("cmsuserpass", cmsUserPasswordBase64);
+int port = cmd.getPort();
+if (0 == port) {
+port = 8443;
+}
+params.put("port", String.valueOf(port));
+params.put("apiversion", apiVersion);
+params.put("apirelativepath", "/nuage/api/" + apiVersion);
+params.put("retrycount", 
String.valueOf(MoreObjects.firstNonNull(cmd.getApiRetryCount(), 
clientDefaults.get("DEFAULT_API_RETRY_COUNT";
+params.put("retryinterval", 
String.valueOf(MoreObjects.firstNonNull(cmd.getApiRetryInterval(), 
clientDefaults.get("DEFAULT_API_RETRY_INTERVAL";
+
+final Map hostdetails = new HashMap();
+hostdetails.putAll(params);
 resource.configure(cmd.getHostName(), hostdetails);
 
-final Host host = _resourceMgr.addHost(zoneId, resource, 
Host.Type.L2Networking, params);
+Host host = _resourceMgr.addHost(zoneId, resource, 
Host.Type.L2Networking, params);
 if (host != null) {
-return Transaction.execute(new 
TransactionCallback() {
-@Override
-public NuageVspDeviceVO 
doInTransaction(TransactionStatus status) {
-NuageVspDeviceVO nuageVspDevice = new 
NuageVspDeviceVO(host.getId(), physicalNetworkId, 
ntwkSvcProvider.getProviderName(), deviceName);
-_nuageVspDao.persist(nuageVspDevice);
+NuageVspDeviceVO nuageVspDevice = new 
NuageVspDeviceVO(host.getId(), physicalNetworkId, 
ntwkSvc

[GitHub] cloudstack pull request: CLOUDSTACK-8832 : Update Nuage VSP plugin...

2015-10-12 Thread jburwell
Github user jburwell commented on a diff in the pull request:

https://github.com/apache/cloudstack/pull/801#discussion_r41803470
  
--- Diff: 
plugins/network-elements/nuage-vsp/src/com/cloud/network/manager/NuageVspManagerImpl.java
 ---
@@ -152,50 +243,179 @@ public NuageVspDeviceVO 
addNuageVspDevice(AddNuageVspDeviceCmd cmd) {
 throw new CloudRuntimeException("A NuageVsp device is already 
configured on this physical network");
 }
 
-Map params = new HashMap();
-params.put("guid", UUID.randomUUID().toString());
-params.put("zoneId", 
String.valueOf(physicalNetwork.getDataCenterId()));
-params.put("physicalNetworkId", 
String.valueOf(physicalNetwork.getId()));
-params.put("name", "Nuage VSD - " + cmd.getHostName());
-params.put("hostname", cmd.getHostName());
-params.put("cmsuser", cmd.getUserName());
-String cmsUserPasswordBase64 = 
org.apache.commons.codec.binary.StringUtils.newStringUtf8(Base64.encodeBase64(cmd.getPassword().getBytes(Charset.forName("UTF-8";
-params.put("cmsuserpass", cmsUserPasswordBase64);
-int port = cmd.getPort();
-if (0 == port) {
-port = 443;
-}
-params.put("port", String.valueOf(port));
-params.put("apirelativepath", "/nuage/api/" + cmd.getApiVersion());
-params.put("retrycount", String.valueOf(cmd.getApiRetryCount()));
-params.put("retryinterval", 
String.valueOf(cmd.getApiRetryInterval()));
+try {
+NuageVspPluginClientLoader clientLoader = 
NuageVspPluginClientLoader.getClientLoader(null, null, 1, 1, null);
 
-Map hostdetails = new HashMap();
-hostdetails.putAll(params);
+Map clientDefaults = 
clientLoader.getNuageVspManagerClient().getClientDefaults();
+String apiVersion = 
MoreObjects.firstNonNull(cmd.getApiVersion(), (String) 
clientDefaults.get("CURRENT_API_VERSION"));
+if 
(!clientLoader.getNuageVspManagerClient().isSupportedApiVersion(apiVersion)) {
+throw new CloudRuntimeException("Unsupported API version : 
" + apiVersion);
+}
 
-try {
+Map params = new HashMap();
+params.put("guid", UUID.randomUUID().toString());
+params.put("zoneId", 
String.valueOf(physicalNetwork.getDataCenterId()));
+params.put("physicalNetworkId", 
String.valueOf(physicalNetwork.getId()));
+params.put("name", "Nuage VSD - " + cmd.getHostName());
+params.put("hostname", cmd.getHostName());
+params.put("cmsuser", cmd.getUserName());
+String cmsUserPasswordBase64 = 
org.apache.commons.codec.binary.StringUtils.newStringUtf8(Base64.encodeBase64(cmd.getPassword().getBytes()));
+params.put("cmsuserpass", cmsUserPasswordBase64);
+int port = cmd.getPort();
+if (0 == port) {
+port = 8443;
+}
+params.put("port", String.valueOf(port));
+params.put("apiversion", apiVersion);
+params.put("apirelativepath", "/nuage/api/" + apiVersion);
+params.put("retrycount", 
String.valueOf(MoreObjects.firstNonNull(cmd.getApiRetryCount(), 
clientDefaults.get("DEFAULT_API_RETRY_COUNT";
+params.put("retryinterval", 
String.valueOf(MoreObjects.firstNonNull(cmd.getApiRetryInterval(), 
clientDefaults.get("DEFAULT_API_RETRY_INTERVAL";
+
+final Map hostdetails = new HashMap();
+hostdetails.putAll(params);
 resource.configure(cmd.getHostName(), hostdetails);
 
-final Host host = _resourceMgr.addHost(zoneId, resource, 
Host.Type.L2Networking, params);
+Host host = _resourceMgr.addHost(zoneId, resource, 
Host.Type.L2Networking, params);
 if (host != null) {
-return Transaction.execute(new 
TransactionCallback() {
-@Override
-public NuageVspDeviceVO 
doInTransaction(TransactionStatus status) {
-NuageVspDeviceVO nuageVspDevice = new 
NuageVspDeviceVO(host.getId(), physicalNetworkId, 
ntwkSvcProvider.getProviderName(), deviceName);
-_nuageVspDao.persist(nuageVspDevice);
+NuageVspDeviceVO nuageVspDevice = new 
NuageVspDeviceVO(host.getId(), physicalNetworkId, 
ntwkSvc

[GitHub] cloudstack pull request: CLOUDSTACK-8832 : Update Nuage VSP plugin...

2015-10-12 Thread jburwell
Github user jburwell commented on a diff in the pull request:

https://github.com/apache/cloudstack/pull/801#discussion_r41803532
  
--- Diff: 
plugins/network-elements/nuage-vsp/src/com/cloud/network/manager/NuageVspManagerImpl.java
 ---
@@ -152,50 +243,179 @@ public NuageVspDeviceVO 
addNuageVspDevice(AddNuageVspDeviceCmd cmd) {
 throw new CloudRuntimeException("A NuageVsp device is already 
configured on this physical network");
 }
 
-Map params = new HashMap();
-params.put("guid", UUID.randomUUID().toString());
-params.put("zoneId", 
String.valueOf(physicalNetwork.getDataCenterId()));
-params.put("physicalNetworkId", 
String.valueOf(physicalNetwork.getId()));
-params.put("name", "Nuage VSD - " + cmd.getHostName());
-params.put("hostname", cmd.getHostName());
-params.put("cmsuser", cmd.getUserName());
-String cmsUserPasswordBase64 = 
org.apache.commons.codec.binary.StringUtils.newStringUtf8(Base64.encodeBase64(cmd.getPassword().getBytes(Charset.forName("UTF-8";
-params.put("cmsuserpass", cmsUserPasswordBase64);
-int port = cmd.getPort();
-if (0 == port) {
-port = 443;
-}
-params.put("port", String.valueOf(port));
-params.put("apirelativepath", "/nuage/api/" + cmd.getApiVersion());
-params.put("retrycount", String.valueOf(cmd.getApiRetryCount()));
-params.put("retryinterval", 
String.valueOf(cmd.getApiRetryInterval()));
+try {
+NuageVspPluginClientLoader clientLoader = 
NuageVspPluginClientLoader.getClientLoader(null, null, 1, 1, null);
 
-Map hostdetails = new HashMap();
-hostdetails.putAll(params);
+Map clientDefaults = 
clientLoader.getNuageVspManagerClient().getClientDefaults();
+String apiVersion = 
MoreObjects.firstNonNull(cmd.getApiVersion(), (String) 
clientDefaults.get("CURRENT_API_VERSION"));
+if 
(!clientLoader.getNuageVspManagerClient().isSupportedApiVersion(apiVersion)) {
+throw new CloudRuntimeException("Unsupported API version : 
" + apiVersion);
+}
 
-try {
+Map params = new HashMap();
+params.put("guid", UUID.randomUUID().toString());
+params.put("zoneId", 
String.valueOf(physicalNetwork.getDataCenterId()));
+params.put("physicalNetworkId", 
String.valueOf(physicalNetwork.getId()));
+params.put("name", "Nuage VSD - " + cmd.getHostName());
+params.put("hostname", cmd.getHostName());
+params.put("cmsuser", cmd.getUserName());
+String cmsUserPasswordBase64 = 
org.apache.commons.codec.binary.StringUtils.newStringUtf8(Base64.encodeBase64(cmd.getPassword().getBytes()));
+params.put("cmsuserpass", cmsUserPasswordBase64);
+int port = cmd.getPort();
+if (0 == port) {
+port = 8443;
+}
+params.put("port", String.valueOf(port));
+params.put("apiversion", apiVersion);
+params.put("apirelativepath", "/nuage/api/" + apiVersion);
+params.put("retrycount", 
String.valueOf(MoreObjects.firstNonNull(cmd.getApiRetryCount(), 
clientDefaults.get("DEFAULT_API_RETRY_COUNT";
+params.put("retryinterval", 
String.valueOf(MoreObjects.firstNonNull(cmd.getApiRetryInterval(), 
clientDefaults.get("DEFAULT_API_RETRY_INTERVAL";
+
+final Map hostdetails = new HashMap();
+hostdetails.putAll(params);
 resource.configure(cmd.getHostName(), hostdetails);
 
-final Host host = _resourceMgr.addHost(zoneId, resource, 
Host.Type.L2Networking, params);
+Host host = _resourceMgr.addHost(zoneId, resource, 
Host.Type.L2Networking, params);
 if (host != null) {
-return Transaction.execute(new 
TransactionCallback() {
-@Override
-public NuageVspDeviceVO 
doInTransaction(TransactionStatus status) {
-NuageVspDeviceVO nuageVspDevice = new 
NuageVspDeviceVO(host.getId(), physicalNetworkId, 
ntwkSvcProvider.getProviderName(), deviceName);
-_nuageVspDao.persist(nuageVspDevice);
+NuageVspDeviceVO nuageVspDevice = new 
NuageVspDeviceVO(host.getId(), physicalNetworkId, 
ntwkSvc

[GitHub] cloudstack pull request: CLOUDSTACK-8832 : Update Nuage VSP plugin...

2015-10-12 Thread jburwell
Github user jburwell commented on a diff in the pull request:

https://github.com/apache/cloudstack/pull/801#discussion_r41803659
  
--- Diff: 
plugins/network-elements/nuage-vsp/src/com/cloud/network/manager/NuageVspManagerImpl.java
 ---
@@ -152,50 +243,179 @@ public NuageVspDeviceVO 
addNuageVspDevice(AddNuageVspDeviceCmd cmd) {
 throw new CloudRuntimeException("A NuageVsp device is already 
configured on this physical network");
 }
 
-Map params = new HashMap();
-params.put("guid", UUID.randomUUID().toString());
-params.put("zoneId", 
String.valueOf(physicalNetwork.getDataCenterId()));
-params.put("physicalNetworkId", 
String.valueOf(physicalNetwork.getId()));
-params.put("name", "Nuage VSD - " + cmd.getHostName());
-params.put("hostname", cmd.getHostName());
-params.put("cmsuser", cmd.getUserName());
-String cmsUserPasswordBase64 = 
org.apache.commons.codec.binary.StringUtils.newStringUtf8(Base64.encodeBase64(cmd.getPassword().getBytes(Charset.forName("UTF-8";
-params.put("cmsuserpass", cmsUserPasswordBase64);
-int port = cmd.getPort();
-if (0 == port) {
-port = 443;
-}
-params.put("port", String.valueOf(port));
-params.put("apirelativepath", "/nuage/api/" + cmd.getApiVersion());
-params.put("retrycount", String.valueOf(cmd.getApiRetryCount()));
-params.put("retryinterval", 
String.valueOf(cmd.getApiRetryInterval()));
+try {
+NuageVspPluginClientLoader clientLoader = 
NuageVspPluginClientLoader.getClientLoader(null, null, 1, 1, null);
 
-Map hostdetails = new HashMap();
-hostdetails.putAll(params);
+Map clientDefaults = 
clientLoader.getNuageVspManagerClient().getClientDefaults();
+String apiVersion = 
MoreObjects.firstNonNull(cmd.getApiVersion(), (String) 
clientDefaults.get("CURRENT_API_VERSION"));
+if 
(!clientLoader.getNuageVspManagerClient().isSupportedApiVersion(apiVersion)) {
+throw new CloudRuntimeException("Unsupported API version : 
" + apiVersion);
+}
 
-try {
+Map params = new HashMap();
+params.put("guid", UUID.randomUUID().toString());
+params.put("zoneId", 
String.valueOf(physicalNetwork.getDataCenterId()));
+params.put("physicalNetworkId", 
String.valueOf(physicalNetwork.getId()));
+params.put("name", "Nuage VSD - " + cmd.getHostName());
+params.put("hostname", cmd.getHostName());
+params.put("cmsuser", cmd.getUserName());
+String cmsUserPasswordBase64 = 
org.apache.commons.codec.binary.StringUtils.newStringUtf8(Base64.encodeBase64(cmd.getPassword().getBytes()));
+params.put("cmsuserpass", cmsUserPasswordBase64);
+int port = cmd.getPort();
+if (0 == port) {
+port = 8443;
+}
+params.put("port", String.valueOf(port));
+params.put("apiversion", apiVersion);
+params.put("apirelativepath", "/nuage/api/" + apiVersion);
+params.put("retrycount", 
String.valueOf(MoreObjects.firstNonNull(cmd.getApiRetryCount(), 
clientDefaults.get("DEFAULT_API_RETRY_COUNT";
+params.put("retryinterval", 
String.valueOf(MoreObjects.firstNonNull(cmd.getApiRetryInterval(), 
clientDefaults.get("DEFAULT_API_RETRY_INTERVAL";
+
+final Map hostdetails = new HashMap();
+hostdetails.putAll(params);
 resource.configure(cmd.getHostName(), hostdetails);
 
-final Host host = _resourceMgr.addHost(zoneId, resource, 
Host.Type.L2Networking, params);
+Host host = _resourceMgr.addHost(zoneId, resource, 
Host.Type.L2Networking, params);
 if (host != null) {
-return Transaction.execute(new 
TransactionCallback() {
-@Override
-public NuageVspDeviceVO 
doInTransaction(TransactionStatus status) {
-NuageVspDeviceVO nuageVspDevice = new 
NuageVspDeviceVO(host.getId(), physicalNetworkId, 
ntwkSvcProvider.getProviderName(), deviceName);
-_nuageVspDao.persist(nuageVspDevice);
+NuageVspDeviceVO nuageVspDevice = new 
NuageVspDeviceVO(host.getId(), physicalNetworkId, 
ntwkSvc

[GitHub] cloudstack pull request: CLOUDSTACK-8832 : Update Nuage VSP plugin...

2015-10-12 Thread jburwell
Github user jburwell commented on a diff in the pull request:

https://github.com/apache/cloudstack/pull/801#discussion_r41803706
  
--- Diff: 
plugins/network-elements/nuage-vsp/src/com/cloud/network/manager/NuageVspManagerImpl.java
 ---
@@ -152,50 +243,179 @@ public NuageVspDeviceVO 
addNuageVspDevice(AddNuageVspDeviceCmd cmd) {
 throw new CloudRuntimeException("A NuageVsp device is already 
configured on this physical network");
 }
 
-Map params = new HashMap();
-params.put("guid", UUID.randomUUID().toString());
-params.put("zoneId", 
String.valueOf(physicalNetwork.getDataCenterId()));
-params.put("physicalNetworkId", 
String.valueOf(physicalNetwork.getId()));
-params.put("name", "Nuage VSD - " + cmd.getHostName());
-params.put("hostname", cmd.getHostName());
-params.put("cmsuser", cmd.getUserName());
-String cmsUserPasswordBase64 = 
org.apache.commons.codec.binary.StringUtils.newStringUtf8(Base64.encodeBase64(cmd.getPassword().getBytes(Charset.forName("UTF-8";
-params.put("cmsuserpass", cmsUserPasswordBase64);
-int port = cmd.getPort();
-if (0 == port) {
-port = 443;
-}
-params.put("port", String.valueOf(port));
-params.put("apirelativepath", "/nuage/api/" + cmd.getApiVersion());
-params.put("retrycount", String.valueOf(cmd.getApiRetryCount()));
-params.put("retryinterval", 
String.valueOf(cmd.getApiRetryInterval()));
+try {
+NuageVspPluginClientLoader clientLoader = 
NuageVspPluginClientLoader.getClientLoader(null, null, 1, 1, null);
 
-Map hostdetails = new HashMap();
-hostdetails.putAll(params);
+Map clientDefaults = 
clientLoader.getNuageVspManagerClient().getClientDefaults();
+String apiVersion = 
MoreObjects.firstNonNull(cmd.getApiVersion(), (String) 
clientDefaults.get("CURRENT_API_VERSION"));
+if 
(!clientLoader.getNuageVspManagerClient().isSupportedApiVersion(apiVersion)) {
+throw new CloudRuntimeException("Unsupported API version : 
" + apiVersion);
+}
 
-try {
+Map params = new HashMap();
+params.put("guid", UUID.randomUUID().toString());
+params.put("zoneId", 
String.valueOf(physicalNetwork.getDataCenterId()));
+params.put("physicalNetworkId", 
String.valueOf(physicalNetwork.getId()));
+params.put("name", "Nuage VSD - " + cmd.getHostName());
+params.put("hostname", cmd.getHostName());
+params.put("cmsuser", cmd.getUserName());
+String cmsUserPasswordBase64 = 
org.apache.commons.codec.binary.StringUtils.newStringUtf8(Base64.encodeBase64(cmd.getPassword().getBytes()));
+params.put("cmsuserpass", cmsUserPasswordBase64);
+int port = cmd.getPort();
+if (0 == port) {
+port = 8443;
+}
+params.put("port", String.valueOf(port));
+params.put("apiversion", apiVersion);
+params.put("apirelativepath", "/nuage/api/" + apiVersion);
+params.put("retrycount", 
String.valueOf(MoreObjects.firstNonNull(cmd.getApiRetryCount(), 
clientDefaults.get("DEFAULT_API_RETRY_COUNT";
+params.put("retryinterval", 
String.valueOf(MoreObjects.firstNonNull(cmd.getApiRetryInterval(), 
clientDefaults.get("DEFAULT_API_RETRY_INTERVAL";
+
+final Map hostdetails = new HashMap();
+hostdetails.putAll(params);
 resource.configure(cmd.getHostName(), hostdetails);
 
-final Host host = _resourceMgr.addHost(zoneId, resource, 
Host.Type.L2Networking, params);
+Host host = _resourceMgr.addHost(zoneId, resource, 
Host.Type.L2Networking, params);
 if (host != null) {
-return Transaction.execute(new 
TransactionCallback() {
-@Override
-public NuageVspDeviceVO 
doInTransaction(TransactionStatus status) {
-NuageVspDeviceVO nuageVspDevice = new 
NuageVspDeviceVO(host.getId(), physicalNetworkId, 
ntwkSvcProvider.getProviderName(), deviceName);
-_nuageVspDao.persist(nuageVspDevice);
+NuageVspDeviceVO nuageVspDevice = new 
NuageVspDeviceVO(host.getId(), physicalNetworkId, 
ntwkSvc

[GitHub] cloudstack pull request: CLOUDSTACK-8832 : Update Nuage VSP plugin...

2015-10-12 Thread jburwell
Github user jburwell commented on a diff in the pull request:

https://github.com/apache/cloudstack/pull/801#discussion_r41803927
  
--- Diff: 
plugins/network-elements/nuage-vsp/src/com/cloud/network/manager/NuageVspManagerImpl.java
 ---
@@ -152,50 +243,179 @@ public NuageVspDeviceVO 
addNuageVspDevice(AddNuageVspDeviceCmd cmd) {
 throw new CloudRuntimeException("A NuageVsp device is already 
configured on this physical network");
 }
 
-Map params = new HashMap();
-params.put("guid", UUID.randomUUID().toString());
-params.put("zoneId", 
String.valueOf(physicalNetwork.getDataCenterId()));
-params.put("physicalNetworkId", 
String.valueOf(physicalNetwork.getId()));
-params.put("name", "Nuage VSD - " + cmd.getHostName());
-params.put("hostname", cmd.getHostName());
-params.put("cmsuser", cmd.getUserName());
-String cmsUserPasswordBase64 = 
org.apache.commons.codec.binary.StringUtils.newStringUtf8(Base64.encodeBase64(cmd.getPassword().getBytes(Charset.forName("UTF-8";
-params.put("cmsuserpass", cmsUserPasswordBase64);
-int port = cmd.getPort();
-if (0 == port) {
-port = 443;
-}
-params.put("port", String.valueOf(port));
-params.put("apirelativepath", "/nuage/api/" + cmd.getApiVersion());
-params.put("retrycount", String.valueOf(cmd.getApiRetryCount()));
-params.put("retryinterval", 
String.valueOf(cmd.getApiRetryInterval()));
+try {
+NuageVspPluginClientLoader clientLoader = 
NuageVspPluginClientLoader.getClientLoader(null, null, 1, 1, null);
 
-Map hostdetails = new HashMap();
-hostdetails.putAll(params);
+Map clientDefaults = 
clientLoader.getNuageVspManagerClient().getClientDefaults();
+String apiVersion = 
MoreObjects.firstNonNull(cmd.getApiVersion(), (String) 
clientDefaults.get("CURRENT_API_VERSION"));
+if 
(!clientLoader.getNuageVspManagerClient().isSupportedApiVersion(apiVersion)) {
+throw new CloudRuntimeException("Unsupported API version : 
" + apiVersion);
+}
 
-try {
+Map params = new HashMap();
+params.put("guid", UUID.randomUUID().toString());
+params.put("zoneId", 
String.valueOf(physicalNetwork.getDataCenterId()));
+params.put("physicalNetworkId", 
String.valueOf(physicalNetwork.getId()));
+params.put("name", "Nuage VSD - " + cmd.getHostName());
+params.put("hostname", cmd.getHostName());
+params.put("cmsuser", cmd.getUserName());
+String cmsUserPasswordBase64 = 
org.apache.commons.codec.binary.StringUtils.newStringUtf8(Base64.encodeBase64(cmd.getPassword().getBytes()));
+params.put("cmsuserpass", cmsUserPasswordBase64);
+int port = cmd.getPort();
+if (0 == port) {
+port = 8443;
+}
+params.put("port", String.valueOf(port));
+params.put("apiversion", apiVersion);
+params.put("apirelativepath", "/nuage/api/" + apiVersion);
+params.put("retrycount", 
String.valueOf(MoreObjects.firstNonNull(cmd.getApiRetryCount(), 
clientDefaults.get("DEFAULT_API_RETRY_COUNT";
+params.put("retryinterval", 
String.valueOf(MoreObjects.firstNonNull(cmd.getApiRetryInterval(), 
clientDefaults.get("DEFAULT_API_RETRY_INTERVAL";
+
+final Map hostdetails = new HashMap();
+hostdetails.putAll(params);
 resource.configure(cmd.getHostName(), hostdetails);
 
-final Host host = _resourceMgr.addHost(zoneId, resource, 
Host.Type.L2Networking, params);
+Host host = _resourceMgr.addHost(zoneId, resource, 
Host.Type.L2Networking, params);
 if (host != null) {
-return Transaction.execute(new 
TransactionCallback() {
-@Override
-public NuageVspDeviceVO 
doInTransaction(TransactionStatus status) {
-NuageVspDeviceVO nuageVspDevice = new 
NuageVspDeviceVO(host.getId(), physicalNetworkId, 
ntwkSvcProvider.getProviderName(), deviceName);
-_nuageVspDao.persist(nuageVspDevice);
+NuageVspDeviceVO nuageVspDevice = new 
NuageVspDeviceVO(host.getId(), physicalNetworkId, 
ntwkSvc

[GitHub] cloudstack pull request: CLOUDSTACK-8832 : Update Nuage VSP plugin...

2015-10-12 Thread jburwell
Github user jburwell commented on a diff in the pull request:

https://github.com/apache/cloudstack/pull/801#discussion_r41803966
  
--- Diff: 
plugins/network-elements/nuage-vsp/src/com/cloud/network/manager/NuageVspManagerImpl.java
 ---
@@ -152,50 +243,179 @@ public NuageVspDeviceVO 
addNuageVspDevice(AddNuageVspDeviceCmd cmd) {
 throw new CloudRuntimeException("A NuageVsp device is already 
configured on this physical network");
 }
 
-Map params = new HashMap();
-params.put("guid", UUID.randomUUID().toString());
-params.put("zoneId", 
String.valueOf(physicalNetwork.getDataCenterId()));
-params.put("physicalNetworkId", 
String.valueOf(physicalNetwork.getId()));
-params.put("name", "Nuage VSD - " + cmd.getHostName());
-params.put("hostname", cmd.getHostName());
-params.put("cmsuser", cmd.getUserName());
-String cmsUserPasswordBase64 = 
org.apache.commons.codec.binary.StringUtils.newStringUtf8(Base64.encodeBase64(cmd.getPassword().getBytes(Charset.forName("UTF-8";
-params.put("cmsuserpass", cmsUserPasswordBase64);
-int port = cmd.getPort();
-if (0 == port) {
-port = 443;
-}
-params.put("port", String.valueOf(port));
-params.put("apirelativepath", "/nuage/api/" + cmd.getApiVersion());
-params.put("retrycount", String.valueOf(cmd.getApiRetryCount()));
-params.put("retryinterval", 
String.valueOf(cmd.getApiRetryInterval()));
+try {
+NuageVspPluginClientLoader clientLoader = 
NuageVspPluginClientLoader.getClientLoader(null, null, 1, 1, null);
 
-Map hostdetails = new HashMap();
-hostdetails.putAll(params);
+Map clientDefaults = 
clientLoader.getNuageVspManagerClient().getClientDefaults();
+String apiVersion = 
MoreObjects.firstNonNull(cmd.getApiVersion(), (String) 
clientDefaults.get("CURRENT_API_VERSION"));
+if 
(!clientLoader.getNuageVspManagerClient().isSupportedApiVersion(apiVersion)) {
+throw new CloudRuntimeException("Unsupported API version : 
" + apiVersion);
+}
 
-try {
+Map params = new HashMap();
+params.put("guid", UUID.randomUUID().toString());
+params.put("zoneId", 
String.valueOf(physicalNetwork.getDataCenterId()));
+params.put("physicalNetworkId", 
String.valueOf(physicalNetwork.getId()));
+params.put("name", "Nuage VSD - " + cmd.getHostName());
+params.put("hostname", cmd.getHostName());
+params.put("cmsuser", cmd.getUserName());
+String cmsUserPasswordBase64 = 
org.apache.commons.codec.binary.StringUtils.newStringUtf8(Base64.encodeBase64(cmd.getPassword().getBytes()));
+params.put("cmsuserpass", cmsUserPasswordBase64);
+int port = cmd.getPort();
+if (0 == port) {
+port = 8443;
+}
+params.put("port", String.valueOf(port));
+params.put("apiversion", apiVersion);
+params.put("apirelativepath", "/nuage/api/" + apiVersion);
+params.put("retrycount", 
String.valueOf(MoreObjects.firstNonNull(cmd.getApiRetryCount(), 
clientDefaults.get("DEFAULT_API_RETRY_COUNT";
+params.put("retryinterval", 
String.valueOf(MoreObjects.firstNonNull(cmd.getApiRetryInterval(), 
clientDefaults.get("DEFAULT_API_RETRY_INTERVAL";
+
+final Map hostdetails = new HashMap();
+hostdetails.putAll(params);
 resource.configure(cmd.getHostName(), hostdetails);
 
-final Host host = _resourceMgr.addHost(zoneId, resource, 
Host.Type.L2Networking, params);
+Host host = _resourceMgr.addHost(zoneId, resource, 
Host.Type.L2Networking, params);
 if (host != null) {
-return Transaction.execute(new 
TransactionCallback() {
-@Override
-public NuageVspDeviceVO 
doInTransaction(TransactionStatus status) {
-NuageVspDeviceVO nuageVspDevice = new 
NuageVspDeviceVO(host.getId(), physicalNetworkId, 
ntwkSvcProvider.getProviderName(), deviceName);
-_nuageVspDao.persist(nuageVspDevice);
+NuageVspDeviceVO nuageVspDevice = new 
NuageVspDeviceVO(host.getId(), physicalNetworkId, 
ntwkSvc

[GitHub] cloudstack pull request: CLOUDSTACK-8832 : Update Nuage VSP plugin...

2015-10-12 Thread jburwell
Github user jburwell commented on a diff in the pull request:

https://github.com/apache/cloudstack/pull/801#discussion_r41804131
  
--- Diff: 
plugins/network-elements/nuage-vsp/src/com/cloud/network/manager/NuageVspManagerImpl.java
 ---
@@ -152,50 +243,179 @@ public NuageVspDeviceVO 
addNuageVspDevice(AddNuageVspDeviceCmd cmd) {
 throw new CloudRuntimeException("A NuageVsp device is already 
configured on this physical network");
 }
 
-Map params = new HashMap();
-params.put("guid", UUID.randomUUID().toString());
-params.put("zoneId", 
String.valueOf(physicalNetwork.getDataCenterId()));
-params.put("physicalNetworkId", 
String.valueOf(physicalNetwork.getId()));
-params.put("name", "Nuage VSD - " + cmd.getHostName());
-params.put("hostname", cmd.getHostName());
-params.put("cmsuser", cmd.getUserName());
-String cmsUserPasswordBase64 = 
org.apache.commons.codec.binary.StringUtils.newStringUtf8(Base64.encodeBase64(cmd.getPassword().getBytes(Charset.forName("UTF-8";
-params.put("cmsuserpass", cmsUserPasswordBase64);
-int port = cmd.getPort();
-if (0 == port) {
-port = 443;
-}
-params.put("port", String.valueOf(port));
-params.put("apirelativepath", "/nuage/api/" + cmd.getApiVersion());
-params.put("retrycount", String.valueOf(cmd.getApiRetryCount()));
-params.put("retryinterval", 
String.valueOf(cmd.getApiRetryInterval()));
+try {
+NuageVspPluginClientLoader clientLoader = 
NuageVspPluginClientLoader.getClientLoader(null, null, 1, 1, null);
 
-Map hostdetails = new HashMap();
-hostdetails.putAll(params);
+Map clientDefaults = 
clientLoader.getNuageVspManagerClient().getClientDefaults();
+String apiVersion = 
MoreObjects.firstNonNull(cmd.getApiVersion(), (String) 
clientDefaults.get("CURRENT_API_VERSION"));
+if 
(!clientLoader.getNuageVspManagerClient().isSupportedApiVersion(apiVersion)) {
+throw new CloudRuntimeException("Unsupported API version : 
" + apiVersion);
+}
 
-try {
+Map params = new HashMap();
+params.put("guid", UUID.randomUUID().toString());
+params.put("zoneId", 
String.valueOf(physicalNetwork.getDataCenterId()));
+params.put("physicalNetworkId", 
String.valueOf(physicalNetwork.getId()));
+params.put("name", "Nuage VSD - " + cmd.getHostName());
+params.put("hostname", cmd.getHostName());
+params.put("cmsuser", cmd.getUserName());
+String cmsUserPasswordBase64 = 
org.apache.commons.codec.binary.StringUtils.newStringUtf8(Base64.encodeBase64(cmd.getPassword().getBytes()));
+params.put("cmsuserpass", cmsUserPasswordBase64);
+int port = cmd.getPort();
+if (0 == port) {
+port = 8443;
+}
+params.put("port", String.valueOf(port));
+params.put("apiversion", apiVersion);
+params.put("apirelativepath", "/nuage/api/" + apiVersion);
+params.put("retrycount", 
String.valueOf(MoreObjects.firstNonNull(cmd.getApiRetryCount(), 
clientDefaults.get("DEFAULT_API_RETRY_COUNT";
+params.put("retryinterval", 
String.valueOf(MoreObjects.firstNonNull(cmd.getApiRetryInterval(), 
clientDefaults.get("DEFAULT_API_RETRY_INTERVAL";
+
+final Map hostdetails = new HashMap();
+hostdetails.putAll(params);
 resource.configure(cmd.getHostName(), hostdetails);
 
-final Host host = _resourceMgr.addHost(zoneId, resource, 
Host.Type.L2Networking, params);
+Host host = _resourceMgr.addHost(zoneId, resource, 
Host.Type.L2Networking, params);
 if (host != null) {
-return Transaction.execute(new 
TransactionCallback() {
-@Override
-public NuageVspDeviceVO 
doInTransaction(TransactionStatus status) {
-NuageVspDeviceVO nuageVspDevice = new 
NuageVspDeviceVO(host.getId(), physicalNetworkId, 
ntwkSvcProvider.getProviderName(), deviceName);
-_nuageVspDao.persist(nuageVspDevice);
+NuageVspDeviceVO nuageVspDevice = new 
NuageVspDeviceVO(host.getId(), physicalNetworkId, 
ntwkSvc

[GitHub] cloudstack pull request: CLOUDSTACK-8832 : Update Nuage VSP plugin...

2015-10-12 Thread jburwell
Github user jburwell commented on a diff in the pull request:

https://github.com/apache/cloudstack/pull/801#discussion_r41804334
  
--- Diff: 
plugins/network-elements/nuage-vsp/src/com/cloud/network/manager/NuageVspManagerImpl.java
 ---
@@ -152,50 +243,179 @@ public NuageVspDeviceVO 
addNuageVspDevice(AddNuageVspDeviceCmd cmd) {
 throw new CloudRuntimeException("A NuageVsp device is already 
configured on this physical network");
 }
 
-Map params = new HashMap();
-params.put("guid", UUID.randomUUID().toString());
-params.put("zoneId", 
String.valueOf(physicalNetwork.getDataCenterId()));
-params.put("physicalNetworkId", 
String.valueOf(physicalNetwork.getId()));
-params.put("name", "Nuage VSD - " + cmd.getHostName());
-params.put("hostname", cmd.getHostName());
-params.put("cmsuser", cmd.getUserName());
-String cmsUserPasswordBase64 = 
org.apache.commons.codec.binary.StringUtils.newStringUtf8(Base64.encodeBase64(cmd.getPassword().getBytes(Charset.forName("UTF-8";
-params.put("cmsuserpass", cmsUserPasswordBase64);
-int port = cmd.getPort();
-if (0 == port) {
-port = 443;
-}
-params.put("port", String.valueOf(port));
-params.put("apirelativepath", "/nuage/api/" + cmd.getApiVersion());
-params.put("retrycount", String.valueOf(cmd.getApiRetryCount()));
-params.put("retryinterval", 
String.valueOf(cmd.getApiRetryInterval()));
+try {
+NuageVspPluginClientLoader clientLoader = 
NuageVspPluginClientLoader.getClientLoader(null, null, 1, 1, null);
 
-Map hostdetails = new HashMap();
-hostdetails.putAll(params);
+Map clientDefaults = 
clientLoader.getNuageVspManagerClient().getClientDefaults();
+String apiVersion = 
MoreObjects.firstNonNull(cmd.getApiVersion(), (String) 
clientDefaults.get("CURRENT_API_VERSION"));
+if 
(!clientLoader.getNuageVspManagerClient().isSupportedApiVersion(apiVersion)) {
+throw new CloudRuntimeException("Unsupported API version : 
" + apiVersion);
+}
 
-try {
+Map params = new HashMap();
+params.put("guid", UUID.randomUUID().toString());
+params.put("zoneId", 
String.valueOf(physicalNetwork.getDataCenterId()));
+params.put("physicalNetworkId", 
String.valueOf(physicalNetwork.getId()));
+params.put("name", "Nuage VSD - " + cmd.getHostName());
+params.put("hostname", cmd.getHostName());
+params.put("cmsuser", cmd.getUserName());
+String cmsUserPasswordBase64 = 
org.apache.commons.codec.binary.StringUtils.newStringUtf8(Base64.encodeBase64(cmd.getPassword().getBytes()));
+params.put("cmsuserpass", cmsUserPasswordBase64);
+int port = cmd.getPort();
+if (0 == port) {
+port = 8443;
+}
+params.put("port", String.valueOf(port));
+params.put("apiversion", apiVersion);
+params.put("apirelativepath", "/nuage/api/" + apiVersion);
+params.put("retrycount", 
String.valueOf(MoreObjects.firstNonNull(cmd.getApiRetryCount(), 
clientDefaults.get("DEFAULT_API_RETRY_COUNT";
+params.put("retryinterval", 
String.valueOf(MoreObjects.firstNonNull(cmd.getApiRetryInterval(), 
clientDefaults.get("DEFAULT_API_RETRY_INTERVAL";
+
+final Map hostdetails = new HashMap();
+hostdetails.putAll(params);
 resource.configure(cmd.getHostName(), hostdetails);
 
-final Host host = _resourceMgr.addHost(zoneId, resource, 
Host.Type.L2Networking, params);
+Host host = _resourceMgr.addHost(zoneId, resource, 
Host.Type.L2Networking, params);
 if (host != null) {
-return Transaction.execute(new 
TransactionCallback() {
-@Override
-public NuageVspDeviceVO 
doInTransaction(TransactionStatus status) {
-NuageVspDeviceVO nuageVspDevice = new 
NuageVspDeviceVO(host.getId(), physicalNetworkId, 
ntwkSvcProvider.getProviderName(), deviceName);
-_nuageVspDao.persist(nuageVspDevice);
+NuageVspDeviceVO nuageVspDevice = new 
NuageVspDeviceVO(host.getId(), physicalNetworkId, 
ntwkSvc

[GitHub] cloudstack pull request: CLOUDSTACK-8832 : Update Nuage VSP plugin...

2015-10-12 Thread jburwell
Github user jburwell commented on a diff in the pull request:

https://github.com/apache/cloudstack/pull/801#discussion_r41804441
  
--- Diff: 
plugins/network-elements/nuage-vsp/src/com/cloud/network/manager/NuageVspManagerImpl.java
 ---
@@ -247,6 +467,26 @@ public boolean 
deleteNuageVspDevice(DeleteNuageVspDeviceCmd cmd) {
 }
 }
 
+ConfigurationVO cmsIdConfig = 
_configDao.findByName("nuagevsp.cms.id");
+HostVO host = findNuageVspHost(nuageVspDevice.getHostId());
+if (!auditDomainsOnVsp(host, false, true)) {
+return false;
+}
+
+String nuageVspCmsId = 
findNuageVspCmsIdForDevice(nuageVspDevice.getId(), cmsIdConfig);
+SyncNuageVspCmsIdCommand syncCmd = new 
SyncNuageVspCmsIdCommand(SyncType.UNREGISTER, nuageVspCmsId);
+SyncNuageVspCmsIdAnswer answer = (SyncNuageVspCmsIdAnswer) 
_agentMgr.easySend(nuageVspDevice.getHostId(), syncCmd);
+if (answer != null && answer.getSuccess()) {
+String currentValue = cmsIdConfig.getValue();
+String newValue = currentValue.replace(nuageVspDevice.getId() 
+ ":" + answer.getNuageVspCmsId(), "");
+if (newValue.startsWith(";")) {
--- End diff --

Check that ``newValue`` with ``Strings.isNullOrEmpty()`` to avoid a 
potential ``NullPointerException``.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] cloudstack pull request: CLOUDSTACK-8832 : Update Nuage VSP plugin...

2015-10-12 Thread jburwell
Github user jburwell commented on a diff in the pull request:

https://github.com/apache/cloudstack/pull/801#discussion_r41804704
  
--- Diff: 
plugins/network-elements/nuage-vsp/src/com/cloud/network/manager/NuageVspManagerImpl.java
 ---
@@ -285,60 +525,345 @@ public boolean 
deleteNuageVspDevice(DeleteNuageVspDeviceCmd cmd) {
 return responseList;
 }
 
-@Override
-public boolean configure(String name, Map params) 
throws ConfigurationException {
-try {
-initNuageScheduledTasks();
-} catch (Exception ce) {
-s_logger.warn("Failed to load NuageVsp configuration 
properties. Check if the NuageVsp properties are configured correctly");
+private void registerNewNuageVspDevice(ConfigurationVO currentConfig, 
String registeredNuageVspDevice) {
+if (currentConfig == null) {
+ConfigKey configKey = new 
ConfigKey("Advanced", String.class, "nuagevsp.cms.id", 
registeredNuageVspDevice,
+": - Do 
not edit", false);
+ConfigurationVO configuration = new 
ConfigurationVO("management-server", configKey);
+_configDao.persist(configuration);
+} else {
+String newValue;
+String currentValue = currentConfig.getValue();
+if (!Strings.isNullOrEmpty(currentValue)) {
+newValue = currentValue + ";" + registeredNuageVspDevice;
+} else {
+newValue = registeredNuageVspDevice;
+}
+_configDao.update("nuagevsp.cms.id", newValue);
 }
-return true;
 }
 
-private void initNuageScheduledTasks() {
-Integer numOfSyncThreads = 
Integer.valueOf(_configDao.getValue(NuageVspManager.NuageVspSyncWorkers.key()));
-Integer syncUpIntervalInMinutes = 
Integer.valueOf(_configDao.getValue(NuageVspManager.NuageVspSyncInterval.key()));
-
-if (numOfSyncThreads != null && syncUpIntervalInMinutes != null) {
-ThreadFactory threadFactory = new ThreadFactory() {
-public Thread newThread(Runnable runnable) {
-Thread thread = new Thread(runnable, "Nuage Vsp sync 
task");
-if (thread.isDaemon())
-thread.setDaemon(false);
-if (thread.getPriority() != Thread.NORM_PRIORITY)
-thread.setPriority(Thread.NORM_PRIORITY);
-return thread;
+private void auditHost(HostVO host) {
+_hostDao.loadDetails(host);
+
+boolean validateDomains = true;
+List nuageVspDevices = 
_nuageVspDao.listByHost(host.getId());
+if (!CollectionUtils.isEmpty(nuageVspDevices)) {
+for (NuageVspDeviceVO nuageVspDevice : nuageVspDevices) {
+ConfigurationVO cmsIdConfig = 
_configDao.findByName("nuagevsp.cms.id");
+String nuageVspCmsId = 
findNuageVspCmsIdForDevice(nuageVspDevice.getId(), cmsIdConfig);
+SyncNuageVspCmsIdCommand syncCmd = new 
SyncNuageVspCmsIdCommand(SyncType.AUDIT, nuageVspCmsId);
+SyncNuageVspCmsIdAnswer answer = (SyncNuageVspCmsIdAnswer) 
_agentMgr.easySend(nuageVspDevice.getHostId(), syncCmd);
+
+if (answer != null && !answer.getSuccess()) {
+s_logger.fatal("Nuage VSP Device with ID " + 
nuageVspDevice.getId() + " is configured with an unknown CMS ID!");
--- End diff --

Why are logging to ``FATAL``?  We typically log to ``ERROR``.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] cloudstack pull request: CLOUDSTACK-8832 : Update Nuage VSP plugin...

2015-10-12 Thread jburwell
Github user jburwell commented on a diff in the pull request:

https://github.com/apache/cloudstack/pull/801#discussion_r41804947
  
--- Diff: 
plugins/network-elements/nuage-vsp/src/com/cloud/network/manager/NuageVspManagerImpl.java
 ---
@@ -285,60 +525,345 @@ public boolean 
deleteNuageVspDevice(DeleteNuageVspDeviceCmd cmd) {
 return responseList;
 }
 
-@Override
-public boolean configure(String name, Map params) 
throws ConfigurationException {
-try {
-initNuageScheduledTasks();
-} catch (Exception ce) {
-s_logger.warn("Failed to load NuageVsp configuration 
properties. Check if the NuageVsp properties are configured correctly");
+private void registerNewNuageVspDevice(ConfigurationVO currentConfig, 
String registeredNuageVspDevice) {
+if (currentConfig == null) {
+ConfigKey configKey = new 
ConfigKey("Advanced", String.class, "nuagevsp.cms.id", 
registeredNuageVspDevice,
+": - Do 
not edit", false);
+ConfigurationVO configuration = new 
ConfigurationVO("management-server", configKey);
+_configDao.persist(configuration);
+} else {
+String newValue;
+String currentValue = currentConfig.getValue();
+if (!Strings.isNullOrEmpty(currentValue)) {
+newValue = currentValue + ";" + registeredNuageVspDevice;
+} else {
+newValue = registeredNuageVspDevice;
+}
+_configDao.update("nuagevsp.cms.id", newValue);
 }
-return true;
 }
 
-private void initNuageScheduledTasks() {
-Integer numOfSyncThreads = 
Integer.valueOf(_configDao.getValue(NuageVspManager.NuageVspSyncWorkers.key()));
-Integer syncUpIntervalInMinutes = 
Integer.valueOf(_configDao.getValue(NuageVspManager.NuageVspSyncInterval.key()));
-
-if (numOfSyncThreads != null && syncUpIntervalInMinutes != null) {
-ThreadFactory threadFactory = new ThreadFactory() {
-public Thread newThread(Runnable runnable) {
-Thread thread = new Thread(runnable, "Nuage Vsp sync 
task");
-if (thread.isDaemon())
-thread.setDaemon(false);
-if (thread.getPriority() != Thread.NORM_PRIORITY)
-thread.setPriority(Thread.NORM_PRIORITY);
-return thread;
+private void auditHost(HostVO host) {
+_hostDao.loadDetails(host);
+
+boolean validateDomains = true;
+List nuageVspDevices = 
_nuageVspDao.listByHost(host.getId());
+if (!CollectionUtils.isEmpty(nuageVspDevices)) {
+for (NuageVspDeviceVO nuageVspDevice : nuageVspDevices) {
+ConfigurationVO cmsIdConfig = 
_configDao.findByName("nuagevsp.cms.id");
+String nuageVspCmsId = 
findNuageVspCmsIdForDevice(nuageVspDevice.getId(), cmsIdConfig);
+SyncNuageVspCmsIdCommand syncCmd = new 
SyncNuageVspCmsIdCommand(SyncType.AUDIT, nuageVspCmsId);
+SyncNuageVspCmsIdAnswer answer = (SyncNuageVspCmsIdAnswer) 
_agentMgr.easySend(nuageVspDevice.getHostId(), syncCmd);
+
+if (answer != null && !answer.getSuccess()) {
+s_logger.fatal("Nuage VSP Device with ID " + 
nuageVspDevice.getId() + " is configured with an unknown CMS ID!");
+validateDomains = false;
+} else if (answer != null && answer.getSyncType() == 
SyncType.REGISTER) {
+registerNewNuageVspDevice(cmsIdConfig, 
nuageVspDevice.getId() + ":" + answer.getNuageVspCmsId());
 }
-};
-scheduler = Executors.newScheduledThreadPool(numOfSyncThreads, 
threadFactory);
-scheduler.scheduleWithFixedDelay(new 
NuageVspSyncTask("FLOATING_IP"), ONE_MINUTE_MULTIPLIER * 15, 
ONE_MINUTE_MULTIPLIER * syncUpIntervalInMinutes,
-TimeUnit.MILLISECONDS);
-scheduler.scheduleWithFixedDelay(new 
NuageVspSyncTask("ENTERPRISE_NTWK_MACRO"), ONE_MINUTE_MULTIPLIER * 15, 
ONE_MINUTE_MULTIPLIER * syncUpIntervalInMinutes,
-TimeUnit.MILLISECONDS);
-scheduler
-.scheduleWithFixedDelay(new 
NuageVspSyncTask("ENTERPRISE"), ONE_MINUTE_MULTIPLIER * 15, 
ONE_MINUTE_MULTIPLIER * syncUpIntervalInMinutes, TimeUnit.MILLISECONDS);
-} else {
-s_logger.warn("NuageVsp configuration for syncWorkers=" 

[GitHub] cloudstack pull request: CLOUDSTACK-8832 : Update Nuage VSP plugin...

2015-10-12 Thread jburwell
Github user jburwell commented on a diff in the pull request:

https://github.com/apache/cloudstack/pull/801#discussion_r41805233
  
--- Diff: 
plugins/network-elements/nuage-vsp/src/com/cloud/network/element/NuageVspElement.java
 ---
@@ -129,6 +145,18 @@
 AgentManager _agentMgr;
 @Inject
 NetworkOfferingDao _ntwkOfferingDao;
+@Inject
+ConfigurationDao _configDao;
+@Inject
+NuageVspManager _nuageVspManager;
+@Inject
+FirewallRulesDao _firewallRulesDao;
+@Inject
+FirewallRulesCidrsDao _firewallRulesCidrsDao;
+@Inject
+PhysicalNetworkDao _physicalNetworkDao;
+@Inject
+NetworkACLItemDao _networkACLItemDao;
 
 @Override
 public boolean applyIps(Network network, List ipAddress, Set service) throws 
ResourceUnavailableException {
--- End diff --

Has any progress made on addressing this comment?


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] cloudstack pull request: CLOUDSTACK-8832 : Update Nuage VSP plugin...

2015-10-12 Thread jburwell
Github user jburwell commented on a diff in the pull request:

https://github.com/apache/cloudstack/pull/801#discussion_r41805880
  
--- Diff: 
plugins/network-elements/nuage-vsp/src/com/cloud/network/manager/NuageVspManagerImpl.java
 ---
@@ -285,60 +507,341 @@ public boolean 
deleteNuageVspDevice(DeleteNuageVspDeviceCmd cmd) {
 return responseList;
 }
 
-@Override
-public boolean configure(String name, Map params) 
throws ConfigurationException {
-try {
-initNuageScheduledTasks();
-} catch (Exception ce) {
-s_logger.warn("Failed to load NuageVsp configuration 
properties. Check if the NuageVsp properties are configured correctly");
+private void registerNewNuageVspDevice(ConfigurationVO currentConfig, 
String registeredNuageVspDevice) {
+if (currentConfig == null) {
+ConfigKey configKey = new 
ConfigKey("Advanced", String.class, "nuagevsp.cms.id", 
registeredNuageVspDevice,
+": - Do 
not edit", false);
+ConfigurationVO configuration = new 
ConfigurationVO("management-server", configKey);
+_configDao.persist(configuration);
+} else {
+String newValue;
+String currentValue = currentConfig.getValue();
+if (StringUtils.isNotBlank(currentValue)) {
+newValue = currentValue + ";" + registeredNuageVspDevice;
+} else {
+newValue = registeredNuageVspDevice;
+}
+_configDao.update("nuagevsp.cms.id", newValue);
 }
-return true;
 }
 
-private void initNuageScheduledTasks() {
-Integer numOfSyncThreads = 
Integer.valueOf(_configDao.getValue(NuageVspManager.NuageVspSyncWorkers.key()));
-Integer syncUpIntervalInMinutes = 
Integer.valueOf(_configDao.getValue(NuageVspManager.NuageVspSyncInterval.key()));
-
-if (numOfSyncThreads != null && syncUpIntervalInMinutes != null) {
-ThreadFactory threadFactory = new ThreadFactory() {
-public Thread newThread(Runnable runnable) {
-Thread thread = new Thread(runnable, "Nuage Vsp sync 
task");
-if (thread.isDaemon())
-thread.setDaemon(false);
-if (thread.getPriority() != Thread.NORM_PRIORITY)
-thread.setPriority(Thread.NORM_PRIORITY);
-return thread;
+private void auditHost(HostVO host) {
+_hostDao.loadDetails(host);
+
+boolean validateDomains = true;
+List nuageVspDevices = 
_nuageVspDao.listByHost(host.getId());
+if (!CollectionUtils.isEmpty(nuageVspDevices)) {
+for (NuageVspDeviceVO nuageVspDevice : nuageVspDevices) {
+ConfigurationVO cmsIdConfig = 
_configDao.findByName("nuagevsp.cms.id");
+String nuageVspCmsId = 
findNuageVspCmsIdForDevice(nuageVspDevice.getId(), cmsIdConfig);
+SyncNuageVspCmsIdCommand syncCmd = new 
SyncNuageVspCmsIdCommand(SyncType.AUDIT, nuageVspCmsId);
+SyncNuageVspCmsIdAnswer answer = (SyncNuageVspCmsIdAnswer) 
_agentMgr.easySend(nuageVspDevice.getHostId(), syncCmd);
+
+if (answer != null && !answer.getSuccess()) {
+s_logger.fatal("Nuage VSP Device with ID " + 
nuageVspDevice.getId() + " is configured with an unknown CMS ID!");
+validateDomains = false;
+} else if (answer != null && answer.getSyncType() == 
SyncType.REGISTER) {
+registerNewNuageVspDevice(cmsIdConfig, 
nuageVspDevice.getId() + ":" + answer.getNuageVspCmsId());
 }
-};
-scheduler = Executors.newScheduledThreadPool(numOfSyncThreads, 
threadFactory);
-scheduler.scheduleWithFixedDelay(new 
NuageVspSyncTask("FLOATING_IP"), ONE_MINUTE_MULTIPLIER * 15, 
ONE_MINUTE_MULTIPLIER * syncUpIntervalInMinutes,
-TimeUnit.MILLISECONDS);
-scheduler.scheduleWithFixedDelay(new 
NuageVspSyncTask("ENTERPRISE_NTWK_MACRO"), ONE_MINUTE_MULTIPLIER * 15, 
ONE_MINUTE_MULTIPLIER * syncUpIntervalInMinutes,
-TimeUnit.MILLISECONDS);
-scheduler
-.scheduleWithFixedDelay(new 
NuageVspSyncTask("ENTERPRISE"), ONE_MINUTE_MULTIPLIER * 15, 
ONE_MINUTE_MULTIPLIER * syncUpIntervalInMinutes, TimeUnit.MILLISECONDS);
-} else {
-s_logger.warn("NuageVsp configuration for syncWorkers=" 

[GitHub] cloudstack pull request: CLOUDSTACK-8832 : Update Nuage VSP plugin...

2015-10-12 Thread jburwell
Github user jburwell commented on a diff in the pull request:

https://github.com/apache/cloudstack/pull/801#discussion_r41805905
  
--- Diff: 
plugins/network-elements/nuage-vsp/src/com/cloud/network/manager/NuageVspManagerImpl.java
 ---
@@ -285,60 +507,341 @@ public boolean 
deleteNuageVspDevice(DeleteNuageVspDeviceCmd cmd) {
 return responseList;
 }
 
-@Override
-public boolean configure(String name, Map params) 
throws ConfigurationException {
-try {
-initNuageScheduledTasks();
-} catch (Exception ce) {
-s_logger.warn("Failed to load NuageVsp configuration 
properties. Check if the NuageVsp properties are configured correctly");
+private void registerNewNuageVspDevice(ConfigurationVO currentConfig, 
String registeredNuageVspDevice) {
+if (currentConfig == null) {
+ConfigKey configKey = new 
ConfigKey("Advanced", String.class, "nuagevsp.cms.id", 
registeredNuageVspDevice,
+": - Do 
not edit", false);
+ConfigurationVO configuration = new 
ConfigurationVO("management-server", configKey);
+_configDao.persist(configuration);
+} else {
+String newValue;
+String currentValue = currentConfig.getValue();
+if (StringUtils.isNotBlank(currentValue)) {
+newValue = currentValue + ";" + registeredNuageVspDevice;
+} else {
+newValue = registeredNuageVspDevice;
+}
+_configDao.update("nuagevsp.cms.id", newValue);
 }
-return true;
 }
 
-private void initNuageScheduledTasks() {
-Integer numOfSyncThreads = 
Integer.valueOf(_configDao.getValue(NuageVspManager.NuageVspSyncWorkers.key()));
-Integer syncUpIntervalInMinutes = 
Integer.valueOf(_configDao.getValue(NuageVspManager.NuageVspSyncInterval.key()));
-
-if (numOfSyncThreads != null && syncUpIntervalInMinutes != null) {
-ThreadFactory threadFactory = new ThreadFactory() {
-public Thread newThread(Runnable runnable) {
-Thread thread = new Thread(runnable, "Nuage Vsp sync 
task");
-if (thread.isDaemon())
-thread.setDaemon(false);
-if (thread.getPriority() != Thread.NORM_PRIORITY)
-thread.setPriority(Thread.NORM_PRIORITY);
-return thread;
+private void auditHost(HostVO host) {
+_hostDao.loadDetails(host);
+
+boolean validateDomains = true;
+List nuageVspDevices = 
_nuageVspDao.listByHost(host.getId());
+if (!CollectionUtils.isEmpty(nuageVspDevices)) {
+for (NuageVspDeviceVO nuageVspDevice : nuageVspDevices) {
+ConfigurationVO cmsIdConfig = 
_configDao.findByName("nuagevsp.cms.id");
+String nuageVspCmsId = 
findNuageVspCmsIdForDevice(nuageVspDevice.getId(), cmsIdConfig);
+SyncNuageVspCmsIdCommand syncCmd = new 
SyncNuageVspCmsIdCommand(SyncType.AUDIT, nuageVspCmsId);
+SyncNuageVspCmsIdAnswer answer = (SyncNuageVspCmsIdAnswer) 
_agentMgr.easySend(nuageVspDevice.getHostId(), syncCmd);
+
+if (answer != null && !answer.getSuccess()) {
+s_logger.fatal("Nuage VSP Device with ID " + 
nuageVspDevice.getId() + " is configured with an unknown CMS ID!");
+validateDomains = false;
+} else if (answer != null && answer.getSyncType() == 
SyncType.REGISTER) {
+registerNewNuageVspDevice(cmsIdConfig, 
nuageVspDevice.getId() + ":" + answer.getNuageVspCmsId());
 }
-};
-scheduler = Executors.newScheduledThreadPool(numOfSyncThreads, 
threadFactory);
-scheduler.scheduleWithFixedDelay(new 
NuageVspSyncTask("FLOATING_IP"), ONE_MINUTE_MULTIPLIER * 15, 
ONE_MINUTE_MULTIPLIER * syncUpIntervalInMinutes,
-TimeUnit.MILLISECONDS);
-scheduler.scheduleWithFixedDelay(new 
NuageVspSyncTask("ENTERPRISE_NTWK_MACRO"), ONE_MINUTE_MULTIPLIER * 15, 
ONE_MINUTE_MULTIPLIER * syncUpIntervalInMinutes,
-TimeUnit.MILLISECONDS);
-scheduler
-.scheduleWithFixedDelay(new 
NuageVspSyncTask("ENTERPRISE"), ONE_MINUTE_MULTIPLIER * 15, 
ONE_MINUTE_MULTIPLIER * syncUpIntervalInMinutes, TimeUnit.MILLISECONDS);
-} else {
-s_logger.warn("NuageVsp configuration for syncWorkers=" 

[GitHub] cloudstack pull request: CLOUDSTACK-8832 : Update Nuage VSP plugin...

2015-10-12 Thread jburwell
Github user jburwell commented on a diff in the pull request:

https://github.com/apache/cloudstack/pull/801#discussion_r41805940
  
--- Diff: 
plugins/network-elements/nuage-vsp/src/com/cloud/network/manager/NuageVspManagerImpl.java
 ---
@@ -285,60 +507,341 @@ public boolean 
deleteNuageVspDevice(DeleteNuageVspDeviceCmd cmd) {
 return responseList;
 }
 
-@Override
-public boolean configure(String name, Map params) 
throws ConfigurationException {
-try {
-initNuageScheduledTasks();
-} catch (Exception ce) {
-s_logger.warn("Failed to load NuageVsp configuration 
properties. Check if the NuageVsp properties are configured correctly");
+private void registerNewNuageVspDevice(ConfigurationVO currentConfig, 
String registeredNuageVspDevice) {
+if (currentConfig == null) {
+ConfigKey configKey = new 
ConfigKey("Advanced", String.class, "nuagevsp.cms.id", 
registeredNuageVspDevice,
+": - Do 
not edit", false);
+ConfigurationVO configuration = new 
ConfigurationVO("management-server", configKey);
+_configDao.persist(configuration);
+} else {
+String newValue;
+String currentValue = currentConfig.getValue();
+if (StringUtils.isNotBlank(currentValue)) {
+newValue = currentValue + ";" + registeredNuageVspDevice;
+} else {
+newValue = registeredNuageVspDevice;
+}
+_configDao.update("nuagevsp.cms.id", newValue);
 }
-return true;
 }
 
-private void initNuageScheduledTasks() {
-Integer numOfSyncThreads = 
Integer.valueOf(_configDao.getValue(NuageVspManager.NuageVspSyncWorkers.key()));
-Integer syncUpIntervalInMinutes = 
Integer.valueOf(_configDao.getValue(NuageVspManager.NuageVspSyncInterval.key()));
-
-if (numOfSyncThreads != null && syncUpIntervalInMinutes != null) {
-ThreadFactory threadFactory = new ThreadFactory() {
-public Thread newThread(Runnable runnable) {
-Thread thread = new Thread(runnable, "Nuage Vsp sync 
task");
-if (thread.isDaemon())
-thread.setDaemon(false);
-if (thread.getPriority() != Thread.NORM_PRIORITY)
-thread.setPriority(Thread.NORM_PRIORITY);
-return thread;
+private void auditHost(HostVO host) {
+_hostDao.loadDetails(host);
+
+boolean validateDomains = true;
+List nuageVspDevices = 
_nuageVspDao.listByHost(host.getId());
+if (!CollectionUtils.isEmpty(nuageVspDevices)) {
+for (NuageVspDeviceVO nuageVspDevice : nuageVspDevices) {
+ConfigurationVO cmsIdConfig = 
_configDao.findByName("nuagevsp.cms.id");
+String nuageVspCmsId = 
findNuageVspCmsIdForDevice(nuageVspDevice.getId(), cmsIdConfig);
+SyncNuageVspCmsIdCommand syncCmd = new 
SyncNuageVspCmsIdCommand(SyncType.AUDIT, nuageVspCmsId);
+SyncNuageVspCmsIdAnswer answer = (SyncNuageVspCmsIdAnswer) 
_agentMgr.easySend(nuageVspDevice.getHostId(), syncCmd);
+
+if (answer != null && !answer.getSuccess()) {
+s_logger.fatal("Nuage VSP Device with ID " + 
nuageVspDevice.getId() + " is configured with an unknown CMS ID!");
+validateDomains = false;
+} else if (answer != null && answer.getSyncType() == 
SyncType.REGISTER) {
+registerNewNuageVspDevice(cmsIdConfig, 
nuageVspDevice.getId() + ":" + answer.getNuageVspCmsId());
 }
-};
-scheduler = Executors.newScheduledThreadPool(numOfSyncThreads, 
threadFactory);
-scheduler.scheduleWithFixedDelay(new 
NuageVspSyncTask("FLOATING_IP"), ONE_MINUTE_MULTIPLIER * 15, 
ONE_MINUTE_MULTIPLIER * syncUpIntervalInMinutes,
-TimeUnit.MILLISECONDS);
-scheduler.scheduleWithFixedDelay(new 
NuageVspSyncTask("ENTERPRISE_NTWK_MACRO"), ONE_MINUTE_MULTIPLIER * 15, 
ONE_MINUTE_MULTIPLIER * syncUpIntervalInMinutes,
-TimeUnit.MILLISECONDS);
-scheduler
-.scheduleWithFixedDelay(new 
NuageVspSyncTask("ENTERPRISE"), ONE_MINUTE_MULTIPLIER * 15, 
ONE_MINUTE_MULTIPLIER * syncUpIntervalInMinutes, TimeUnit.MILLISECONDS);
-} else {
-s_logger.warn("NuageVsp configuration for syncWorkers=" 

[GitHub] cloudstack pull request: CLOUDSTACK-8832 : Update Nuage VSP plugin...

2015-10-12 Thread jburwell
Github user jburwell commented on a diff in the pull request:

https://github.com/apache/cloudstack/pull/801#discussion_r41806010
  
--- Diff: 
plugins/network-elements/nuage-vsp/src/com/cloud/network/resource/NuageVspResource.java
 ---
@@ -262,15 +260,19 @@ public String getName() {
 public PingCommand getCurrentStatus(long id) {
 if ((_relativePath == null) || (_relativePath.isEmpty()) || 
(_cmsUserInfo == null) || (_cmsUserInfo.length == 0)) {
 s_logger.error("Failed to ping to Nuage VSD");
--- End diff --

Please add identifying information about Nuage VSP that failed to ping.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] cloudstack pull request: CLOUDSTACK-8832 : Update Nuage VSP plugin...

2015-10-12 Thread jburwell
Github user jburwell commented on a diff in the pull request:

https://github.com/apache/cloudstack/pull/801#discussion_r41806067
  
--- Diff: 
plugins/network-elements/nuage-vsp/src/com/cloud/network/resource/NuageVspResource.java
 ---
@@ -360,32 +375,25 @@ private Answer 
executeRequest(ImplementNetworkVspCommand cmd) {
 private Answer executeRequest(ReserveVmInterfaceVspCommand cmd) {
 try {
 isNuageVspGuruLoaded();
-List> vmInterfaceInfo = 
_nuageVspGuruClient.reserve(cmd.getNicUuid(), cmd.getNicMacAddress(), 
cmd.getNetworkUuid(), cmd.isL3Network(),
-cmd.getVpcUuid(), cmd.getNetworkDomainUuid(), 
cmd.getNetworksAccountUuid(), cmd.isDomainRouter(), cmd._getDomainRouterIp(), 
cmd._getVmInstanceName(),
-cmd._getVmUuid());
-return new ReserveVmInterfaceVspAnswer(cmd, vmInterfaceInfo, 
"Created NIC in VSP that maps to nicUuid" + cmd.getNicUuid());
+_nuageVspGuruClient.reserve(cmd.getNicUuid(), 
cmd.getNicMacAddress(), cmd.getNetworkUuid(), cmd.isL3Network(),
+cmd.isSharedNetwork(), cmd.getVpcUuid(), 
cmd.getNetworkDomainUuid(), cmd.getNetworksAccountUuid(), cmd.isDomainRouter(), 
cmd.getDomainRouterIp(),
+cmd.getVmInstanceName(), cmd.getVmUuid(), 
cmd.useStaticIp(), cmd.getStaticIp(), cmd.getStaticNatIpUuid(), 
cmd.getStaticNatIpAddress(), cmd.isStaticNatIpAllocated(),
+cmd.isOneToOneNat(), cmd.getStaticNatVlanUuid(), 
cmd.getStaticNatVlanGateway(), cmd.getStaticNatVlanNetmask());
+return new ReserveVmInterfaceVspAnswer(cmd, "Created NIC in 
VSP that maps to nicUuid" + cmd.getNicUuid());
--- End diff --

Please add identifying for the Nuage VSP device to assist with operational 
debugging.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] cloudstack pull request: CLOUDSTACK-8832 : Update Nuage VSP plugin...

2015-10-12 Thread jburwell
Github user jburwell commented on a diff in the pull request:

https://github.com/apache/cloudstack/pull/801#discussion_r41806130
  
--- Diff: 
plugins/network-elements/nuage-vsp/src/com/cloud/network/resource/NuageVspResource.java
 ---
@@ -360,32 +375,25 @@ private Answer 
executeRequest(ImplementNetworkVspCommand cmd) {
 private Answer executeRequest(ReserveVmInterfaceVspCommand cmd) {
 try {
 isNuageVspGuruLoaded();
-List> vmInterfaceInfo = 
_nuageVspGuruClient.reserve(cmd.getNicUuid(), cmd.getNicMacAddress(), 
cmd.getNetworkUuid(), cmd.isL3Network(),
-cmd.getVpcUuid(), cmd.getNetworkDomainUuid(), 
cmd.getNetworksAccountUuid(), cmd.isDomainRouter(), cmd._getDomainRouterIp(), 
cmd._getVmInstanceName(),
-cmd._getVmUuid());
-return new ReserveVmInterfaceVspAnswer(cmd, vmInterfaceInfo, 
"Created NIC in VSP that maps to nicUuid" + cmd.getNicUuid());
+_nuageVspGuruClient.reserve(cmd.getNicUuid(), 
cmd.getNicMacAddress(), cmd.getNetworkUuid(), cmd.isL3Network(),
+cmd.isSharedNetwork(), cmd.getVpcUuid(), 
cmd.getNetworkDomainUuid(), cmd.getNetworksAccountUuid(), cmd.isDomainRouter(), 
cmd.getDomainRouterIp(),
+cmd.getVmInstanceName(), cmd.getVmUuid(), 
cmd.useStaticIp(), cmd.getStaticIp(), cmd.getStaticNatIpUuid(), 
cmd.getStaticNatIpAddress(), cmd.isStaticNatIpAllocated(),
+cmd.isOneToOneNat(), cmd.getStaticNatVlanUuid(), 
cmd.getStaticNatVlanGateway(), cmd.getStaticNatVlanNetmask());
+return new ReserveVmInterfaceVspAnswer(cmd, "Created NIC in 
VSP that maps to nicUuid" + cmd.getNicUuid());
 } catch (Exception e) {
+s_logger.error("Failure during " + cmd, e);
 return new ReserveVmInterfaceVspAnswer(cmd, e);
 }
 }
 
-private Answer executeRequest(ReleaseVmVspCommand cmd) {
-try {
-isNuageVspGuruLoaded();
-_nuageVspGuruClient.release(cmd.getNetworkUuid(), 
cmd.getVmUuid(), cmd.getVmInstanceName());
-return new ReleaseVmVspAnswer(cmd, true, "VM has been deleted 
from VSP.");
-} catch (Exception e) {
-return new ReleaseVmVspAnswer(cmd, e);
-}
-}
-
 private Answer executeRequest(DeallocateVmVspCommand cmd) {
 try {
 isNuageVspGuruLoaded();
-_nuageVspGuruClient.deallocate(cmd.getNetworkUuid(), 
cmd.getNicFrmDdUuid(), cmd.getNicMacAddress(), cmd.getNicIp4Address(), 
cmd.isL3Network(), cmd.getVpcUuid(),
-cmd.getNetworksDomainUuid(), cmd.getVmInstanceName(), 
cmd.getVmUuid());
+_nuageVspGuruClient.deallocate(cmd.getNetworkUuid(), 
cmd.getNicFromDdUuid(), cmd.getNicMacAddress(), cmd.getNicIp4Address(), 
cmd.isL3Network(), cmd.isSharedNetwork(),
+cmd.getVpcUuid(), cmd.getNetworksDomainUuid(), 
cmd.getVmInstanceName(), cmd.getVmUuid(), cmd.isExpungingState());
 return new DeallocateVmVspAnswer(cmd, true, "Deallocated VM 
from Nuage VSP.");
 } catch (Exception e) {
--- End diff --

What are all unchecked and checked exceptions being caught?  It seems like 
we should only be catching the expected checked exceptions, and allow unchecked 
exceptions simply bubble out.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] cloudstack pull request: CLOUDSTACK-8832 : Update Nuage VSP plugin...

2015-10-12 Thread jburwell
Github user jburwell commented on a diff in the pull request:

https://github.com/apache/cloudstack/pull/801#discussion_r41806177
  
--- Diff: 
plugins/network-elements/nuage-vsp/src/com/cloud/network/resource/NuageVspResource.java
 ---
@@ -393,9 +401,10 @@ private Answer executeRequest(DeallocateVmVspCommand 
cmd) {
 private Answer executeRequest(TrashNetworkVspCommand cmd) {
 try {
 isNuageVspGuruLoaded();
-_nuageVspGuruClient.trash(cmd.getDomainUuid(), 
cmd.getNetworkUuid(), cmd.isL3Network(), cmd.getVpcUuid());
+_nuageVspGuruClient.trash(cmd.getDomainUuid(), 
cmd.getNetworkUuid(), cmd.isL3Network(), cmd.isSharedNetwork(), 
cmd.getVpcUuid(), cmd.getDomainTemplateName());
 return new TrashNetworkVspAnswer(cmd, true, "Deleted Nuage VSP 
network mapping to " + cmd.getNetworkUuid());
 } catch (Exception e) {
--- End diff --

Why are all unchecked and checked exceptions being caught?  It seems like 
we should only be catching the expected checked exceptions, and allow unchecked 
exceptions simply bubble out.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] cloudstack pull request: CLOUDSTACK-8832 : Update Nuage VSP plugin...

2015-10-12 Thread jburwell
Github user jburwell commented on a diff in the pull request:

https://github.com/apache/cloudstack/pull/801#discussion_r41806223
  
--- Diff: 
plugins/network-elements/nuage-vsp/src/com/cloud/network/resource/NuageVspResource.java
 ---
@@ -424,9 +449,10 @@ private Answer executeRequest(ApplyAclRuleVspCommand 
cmd) {
 private Answer executeRequest(ShutDownVpcVspCommand cmd) {
 try {
 isNuageVspElementLoaded();
-_nuageVspElementClient.shutDownVpc(cmd.getDomainUuid(), 
cmd.getVpcUuid());
+_nuageVspElementClient.shutdownVpc(cmd.getDomainUuid(), 
cmd.getVpcUuid(), cmd.getDomainTemplateName());
 return new ShutDownVpcVspAnswer(cmd, true, "Shutdown VPC " + 
cmd.getVpcUuid());
 } catch (Exception e) {
--- End diff --

Why are all unchecked and checked exceptions being caught?  It seems like 
we should only be catching the expected checked exceptions, and allow unchecked 
exceptions simply bubble out.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] cloudstack pull request: CLOUDSTACK-8832 : Update Nuage VSP plugin...

2015-10-12 Thread jburwell
Github user jburwell commented on a diff in the pull request:

https://github.com/apache/cloudstack/pull/801#discussion_r41806186
  
--- Diff: 
plugins/network-elements/nuage-vsp/src/com/cloud/network/resource/NuageVspResource.java
 ---
@@ -403,20 +412,36 @@ private Answer executeRequest(TrashNetworkVspCommand 
cmd) {
 private Answer executeRequest(ApplyStaticNatVspCommand cmd) {
 try {
 isNuageVspElementLoaded();
-
_nuageVspElementClient.applyStaticNats(cmd.getNetworkDomainUuid(), 
cmd.getVpcOrSubnetUuid(), cmd.isL3Network(), cmd.getStaticNatDetails());
+
_nuageVspElementClient.applyStaticNats(cmd.getNetworkDomainUuid(), 
cmd.getNetworkUuid(), cmd.getVpcOrSubnetUuid(), cmd.isL3Network(),
+cmd.isVpc(), cmd.getStaticNatDetails());
 return new ApplyStaticNatVspAnswer(cmd, true, "Applied Static 
NAT to VSP network mapping to " + cmd.getVpcOrSubnetUuid());
 } catch (Exception e) {
+s_logger.error("Failure during " + cmd, e);
 return new ApplyStaticNatVspAnswer(cmd, e);
 }
 }
 
+private Answer executeRequest(ImplementVspCommand cmd) {
+try {
+isNuageVspElementLoaded();
+boolean success = 
_nuageVspElementClient.implement(cmd.getNetworkId(), 
cmd.getNetworkDomainUuid(), cmd.getNetworkUuid(), cmd.getNetworkName(), 
cmd.getVpcOrSubnetUuid(), cmd.isL2Network(),
+cmd.isL3Network(), cmd.isVpc(), cmd.isShared(), 
cmd.getDomainTemplateName(), cmd.isFirewallServiceSupported(), 
cmd.getDnsServers(), cmd.getIngressFirewallRules(),
+cmd.getEgressFirewallRules(), cmd.getAcsFipUuid(), 
cmd.isEgressDefaultPolicy());
+return new ImplementVspAnswer(cmd, success, "Implemented 
network in VSP " + cmd.getNetworkUuid());
+} catch (Exception e) {
--- End diff --

Why are all unchecked and checked exceptions being caught?  It seems like 
we should only be catching the expected checked exceptions, and allow unchecked 
exceptions simply bubble out.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] cloudstack pull request: CLOUDSTACK-8832 : Update Nuage VSP plugin...

2015-10-12 Thread jburwell
Github user jburwell commented on a diff in the pull request:

https://github.com/apache/cloudstack/pull/801#discussion_r41806263
  
--- Diff: 
plugins/network-elements/nuage-vsp/src/com/cloud/network/resource/NuageVspResource.java
 ---
@@ -441,6 +456,44 @@ private Answer executeRequest(SyncVspCommand cmd) {
 }
 }
 
+private Answer executeRequest(SyncNuageVspCmsIdCommand cmd) {
+try {
+isNuageVspManagerLoaded();
+if (cmd.getSyncType() == SyncType.AUDIT || cmd.getSyncType() 
== SyncType.AUDIT_ONLY) {
+Pair answer = 
_nuageVspManagerClient.auditNuageVspCmsId(cmd.getNuageVspCmsId(), 
cmd.getSyncType() == SyncType.AUDIT_ONLY);
+return new SyncNuageVspCmsIdAnswer(answer.getLeft(), 
answer.getRight(), cmd.getSyncType());
+} else if (cmd.getSyncType() == SyncType.REGISTER) {
+String registeredNuageVspCmsId = 
_nuageVspManagerClient.registerNuageVspCmsId();
+return new 
SyncNuageVspCmsIdAnswer(StringUtils.isNotBlank(registeredNuageVspCmsId), 
registeredNuageVspCmsId, cmd.getSyncType());
+} else {
+boolean success = 
_nuageVspManagerClient.unregisterNuageVspCmsId(cmd.getNuageVspCmsId());
+return new SyncNuageVspCmsIdAnswer(success, 
cmd.getNuageVspCmsId(), cmd.getSyncType());
+}
+} catch (Exception e) {
--- End diff --

Why are all unchecked and checked exceptions being caught?  It seems like 
we should only be catching the expected checked exceptions, and allow unchecked 
exceptions simply bubble out.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] cloudstack pull request: CLOUDSTACK-8832 : Update Nuage VSP plugin...

2015-10-12 Thread jburwell
Github user jburwell commented on a diff in the pull request:

https://github.com/apache/cloudstack/pull/801#discussion_r41806251
  
--- Diff: 
plugins/network-elements/nuage-vsp/src/com/cloud/network/resource/NuageVspResource.java
 ---
@@ -424,9 +449,10 @@ private Answer executeRequest(ApplyAclRuleVspCommand 
cmd) {
 private Answer executeRequest(ShutDownVpcVspCommand cmd) {
 try {
 isNuageVspElementLoaded();
-_nuageVspElementClient.shutDownVpc(cmd.getDomainUuid(), 
cmd.getVpcUuid());
+_nuageVspElementClient.shutdownVpc(cmd.getDomainUuid(), 
cmd.getVpcUuid(), cmd.getDomainTemplateName());
 return new ShutDownVpcVspAnswer(cmd, true, "Shutdown VPC " + 
cmd.getVpcUuid());
 } catch (Exception e) {
+s_logger.error("Failure during " + cmd, e);
--- End diff --

Please add identifying information about Nuage VSP device to assist with 
operational debugging.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] cloudstack pull request: CLOUDSTACK-8832 : Update Nuage VSP plugin...

2015-10-12 Thread jburwell
Github user jburwell commented on a diff in the pull request:

https://github.com/apache/cloudstack/pull/801#discussion_r41806277
  
--- Diff: 
plugins/network-elements/nuage-vsp/src/com/cloud/network/resource/NuageVspResource.java
 ---
@@ -441,6 +456,44 @@ private Answer executeRequest(SyncVspCommand cmd) {
 }
 }
 
+private Answer executeRequest(SyncNuageVspCmsIdCommand cmd) {
+try {
+isNuageVspManagerLoaded();
+if (cmd.getSyncType() == SyncType.AUDIT || cmd.getSyncType() 
== SyncType.AUDIT_ONLY) {
+Pair answer = 
_nuageVspManagerClient.auditNuageVspCmsId(cmd.getNuageVspCmsId(), 
cmd.getSyncType() == SyncType.AUDIT_ONLY);
+return new SyncNuageVspCmsIdAnswer(answer.getLeft(), 
answer.getRight(), cmd.getSyncType());
+} else if (cmd.getSyncType() == SyncType.REGISTER) {
+String registeredNuageVspCmsId = 
_nuageVspManagerClient.registerNuageVspCmsId();
+return new 
SyncNuageVspCmsIdAnswer(StringUtils.isNotBlank(registeredNuageVspCmsId), 
registeredNuageVspCmsId, cmd.getSyncType());
+} else {
+boolean success = 
_nuageVspManagerClient.unregisterNuageVspCmsId(cmd.getNuageVspCmsId());
+return new SyncNuageVspCmsIdAnswer(success, 
cmd.getNuageVspCmsId(), cmd.getSyncType());
+}
+} catch (Exception e) {
+return new SyncNuageVspCmsIdAnswer(false, null, 
cmd.getSyncType());
+}
+}
+
+private Answer executeRequest(SyncDomainCommand cmd) {
+try {
+isNuageVspManagerLoaded();
+boolean success = 
_nuageVspManagerClient.syncDomainWithNuageVsp(cmd.getDomainUuid(), 
cmd.getDomainName(), cmd.getDomainPath(), cmd.isToAdd(), cmd.isToRemove());
+return new SyncDomainAnswer(success);
+} catch (Exception e) {
--- End diff --

Why are all unchecked and checked exceptions being caught?  It seems like 
we should only be catching the expected checked exceptions, and allow unchecked 
exceptions simply bubble out.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


  1   2   3   4   5   6   7   8   9   10   >