[GitHub] cloudstack pull request #1624: Fixes regarding VOLUME_DELETE events resultin...

2016-10-22 Thread asfgit
Github user asfgit closed the pull request at:

https://github.com/apache/cloudstack/pull/1624


---
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 #1624: Fixes regarding VOLUME_DELETE events resultin...

2016-09-17 Thread ProjectMoon
Github user ProjectMoon closed the pull request at:

https://github.com/apache/cloudstack/pull/1624


---
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 #1624: Fixes regarding VOLUME_DELETE events resultin...

2016-09-17 Thread ProjectMoon
GitHub user ProjectMoon reopened a pull request:

https://github.com/apache/cloudstack/pull/1624

Fixes regarding VOLUME_DELETE events resulting from account deletion

New version of #1491.

**Original Description**
New version of #1373, but updated for the 4.7 branch with another fix that 
allows it to properly find expunged root volumes. This is a bug fix, which is 
why we target the 4.7 branch.

Original pull request:
Fixes regarding usage event emission.

UsageEventUtils was previously not checking deleted accounts, which meant 
that if an account was deleted that had some resources running on it, those 
resources would get destroyed without emitting any events.

Furthermore, the VOLUME_DELETE event of ROOT volumes is the responsibility 
of the UserVmManager, which gets circumvented when expunging resources 
following the account deletion. Added a check to the AccountManager which 
catches the ROOT volumes that need to be deleted and emits events for them.

To test this: Create a new user. As that user, create and destroy an 
instance. This should cause the VM_CREATE, VM_START, VM_STOP, VM_DESTROY, 
VOLUME_CREATE, and VOLUME_DELETE events to be emitted. 
Create a new instance as the same user. Log in as admin, and delete the 
user. The same set of events should be emitted, and there should be no 
duplicate DELETE events for the ROOT volume of the previous instance.

You can merge this pull request into a Git repository by running:

$ git pull https://github.com/greenqloud/cloudstack 
pr-volume-usage-events-fixes-4.8

Alternatively you can review and apply these changes as the patch at:

https://github.com/apache/cloudstack/pull/1624.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

This closes #1624


commit 24a194939b46488e38af6913f417d7e08ebf5eb3
Author: nnesic 
Date:   2015-10-12T13:15:30Z

Emit a VOLUME_DELETE usage event when account deletion destroys an instance.

Currently the logic about volume deletion seems to be that an event
should be emitted when the volume delete is requested, not when the
deletion completes.

The VolumeStateListener specifically ignores destroy events for ROOT
volumes, assuming that the ROOT volume only gets deleted when the
instance is destroyed and the UserVmManager should take care of it.

When deleting an account, all of its resources get destroyed, but the
instance expunging circumvents the UserVmManager, and thus we miss the
VOLUME_DESTROY usage event.  Added a check in the AccountManager to
emit the deletion event for ROOT volumes belonging to instances which
weren't destroyed prior to the account deletion.

commit 609c3bb17be96c68cd3652fb1e8439e1907a8176
Author: nnesic 
Date:   2016-09-13T10:01:50Z

Instead of emitting volume delete events directly, account manager
now attempts to propperly destroy the vm before expunging it. This
way the destroy logic is respected, including the event emission.
Unit tests have been modified accordingly.




---
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 #1624: Fixes regarding VOLUME_DELETE events resultin...

2016-09-12 Thread nnesic
Github user nnesic commented on a diff in the pull request:

https://github.com/apache/cloudstack/pull/1624#discussion_r78407479
  
--- Diff: server/src/com/cloud/user/AccountManagerImpl.java ---
@@ -761,6 +774,17 @@ protected boolean cleanupAccount(AccountVO account, 
long callerUserId, Account c
 s_logger.error("Unable to expunge vm: " + vm.getId());
 accountCleanupNeeded = true;
 }
+else if 
(!vm.getState().equals(VirtualMachine.State.Destroyed)) {
+// We have to emit the event here because the state 
listener is ignoring root volume deletions,
+// assuming that the UserVMManager is responsible for 
emitting the usage event for them when
--- End diff --

The reason why the delete events for the root volume are not handled by the 
state listener is that the root volumes don't get destroyed until the VM is 
expunged. Because of this, if we rely on the state listener to emit the event, 
the timestamp on the event will not reflect the actual time when the user 
requested and expects the volume to be destroyed. 

For now, I would not move the logic for handling these events out of 
UserVMManager. However, thinking about this again, I agree that it would be 
better not to scatter this event emitting further. Instead, I am working adding 
a call to vmMgr.destroy during the cleanup of the account (right now the 
manager is taking a shortcut, and expunging machines directly). Does that sound 
better?


---
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 #1624: Fixes regarding VOLUME_DELETE events resultin...

2016-09-02 Thread rhtyd
Github user rhtyd commented on a diff in the pull request:

https://github.com/apache/cloudstack/pull/1624#discussion_r77326112
  
--- Diff: server/src/com/cloud/user/AccountManagerImpl.java ---
@@ -761,6 +774,17 @@ protected boolean cleanupAccount(AccountVO account, 
long callerUserId, Account c
 s_logger.error("Unable to expunge vm: " + vm.getId());
 accountCleanupNeeded = true;
 }
+else if 
(!vm.getState().equals(VirtualMachine.State.Destroyed)) {
+// We have to emit the event here because the state 
listener is ignoring root volume deletions,
+// assuming that the UserVMManager is responsible for 
emitting the usage event for them when
--- End diff --

Why not fix the state listener, or the manager that is responsible for 
emitting the event in the first place?


---
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 #1624: Fixes regarding VOLUME_DELETE events resultin...

2016-09-02 Thread rhtyd
Github user rhtyd commented on a diff in the pull request:

https://github.com/apache/cloudstack/pull/1624#discussion_r77325991
  
--- Diff: server/src/com/cloud/user/AccountManagerImpl.java ---
@@ -677,6 +679,17 @@ public boolean deleteAccount(AccountVO account, long 
callerUserId, Account calle
 return cleanupAccount(account, callerUserId, caller);
 }
 
+protected List getExpungedInstanceRootVolume(long 
instanceId) {
+SearchBuilder sb = _volumeDao.createSearchBuilder();
+sb.and("instanceId", sb.entity().getInstanceId(), 
SearchCriteria.Op.EQ);
+sb.and("vType", sb.entity().getVolumeType(), SearchCriteria.Op.EQ);
+sb.done();
+SearchCriteria c = sb.create();
+c.setParameters("instanceId", instanceId);
+c.setParameters("vType", Volume.Type.ROOT);
+return _volumeDao.customSearchIncludingRemoved(c, null);
--- End diff --

This method does not return expunged volume, but root volume of a VM. Could 
there be a case where a VM can have more than one root volume? If not, let's 
rename the method to say `getInstanceRootVolume` and return just the VolumeVO 
instead a 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 #1624: Fixes regarding VOLUME_DELETE events resultin...

2016-08-29 Thread ProjectMoon
GitHub user ProjectMoon reopened a pull request:

https://github.com/apache/cloudstack/pull/1624

Fixes regarding VOLUME_DELETE events resulting from account deletion

New version of #1491.

**Original Description**
New version of #1373, but updated for the 4.7 branch with another fix that 
allows it to properly find expunged root volumes. This is a bug fix, which is 
why we target the 4.7 branch.

Original pull request:
Fixes regarding usage event emission.

UsageEventUtils was previously not checking deleted accounts, which meant 
that if an account was deleted that had some resources running on it, those 
resources would get destroyed without emitting any events.

Furthermore, the VOLUME_DELETE event of ROOT volumes is the responsibility 
of the UserVmManager, which gets circumvented when expunging resources 
following the account deletion. Added a check to the AccountManager which 
catches the ROOT volumes that need to be deleted and emits events for them.

To test this: Create a new user. As that user, create and destroy an 
instance. This should cause the VM_CREATE, VM_START, VM_STOP, VM_DESTROY, 
VOLUME_CREATE, and VOLUME_DELETE events to be emitted. 
Create a new instance as the same user. Log in as admin, and delete the 
user. The same set of events should be emitted, and there should be no 
duplicate DELETE events for the ROOT volume of the previous instance.

You can merge this pull request into a Git repository by running:

$ git pull https://github.com/greenqloud/cloudstack 
pr-volume-usage-events-fixes-4.8

Alternatively you can review and apply these changes as the patch at:

https://github.com/apache/cloudstack/pull/1624.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

This closes #1624


commit 8009683e67da185bc3e6d630c42b0f614f1eb825
Author: nnesic 
Date:   2015-10-12T13:15:30Z

Emit a VOLUME_DELETE usage event when account deletion destroys an instance.

Currently the logic about volume deletion seems to be that an event
should be emitted when the volume delete is requested, not when the
deletion completes.

The VolumeStateListener specifically ignores destroy events for ROOT
volumes, assuming that the ROOT volume only gets deleted when the
instance is destroyed and the UserVmManager should take care of it.

When deleting an account, all of its resources get destroyed, but the
instance expunging circumvents the UserVmManager, and thus we miss the
VOLUME_DESTROY usage event.  Added a check in the AccountManager to
emit the deletion event for ROOT volumes belonging to instances which
weren't destroyed prior to the account deletion.




---
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 #1624: Fixes regarding VOLUME_DELETE events resultin...

2016-08-29 Thread ProjectMoon
Github user ProjectMoon closed the pull request at:

https://github.com/apache/cloudstack/pull/1624


---
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 #1624: Fixes regarding VOLUME_DELETE events resultin...

2016-08-28 Thread jburwell
Github user jburwell commented on a diff in the pull request:

https://github.com/apache/cloudstack/pull/1624#discussion_r76545408
  
--- Diff: server/test/com/cloud/user/AccountManagerImplTest.java ---
@@ -231,6 +253,73 @@ public void cleanup() {
 CallContext.unregister();
 }
 
+public UsageEventUtils setupUsageUtils() {
+_usageEventDao = new MockUsageEventDao();
+UsageEventUtils utils = new UsageEventUtils();
+
+Map usageUtilsFields = new HashMap();
+usageUtilsFields.put("usageEventDao", "_usageEventDao");
+usageUtilsFields.put("accountDao", "_accountDao");
+usageUtilsFields.put("dcDao", "_dcDao");
+usageUtilsFields.put("configDao", "_configDao");
--- End diff --

@ProjectMoon I got lost thinking it was in the main code base re-allocating 
a set of static values on every invocation would cause GC churn.  Not a 
significant concern in a test 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 #1624: Fixes regarding VOLUME_DELETE events resultin...

2016-08-23 Thread ProjectMoon
Github user ProjectMoon commented on a diff in the pull request:

https://github.com/apache/cloudstack/pull/1624#discussion_r75853547
  
--- Diff: server/test/com/cloud/user/AccountManagerImplTest.java ---
@@ -231,6 +253,73 @@ public void cleanup() {
 CallContext.unregister();
 }
 
+public UsageEventUtils setupUsageUtils() {
+_usageEventDao = new MockUsageEventDao();
+UsageEventUtils utils = new UsageEventUtils();
+
+Map usageUtilsFields = new HashMap();
+usageUtilsFields.put("usageEventDao", "_usageEventDao");
+usageUtilsFields.put("accountDao", "_accountDao");
+usageUtilsFields.put("dcDao", "_dcDao");
+usageUtilsFields.put("configDao", "_configDao");
--- End diff --

In this case, the map is not used outside of the method.


---
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 #1624: Fixes regarding VOLUME_DELETE events resultin...

2016-08-10 Thread jburwell
Github user jburwell commented on a diff in the pull request:

https://github.com/apache/cloudstack/pull/1624#discussion_r74314697
  
--- Diff: server/test/com/cloud/user/MockUsageEventDao.java ---
@@ -0,0 +1,356 @@
+// 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.user;
+
+import java.util.ArrayList;
+import java.util.Date;
+import java.util.List;
+import java.util.Map;
+
+import javax.naming.ConfigurationException;
+
+import com.cloud.event.UsageEventVO;
+import com.cloud.event.dao.UsageEventDao;
+import com.cloud.utils.Pair;
+import com.cloud.utils.db.Attribute;
+import com.cloud.utils.db.Filter;
+import com.cloud.utils.db.GenericSearchBuilder;
+import com.cloud.utils.db.SearchBuilder;
+import com.cloud.utils.db.SearchCriteria;
+
+public class MockUsageEventDao implements UsageEventDao{
+
+List persistedItems;
+
+public MockUsageEventDao() {
+persistedItems = new ArrayList();
+}
+
+@Override
+public UsageEventVO findById(Long id) {
+// TODO Auto-generated method stub
+return null;
+}
+
+@Override
+public UsageEventVO findByIdIncludingRemoved(Long id) {
+// TODO Auto-generated method stub
+return null;
+}
+
+@Override
+public UsageEventVO findById(Long id, boolean fresh) {
+// TODO Auto-generated method stub
+return null;
+}
+
+@Override
+public UsageEventVO findByUuid(String uuid) {
+// TODO Auto-generated method stub
+return null;
+}
+
+@Override
+public UsageEventVO findByUuidIncludingRemoved(String uuid) {
+// TODO Auto-generated method stub
+return null;
+}
+
+@Override
+public UsageEventVO createForUpdate() {
+// TODO Auto-generated method stub
+return null;
+}
+
+@Override
+public SearchBuilder createSearchBuilder() {
+// TODO Auto-generated method stub
+return null;
+}
+
+@Override
+public  GenericSearchBuilder createSearchBuilder(
+Class clazz) {
+// TODO Auto-generated method stub
+return null;
+}
+
+@Override
+public UsageEventVO createForUpdate(Long id) {
+// TODO Auto-generated method stub
+return null;
+}
+
+@Override
+public SearchCriteria createSearchCriteria() {
+// TODO Auto-generated method stub
+return null;
+}
+
+@Override
+public List lockRows(SearchCriteria sc,
+Filter filter, boolean exclusive) {
+// TODO Auto-generated method stub
+return null;
+}
+
+@Override
+public UsageEventVO lockOneRandomRow(SearchCriteria sc,
+boolean exclusive) {
+// TODO Auto-generated method stub
+return null;
+}
+
+@Override
+public UsageEventVO lockRow(Long id, Boolean exclusive) {
+// TODO Auto-generated method stub
+return null;
+}
+
+@Override
+public UsageEventVO acquireInLockTable(Long id) {
+// TODO Auto-generated method stub
+return null;
+}
+
+@Override
+public UsageEventVO acquireInLockTable(Long id, int seconds) {
+// TODO Auto-generated method stub
+return null;
+}
+
+@Override
+public boolean releaseFromLockTable(Long id) {
+// TODO Auto-generated method stub
+return false;
+}
+
+@Override
+public boolean update(Long id, UsageEventVO entity) {
+// TODO Auto-generated method stub
+return false;
+}
+
+@Override
+public int update(UsageEventVO entity, SearchCriteria 
sc) {
+ 

[GitHub] cloudstack pull request #1624: Fixes regarding VOLUME_DELETE events resultin...

2016-08-10 Thread jburwell
Github user jburwell commented on a diff in the pull request:

https://github.com/apache/cloudstack/pull/1624#discussion_r74314758
  
--- Diff: server/test/com/cloud/user/MockUsageEventDao.java ---
@@ -0,0 +1,356 @@
+// 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.user;
+
+import java.util.ArrayList;
+import java.util.Date;
+import java.util.List;
+import java.util.Map;
+
+import javax.naming.ConfigurationException;
+
+import com.cloud.event.UsageEventVO;
+import com.cloud.event.dao.UsageEventDao;
+import com.cloud.utils.Pair;
+import com.cloud.utils.db.Attribute;
+import com.cloud.utils.db.Filter;
+import com.cloud.utils.db.GenericSearchBuilder;
+import com.cloud.utils.db.SearchBuilder;
+import com.cloud.utils.db.SearchCriteria;
+
+public class MockUsageEventDao implements UsageEventDao{
+
+List persistedItems;
+
+public MockUsageEventDao() {
+persistedItems = new ArrayList();
+}
+
+@Override
+public UsageEventVO findById(Long id) {
+// TODO Auto-generated method stub
+return null;
+}
+
+@Override
+public UsageEventVO findByIdIncludingRemoved(Long id) {
+// TODO Auto-generated method stub
+return null;
+}
+
+@Override
+public UsageEventVO findById(Long id, boolean fresh) {
+// TODO Auto-generated method stub
+return null;
+}
+
+@Override
+public UsageEventVO findByUuid(String uuid) {
+// TODO Auto-generated method stub
+return null;
+}
+
+@Override
+public UsageEventVO findByUuidIncludingRemoved(String uuid) {
+// TODO Auto-generated method stub
+return null;
+}
+
+@Override
+public UsageEventVO createForUpdate() {
+// TODO Auto-generated method stub
+return null;
+}
+
+@Override
+public SearchBuilder createSearchBuilder() {
+// TODO Auto-generated method stub
+return null;
+}
+
+@Override
+public  GenericSearchBuilder createSearchBuilder(
+Class clazz) {
+// TODO Auto-generated method stub
+return null;
+}
+
+@Override
+public UsageEventVO createForUpdate(Long id) {
+// TODO Auto-generated method stub
+return null;
+}
+
+@Override
+public SearchCriteria createSearchCriteria() {
+// TODO Auto-generated method stub
+return null;
+}
+
+@Override
+public List lockRows(SearchCriteria sc,
+Filter filter, boolean exclusive) {
+// TODO Auto-generated method stub
+return null;
+}
+
+@Override
+public UsageEventVO lockOneRandomRow(SearchCriteria sc,
+boolean exclusive) {
+// TODO Auto-generated method stub
+return null;
+}
+
+@Override
+public UsageEventVO lockRow(Long id, Boolean exclusive) {
+// TODO Auto-generated method stub
+return null;
+}
+
+@Override
+public UsageEventVO acquireInLockTable(Long id) {
+// TODO Auto-generated method stub
+return null;
+}
+
+@Override
+public UsageEventVO acquireInLockTable(Long id, int seconds) {
+// TODO Auto-generated method stub
+return null;
+}
+
+@Override
+public boolean releaseFromLockTable(Long id) {
+// TODO Auto-generated method stub
+return false;
+}
+
+@Override
+public boolean update(Long id, UsageEventVO entity) {
+// TODO Auto-generated method stub
+return false;
+}
+
+@Override
+public int update(UsageEventVO entity, SearchCriteria 
sc) {
+ 

[GitHub] cloudstack pull request #1624: Fixes regarding VOLUME_DELETE events resultin...

2016-08-10 Thread jburwell
Github user jburwell commented on a diff in the pull request:

https://github.com/apache/cloudstack/pull/1624#discussion_r74314735
  
--- Diff: server/test/com/cloud/user/MockUsageEventDao.java ---
@@ -0,0 +1,356 @@
+// 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.user;
+
+import java.util.ArrayList;
+import java.util.Date;
+import java.util.List;
+import java.util.Map;
+
+import javax.naming.ConfigurationException;
+
+import com.cloud.event.UsageEventVO;
+import com.cloud.event.dao.UsageEventDao;
+import com.cloud.utils.Pair;
+import com.cloud.utils.db.Attribute;
+import com.cloud.utils.db.Filter;
+import com.cloud.utils.db.GenericSearchBuilder;
+import com.cloud.utils.db.SearchBuilder;
+import com.cloud.utils.db.SearchCriteria;
+
+public class MockUsageEventDao implements UsageEventDao{
+
+List persistedItems;
+
+public MockUsageEventDao() {
+persistedItems = new ArrayList();
+}
+
+@Override
+public UsageEventVO findById(Long id) {
+// TODO Auto-generated method stub
+return null;
+}
+
+@Override
+public UsageEventVO findByIdIncludingRemoved(Long id) {
+// TODO Auto-generated method stub
+return null;
+}
+
+@Override
+public UsageEventVO findById(Long id, boolean fresh) {
+// TODO Auto-generated method stub
+return null;
+}
+
+@Override
+public UsageEventVO findByUuid(String uuid) {
+// TODO Auto-generated method stub
+return null;
+}
+
+@Override
+public UsageEventVO findByUuidIncludingRemoved(String uuid) {
+// TODO Auto-generated method stub
+return null;
+}
+
+@Override
+public UsageEventVO createForUpdate() {
+// TODO Auto-generated method stub
+return null;
+}
+
+@Override
+public SearchBuilder createSearchBuilder() {
+// TODO Auto-generated method stub
+return null;
+}
+
+@Override
+public  GenericSearchBuilder createSearchBuilder(
+Class clazz) {
+// TODO Auto-generated method stub
+return null;
+}
+
+@Override
+public UsageEventVO createForUpdate(Long id) {
+// TODO Auto-generated method stub
+return null;
+}
+
+@Override
+public SearchCriteria createSearchCriteria() {
+// TODO Auto-generated method stub
+return null;
+}
+
+@Override
+public List lockRows(SearchCriteria sc,
+Filter filter, boolean exclusive) {
+// TODO Auto-generated method stub
+return null;
+}
+
+@Override
+public UsageEventVO lockOneRandomRow(SearchCriteria sc,
+boolean exclusive) {
+// TODO Auto-generated method stub
+return null;
+}
+
+@Override
+public UsageEventVO lockRow(Long id, Boolean exclusive) {
+// TODO Auto-generated method stub
+return null;
+}
+
+@Override
+public UsageEventVO acquireInLockTable(Long id) {
+// TODO Auto-generated method stub
+return null;
+}
+
+@Override
+public UsageEventVO acquireInLockTable(Long id, int seconds) {
+// TODO Auto-generated method stub
+return null;
+}
+
+@Override
+public boolean releaseFromLockTable(Long id) {
+// TODO Auto-generated method stub
+return false;
+}
+
+@Override
+public boolean update(Long id, UsageEventVO entity) {
+// TODO Auto-generated method stub
+return false;
+}
+
+@Override
+public int update(UsageEventVO entity, SearchCriteria 
sc) {
+ 

[GitHub] cloudstack pull request #1624: Fixes regarding VOLUME_DELETE events resultin...

2016-08-10 Thread jburwell
Github user jburwell commented on a diff in the pull request:

https://github.com/apache/cloudstack/pull/1624#discussion_r74314710
  
--- Diff: server/test/com/cloud/user/MockUsageEventDao.java ---
@@ -0,0 +1,356 @@
+// 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.user;
+
+import java.util.ArrayList;
+import java.util.Date;
+import java.util.List;
+import java.util.Map;
+
+import javax.naming.ConfigurationException;
+
+import com.cloud.event.UsageEventVO;
+import com.cloud.event.dao.UsageEventDao;
+import com.cloud.utils.Pair;
+import com.cloud.utils.db.Attribute;
+import com.cloud.utils.db.Filter;
+import com.cloud.utils.db.GenericSearchBuilder;
+import com.cloud.utils.db.SearchBuilder;
+import com.cloud.utils.db.SearchCriteria;
+
+public class MockUsageEventDao implements UsageEventDao{
+
+List persistedItems;
+
+public MockUsageEventDao() {
+persistedItems = new ArrayList();
+}
+
+@Override
+public UsageEventVO findById(Long id) {
+// TODO Auto-generated method stub
+return null;
+}
+
+@Override
+public UsageEventVO findByIdIncludingRemoved(Long id) {
+// TODO Auto-generated method stub
+return null;
+}
+
+@Override
+public UsageEventVO findById(Long id, boolean fresh) {
+// TODO Auto-generated method stub
+return null;
+}
+
+@Override
+public UsageEventVO findByUuid(String uuid) {
+// TODO Auto-generated method stub
+return null;
+}
+
+@Override
+public UsageEventVO findByUuidIncludingRemoved(String uuid) {
+// TODO Auto-generated method stub
+return null;
+}
+
+@Override
+public UsageEventVO createForUpdate() {
+// TODO Auto-generated method stub
+return null;
+}
+
+@Override
+public SearchBuilder createSearchBuilder() {
+// TODO Auto-generated method stub
+return null;
+}
+
+@Override
+public  GenericSearchBuilder createSearchBuilder(
+Class clazz) {
+// TODO Auto-generated method stub
+return null;
+}
+
+@Override
+public UsageEventVO createForUpdate(Long id) {
+// TODO Auto-generated method stub
+return null;
+}
+
+@Override
+public SearchCriteria createSearchCriteria() {
+// TODO Auto-generated method stub
+return null;
+}
+
+@Override
+public List lockRows(SearchCriteria sc,
+Filter filter, boolean exclusive) {
+// TODO Auto-generated method stub
+return null;
+}
+
+@Override
+public UsageEventVO lockOneRandomRow(SearchCriteria sc,
+boolean exclusive) {
+// TODO Auto-generated method stub
+return null;
+}
+
+@Override
+public UsageEventVO lockRow(Long id, Boolean exclusive) {
+// TODO Auto-generated method stub
+return null;
+}
+
+@Override
+public UsageEventVO acquireInLockTable(Long id) {
+// TODO Auto-generated method stub
+return null;
+}
+
+@Override
+public UsageEventVO acquireInLockTable(Long id, int seconds) {
+// TODO Auto-generated method stub
+return null;
+}
+
+@Override
+public boolean releaseFromLockTable(Long id) {
+// TODO Auto-generated method stub
+return false;
+}
+
+@Override
+public boolean update(Long id, UsageEventVO entity) {
+// TODO Auto-generated method stub
+return false;
+}
+
+@Override
+public int update(UsageEventVO entity, SearchCriteria 
sc) {
+ 

[GitHub] cloudstack pull request #1624: Fixes regarding VOLUME_DELETE events resultin...

2016-08-10 Thread jburwell
Github user jburwell commented on a diff in the pull request:

https://github.com/apache/cloudstack/pull/1624#discussion_r74314681
  
--- Diff: server/test/com/cloud/user/MockUsageEventDao.java ---
@@ -0,0 +1,356 @@
+// 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.user;
+
+import java.util.ArrayList;
+import java.util.Date;
+import java.util.List;
+import java.util.Map;
+
+import javax.naming.ConfigurationException;
+
+import com.cloud.event.UsageEventVO;
+import com.cloud.event.dao.UsageEventDao;
+import com.cloud.utils.Pair;
+import com.cloud.utils.db.Attribute;
+import com.cloud.utils.db.Filter;
+import com.cloud.utils.db.GenericSearchBuilder;
+import com.cloud.utils.db.SearchBuilder;
+import com.cloud.utils.db.SearchCriteria;
+
+public class MockUsageEventDao implements UsageEventDao{
+
+List persistedItems;
+
+public MockUsageEventDao() {
+persistedItems = new ArrayList();
+}
+
+@Override
+public UsageEventVO findById(Long id) {
+// TODO Auto-generated method stub
+return null;
+}
+
+@Override
+public UsageEventVO findByIdIncludingRemoved(Long id) {
+// TODO Auto-generated method stub
+return null;
+}
+
+@Override
+public UsageEventVO findById(Long id, boolean fresh) {
+// TODO Auto-generated method stub
+return null;
+}
+
+@Override
+public UsageEventVO findByUuid(String uuid) {
+// TODO Auto-generated method stub
+return null;
+}
+
+@Override
+public UsageEventVO findByUuidIncludingRemoved(String uuid) {
+// TODO Auto-generated method stub
+return null;
+}
+
+@Override
+public UsageEventVO createForUpdate() {
+// TODO Auto-generated method stub
+return null;
+}
+
+@Override
+public SearchBuilder createSearchBuilder() {
+// TODO Auto-generated method stub
+return null;
+}
+
+@Override
+public  GenericSearchBuilder createSearchBuilder(
+Class clazz) {
+// TODO Auto-generated method stub
+return null;
+}
+
+@Override
+public UsageEventVO createForUpdate(Long id) {
+// TODO Auto-generated method stub
+return null;
+}
+
+@Override
+public SearchCriteria createSearchCriteria() {
+// TODO Auto-generated method stub
+return null;
+}
+
+@Override
+public List lockRows(SearchCriteria sc,
+Filter filter, boolean exclusive) {
+// TODO Auto-generated method stub
+return null;
+}
+
+@Override
+public UsageEventVO lockOneRandomRow(SearchCriteria sc,
+boolean exclusive) {
+// TODO Auto-generated method stub
+return null;
+}
+
+@Override
+public UsageEventVO lockRow(Long id, Boolean exclusive) {
+// TODO Auto-generated method stub
+return null;
+}
+
+@Override
+public UsageEventVO acquireInLockTable(Long id) {
+// TODO Auto-generated method stub
+return null;
+}
+
+@Override
+public UsageEventVO acquireInLockTable(Long id, int seconds) {
+// TODO Auto-generated method stub
+return null;
+}
+
+@Override
+public boolean releaseFromLockTable(Long id) {
+// TODO Auto-generated method stub
+return false;
+}
+
+@Override
+public boolean update(Long id, UsageEventVO entity) {
+// TODO Auto-generated method stub
+return false;
+}
+
+@Override
+public int update(UsageEventVO entity, SearchCriteria 
sc) {
+ 

[GitHub] cloudstack pull request #1624: Fixes regarding VOLUME_DELETE events resultin...

2016-08-10 Thread jburwell
Github user jburwell commented on a diff in the pull request:

https://github.com/apache/cloudstack/pull/1624#discussion_r74314089
  
--- Diff: server/test/com/cloud/user/MockUsageEventDao.java ---
@@ -0,0 +1,356 @@
+// 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.user;
+
+import java.util.ArrayList;
+import java.util.Date;
+import java.util.List;
+import java.util.Map;
+
+import javax.naming.ConfigurationException;
+
+import com.cloud.event.UsageEventVO;
+import com.cloud.event.dao.UsageEventDao;
+import com.cloud.utils.Pair;
+import com.cloud.utils.db.Attribute;
+import com.cloud.utils.db.Filter;
+import com.cloud.utils.db.GenericSearchBuilder;
+import com.cloud.utils.db.SearchBuilder;
+import com.cloud.utils.db.SearchCriteria;
+
+public class MockUsageEventDao implements UsageEventDao{
+
+List persistedItems;
+
+public MockUsageEventDao() {
+persistedItems = new ArrayList();
+}
+
+@Override
+public UsageEventVO findById(Long id) {
+// TODO Auto-generated method stub
+return null;
+}
+
+@Override
+public UsageEventVO findByIdIncludingRemoved(Long id) {
+// TODO Auto-generated method stub
+return null;
+}
+
+@Override
+public UsageEventVO findById(Long id, boolean fresh) {
+// TODO Auto-generated method stub
+return null;
+}
+
+@Override
+public UsageEventVO findByUuid(String uuid) {
+// TODO Auto-generated method stub
--- End diff --

Is there a TODO to be resolved?


---
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 #1624: Fixes regarding VOLUME_DELETE events resultin...

2016-08-10 Thread jburwell
Github user jburwell commented on a diff in the pull request:

https://github.com/apache/cloudstack/pull/1624#discussion_r74314768
  
--- Diff: server/test/com/cloud/user/MockUsageEventDao.java ---
@@ -0,0 +1,356 @@
+// 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.user;
+
+import java.util.ArrayList;
+import java.util.Date;
+import java.util.List;
+import java.util.Map;
+
+import javax.naming.ConfigurationException;
+
+import com.cloud.event.UsageEventVO;
+import com.cloud.event.dao.UsageEventDao;
+import com.cloud.utils.Pair;
+import com.cloud.utils.db.Attribute;
+import com.cloud.utils.db.Filter;
+import com.cloud.utils.db.GenericSearchBuilder;
+import com.cloud.utils.db.SearchBuilder;
+import com.cloud.utils.db.SearchCriteria;
+
+public class MockUsageEventDao implements UsageEventDao{
+
+List persistedItems;
+
+public MockUsageEventDao() {
+persistedItems = new ArrayList();
+}
+
+@Override
+public UsageEventVO findById(Long id) {
+// TODO Auto-generated method stub
+return null;
+}
+
+@Override
+public UsageEventVO findByIdIncludingRemoved(Long id) {
+// TODO Auto-generated method stub
+return null;
+}
+
+@Override
+public UsageEventVO findById(Long id, boolean fresh) {
+// TODO Auto-generated method stub
+return null;
+}
+
+@Override
+public UsageEventVO findByUuid(String uuid) {
+// TODO Auto-generated method stub
+return null;
+}
+
+@Override
+public UsageEventVO findByUuidIncludingRemoved(String uuid) {
+// TODO Auto-generated method stub
+return null;
+}
+
+@Override
+public UsageEventVO createForUpdate() {
+// TODO Auto-generated method stub
+return null;
+}
+
+@Override
+public SearchBuilder createSearchBuilder() {
+// TODO Auto-generated method stub
+return null;
+}
+
+@Override
+public  GenericSearchBuilder createSearchBuilder(
+Class clazz) {
+// TODO Auto-generated method stub
+return null;
+}
+
+@Override
+public UsageEventVO createForUpdate(Long id) {
+// TODO Auto-generated method stub
+return null;
+}
+
+@Override
+public SearchCriteria createSearchCriteria() {
+// TODO Auto-generated method stub
+return null;
+}
+
+@Override
+public List lockRows(SearchCriteria sc,
+Filter filter, boolean exclusive) {
+// TODO Auto-generated method stub
+return null;
+}
+
+@Override
+public UsageEventVO lockOneRandomRow(SearchCriteria sc,
+boolean exclusive) {
+// TODO Auto-generated method stub
+return null;
+}
+
+@Override
+public UsageEventVO lockRow(Long id, Boolean exclusive) {
+// TODO Auto-generated method stub
+return null;
+}
+
+@Override
+public UsageEventVO acquireInLockTable(Long id) {
+// TODO Auto-generated method stub
+return null;
+}
+
+@Override
+public UsageEventVO acquireInLockTable(Long id, int seconds) {
+// TODO Auto-generated method stub
+return null;
+}
+
+@Override
+public boolean releaseFromLockTable(Long id) {
+// TODO Auto-generated method stub
+return false;
+}
+
+@Override
+public boolean update(Long id, UsageEventVO entity) {
+// TODO Auto-generated method stub
+return false;
+}
+
+@Override
+public int update(UsageEventVO entity, SearchCriteria 
sc) {
+ 

[GitHub] cloudstack pull request #1624: Fixes regarding VOLUME_DELETE events resultin...

2016-08-10 Thread jburwell
Github user jburwell commented on a diff in the pull request:

https://github.com/apache/cloudstack/pull/1624#discussion_r74314724
  
--- Diff: server/test/com/cloud/user/MockUsageEventDao.java ---
@@ -0,0 +1,356 @@
+// 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.user;
+
+import java.util.ArrayList;
+import java.util.Date;
+import java.util.List;
+import java.util.Map;
+
+import javax.naming.ConfigurationException;
+
+import com.cloud.event.UsageEventVO;
+import com.cloud.event.dao.UsageEventDao;
+import com.cloud.utils.Pair;
+import com.cloud.utils.db.Attribute;
+import com.cloud.utils.db.Filter;
+import com.cloud.utils.db.GenericSearchBuilder;
+import com.cloud.utils.db.SearchBuilder;
+import com.cloud.utils.db.SearchCriteria;
+
+public class MockUsageEventDao implements UsageEventDao{
+
+List persistedItems;
+
+public MockUsageEventDao() {
+persistedItems = new ArrayList();
+}
+
+@Override
+public UsageEventVO findById(Long id) {
+// TODO Auto-generated method stub
+return null;
+}
+
+@Override
+public UsageEventVO findByIdIncludingRemoved(Long id) {
+// TODO Auto-generated method stub
+return null;
+}
+
+@Override
+public UsageEventVO findById(Long id, boolean fresh) {
+// TODO Auto-generated method stub
+return null;
+}
+
+@Override
+public UsageEventVO findByUuid(String uuid) {
+// TODO Auto-generated method stub
+return null;
+}
+
+@Override
+public UsageEventVO findByUuidIncludingRemoved(String uuid) {
+// TODO Auto-generated method stub
+return null;
+}
+
+@Override
+public UsageEventVO createForUpdate() {
+// TODO Auto-generated method stub
+return null;
+}
+
+@Override
+public SearchBuilder createSearchBuilder() {
+// TODO Auto-generated method stub
+return null;
+}
+
+@Override
+public  GenericSearchBuilder createSearchBuilder(
+Class clazz) {
+// TODO Auto-generated method stub
+return null;
+}
+
+@Override
+public UsageEventVO createForUpdate(Long id) {
+// TODO Auto-generated method stub
+return null;
+}
+
+@Override
+public SearchCriteria createSearchCriteria() {
+// TODO Auto-generated method stub
+return null;
+}
+
+@Override
+public List lockRows(SearchCriteria sc,
+Filter filter, boolean exclusive) {
+// TODO Auto-generated method stub
+return null;
+}
+
+@Override
+public UsageEventVO lockOneRandomRow(SearchCriteria sc,
+boolean exclusive) {
+// TODO Auto-generated method stub
+return null;
+}
+
+@Override
+public UsageEventVO lockRow(Long id, Boolean exclusive) {
+// TODO Auto-generated method stub
+return null;
+}
+
+@Override
+public UsageEventVO acquireInLockTable(Long id) {
+// TODO Auto-generated method stub
+return null;
+}
+
+@Override
+public UsageEventVO acquireInLockTable(Long id, int seconds) {
+// TODO Auto-generated method stub
+return null;
+}
+
+@Override
+public boolean releaseFromLockTable(Long id) {
+// TODO Auto-generated method stub
+return false;
+}
+
+@Override
+public boolean update(Long id, UsageEventVO entity) {
+// TODO Auto-generated method stub
+return false;
+}
+
+@Override
+public int update(UsageEventVO entity, SearchCriteria 
sc) {
+ 

[GitHub] cloudstack pull request #1624: Fixes regarding VOLUME_DELETE events resultin...

2016-08-10 Thread jburwell
Github user jburwell commented on a diff in the pull request:

https://github.com/apache/cloudstack/pull/1624#discussion_r74314666
  
--- Diff: server/test/com/cloud/user/MockUsageEventDao.java ---
@@ -0,0 +1,356 @@
+// 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.user;
+
+import java.util.ArrayList;
+import java.util.Date;
+import java.util.List;
+import java.util.Map;
+
+import javax.naming.ConfigurationException;
+
+import com.cloud.event.UsageEventVO;
+import com.cloud.event.dao.UsageEventDao;
+import com.cloud.utils.Pair;
+import com.cloud.utils.db.Attribute;
+import com.cloud.utils.db.Filter;
+import com.cloud.utils.db.GenericSearchBuilder;
+import com.cloud.utils.db.SearchBuilder;
+import com.cloud.utils.db.SearchCriteria;
+
+public class MockUsageEventDao implements UsageEventDao{
+
+List persistedItems;
+
+public MockUsageEventDao() {
+persistedItems = new ArrayList();
+}
+
+@Override
+public UsageEventVO findById(Long id) {
+// TODO Auto-generated method stub
+return null;
+}
+
+@Override
+public UsageEventVO findByIdIncludingRemoved(Long id) {
+// TODO Auto-generated method stub
+return null;
+}
+
+@Override
+public UsageEventVO findById(Long id, boolean fresh) {
+// TODO Auto-generated method stub
+return null;
+}
+
+@Override
+public UsageEventVO findByUuid(String uuid) {
+// TODO Auto-generated method stub
+return null;
+}
+
+@Override
+public UsageEventVO findByUuidIncludingRemoved(String uuid) {
+// TODO Auto-generated method stub
+return null;
+}
+
+@Override
+public UsageEventVO createForUpdate() {
+// TODO Auto-generated method stub
+return null;
+}
+
+@Override
+public SearchBuilder createSearchBuilder() {
+// TODO Auto-generated method stub
+return null;
+}
+
+@Override
+public  GenericSearchBuilder createSearchBuilder(
+Class clazz) {
+// TODO Auto-generated method stub
+return null;
+}
+
+@Override
+public UsageEventVO createForUpdate(Long id) {
+// TODO Auto-generated method stub
+return null;
+}
+
+@Override
+public SearchCriteria createSearchCriteria() {
+// TODO Auto-generated method stub
+return null;
+}
+
+@Override
+public List lockRows(SearchCriteria sc,
+Filter filter, boolean exclusive) {
+// TODO Auto-generated method stub
+return null;
+}
+
+@Override
+public UsageEventVO lockOneRandomRow(SearchCriteria sc,
+boolean exclusive) {
+// TODO Auto-generated method stub
+return null;
+}
+
+@Override
+public UsageEventVO lockRow(Long id, Boolean exclusive) {
+// TODO Auto-generated method stub
+return null;
+}
+
+@Override
+public UsageEventVO acquireInLockTable(Long id) {
+// TODO Auto-generated method stub
+return null;
+}
+
+@Override
+public UsageEventVO acquireInLockTable(Long id, int seconds) {
+// TODO Auto-generated method stub
+return null;
+}
+
+@Override
+public boolean releaseFromLockTable(Long id) {
+// TODO Auto-generated method stub
+return false;
+}
+
+@Override
+public boolean update(Long id, UsageEventVO entity) {
+// TODO Auto-generated method stub
+return false;
+}
+
+@Override
+public int update(UsageEventVO entity, SearchCriteria 
sc) {
+ 

[GitHub] cloudstack pull request #1624: Fixes regarding VOLUME_DELETE events resultin...

2016-08-10 Thread jburwell
Github user jburwell commented on a diff in the pull request:

https://github.com/apache/cloudstack/pull/1624#discussion_r74314633
  
--- Diff: server/test/com/cloud/user/MockUsageEventDao.java ---
@@ -0,0 +1,356 @@
+// 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.user;
+
+import java.util.ArrayList;
+import java.util.Date;
+import java.util.List;
+import java.util.Map;
+
+import javax.naming.ConfigurationException;
+
+import com.cloud.event.UsageEventVO;
+import com.cloud.event.dao.UsageEventDao;
+import com.cloud.utils.Pair;
+import com.cloud.utils.db.Attribute;
+import com.cloud.utils.db.Filter;
+import com.cloud.utils.db.GenericSearchBuilder;
+import com.cloud.utils.db.SearchBuilder;
+import com.cloud.utils.db.SearchCriteria;
+
+public class MockUsageEventDao implements UsageEventDao{
+
+List persistedItems;
+
+public MockUsageEventDao() {
+persistedItems = new ArrayList();
+}
+
+@Override
+public UsageEventVO findById(Long id) {
+// TODO Auto-generated method stub
+return null;
+}
+
+@Override
+public UsageEventVO findByIdIncludingRemoved(Long id) {
+// TODO Auto-generated method stub
+return null;
+}
+
+@Override
+public UsageEventVO findById(Long id, boolean fresh) {
+// TODO Auto-generated method stub
+return null;
+}
+
+@Override
+public UsageEventVO findByUuid(String uuid) {
+// TODO Auto-generated method stub
+return null;
+}
+
+@Override
+public UsageEventVO findByUuidIncludingRemoved(String uuid) {
+// TODO Auto-generated method stub
+return null;
+}
+
+@Override
+public UsageEventVO createForUpdate() {
+// TODO Auto-generated method stub
+return null;
+}
+
+@Override
+public SearchBuilder createSearchBuilder() {
+// TODO Auto-generated method stub
+return null;
+}
+
+@Override
+public  GenericSearchBuilder createSearchBuilder(
+Class clazz) {
+// TODO Auto-generated method stub
+return null;
+}
+
+@Override
+public UsageEventVO createForUpdate(Long id) {
+// TODO Auto-generated method stub
+return null;
+}
+
+@Override
+public SearchCriteria createSearchCriteria() {
+// TODO Auto-generated method stub
+return null;
+}
+
+@Override
+public List lockRows(SearchCriteria sc,
+Filter filter, boolean exclusive) {
+// TODO Auto-generated method stub
+return null;
+}
+
+@Override
+public UsageEventVO lockOneRandomRow(SearchCriteria sc,
+boolean exclusive) {
+// TODO Auto-generated method stub
+return null;
+}
+
+@Override
+public UsageEventVO lockRow(Long id, Boolean exclusive) {
+// TODO Auto-generated method stub
+return null;
+}
+
+@Override
+public UsageEventVO acquireInLockTable(Long id) {
+// TODO Auto-generated method stub
+return null;
+}
+
+@Override
+public UsageEventVO acquireInLockTable(Long id, int seconds) {
+// TODO Auto-generated method stub
+return null;
+}
+
+@Override
+public boolean releaseFromLockTable(Long id) {
+// TODO Auto-generated method stub
+return false;
+}
+
+@Override
+public boolean update(Long id, UsageEventVO entity) {
+// TODO Auto-generated method stub
+return false;
+}
+
+@Override
+public int update(UsageEventVO entity, SearchCriteria 
sc) {
+ 

[GitHub] cloudstack pull request #1624: Fixes regarding VOLUME_DELETE events resultin...

2016-08-10 Thread jburwell
Github user jburwell commented on a diff in the pull request:

https://github.com/apache/cloudstack/pull/1624#discussion_r74314591
  
--- Diff: server/test/com/cloud/user/MockUsageEventDao.java ---
@@ -0,0 +1,356 @@
+// 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.user;
+
+import java.util.ArrayList;
+import java.util.Date;
+import java.util.List;
+import java.util.Map;
+
+import javax.naming.ConfigurationException;
+
+import com.cloud.event.UsageEventVO;
+import com.cloud.event.dao.UsageEventDao;
+import com.cloud.utils.Pair;
+import com.cloud.utils.db.Attribute;
+import com.cloud.utils.db.Filter;
+import com.cloud.utils.db.GenericSearchBuilder;
+import com.cloud.utils.db.SearchBuilder;
+import com.cloud.utils.db.SearchCriteria;
+
+public class MockUsageEventDao implements UsageEventDao{
+
+List persistedItems;
+
+public MockUsageEventDao() {
+persistedItems = new ArrayList();
+}
+
+@Override
+public UsageEventVO findById(Long id) {
+// TODO Auto-generated method stub
+return null;
+}
+
+@Override
+public UsageEventVO findByIdIncludingRemoved(Long id) {
+// TODO Auto-generated method stub
+return null;
+}
+
+@Override
+public UsageEventVO findById(Long id, boolean fresh) {
+// TODO Auto-generated method stub
+return null;
+}
+
+@Override
+public UsageEventVO findByUuid(String uuid) {
+// TODO Auto-generated method stub
+return null;
+}
+
+@Override
+public UsageEventVO findByUuidIncludingRemoved(String uuid) {
+// TODO Auto-generated method stub
+return null;
+}
+
+@Override
+public UsageEventVO createForUpdate() {
+// TODO Auto-generated method stub
+return null;
+}
+
+@Override
+public SearchBuilder createSearchBuilder() {
+// TODO Auto-generated method stub
+return null;
+}
+
+@Override
+public  GenericSearchBuilder createSearchBuilder(
+Class clazz) {
+// TODO Auto-generated method stub
+return null;
+}
+
+@Override
+public UsageEventVO createForUpdate(Long id) {
+// TODO Auto-generated method stub
+return null;
+}
+
+@Override
+public SearchCriteria createSearchCriteria() {
+// TODO Auto-generated method stub
+return null;
+}
+
+@Override
+public List lockRows(SearchCriteria sc,
+Filter filter, boolean exclusive) {
+// TODO Auto-generated method stub
+return null;
+}
+
+@Override
+public UsageEventVO lockOneRandomRow(SearchCriteria sc,
+boolean exclusive) {
+// TODO Auto-generated method stub
+return null;
+}
+
+@Override
+public UsageEventVO lockRow(Long id, Boolean exclusive) {
+// TODO Auto-generated method stub
+return null;
+}
+
+@Override
+public UsageEventVO acquireInLockTable(Long id) {
+// TODO Auto-generated method stub
+return null;
+}
+
+@Override
+public UsageEventVO acquireInLockTable(Long id, int seconds) {
+// TODO Auto-generated method stub
+return null;
+}
+
+@Override
+public boolean releaseFromLockTable(Long id) {
+// TODO Auto-generated method stub
+return false;
+}
+
+@Override
+public boolean update(Long id, UsageEventVO entity) {
+// TODO Auto-generated method stub
+return false;
+}
+
+@Override
+public int update(UsageEventVO entity, SearchCriteria 
sc) {
+ 

[GitHub] cloudstack pull request #1624: Fixes regarding VOLUME_DELETE events resultin...

2016-08-10 Thread jburwell
Github user jburwell commented on a diff in the pull request:

https://github.com/apache/cloudstack/pull/1624#discussion_r74314650
  
--- Diff: server/test/com/cloud/user/MockUsageEventDao.java ---
@@ -0,0 +1,356 @@
+// 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.user;
+
+import java.util.ArrayList;
+import java.util.Date;
+import java.util.List;
+import java.util.Map;
+
+import javax.naming.ConfigurationException;
+
+import com.cloud.event.UsageEventVO;
+import com.cloud.event.dao.UsageEventDao;
+import com.cloud.utils.Pair;
+import com.cloud.utils.db.Attribute;
+import com.cloud.utils.db.Filter;
+import com.cloud.utils.db.GenericSearchBuilder;
+import com.cloud.utils.db.SearchBuilder;
+import com.cloud.utils.db.SearchCriteria;
+
+public class MockUsageEventDao implements UsageEventDao{
+
+List persistedItems;
+
+public MockUsageEventDao() {
+persistedItems = new ArrayList();
+}
+
+@Override
+public UsageEventVO findById(Long id) {
+// TODO Auto-generated method stub
+return null;
+}
+
+@Override
+public UsageEventVO findByIdIncludingRemoved(Long id) {
+// TODO Auto-generated method stub
+return null;
+}
+
+@Override
+public UsageEventVO findById(Long id, boolean fresh) {
+// TODO Auto-generated method stub
+return null;
+}
+
+@Override
+public UsageEventVO findByUuid(String uuid) {
+// TODO Auto-generated method stub
+return null;
+}
+
+@Override
+public UsageEventVO findByUuidIncludingRemoved(String uuid) {
+// TODO Auto-generated method stub
+return null;
+}
+
+@Override
+public UsageEventVO createForUpdate() {
+// TODO Auto-generated method stub
+return null;
+}
+
+@Override
+public SearchBuilder createSearchBuilder() {
+// TODO Auto-generated method stub
+return null;
+}
+
+@Override
+public  GenericSearchBuilder createSearchBuilder(
+Class clazz) {
+// TODO Auto-generated method stub
+return null;
+}
+
+@Override
+public UsageEventVO createForUpdate(Long id) {
+// TODO Auto-generated method stub
+return null;
+}
+
+@Override
+public SearchCriteria createSearchCriteria() {
+// TODO Auto-generated method stub
+return null;
+}
+
+@Override
+public List lockRows(SearchCriteria sc,
+Filter filter, boolean exclusive) {
+// TODO Auto-generated method stub
+return null;
+}
+
+@Override
+public UsageEventVO lockOneRandomRow(SearchCriteria sc,
+boolean exclusive) {
+// TODO Auto-generated method stub
+return null;
+}
+
+@Override
+public UsageEventVO lockRow(Long id, Boolean exclusive) {
+// TODO Auto-generated method stub
+return null;
+}
+
+@Override
+public UsageEventVO acquireInLockTable(Long id) {
+// TODO Auto-generated method stub
+return null;
+}
+
+@Override
+public UsageEventVO acquireInLockTable(Long id, int seconds) {
+// TODO Auto-generated method stub
+return null;
+}
+
+@Override
+public boolean releaseFromLockTable(Long id) {
+// TODO Auto-generated method stub
+return false;
+}
+
+@Override
+public boolean update(Long id, UsageEventVO entity) {
+// TODO Auto-generated method stub
+return false;
+}
+
+@Override
+public int update(UsageEventVO entity, SearchCriteria 
sc) {
+ 

[GitHub] cloudstack pull request #1624: Fixes regarding VOLUME_DELETE events resultin...

2016-08-10 Thread jburwell
Github user jburwell commented on a diff in the pull request:

https://github.com/apache/cloudstack/pull/1624#discussion_r74314577
  
--- Diff: server/test/com/cloud/user/MockUsageEventDao.java ---
@@ -0,0 +1,356 @@
+// 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.user;
+
+import java.util.ArrayList;
+import java.util.Date;
+import java.util.List;
+import java.util.Map;
+
+import javax.naming.ConfigurationException;
+
+import com.cloud.event.UsageEventVO;
+import com.cloud.event.dao.UsageEventDao;
+import com.cloud.utils.Pair;
+import com.cloud.utils.db.Attribute;
+import com.cloud.utils.db.Filter;
+import com.cloud.utils.db.GenericSearchBuilder;
+import com.cloud.utils.db.SearchBuilder;
+import com.cloud.utils.db.SearchCriteria;
+
+public class MockUsageEventDao implements UsageEventDao{
+
+List persistedItems;
+
+public MockUsageEventDao() {
+persistedItems = new ArrayList();
+}
+
+@Override
+public UsageEventVO findById(Long id) {
+// TODO Auto-generated method stub
+return null;
+}
+
+@Override
+public UsageEventVO findByIdIncludingRemoved(Long id) {
+// TODO Auto-generated method stub
+return null;
+}
+
+@Override
+public UsageEventVO findById(Long id, boolean fresh) {
+// TODO Auto-generated method stub
+return null;
+}
+
+@Override
+public UsageEventVO findByUuid(String uuid) {
+// TODO Auto-generated method stub
+return null;
+}
+
+@Override
+public UsageEventVO findByUuidIncludingRemoved(String uuid) {
+// TODO Auto-generated method stub
+return null;
+}
+
+@Override
+public UsageEventVO createForUpdate() {
+// TODO Auto-generated method stub
+return null;
+}
+
+@Override
+public SearchBuilder createSearchBuilder() {
+// TODO Auto-generated method stub
+return null;
+}
+
+@Override
+public  GenericSearchBuilder createSearchBuilder(
+Class clazz) {
+// TODO Auto-generated method stub
+return null;
+}
+
+@Override
+public UsageEventVO createForUpdate(Long id) {
+// TODO Auto-generated method stub
+return null;
+}
+
+@Override
+public SearchCriteria createSearchCriteria() {
+// TODO Auto-generated method stub
+return null;
+}
+
+@Override
+public List lockRows(SearchCriteria sc,
+Filter filter, boolean exclusive) {
+// TODO Auto-generated method stub
+return null;
+}
+
+@Override
+public UsageEventVO lockOneRandomRow(SearchCriteria sc,
+boolean exclusive) {
+// TODO Auto-generated method stub
+return null;
+}
+
+@Override
+public UsageEventVO lockRow(Long id, Boolean exclusive) {
+// TODO Auto-generated method stub
+return null;
+}
+
+@Override
+public UsageEventVO acquireInLockTable(Long id) {
+// TODO Auto-generated method stub
+return null;
+}
+
+@Override
+public UsageEventVO acquireInLockTable(Long id, int seconds) {
+// TODO Auto-generated method stub
+return null;
+}
+
+@Override
+public boolean releaseFromLockTable(Long id) {
+// TODO Auto-generated method stub
+return false;
+}
+
+@Override
+public boolean update(Long id, UsageEventVO entity) {
+// TODO Auto-generated method stub
+return false;
+}
+
+@Override
+public int update(UsageEventVO entity, SearchCriteria 
sc) {
+ 

[GitHub] cloudstack pull request #1624: Fixes regarding VOLUME_DELETE events resultin...

2016-08-10 Thread jburwell
Github user jburwell commented on a diff in the pull request:

https://github.com/apache/cloudstack/pull/1624#discussion_r74314529
  
--- Diff: server/test/com/cloud/user/MockUsageEventDao.java ---
@@ -0,0 +1,356 @@
+// 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.user;
+
+import java.util.ArrayList;
+import java.util.Date;
+import java.util.List;
+import java.util.Map;
+
+import javax.naming.ConfigurationException;
+
+import com.cloud.event.UsageEventVO;
+import com.cloud.event.dao.UsageEventDao;
+import com.cloud.utils.Pair;
+import com.cloud.utils.db.Attribute;
+import com.cloud.utils.db.Filter;
+import com.cloud.utils.db.GenericSearchBuilder;
+import com.cloud.utils.db.SearchBuilder;
+import com.cloud.utils.db.SearchCriteria;
+
+public class MockUsageEventDao implements UsageEventDao{
+
+List persistedItems;
+
+public MockUsageEventDao() {
+persistedItems = new ArrayList();
+}
+
+@Override
+public UsageEventVO findById(Long id) {
+// TODO Auto-generated method stub
+return null;
+}
+
+@Override
+public UsageEventVO findByIdIncludingRemoved(Long id) {
+// TODO Auto-generated method stub
+return null;
+}
+
+@Override
+public UsageEventVO findById(Long id, boolean fresh) {
+// TODO Auto-generated method stub
+return null;
+}
+
+@Override
+public UsageEventVO findByUuid(String uuid) {
+// TODO Auto-generated method stub
+return null;
+}
+
+@Override
+public UsageEventVO findByUuidIncludingRemoved(String uuid) {
+// TODO Auto-generated method stub
+return null;
+}
+
+@Override
+public UsageEventVO createForUpdate() {
+// TODO Auto-generated method stub
+return null;
+}
+
+@Override
+public SearchBuilder createSearchBuilder() {
+// TODO Auto-generated method stub
+return null;
+}
+
+@Override
+public  GenericSearchBuilder createSearchBuilder(
+Class clazz) {
+// TODO Auto-generated method stub
+return null;
+}
+
+@Override
+public UsageEventVO createForUpdate(Long id) {
+// TODO Auto-generated method stub
+return null;
+}
+
+@Override
+public SearchCriteria createSearchCriteria() {
+// TODO Auto-generated method stub
+return null;
+}
+
+@Override
+public List lockRows(SearchCriteria sc,
+Filter filter, boolean exclusive) {
+// TODO Auto-generated method stub
+return null;
+}
+
+@Override
+public UsageEventVO lockOneRandomRow(SearchCriteria sc,
+boolean exclusive) {
+// TODO Auto-generated method stub
+return null;
+}
+
+@Override
+public UsageEventVO lockRow(Long id, Boolean exclusive) {
+// TODO Auto-generated method stub
+return null;
+}
+
+@Override
+public UsageEventVO acquireInLockTable(Long id) {
+// TODO Auto-generated method stub
+return null;
+}
+
+@Override
+public UsageEventVO acquireInLockTable(Long id, int seconds) {
+// TODO Auto-generated method stub
+return null;
+}
+
+@Override
+public boolean releaseFromLockTable(Long id) {
+// TODO Auto-generated method stub
+return false;
+}
+
+@Override
+public boolean update(Long id, UsageEventVO entity) {
+// TODO Auto-generated method stub
+return false;
+}
+
+@Override
+public int update(UsageEventVO entity, SearchCriteria 
sc) {
+ 

[GitHub] cloudstack pull request #1624: Fixes regarding VOLUME_DELETE events resultin...

2016-08-10 Thread jburwell
Github user jburwell commented on a diff in the pull request:

https://github.com/apache/cloudstack/pull/1624#discussion_r74314463
  
--- Diff: server/test/com/cloud/user/MockUsageEventDao.java ---
@@ -0,0 +1,356 @@
+// 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.user;
+
+import java.util.ArrayList;
+import java.util.Date;
+import java.util.List;
+import java.util.Map;
+
+import javax.naming.ConfigurationException;
+
+import com.cloud.event.UsageEventVO;
+import com.cloud.event.dao.UsageEventDao;
+import com.cloud.utils.Pair;
+import com.cloud.utils.db.Attribute;
+import com.cloud.utils.db.Filter;
+import com.cloud.utils.db.GenericSearchBuilder;
+import com.cloud.utils.db.SearchBuilder;
+import com.cloud.utils.db.SearchCriteria;
+
+public class MockUsageEventDao implements UsageEventDao{
+
+List persistedItems;
+
+public MockUsageEventDao() {
+persistedItems = new ArrayList();
+}
+
+@Override
+public UsageEventVO findById(Long id) {
+// TODO Auto-generated method stub
+return null;
+}
+
+@Override
+public UsageEventVO findByIdIncludingRemoved(Long id) {
+// TODO Auto-generated method stub
+return null;
+}
+
+@Override
+public UsageEventVO findById(Long id, boolean fresh) {
+// TODO Auto-generated method stub
+return null;
+}
+
+@Override
+public UsageEventVO findByUuid(String uuid) {
+// TODO Auto-generated method stub
+return null;
+}
+
+@Override
+public UsageEventVO findByUuidIncludingRemoved(String uuid) {
+// TODO Auto-generated method stub
+return null;
+}
+
+@Override
+public UsageEventVO createForUpdate() {
+// TODO Auto-generated method stub
+return null;
+}
+
+@Override
+public SearchBuilder createSearchBuilder() {
+// TODO Auto-generated method stub
+return null;
+}
+
+@Override
+public  GenericSearchBuilder createSearchBuilder(
+Class clazz) {
+// TODO Auto-generated method stub
+return null;
+}
+
+@Override
+public UsageEventVO createForUpdate(Long id) {
+// TODO Auto-generated method stub
+return null;
+}
+
+@Override
+public SearchCriteria createSearchCriteria() {
+// TODO Auto-generated method stub
+return null;
+}
+
+@Override
+public List lockRows(SearchCriteria sc,
+Filter filter, boolean exclusive) {
+// TODO Auto-generated method stub
+return null;
+}
+
+@Override
+public UsageEventVO lockOneRandomRow(SearchCriteria sc,
+boolean exclusive) {
+// TODO Auto-generated method stub
+return null;
+}
+
+@Override
+public UsageEventVO lockRow(Long id, Boolean exclusive) {
+// TODO Auto-generated method stub
+return null;
+}
+
+@Override
+public UsageEventVO acquireInLockTable(Long id) {
+// TODO Auto-generated method stub
+return null;
+}
+
+@Override
+public UsageEventVO acquireInLockTable(Long id, int seconds) {
+// TODO Auto-generated method stub
+return null;
+}
+
+@Override
+public boolean releaseFromLockTable(Long id) {
+// TODO Auto-generated method stub
+return false;
+}
+
+@Override
+public boolean update(Long id, UsageEventVO entity) {
+// TODO Auto-generated method stub
+return false;
+}
+
+@Override
+public int update(UsageEventVO entity, SearchCriteria 
sc) {
+ 

[GitHub] cloudstack pull request #1624: Fixes regarding VOLUME_DELETE events resultin...

2016-08-10 Thread jburwell
Github user jburwell commented on a diff in the pull request:

https://github.com/apache/cloudstack/pull/1624#discussion_r74314477
  
--- Diff: server/test/com/cloud/user/MockUsageEventDao.java ---
@@ -0,0 +1,356 @@
+// 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.user;
+
+import java.util.ArrayList;
+import java.util.Date;
+import java.util.List;
+import java.util.Map;
+
+import javax.naming.ConfigurationException;
+
+import com.cloud.event.UsageEventVO;
+import com.cloud.event.dao.UsageEventDao;
+import com.cloud.utils.Pair;
+import com.cloud.utils.db.Attribute;
+import com.cloud.utils.db.Filter;
+import com.cloud.utils.db.GenericSearchBuilder;
+import com.cloud.utils.db.SearchBuilder;
+import com.cloud.utils.db.SearchCriteria;
+
+public class MockUsageEventDao implements UsageEventDao{
+
+List persistedItems;
+
+public MockUsageEventDao() {
+persistedItems = new ArrayList();
+}
+
+@Override
+public UsageEventVO findById(Long id) {
+// TODO Auto-generated method stub
+return null;
+}
+
+@Override
+public UsageEventVO findByIdIncludingRemoved(Long id) {
+// TODO Auto-generated method stub
+return null;
+}
+
+@Override
+public UsageEventVO findById(Long id, boolean fresh) {
+// TODO Auto-generated method stub
+return null;
+}
+
+@Override
+public UsageEventVO findByUuid(String uuid) {
+// TODO Auto-generated method stub
+return null;
+}
+
+@Override
+public UsageEventVO findByUuidIncludingRemoved(String uuid) {
+// TODO Auto-generated method stub
+return null;
+}
+
+@Override
+public UsageEventVO createForUpdate() {
+// TODO Auto-generated method stub
+return null;
+}
+
+@Override
+public SearchBuilder createSearchBuilder() {
+// TODO Auto-generated method stub
+return null;
+}
+
+@Override
+public  GenericSearchBuilder createSearchBuilder(
+Class clazz) {
+// TODO Auto-generated method stub
+return null;
+}
+
+@Override
+public UsageEventVO createForUpdate(Long id) {
+// TODO Auto-generated method stub
+return null;
+}
+
+@Override
+public SearchCriteria createSearchCriteria() {
+// TODO Auto-generated method stub
+return null;
+}
+
+@Override
+public List lockRows(SearchCriteria sc,
+Filter filter, boolean exclusive) {
+// TODO Auto-generated method stub
+return null;
+}
+
+@Override
+public UsageEventVO lockOneRandomRow(SearchCriteria sc,
+boolean exclusive) {
+// TODO Auto-generated method stub
+return null;
+}
+
+@Override
+public UsageEventVO lockRow(Long id, Boolean exclusive) {
+// TODO Auto-generated method stub
+return null;
+}
+
+@Override
+public UsageEventVO acquireInLockTable(Long id) {
+// TODO Auto-generated method stub
+return null;
+}
+
+@Override
+public UsageEventVO acquireInLockTable(Long id, int seconds) {
+// TODO Auto-generated method stub
+return null;
+}
+
+@Override
+public boolean releaseFromLockTable(Long id) {
+// TODO Auto-generated method stub
+return false;
+}
+
+@Override
+public boolean update(Long id, UsageEventVO entity) {
+// TODO Auto-generated method stub
+return false;
+}
+
+@Override
+public int update(UsageEventVO entity, SearchCriteria 
sc) {
+ 

[GitHub] cloudstack pull request #1624: Fixes regarding VOLUME_DELETE events resultin...

2016-08-10 Thread jburwell
Github user jburwell commented on a diff in the pull request:

https://github.com/apache/cloudstack/pull/1624#discussion_r74314512
  
--- Diff: server/test/com/cloud/user/MockUsageEventDao.java ---
@@ -0,0 +1,356 @@
+// 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.user;
+
+import java.util.ArrayList;
+import java.util.Date;
+import java.util.List;
+import java.util.Map;
+
+import javax.naming.ConfigurationException;
+
+import com.cloud.event.UsageEventVO;
+import com.cloud.event.dao.UsageEventDao;
+import com.cloud.utils.Pair;
+import com.cloud.utils.db.Attribute;
+import com.cloud.utils.db.Filter;
+import com.cloud.utils.db.GenericSearchBuilder;
+import com.cloud.utils.db.SearchBuilder;
+import com.cloud.utils.db.SearchCriteria;
+
+public class MockUsageEventDao implements UsageEventDao{
+
+List persistedItems;
+
+public MockUsageEventDao() {
+persistedItems = new ArrayList();
+}
+
+@Override
+public UsageEventVO findById(Long id) {
+// TODO Auto-generated method stub
+return null;
+}
+
+@Override
+public UsageEventVO findByIdIncludingRemoved(Long id) {
+// TODO Auto-generated method stub
+return null;
+}
+
+@Override
+public UsageEventVO findById(Long id, boolean fresh) {
+// TODO Auto-generated method stub
+return null;
+}
+
+@Override
+public UsageEventVO findByUuid(String uuid) {
+// TODO Auto-generated method stub
+return null;
+}
+
+@Override
+public UsageEventVO findByUuidIncludingRemoved(String uuid) {
+// TODO Auto-generated method stub
+return null;
+}
+
+@Override
+public UsageEventVO createForUpdate() {
+// TODO Auto-generated method stub
+return null;
+}
+
+@Override
+public SearchBuilder createSearchBuilder() {
+// TODO Auto-generated method stub
+return null;
+}
+
+@Override
+public  GenericSearchBuilder createSearchBuilder(
+Class clazz) {
+// TODO Auto-generated method stub
+return null;
+}
+
+@Override
+public UsageEventVO createForUpdate(Long id) {
+// TODO Auto-generated method stub
+return null;
+}
+
+@Override
+public SearchCriteria createSearchCriteria() {
+// TODO Auto-generated method stub
+return null;
+}
+
+@Override
+public List lockRows(SearchCriteria sc,
+Filter filter, boolean exclusive) {
+// TODO Auto-generated method stub
+return null;
+}
+
+@Override
+public UsageEventVO lockOneRandomRow(SearchCriteria sc,
+boolean exclusive) {
+// TODO Auto-generated method stub
+return null;
+}
+
+@Override
+public UsageEventVO lockRow(Long id, Boolean exclusive) {
+// TODO Auto-generated method stub
+return null;
+}
+
+@Override
+public UsageEventVO acquireInLockTable(Long id) {
+// TODO Auto-generated method stub
+return null;
+}
+
+@Override
+public UsageEventVO acquireInLockTable(Long id, int seconds) {
+// TODO Auto-generated method stub
+return null;
+}
+
+@Override
+public boolean releaseFromLockTable(Long id) {
+// TODO Auto-generated method stub
+return false;
+}
+
+@Override
+public boolean update(Long id, UsageEventVO entity) {
+// TODO Auto-generated method stub
+return false;
+}
+
+@Override
+public int update(UsageEventVO entity, SearchCriteria 
sc) {
+ 

[GitHub] cloudstack pull request #1624: Fixes regarding VOLUME_DELETE events resultin...

2016-08-10 Thread jburwell
Github user jburwell commented on a diff in the pull request:

https://github.com/apache/cloudstack/pull/1624#discussion_r74314403
  
--- Diff: server/test/com/cloud/user/MockUsageEventDao.java ---
@@ -0,0 +1,356 @@
+// 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.user;
+
+import java.util.ArrayList;
+import java.util.Date;
+import java.util.List;
+import java.util.Map;
+
+import javax.naming.ConfigurationException;
+
+import com.cloud.event.UsageEventVO;
+import com.cloud.event.dao.UsageEventDao;
+import com.cloud.utils.Pair;
+import com.cloud.utils.db.Attribute;
+import com.cloud.utils.db.Filter;
+import com.cloud.utils.db.GenericSearchBuilder;
+import com.cloud.utils.db.SearchBuilder;
+import com.cloud.utils.db.SearchCriteria;
+
+public class MockUsageEventDao implements UsageEventDao{
+
+List persistedItems;
+
+public MockUsageEventDao() {
+persistedItems = new ArrayList();
+}
+
+@Override
+public UsageEventVO findById(Long id) {
+// TODO Auto-generated method stub
+return null;
+}
+
+@Override
+public UsageEventVO findByIdIncludingRemoved(Long id) {
+// TODO Auto-generated method stub
+return null;
+}
+
+@Override
+public UsageEventVO findById(Long id, boolean fresh) {
+// TODO Auto-generated method stub
+return null;
+}
+
+@Override
+public UsageEventVO findByUuid(String uuid) {
+// TODO Auto-generated method stub
+return null;
+}
+
+@Override
+public UsageEventVO findByUuidIncludingRemoved(String uuid) {
+// TODO Auto-generated method stub
+return null;
+}
+
+@Override
+public UsageEventVO createForUpdate() {
+// TODO Auto-generated method stub
+return null;
+}
+
+@Override
+public SearchBuilder createSearchBuilder() {
+// TODO Auto-generated method stub
+return null;
+}
+
+@Override
+public  GenericSearchBuilder createSearchBuilder(
+Class clazz) {
+// TODO Auto-generated method stub
+return null;
+}
+
+@Override
+public UsageEventVO createForUpdate(Long id) {
+// TODO Auto-generated method stub
+return null;
+}
+
+@Override
+public SearchCriteria createSearchCriteria() {
+// TODO Auto-generated method stub
+return null;
+}
+
+@Override
+public List lockRows(SearchCriteria sc,
+Filter filter, boolean exclusive) {
+// TODO Auto-generated method stub
+return null;
+}
+
+@Override
+public UsageEventVO lockOneRandomRow(SearchCriteria sc,
+boolean exclusive) {
+// TODO Auto-generated method stub
+return null;
+}
+
+@Override
+public UsageEventVO lockRow(Long id, Boolean exclusive) {
+// TODO Auto-generated method stub
+return null;
+}
+
+@Override
+public UsageEventVO acquireInLockTable(Long id) {
+// TODO Auto-generated method stub
+return null;
+}
+
+@Override
+public UsageEventVO acquireInLockTable(Long id, int seconds) {
+// TODO Auto-generated method stub
+return null;
+}
+
+@Override
+public boolean releaseFromLockTable(Long id) {
+// TODO Auto-generated method stub
+return false;
+}
+
+@Override
+public boolean update(Long id, UsageEventVO entity) {
+// TODO Auto-generated method stub
+return false;
+}
+
+@Override
+public int update(UsageEventVO entity, SearchCriteria 
sc) {
+ 

[GitHub] cloudstack pull request #1624: Fixes regarding VOLUME_DELETE events resultin...

2016-08-10 Thread jburwell
Github user jburwell commented on a diff in the pull request:

https://github.com/apache/cloudstack/pull/1624#discussion_r74314442
  
--- Diff: server/test/com/cloud/user/MockUsageEventDao.java ---
@@ -0,0 +1,356 @@
+// 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.user;
+
+import java.util.ArrayList;
+import java.util.Date;
+import java.util.List;
+import java.util.Map;
+
+import javax.naming.ConfigurationException;
+
+import com.cloud.event.UsageEventVO;
+import com.cloud.event.dao.UsageEventDao;
+import com.cloud.utils.Pair;
+import com.cloud.utils.db.Attribute;
+import com.cloud.utils.db.Filter;
+import com.cloud.utils.db.GenericSearchBuilder;
+import com.cloud.utils.db.SearchBuilder;
+import com.cloud.utils.db.SearchCriteria;
+
+public class MockUsageEventDao implements UsageEventDao{
+
+List persistedItems;
+
+public MockUsageEventDao() {
+persistedItems = new ArrayList();
+}
+
+@Override
+public UsageEventVO findById(Long id) {
+// TODO Auto-generated method stub
+return null;
+}
+
+@Override
+public UsageEventVO findByIdIncludingRemoved(Long id) {
+// TODO Auto-generated method stub
+return null;
+}
+
+@Override
+public UsageEventVO findById(Long id, boolean fresh) {
+// TODO Auto-generated method stub
+return null;
+}
+
+@Override
+public UsageEventVO findByUuid(String uuid) {
+// TODO Auto-generated method stub
+return null;
+}
+
+@Override
+public UsageEventVO findByUuidIncludingRemoved(String uuid) {
+// TODO Auto-generated method stub
+return null;
+}
+
+@Override
+public UsageEventVO createForUpdate() {
+// TODO Auto-generated method stub
+return null;
+}
+
+@Override
+public SearchBuilder createSearchBuilder() {
+// TODO Auto-generated method stub
+return null;
+}
+
+@Override
+public  GenericSearchBuilder createSearchBuilder(
+Class clazz) {
+// TODO Auto-generated method stub
+return null;
+}
+
+@Override
+public UsageEventVO createForUpdate(Long id) {
+// TODO Auto-generated method stub
+return null;
+}
+
+@Override
+public SearchCriteria createSearchCriteria() {
+// TODO Auto-generated method stub
+return null;
+}
+
+@Override
+public List lockRows(SearchCriteria sc,
+Filter filter, boolean exclusive) {
+// TODO Auto-generated method stub
+return null;
+}
+
+@Override
+public UsageEventVO lockOneRandomRow(SearchCriteria sc,
+boolean exclusive) {
+// TODO Auto-generated method stub
+return null;
+}
+
+@Override
+public UsageEventVO lockRow(Long id, Boolean exclusive) {
+// TODO Auto-generated method stub
+return null;
+}
+
+@Override
+public UsageEventVO acquireInLockTable(Long id) {
+// TODO Auto-generated method stub
+return null;
+}
+
+@Override
+public UsageEventVO acquireInLockTable(Long id, int seconds) {
+// TODO Auto-generated method stub
+return null;
+}
+
+@Override
+public boolean releaseFromLockTable(Long id) {
+// TODO Auto-generated method stub
+return false;
+}
+
+@Override
+public boolean update(Long id, UsageEventVO entity) {
+// TODO Auto-generated method stub
+return false;
+}
+
+@Override
+public int update(UsageEventVO entity, SearchCriteria 
sc) {
+ 

[GitHub] cloudstack pull request #1624: Fixes regarding VOLUME_DELETE events resultin...

2016-08-10 Thread jburwell
Github user jburwell commented on a diff in the pull request:

https://github.com/apache/cloudstack/pull/1624#discussion_r74314414
  
--- Diff: server/test/com/cloud/user/MockUsageEventDao.java ---
@@ -0,0 +1,356 @@
+// 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.user;
+
+import java.util.ArrayList;
+import java.util.Date;
+import java.util.List;
+import java.util.Map;
+
+import javax.naming.ConfigurationException;
+
+import com.cloud.event.UsageEventVO;
+import com.cloud.event.dao.UsageEventDao;
+import com.cloud.utils.Pair;
+import com.cloud.utils.db.Attribute;
+import com.cloud.utils.db.Filter;
+import com.cloud.utils.db.GenericSearchBuilder;
+import com.cloud.utils.db.SearchBuilder;
+import com.cloud.utils.db.SearchCriteria;
+
+public class MockUsageEventDao implements UsageEventDao{
+
+List persistedItems;
+
+public MockUsageEventDao() {
+persistedItems = new ArrayList();
+}
+
+@Override
+public UsageEventVO findById(Long id) {
+// TODO Auto-generated method stub
+return null;
+}
+
+@Override
+public UsageEventVO findByIdIncludingRemoved(Long id) {
+// TODO Auto-generated method stub
+return null;
+}
+
+@Override
+public UsageEventVO findById(Long id, boolean fresh) {
+// TODO Auto-generated method stub
+return null;
+}
+
+@Override
+public UsageEventVO findByUuid(String uuid) {
+// TODO Auto-generated method stub
+return null;
+}
+
+@Override
+public UsageEventVO findByUuidIncludingRemoved(String uuid) {
+// TODO Auto-generated method stub
+return null;
+}
+
+@Override
+public UsageEventVO createForUpdate() {
+// TODO Auto-generated method stub
+return null;
+}
+
+@Override
+public SearchBuilder createSearchBuilder() {
+// TODO Auto-generated method stub
+return null;
+}
+
+@Override
+public  GenericSearchBuilder createSearchBuilder(
+Class clazz) {
+// TODO Auto-generated method stub
+return null;
+}
+
+@Override
+public UsageEventVO createForUpdate(Long id) {
+// TODO Auto-generated method stub
+return null;
+}
+
+@Override
+public SearchCriteria createSearchCriteria() {
+// TODO Auto-generated method stub
+return null;
+}
+
+@Override
+public List lockRows(SearchCriteria sc,
+Filter filter, boolean exclusive) {
+// TODO Auto-generated method stub
+return null;
+}
+
+@Override
+public UsageEventVO lockOneRandomRow(SearchCriteria sc,
+boolean exclusive) {
+// TODO Auto-generated method stub
+return null;
+}
+
+@Override
+public UsageEventVO lockRow(Long id, Boolean exclusive) {
+// TODO Auto-generated method stub
+return null;
+}
+
+@Override
+public UsageEventVO acquireInLockTable(Long id) {
+// TODO Auto-generated method stub
+return null;
+}
+
+@Override
+public UsageEventVO acquireInLockTable(Long id, int seconds) {
+// TODO Auto-generated method stub
+return null;
+}
+
+@Override
+public boolean releaseFromLockTable(Long id) {
+// TODO Auto-generated method stub
+return false;
+}
+
+@Override
+public boolean update(Long id, UsageEventVO entity) {
+// TODO Auto-generated method stub
+return false;
+}
+
+@Override
+public int update(UsageEventVO entity, SearchCriteria 
sc) {
+ 

[GitHub] cloudstack pull request #1624: Fixes regarding VOLUME_DELETE events resultin...

2016-08-10 Thread jburwell
Github user jburwell commented on a diff in the pull request:

https://github.com/apache/cloudstack/pull/1624#discussion_r74314378
  
--- Diff: server/test/com/cloud/user/MockUsageEventDao.java ---
@@ -0,0 +1,356 @@
+// 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.user;
+
+import java.util.ArrayList;
+import java.util.Date;
+import java.util.List;
+import java.util.Map;
+
+import javax.naming.ConfigurationException;
+
+import com.cloud.event.UsageEventVO;
+import com.cloud.event.dao.UsageEventDao;
+import com.cloud.utils.Pair;
+import com.cloud.utils.db.Attribute;
+import com.cloud.utils.db.Filter;
+import com.cloud.utils.db.GenericSearchBuilder;
+import com.cloud.utils.db.SearchBuilder;
+import com.cloud.utils.db.SearchCriteria;
+
+public class MockUsageEventDao implements UsageEventDao{
+
+List persistedItems;
+
+public MockUsageEventDao() {
+persistedItems = new ArrayList();
+}
+
+@Override
+public UsageEventVO findById(Long id) {
+// TODO Auto-generated method stub
+return null;
+}
+
+@Override
+public UsageEventVO findByIdIncludingRemoved(Long id) {
+// TODO Auto-generated method stub
+return null;
+}
+
+@Override
+public UsageEventVO findById(Long id, boolean fresh) {
+// TODO Auto-generated method stub
+return null;
+}
+
+@Override
+public UsageEventVO findByUuid(String uuid) {
+// TODO Auto-generated method stub
+return null;
+}
+
+@Override
+public UsageEventVO findByUuidIncludingRemoved(String uuid) {
+// TODO Auto-generated method stub
+return null;
+}
+
+@Override
+public UsageEventVO createForUpdate() {
+// TODO Auto-generated method stub
+return null;
+}
+
+@Override
+public SearchBuilder createSearchBuilder() {
+// TODO Auto-generated method stub
+return null;
+}
+
+@Override
+public  GenericSearchBuilder createSearchBuilder(
+Class clazz) {
+// TODO Auto-generated method stub
+return null;
+}
+
+@Override
+public UsageEventVO createForUpdate(Long id) {
+// TODO Auto-generated method stub
+return null;
+}
+
+@Override
+public SearchCriteria createSearchCriteria() {
+// TODO Auto-generated method stub
+return null;
+}
+
+@Override
+public List lockRows(SearchCriteria sc,
+Filter filter, boolean exclusive) {
+// TODO Auto-generated method stub
+return null;
+}
+
+@Override
+public UsageEventVO lockOneRandomRow(SearchCriteria sc,
+boolean exclusive) {
+// TODO Auto-generated method stub
+return null;
+}
+
+@Override
+public UsageEventVO lockRow(Long id, Boolean exclusive) {
+// TODO Auto-generated method stub
+return null;
+}
+
+@Override
+public UsageEventVO acquireInLockTable(Long id) {
+// TODO Auto-generated method stub
+return null;
+}
+
+@Override
+public UsageEventVO acquireInLockTable(Long id, int seconds) {
+// TODO Auto-generated method stub
+return null;
+}
+
+@Override
+public boolean releaseFromLockTable(Long id) {
+// TODO Auto-generated method stub
+return false;
+}
+
+@Override
+public boolean update(Long id, UsageEventVO entity) {
+// TODO Auto-generated method stub
+return false;
+}
+
+@Override
+public int update(UsageEventVO entity, SearchCriteria 
sc) {
+ 

[GitHub] cloudstack pull request #1624: Fixes regarding VOLUME_DELETE events resultin...

2016-08-10 Thread jburwell
Github user jburwell commented on a diff in the pull request:

https://github.com/apache/cloudstack/pull/1624#discussion_r74314390
  
--- Diff: server/test/com/cloud/user/MockUsageEventDao.java ---
@@ -0,0 +1,356 @@
+// 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.user;
+
+import java.util.ArrayList;
+import java.util.Date;
+import java.util.List;
+import java.util.Map;
+
+import javax.naming.ConfigurationException;
+
+import com.cloud.event.UsageEventVO;
+import com.cloud.event.dao.UsageEventDao;
+import com.cloud.utils.Pair;
+import com.cloud.utils.db.Attribute;
+import com.cloud.utils.db.Filter;
+import com.cloud.utils.db.GenericSearchBuilder;
+import com.cloud.utils.db.SearchBuilder;
+import com.cloud.utils.db.SearchCriteria;
+
+public class MockUsageEventDao implements UsageEventDao{
+
+List persistedItems;
+
+public MockUsageEventDao() {
+persistedItems = new ArrayList();
+}
+
+@Override
+public UsageEventVO findById(Long id) {
+// TODO Auto-generated method stub
+return null;
+}
+
+@Override
+public UsageEventVO findByIdIncludingRemoved(Long id) {
+// TODO Auto-generated method stub
+return null;
+}
+
+@Override
+public UsageEventVO findById(Long id, boolean fresh) {
+// TODO Auto-generated method stub
+return null;
+}
+
+@Override
+public UsageEventVO findByUuid(String uuid) {
+// TODO Auto-generated method stub
+return null;
+}
+
+@Override
+public UsageEventVO findByUuidIncludingRemoved(String uuid) {
+// TODO Auto-generated method stub
+return null;
+}
+
+@Override
+public UsageEventVO createForUpdate() {
+// TODO Auto-generated method stub
+return null;
+}
+
+@Override
+public SearchBuilder createSearchBuilder() {
+// TODO Auto-generated method stub
+return null;
+}
+
+@Override
+public  GenericSearchBuilder createSearchBuilder(
+Class clazz) {
+// TODO Auto-generated method stub
+return null;
+}
+
+@Override
+public UsageEventVO createForUpdate(Long id) {
+// TODO Auto-generated method stub
+return null;
+}
+
+@Override
+public SearchCriteria createSearchCriteria() {
+// TODO Auto-generated method stub
+return null;
+}
+
+@Override
+public List lockRows(SearchCriteria sc,
+Filter filter, boolean exclusive) {
+// TODO Auto-generated method stub
+return null;
+}
+
+@Override
+public UsageEventVO lockOneRandomRow(SearchCriteria sc,
+boolean exclusive) {
+// TODO Auto-generated method stub
+return null;
+}
+
+@Override
+public UsageEventVO lockRow(Long id, Boolean exclusive) {
+// TODO Auto-generated method stub
+return null;
+}
+
+@Override
+public UsageEventVO acquireInLockTable(Long id) {
+// TODO Auto-generated method stub
+return null;
+}
+
+@Override
+public UsageEventVO acquireInLockTable(Long id, int seconds) {
+// TODO Auto-generated method stub
+return null;
+}
+
+@Override
+public boolean releaseFromLockTable(Long id) {
+// TODO Auto-generated method stub
+return false;
+}
+
+@Override
+public boolean update(Long id, UsageEventVO entity) {
+// TODO Auto-generated method stub
+return false;
+}
+
+@Override
+public int update(UsageEventVO entity, SearchCriteria 
sc) {
+ 

[GitHub] cloudstack pull request #1624: Fixes regarding VOLUME_DELETE events resultin...

2016-08-10 Thread jburwell
Github user jburwell commented on a diff in the pull request:

https://github.com/apache/cloudstack/pull/1624#discussion_r74314424
  
--- Diff: server/test/com/cloud/user/MockUsageEventDao.java ---
@@ -0,0 +1,356 @@
+// 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.user;
+
+import java.util.ArrayList;
+import java.util.Date;
+import java.util.List;
+import java.util.Map;
+
+import javax.naming.ConfigurationException;
+
+import com.cloud.event.UsageEventVO;
+import com.cloud.event.dao.UsageEventDao;
+import com.cloud.utils.Pair;
+import com.cloud.utils.db.Attribute;
+import com.cloud.utils.db.Filter;
+import com.cloud.utils.db.GenericSearchBuilder;
+import com.cloud.utils.db.SearchBuilder;
+import com.cloud.utils.db.SearchCriteria;
+
+public class MockUsageEventDao implements UsageEventDao{
+
+List persistedItems;
+
+public MockUsageEventDao() {
+persistedItems = new ArrayList();
+}
+
+@Override
+public UsageEventVO findById(Long id) {
+// TODO Auto-generated method stub
+return null;
+}
+
+@Override
+public UsageEventVO findByIdIncludingRemoved(Long id) {
+// TODO Auto-generated method stub
+return null;
+}
+
+@Override
+public UsageEventVO findById(Long id, boolean fresh) {
+// TODO Auto-generated method stub
+return null;
+}
+
+@Override
+public UsageEventVO findByUuid(String uuid) {
+// TODO Auto-generated method stub
+return null;
+}
+
+@Override
+public UsageEventVO findByUuidIncludingRemoved(String uuid) {
+// TODO Auto-generated method stub
+return null;
+}
+
+@Override
+public UsageEventVO createForUpdate() {
+// TODO Auto-generated method stub
+return null;
+}
+
+@Override
+public SearchBuilder createSearchBuilder() {
+// TODO Auto-generated method stub
+return null;
+}
+
+@Override
+public  GenericSearchBuilder createSearchBuilder(
+Class clazz) {
+// TODO Auto-generated method stub
+return null;
+}
+
+@Override
+public UsageEventVO createForUpdate(Long id) {
+// TODO Auto-generated method stub
+return null;
+}
+
+@Override
+public SearchCriteria createSearchCriteria() {
+// TODO Auto-generated method stub
+return null;
+}
+
+@Override
+public List lockRows(SearchCriteria sc,
+Filter filter, boolean exclusive) {
+// TODO Auto-generated method stub
+return null;
+}
+
+@Override
+public UsageEventVO lockOneRandomRow(SearchCriteria sc,
+boolean exclusive) {
+// TODO Auto-generated method stub
+return null;
+}
+
+@Override
+public UsageEventVO lockRow(Long id, Boolean exclusive) {
+// TODO Auto-generated method stub
+return null;
+}
+
+@Override
+public UsageEventVO acquireInLockTable(Long id) {
+// TODO Auto-generated method stub
+return null;
+}
+
+@Override
+public UsageEventVO acquireInLockTable(Long id, int seconds) {
+// TODO Auto-generated method stub
+return null;
+}
+
+@Override
+public boolean releaseFromLockTable(Long id) {
+// TODO Auto-generated method stub
+return false;
+}
+
+@Override
+public boolean update(Long id, UsageEventVO entity) {
+// TODO Auto-generated method stub
+return false;
+}
+
+@Override
+public int update(UsageEventVO entity, SearchCriteria 
sc) {
+ 

[GitHub] cloudstack pull request #1624: Fixes regarding VOLUME_DELETE events resultin...

2016-08-10 Thread jburwell
Github user jburwell commented on a diff in the pull request:

https://github.com/apache/cloudstack/pull/1624#discussion_r74314365
  
--- Diff: server/test/com/cloud/user/MockUsageEventDao.java ---
@@ -0,0 +1,356 @@
+// 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.user;
+
+import java.util.ArrayList;
+import java.util.Date;
+import java.util.List;
+import java.util.Map;
+
+import javax.naming.ConfigurationException;
+
+import com.cloud.event.UsageEventVO;
+import com.cloud.event.dao.UsageEventDao;
+import com.cloud.utils.Pair;
+import com.cloud.utils.db.Attribute;
+import com.cloud.utils.db.Filter;
+import com.cloud.utils.db.GenericSearchBuilder;
+import com.cloud.utils.db.SearchBuilder;
+import com.cloud.utils.db.SearchCriteria;
+
+public class MockUsageEventDao implements UsageEventDao{
+
+List persistedItems;
+
+public MockUsageEventDao() {
+persistedItems = new ArrayList();
+}
+
+@Override
+public UsageEventVO findById(Long id) {
+// TODO Auto-generated method stub
+return null;
+}
+
+@Override
+public UsageEventVO findByIdIncludingRemoved(Long id) {
+// TODO Auto-generated method stub
+return null;
+}
+
+@Override
+public UsageEventVO findById(Long id, boolean fresh) {
+// TODO Auto-generated method stub
+return null;
+}
+
+@Override
+public UsageEventVO findByUuid(String uuid) {
+// TODO Auto-generated method stub
+return null;
+}
+
+@Override
+public UsageEventVO findByUuidIncludingRemoved(String uuid) {
+// TODO Auto-generated method stub
+return null;
+}
+
+@Override
+public UsageEventVO createForUpdate() {
+// TODO Auto-generated method stub
+return null;
+}
+
+@Override
+public SearchBuilder createSearchBuilder() {
+// TODO Auto-generated method stub
+return null;
+}
+
+@Override
+public  GenericSearchBuilder createSearchBuilder(
+Class clazz) {
+// TODO Auto-generated method stub
+return null;
+}
+
+@Override
+public UsageEventVO createForUpdate(Long id) {
+// TODO Auto-generated method stub
+return null;
+}
+
+@Override
+public SearchCriteria createSearchCriteria() {
+// TODO Auto-generated method stub
+return null;
+}
+
+@Override
+public List lockRows(SearchCriteria sc,
+Filter filter, boolean exclusive) {
+// TODO Auto-generated method stub
+return null;
+}
+
+@Override
+public UsageEventVO lockOneRandomRow(SearchCriteria sc,
+boolean exclusive) {
+// TODO Auto-generated method stub
+return null;
+}
+
+@Override
+public UsageEventVO lockRow(Long id, Boolean exclusive) {
+// TODO Auto-generated method stub
+return null;
+}
+
+@Override
+public UsageEventVO acquireInLockTable(Long id) {
+// TODO Auto-generated method stub
+return null;
+}
+
+@Override
+public UsageEventVO acquireInLockTable(Long id, int seconds) {
+// TODO Auto-generated method stub
+return null;
+}
+
+@Override
+public boolean releaseFromLockTable(Long id) {
+// TODO Auto-generated method stub
+return false;
+}
+
+@Override
+public boolean update(Long id, UsageEventVO entity) {
+// TODO Auto-generated method stub
+return false;
+}
+
+@Override
+public int update(UsageEventVO entity, SearchCriteria 
sc) {
+ 

[GitHub] cloudstack pull request #1624: Fixes regarding VOLUME_DELETE events resultin...

2016-08-10 Thread jburwell
Github user jburwell commented on a diff in the pull request:

https://github.com/apache/cloudstack/pull/1624#discussion_r74314349
  
--- Diff: server/test/com/cloud/user/MockUsageEventDao.java ---
@@ -0,0 +1,356 @@
+// 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.user;
+
+import java.util.ArrayList;
+import java.util.Date;
+import java.util.List;
+import java.util.Map;
+
+import javax.naming.ConfigurationException;
+
+import com.cloud.event.UsageEventVO;
+import com.cloud.event.dao.UsageEventDao;
+import com.cloud.utils.Pair;
+import com.cloud.utils.db.Attribute;
+import com.cloud.utils.db.Filter;
+import com.cloud.utils.db.GenericSearchBuilder;
+import com.cloud.utils.db.SearchBuilder;
+import com.cloud.utils.db.SearchCriteria;
+
+public class MockUsageEventDao implements UsageEventDao{
+
+List persistedItems;
+
+public MockUsageEventDao() {
+persistedItems = new ArrayList();
+}
+
+@Override
+public UsageEventVO findById(Long id) {
+// TODO Auto-generated method stub
+return null;
+}
+
+@Override
+public UsageEventVO findByIdIncludingRemoved(Long id) {
+// TODO Auto-generated method stub
+return null;
+}
+
+@Override
+public UsageEventVO findById(Long id, boolean fresh) {
+// TODO Auto-generated method stub
+return null;
+}
+
+@Override
+public UsageEventVO findByUuid(String uuid) {
+// TODO Auto-generated method stub
+return null;
+}
+
+@Override
+public UsageEventVO findByUuidIncludingRemoved(String uuid) {
+// TODO Auto-generated method stub
+return null;
+}
+
+@Override
+public UsageEventVO createForUpdate() {
+// TODO Auto-generated method stub
+return null;
+}
+
+@Override
+public SearchBuilder createSearchBuilder() {
+// TODO Auto-generated method stub
+return null;
+}
+
+@Override
+public  GenericSearchBuilder createSearchBuilder(
+Class clazz) {
+// TODO Auto-generated method stub
+return null;
+}
+
+@Override
+public UsageEventVO createForUpdate(Long id) {
+// TODO Auto-generated method stub
+return null;
+}
+
+@Override
+public SearchCriteria createSearchCriteria() {
+// TODO Auto-generated method stub
+return null;
+}
+
+@Override
+public List lockRows(SearchCriteria sc,
+Filter filter, boolean exclusive) {
+// TODO Auto-generated method stub
+return null;
+}
+
+@Override
+public UsageEventVO lockOneRandomRow(SearchCriteria sc,
+boolean exclusive) {
+// TODO Auto-generated method stub
+return null;
+}
+
+@Override
+public UsageEventVO lockRow(Long id, Boolean exclusive) {
+// TODO Auto-generated method stub
+return null;
+}
+
+@Override
+public UsageEventVO acquireInLockTable(Long id) {
+// TODO Auto-generated method stub
+return null;
+}
+
+@Override
+public UsageEventVO acquireInLockTable(Long id, int seconds) {
+// TODO Auto-generated method stub
+return null;
+}
+
+@Override
+public boolean releaseFromLockTable(Long id) {
+// TODO Auto-generated method stub
+return false;
+}
+
+@Override
+public boolean update(Long id, UsageEventVO entity) {
+// TODO Auto-generated method stub
+return false;
+}
+
+@Override
+public int update(UsageEventVO entity, SearchCriteria 
sc) {
+ 

[GitHub] cloudstack pull request #1624: Fixes regarding VOLUME_DELETE events resultin...

2016-08-10 Thread jburwell
Github user jburwell commented on a diff in the pull request:

https://github.com/apache/cloudstack/pull/1624#discussion_r74314326
  
--- Diff: server/test/com/cloud/user/MockUsageEventDao.java ---
@@ -0,0 +1,356 @@
+// 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.user;
+
+import java.util.ArrayList;
+import java.util.Date;
+import java.util.List;
+import java.util.Map;
+
+import javax.naming.ConfigurationException;
+
+import com.cloud.event.UsageEventVO;
+import com.cloud.event.dao.UsageEventDao;
+import com.cloud.utils.Pair;
+import com.cloud.utils.db.Attribute;
+import com.cloud.utils.db.Filter;
+import com.cloud.utils.db.GenericSearchBuilder;
+import com.cloud.utils.db.SearchBuilder;
+import com.cloud.utils.db.SearchCriteria;
+
+public class MockUsageEventDao implements UsageEventDao{
+
+List persistedItems;
+
+public MockUsageEventDao() {
+persistedItems = new ArrayList();
+}
+
+@Override
+public UsageEventVO findById(Long id) {
+// TODO Auto-generated method stub
+return null;
+}
+
+@Override
+public UsageEventVO findByIdIncludingRemoved(Long id) {
+// TODO Auto-generated method stub
+return null;
+}
+
+@Override
+public UsageEventVO findById(Long id, boolean fresh) {
+// TODO Auto-generated method stub
+return null;
+}
+
+@Override
+public UsageEventVO findByUuid(String uuid) {
+// TODO Auto-generated method stub
+return null;
+}
+
+@Override
+public UsageEventVO findByUuidIncludingRemoved(String uuid) {
+// TODO Auto-generated method stub
+return null;
+}
+
+@Override
+public UsageEventVO createForUpdate() {
+// TODO Auto-generated method stub
+return null;
+}
+
+@Override
+public SearchBuilder createSearchBuilder() {
+// TODO Auto-generated method stub
+return null;
+}
+
+@Override
+public  GenericSearchBuilder createSearchBuilder(
+Class clazz) {
+// TODO Auto-generated method stub
+return null;
+}
+
+@Override
+public UsageEventVO createForUpdate(Long id) {
+// TODO Auto-generated method stub
+return null;
+}
+
+@Override
+public SearchCriteria createSearchCriteria() {
+// TODO Auto-generated method stub
+return null;
+}
+
+@Override
+public List lockRows(SearchCriteria sc,
+Filter filter, boolean exclusive) {
+// TODO Auto-generated method stub
+return null;
+}
+
+@Override
+public UsageEventVO lockOneRandomRow(SearchCriteria sc,
+boolean exclusive) {
+// TODO Auto-generated method stub
+return null;
+}
+
+@Override
+public UsageEventVO lockRow(Long id, Boolean exclusive) {
+// TODO Auto-generated method stub
+return null;
+}
+
+@Override
+public UsageEventVO acquireInLockTable(Long id) {
+// TODO Auto-generated method stub
+return null;
+}
+
+@Override
+public UsageEventVO acquireInLockTable(Long id, int seconds) {
+// TODO Auto-generated method stub
+return null;
+}
+
+@Override
+public boolean releaseFromLockTable(Long id) {
+// TODO Auto-generated method stub
+return false;
+}
+
+@Override
+public boolean update(Long id, UsageEventVO entity) {
+// TODO Auto-generated method stub
+return false;
+}
+
+@Override
+public int update(UsageEventVO entity, SearchCriteria 
sc) {
+ 

[GitHub] cloudstack pull request #1624: Fixes regarding VOLUME_DELETE events resultin...

2016-08-10 Thread jburwell
Github user jburwell commented on a diff in the pull request:

https://github.com/apache/cloudstack/pull/1624#discussion_r74314305
  
--- Diff: server/test/com/cloud/user/MockUsageEventDao.java ---
@@ -0,0 +1,356 @@
+// 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.user;
+
+import java.util.ArrayList;
+import java.util.Date;
+import java.util.List;
+import java.util.Map;
+
+import javax.naming.ConfigurationException;
+
+import com.cloud.event.UsageEventVO;
+import com.cloud.event.dao.UsageEventDao;
+import com.cloud.utils.Pair;
+import com.cloud.utils.db.Attribute;
+import com.cloud.utils.db.Filter;
+import com.cloud.utils.db.GenericSearchBuilder;
+import com.cloud.utils.db.SearchBuilder;
+import com.cloud.utils.db.SearchCriteria;
+
+public class MockUsageEventDao implements UsageEventDao{
+
+List persistedItems;
+
+public MockUsageEventDao() {
+persistedItems = new ArrayList();
+}
+
+@Override
+public UsageEventVO findById(Long id) {
+// TODO Auto-generated method stub
+return null;
+}
+
+@Override
+public UsageEventVO findByIdIncludingRemoved(Long id) {
+// TODO Auto-generated method stub
+return null;
+}
+
+@Override
+public UsageEventVO findById(Long id, boolean fresh) {
+// TODO Auto-generated method stub
+return null;
+}
+
+@Override
+public UsageEventVO findByUuid(String uuid) {
+// TODO Auto-generated method stub
+return null;
+}
+
+@Override
+public UsageEventVO findByUuidIncludingRemoved(String uuid) {
+// TODO Auto-generated method stub
+return null;
+}
+
+@Override
+public UsageEventVO createForUpdate() {
+// TODO Auto-generated method stub
+return null;
+}
+
+@Override
+public SearchBuilder createSearchBuilder() {
+// TODO Auto-generated method stub
+return null;
+}
+
+@Override
+public  GenericSearchBuilder createSearchBuilder(
+Class clazz) {
+// TODO Auto-generated method stub
+return null;
+}
+
+@Override
+public UsageEventVO createForUpdate(Long id) {
+// TODO Auto-generated method stub
+return null;
+}
+
+@Override
+public SearchCriteria createSearchCriteria() {
+// TODO Auto-generated method stub
+return null;
+}
+
+@Override
+public List lockRows(SearchCriteria sc,
+Filter filter, boolean exclusive) {
+// TODO Auto-generated method stub
+return null;
+}
+
+@Override
+public UsageEventVO lockOneRandomRow(SearchCriteria sc,
+boolean exclusive) {
+// TODO Auto-generated method stub
+return null;
+}
+
+@Override
+public UsageEventVO lockRow(Long id, Boolean exclusive) {
+// TODO Auto-generated method stub
+return null;
+}
+
+@Override
+public UsageEventVO acquireInLockTable(Long id) {
+// TODO Auto-generated method stub
+return null;
+}
+
+@Override
+public UsageEventVO acquireInLockTable(Long id, int seconds) {
+// TODO Auto-generated method stub
+return null;
+}
+
+@Override
+public boolean releaseFromLockTable(Long id) {
+// TODO Auto-generated method stub
+return false;
+}
+
+@Override
+public boolean update(Long id, UsageEventVO entity) {
+// TODO Auto-generated method stub
+return false;
+}
+
+@Override
+public int update(UsageEventVO entity, SearchCriteria 
sc) {
+ 

[GitHub] cloudstack pull request #1624: Fixes regarding VOLUME_DELETE events resultin...

2016-08-10 Thread jburwell
Github user jburwell commented on a diff in the pull request:

https://github.com/apache/cloudstack/pull/1624#discussion_r74314335
  
--- Diff: server/test/com/cloud/user/MockUsageEventDao.java ---
@@ -0,0 +1,356 @@
+// 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.user;
+
+import java.util.ArrayList;
+import java.util.Date;
+import java.util.List;
+import java.util.Map;
+
+import javax.naming.ConfigurationException;
+
+import com.cloud.event.UsageEventVO;
+import com.cloud.event.dao.UsageEventDao;
+import com.cloud.utils.Pair;
+import com.cloud.utils.db.Attribute;
+import com.cloud.utils.db.Filter;
+import com.cloud.utils.db.GenericSearchBuilder;
+import com.cloud.utils.db.SearchBuilder;
+import com.cloud.utils.db.SearchCriteria;
+
+public class MockUsageEventDao implements UsageEventDao{
+
+List persistedItems;
+
+public MockUsageEventDao() {
+persistedItems = new ArrayList();
+}
+
+@Override
+public UsageEventVO findById(Long id) {
+// TODO Auto-generated method stub
+return null;
+}
+
+@Override
+public UsageEventVO findByIdIncludingRemoved(Long id) {
+// TODO Auto-generated method stub
+return null;
+}
+
+@Override
+public UsageEventVO findById(Long id, boolean fresh) {
+// TODO Auto-generated method stub
+return null;
+}
+
+@Override
+public UsageEventVO findByUuid(String uuid) {
+// TODO Auto-generated method stub
+return null;
+}
+
+@Override
+public UsageEventVO findByUuidIncludingRemoved(String uuid) {
+// TODO Auto-generated method stub
+return null;
+}
+
+@Override
+public UsageEventVO createForUpdate() {
+// TODO Auto-generated method stub
+return null;
+}
+
+@Override
+public SearchBuilder createSearchBuilder() {
+// TODO Auto-generated method stub
+return null;
+}
+
+@Override
+public  GenericSearchBuilder createSearchBuilder(
+Class clazz) {
+// TODO Auto-generated method stub
+return null;
+}
+
+@Override
+public UsageEventVO createForUpdate(Long id) {
+// TODO Auto-generated method stub
+return null;
+}
+
+@Override
+public SearchCriteria createSearchCriteria() {
+// TODO Auto-generated method stub
+return null;
+}
+
+@Override
+public List lockRows(SearchCriteria sc,
+Filter filter, boolean exclusive) {
+// TODO Auto-generated method stub
+return null;
+}
+
+@Override
+public UsageEventVO lockOneRandomRow(SearchCriteria sc,
+boolean exclusive) {
+// TODO Auto-generated method stub
+return null;
+}
+
+@Override
+public UsageEventVO lockRow(Long id, Boolean exclusive) {
+// TODO Auto-generated method stub
+return null;
+}
+
+@Override
+public UsageEventVO acquireInLockTable(Long id) {
+// TODO Auto-generated method stub
+return null;
+}
+
+@Override
+public UsageEventVO acquireInLockTable(Long id, int seconds) {
+// TODO Auto-generated method stub
+return null;
+}
+
+@Override
+public boolean releaseFromLockTable(Long id) {
+// TODO Auto-generated method stub
+return false;
+}
+
+@Override
+public boolean update(Long id, UsageEventVO entity) {
+// TODO Auto-generated method stub
+return false;
+}
+
+@Override
+public int update(UsageEventVO entity, SearchCriteria 
sc) {
+ 

[GitHub] cloudstack pull request #1624: Fixes regarding VOLUME_DELETE events resultin...

2016-08-10 Thread jburwell
Github user jburwell commented on a diff in the pull request:

https://github.com/apache/cloudstack/pull/1624#discussion_r74314285
  
--- Diff: server/test/com/cloud/user/MockUsageEventDao.java ---
@@ -0,0 +1,356 @@
+// 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.user;
+
+import java.util.ArrayList;
+import java.util.Date;
+import java.util.List;
+import java.util.Map;
+
+import javax.naming.ConfigurationException;
+
+import com.cloud.event.UsageEventVO;
+import com.cloud.event.dao.UsageEventDao;
+import com.cloud.utils.Pair;
+import com.cloud.utils.db.Attribute;
+import com.cloud.utils.db.Filter;
+import com.cloud.utils.db.GenericSearchBuilder;
+import com.cloud.utils.db.SearchBuilder;
+import com.cloud.utils.db.SearchCriteria;
+
+public class MockUsageEventDao implements UsageEventDao{
+
+List persistedItems;
+
+public MockUsageEventDao() {
+persistedItems = new ArrayList();
+}
+
+@Override
+public UsageEventVO findById(Long id) {
+// TODO Auto-generated method stub
+return null;
+}
+
+@Override
+public UsageEventVO findByIdIncludingRemoved(Long id) {
+// TODO Auto-generated method stub
+return null;
+}
+
+@Override
+public UsageEventVO findById(Long id, boolean fresh) {
+// TODO Auto-generated method stub
+return null;
+}
+
+@Override
+public UsageEventVO findByUuid(String uuid) {
+// TODO Auto-generated method stub
+return null;
+}
+
+@Override
+public UsageEventVO findByUuidIncludingRemoved(String uuid) {
+// TODO Auto-generated method stub
+return null;
+}
+
+@Override
+public UsageEventVO createForUpdate() {
+// TODO Auto-generated method stub
+return null;
+}
+
+@Override
+public SearchBuilder createSearchBuilder() {
+// TODO Auto-generated method stub
+return null;
+}
+
+@Override
+public  GenericSearchBuilder createSearchBuilder(
+Class clazz) {
+// TODO Auto-generated method stub
+return null;
+}
+
+@Override
+public UsageEventVO createForUpdate(Long id) {
+// TODO Auto-generated method stub
+return null;
+}
+
+@Override
+public SearchCriteria createSearchCriteria() {
+// TODO Auto-generated method stub
+return null;
+}
+
+@Override
+public List lockRows(SearchCriteria sc,
+Filter filter, boolean exclusive) {
+// TODO Auto-generated method stub
+return null;
+}
+
+@Override
+public UsageEventVO lockOneRandomRow(SearchCriteria sc,
+boolean exclusive) {
+// TODO Auto-generated method stub
+return null;
+}
+
+@Override
+public UsageEventVO lockRow(Long id, Boolean exclusive) {
+// TODO Auto-generated method stub
+return null;
+}
+
+@Override
+public UsageEventVO acquireInLockTable(Long id) {
+// TODO Auto-generated method stub
+return null;
+}
+
+@Override
+public UsageEventVO acquireInLockTable(Long id, int seconds) {
+// TODO Auto-generated method stub
+return null;
+}
+
+@Override
+public boolean releaseFromLockTable(Long id) {
+// TODO Auto-generated method stub
+return false;
+}
+
+@Override
+public boolean update(Long id, UsageEventVO entity) {
+// TODO Auto-generated method stub
+return false;
+}
+
+@Override
+public int update(UsageEventVO entity, SearchCriteria 
sc) {
+ 

[GitHub] cloudstack pull request #1624: Fixes regarding VOLUME_DELETE events resultin...

2016-08-10 Thread jburwell
Github user jburwell commented on a diff in the pull request:

https://github.com/apache/cloudstack/pull/1624#discussion_r74314270
  
--- Diff: server/test/com/cloud/user/MockUsageEventDao.java ---
@@ -0,0 +1,356 @@
+// 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.user;
+
+import java.util.ArrayList;
+import java.util.Date;
+import java.util.List;
+import java.util.Map;
+
+import javax.naming.ConfigurationException;
+
+import com.cloud.event.UsageEventVO;
+import com.cloud.event.dao.UsageEventDao;
+import com.cloud.utils.Pair;
+import com.cloud.utils.db.Attribute;
+import com.cloud.utils.db.Filter;
+import com.cloud.utils.db.GenericSearchBuilder;
+import com.cloud.utils.db.SearchBuilder;
+import com.cloud.utils.db.SearchCriteria;
+
+public class MockUsageEventDao implements UsageEventDao{
+
+List persistedItems;
+
+public MockUsageEventDao() {
+persistedItems = new ArrayList();
+}
+
+@Override
+public UsageEventVO findById(Long id) {
+// TODO Auto-generated method stub
+return null;
+}
+
+@Override
+public UsageEventVO findByIdIncludingRemoved(Long id) {
+// TODO Auto-generated method stub
+return null;
+}
+
+@Override
+public UsageEventVO findById(Long id, boolean fresh) {
+// TODO Auto-generated method stub
+return null;
+}
+
+@Override
+public UsageEventVO findByUuid(String uuid) {
+// TODO Auto-generated method stub
+return null;
+}
+
+@Override
+public UsageEventVO findByUuidIncludingRemoved(String uuid) {
+// TODO Auto-generated method stub
+return null;
+}
+
+@Override
+public UsageEventVO createForUpdate() {
+// TODO Auto-generated method stub
+return null;
+}
+
+@Override
+public SearchBuilder createSearchBuilder() {
+// TODO Auto-generated method stub
+return null;
+}
+
+@Override
+public  GenericSearchBuilder createSearchBuilder(
+Class clazz) {
+// TODO Auto-generated method stub
+return null;
+}
+
+@Override
+public UsageEventVO createForUpdate(Long id) {
+// TODO Auto-generated method stub
+return null;
+}
+
+@Override
+public SearchCriteria createSearchCriteria() {
+// TODO Auto-generated method stub
+return null;
+}
+
+@Override
+public List lockRows(SearchCriteria sc,
+Filter filter, boolean exclusive) {
+// TODO Auto-generated method stub
+return null;
+}
+
+@Override
+public UsageEventVO lockOneRandomRow(SearchCriteria sc,
+boolean exclusive) {
+// TODO Auto-generated method stub
+return null;
+}
+
+@Override
+public UsageEventVO lockRow(Long id, Boolean exclusive) {
+// TODO Auto-generated method stub
+return null;
+}
+
+@Override
+public UsageEventVO acquireInLockTable(Long id) {
+// TODO Auto-generated method stub
+return null;
+}
+
+@Override
+public UsageEventVO acquireInLockTable(Long id, int seconds) {
+// TODO Auto-generated method stub
+return null;
+}
+
+@Override
+public boolean releaseFromLockTable(Long id) {
+// TODO Auto-generated method stub
+return false;
+}
+
+@Override
+public boolean update(Long id, UsageEventVO entity) {
+// TODO Auto-generated method stub
--- End diff --

Is there a TODO to be resolved?


---
If your project is set up for it, you can reply to this email and have 

[GitHub] cloudstack pull request #1624: Fixes regarding VOLUME_DELETE events resultin...

2016-08-10 Thread jburwell
Github user jburwell commented on a diff in the pull request:

https://github.com/apache/cloudstack/pull/1624#discussion_r74314253
  
--- Diff: server/test/com/cloud/user/MockUsageEventDao.java ---
@@ -0,0 +1,356 @@
+// 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.user;
+
+import java.util.ArrayList;
+import java.util.Date;
+import java.util.List;
+import java.util.Map;
+
+import javax.naming.ConfigurationException;
+
+import com.cloud.event.UsageEventVO;
+import com.cloud.event.dao.UsageEventDao;
+import com.cloud.utils.Pair;
+import com.cloud.utils.db.Attribute;
+import com.cloud.utils.db.Filter;
+import com.cloud.utils.db.GenericSearchBuilder;
+import com.cloud.utils.db.SearchBuilder;
+import com.cloud.utils.db.SearchCriteria;
+
+public class MockUsageEventDao implements UsageEventDao{
+
+List persistedItems;
+
+public MockUsageEventDao() {
+persistedItems = new ArrayList();
+}
+
+@Override
+public UsageEventVO findById(Long id) {
+// TODO Auto-generated method stub
+return null;
+}
+
+@Override
+public UsageEventVO findByIdIncludingRemoved(Long id) {
+// TODO Auto-generated method stub
+return null;
+}
+
+@Override
+public UsageEventVO findById(Long id, boolean fresh) {
+// TODO Auto-generated method stub
+return null;
+}
+
+@Override
+public UsageEventVO findByUuid(String uuid) {
+// TODO Auto-generated method stub
+return null;
+}
+
+@Override
+public UsageEventVO findByUuidIncludingRemoved(String uuid) {
+// TODO Auto-generated method stub
+return null;
+}
+
+@Override
+public UsageEventVO createForUpdate() {
+// TODO Auto-generated method stub
+return null;
+}
+
+@Override
+public SearchBuilder createSearchBuilder() {
+// TODO Auto-generated method stub
+return null;
+}
+
+@Override
+public  GenericSearchBuilder createSearchBuilder(
+Class clazz) {
+// TODO Auto-generated method stub
+return null;
+}
+
+@Override
+public UsageEventVO createForUpdate(Long id) {
+// TODO Auto-generated method stub
+return null;
+}
+
+@Override
+public SearchCriteria createSearchCriteria() {
+// TODO Auto-generated method stub
+return null;
+}
+
+@Override
+public List lockRows(SearchCriteria sc,
+Filter filter, boolean exclusive) {
+// TODO Auto-generated method stub
+return null;
+}
+
+@Override
+public UsageEventVO lockOneRandomRow(SearchCriteria sc,
+boolean exclusive) {
+// TODO Auto-generated method stub
+return null;
+}
+
+@Override
+public UsageEventVO lockRow(Long id, Boolean exclusive) {
+// TODO Auto-generated method stub
+return null;
+}
+
+@Override
+public UsageEventVO acquireInLockTable(Long id) {
+// TODO Auto-generated method stub
+return null;
+}
+
+@Override
+public UsageEventVO acquireInLockTable(Long id, int seconds) {
+// TODO Auto-generated method stub
+return null;
+}
+
+@Override
+public boolean releaseFromLockTable(Long id) {
+// TODO Auto-generated method stub
--- End diff --

Is there a TODO to be resolved?


---
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 

[GitHub] cloudstack pull request #1624: Fixes regarding VOLUME_DELETE events resultin...

2016-08-10 Thread jburwell
Github user jburwell commented on a diff in the pull request:

https://github.com/apache/cloudstack/pull/1624#discussion_r74314233
  
--- Diff: server/test/com/cloud/user/MockUsageEventDao.java ---
@@ -0,0 +1,356 @@
+// 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.user;
+
+import java.util.ArrayList;
+import java.util.Date;
+import java.util.List;
+import java.util.Map;
+
+import javax.naming.ConfigurationException;
+
+import com.cloud.event.UsageEventVO;
+import com.cloud.event.dao.UsageEventDao;
+import com.cloud.utils.Pair;
+import com.cloud.utils.db.Attribute;
+import com.cloud.utils.db.Filter;
+import com.cloud.utils.db.GenericSearchBuilder;
+import com.cloud.utils.db.SearchBuilder;
+import com.cloud.utils.db.SearchCriteria;
+
+public class MockUsageEventDao implements UsageEventDao{
+
+List persistedItems;
+
+public MockUsageEventDao() {
+persistedItems = new ArrayList();
+}
+
+@Override
+public UsageEventVO findById(Long id) {
+// TODO Auto-generated method stub
+return null;
+}
+
+@Override
+public UsageEventVO findByIdIncludingRemoved(Long id) {
+// TODO Auto-generated method stub
+return null;
+}
+
+@Override
+public UsageEventVO findById(Long id, boolean fresh) {
+// TODO Auto-generated method stub
+return null;
+}
+
+@Override
+public UsageEventVO findByUuid(String uuid) {
+// TODO Auto-generated method stub
+return null;
+}
+
+@Override
+public UsageEventVO findByUuidIncludingRemoved(String uuid) {
+// TODO Auto-generated method stub
+return null;
+}
+
+@Override
+public UsageEventVO createForUpdate() {
+// TODO Auto-generated method stub
+return null;
+}
+
+@Override
+public SearchBuilder createSearchBuilder() {
+// TODO Auto-generated method stub
+return null;
+}
+
+@Override
+public  GenericSearchBuilder createSearchBuilder(
+Class clazz) {
+// TODO Auto-generated method stub
+return null;
+}
+
+@Override
+public UsageEventVO createForUpdate(Long id) {
+// TODO Auto-generated method stub
+return null;
+}
+
+@Override
+public SearchCriteria createSearchCriteria() {
+// TODO Auto-generated method stub
+return null;
+}
+
+@Override
+public List lockRows(SearchCriteria sc,
+Filter filter, boolean exclusive) {
+// TODO Auto-generated method stub
+return null;
+}
+
+@Override
+public UsageEventVO lockOneRandomRow(SearchCriteria sc,
+boolean exclusive) {
+// TODO Auto-generated method stub
+return null;
+}
+
+@Override
+public UsageEventVO lockRow(Long id, Boolean exclusive) {
+// TODO Auto-generated method stub
+return null;
+}
+
+@Override
+public UsageEventVO acquireInLockTable(Long id) {
+// TODO Auto-generated method stub
--- End diff --

Is there a TODO to be resolved?


---
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 #1624: Fixes regarding VOLUME_DELETE events resultin...

2016-08-10 Thread jburwell
Github user jburwell commented on a diff in the pull request:

https://github.com/apache/cloudstack/pull/1624#discussion_r74314244
  
--- Diff: server/test/com/cloud/user/MockUsageEventDao.java ---
@@ -0,0 +1,356 @@
+// 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.user;
+
+import java.util.ArrayList;
+import java.util.Date;
+import java.util.List;
+import java.util.Map;
+
+import javax.naming.ConfigurationException;
+
+import com.cloud.event.UsageEventVO;
+import com.cloud.event.dao.UsageEventDao;
+import com.cloud.utils.Pair;
+import com.cloud.utils.db.Attribute;
+import com.cloud.utils.db.Filter;
+import com.cloud.utils.db.GenericSearchBuilder;
+import com.cloud.utils.db.SearchBuilder;
+import com.cloud.utils.db.SearchCriteria;
+
+public class MockUsageEventDao implements UsageEventDao{
+
+List persistedItems;
+
+public MockUsageEventDao() {
+persistedItems = new ArrayList();
+}
+
+@Override
+public UsageEventVO findById(Long id) {
+// TODO Auto-generated method stub
+return null;
+}
+
+@Override
+public UsageEventVO findByIdIncludingRemoved(Long id) {
+// TODO Auto-generated method stub
+return null;
+}
+
+@Override
+public UsageEventVO findById(Long id, boolean fresh) {
+// TODO Auto-generated method stub
+return null;
+}
+
+@Override
+public UsageEventVO findByUuid(String uuid) {
+// TODO Auto-generated method stub
+return null;
+}
+
+@Override
+public UsageEventVO findByUuidIncludingRemoved(String uuid) {
+// TODO Auto-generated method stub
+return null;
+}
+
+@Override
+public UsageEventVO createForUpdate() {
+// TODO Auto-generated method stub
+return null;
+}
+
+@Override
+public SearchBuilder createSearchBuilder() {
+// TODO Auto-generated method stub
+return null;
+}
+
+@Override
+public  GenericSearchBuilder createSearchBuilder(
+Class clazz) {
+// TODO Auto-generated method stub
+return null;
+}
+
+@Override
+public UsageEventVO createForUpdate(Long id) {
+// TODO Auto-generated method stub
+return null;
+}
+
+@Override
+public SearchCriteria createSearchCriteria() {
+// TODO Auto-generated method stub
+return null;
+}
+
+@Override
+public List lockRows(SearchCriteria sc,
+Filter filter, boolean exclusive) {
+// TODO Auto-generated method stub
+return null;
+}
+
+@Override
+public UsageEventVO lockOneRandomRow(SearchCriteria sc,
+boolean exclusive) {
+// TODO Auto-generated method stub
+return null;
+}
+
+@Override
+public UsageEventVO lockRow(Long id, Boolean exclusive) {
+// TODO Auto-generated method stub
+return null;
+}
+
+@Override
+public UsageEventVO acquireInLockTable(Long id) {
+// TODO Auto-generated method stub
+return null;
+}
+
+@Override
+public UsageEventVO acquireInLockTable(Long id, int seconds) {
+// TODO Auto-generated method stub
--- End diff --

Is there a TODO to be resolved?


---
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 #1624: Fixes regarding VOLUME_DELETE events resultin...

2016-08-10 Thread jburwell
Github user jburwell commented on a diff in the pull request:

https://github.com/apache/cloudstack/pull/1624#discussion_r74314175
  
--- Diff: server/test/com/cloud/user/MockUsageEventDao.java ---
@@ -0,0 +1,356 @@
+// 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.user;
+
+import java.util.ArrayList;
+import java.util.Date;
+import java.util.List;
+import java.util.Map;
+
+import javax.naming.ConfigurationException;
+
+import com.cloud.event.UsageEventVO;
+import com.cloud.event.dao.UsageEventDao;
+import com.cloud.utils.Pair;
+import com.cloud.utils.db.Attribute;
+import com.cloud.utils.db.Filter;
+import com.cloud.utils.db.GenericSearchBuilder;
+import com.cloud.utils.db.SearchBuilder;
+import com.cloud.utils.db.SearchCriteria;
+
+public class MockUsageEventDao implements UsageEventDao{
+
+List persistedItems;
+
+public MockUsageEventDao() {
+persistedItems = new ArrayList();
+}
+
+@Override
+public UsageEventVO findById(Long id) {
+// TODO Auto-generated method stub
+return null;
+}
+
+@Override
+public UsageEventVO findByIdIncludingRemoved(Long id) {
+// TODO Auto-generated method stub
+return null;
+}
+
+@Override
+public UsageEventVO findById(Long id, boolean fresh) {
+// TODO Auto-generated method stub
+return null;
+}
+
+@Override
+public UsageEventVO findByUuid(String uuid) {
+// TODO Auto-generated method stub
+return null;
+}
+
+@Override
+public UsageEventVO findByUuidIncludingRemoved(String uuid) {
+// TODO Auto-generated method stub
+return null;
+}
+
+@Override
+public UsageEventVO createForUpdate() {
+// TODO Auto-generated method stub
+return null;
+}
+
+@Override
+public SearchBuilder createSearchBuilder() {
+// TODO Auto-generated method stub
+return null;
+}
+
+@Override
+public  GenericSearchBuilder createSearchBuilder(
+Class clazz) {
+// TODO Auto-generated method stub
+return null;
+}
+
+@Override
+public UsageEventVO createForUpdate(Long id) {
+// TODO Auto-generated method stub
+return null;
+}
+
+@Override
+public SearchCriteria createSearchCriteria() {
+// TODO Auto-generated method stub
--- End diff --

Is there a TODO to be resolved?


---
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 #1624: Fixes regarding VOLUME_DELETE events resultin...

2016-08-10 Thread jburwell
Github user jburwell commented on a diff in the pull request:

https://github.com/apache/cloudstack/pull/1624#discussion_r74314220
  
--- Diff: server/test/com/cloud/user/MockUsageEventDao.java ---
@@ -0,0 +1,356 @@
+// 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.user;
+
+import java.util.ArrayList;
+import java.util.Date;
+import java.util.List;
+import java.util.Map;
+
+import javax.naming.ConfigurationException;
+
+import com.cloud.event.UsageEventVO;
+import com.cloud.event.dao.UsageEventDao;
+import com.cloud.utils.Pair;
+import com.cloud.utils.db.Attribute;
+import com.cloud.utils.db.Filter;
+import com.cloud.utils.db.GenericSearchBuilder;
+import com.cloud.utils.db.SearchBuilder;
+import com.cloud.utils.db.SearchCriteria;
+
+public class MockUsageEventDao implements UsageEventDao{
+
+List persistedItems;
+
+public MockUsageEventDao() {
+persistedItems = new ArrayList();
+}
+
+@Override
+public UsageEventVO findById(Long id) {
+// TODO Auto-generated method stub
+return null;
+}
+
+@Override
+public UsageEventVO findByIdIncludingRemoved(Long id) {
+// TODO Auto-generated method stub
+return null;
+}
+
+@Override
+public UsageEventVO findById(Long id, boolean fresh) {
+// TODO Auto-generated method stub
+return null;
+}
+
+@Override
+public UsageEventVO findByUuid(String uuid) {
+// TODO Auto-generated method stub
+return null;
+}
+
+@Override
+public UsageEventVO findByUuidIncludingRemoved(String uuid) {
+// TODO Auto-generated method stub
+return null;
+}
+
+@Override
+public UsageEventVO createForUpdate() {
+// TODO Auto-generated method stub
+return null;
+}
+
+@Override
+public SearchBuilder createSearchBuilder() {
+// TODO Auto-generated method stub
+return null;
+}
+
+@Override
+public  GenericSearchBuilder createSearchBuilder(
+Class clazz) {
+// TODO Auto-generated method stub
+return null;
+}
+
+@Override
+public UsageEventVO createForUpdate(Long id) {
+// TODO Auto-generated method stub
+return null;
+}
+
+@Override
+public SearchCriteria createSearchCriteria() {
+// TODO Auto-generated method stub
+return null;
+}
+
+@Override
+public List lockRows(SearchCriteria sc,
+Filter filter, boolean exclusive) {
+// TODO Auto-generated method stub
+return null;
+}
+
+@Override
+public UsageEventVO lockOneRandomRow(SearchCriteria sc,
+boolean exclusive) {
+// TODO Auto-generated method stub
+return null;
+}
+
+@Override
+public UsageEventVO lockRow(Long id, Boolean exclusive) {
+// TODO Auto-generated method stub
--- End diff --

Is there a TODO to be resolved?


---
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 #1624: Fixes regarding VOLUME_DELETE events resultin...

2016-08-10 Thread jburwell
Github user jburwell commented on a diff in the pull request:

https://github.com/apache/cloudstack/pull/1624#discussion_r74314203
  
--- Diff: server/test/com/cloud/user/MockUsageEventDao.java ---
@@ -0,0 +1,356 @@
+// 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.user;
+
+import java.util.ArrayList;
+import java.util.Date;
+import java.util.List;
+import java.util.Map;
+
+import javax.naming.ConfigurationException;
+
+import com.cloud.event.UsageEventVO;
+import com.cloud.event.dao.UsageEventDao;
+import com.cloud.utils.Pair;
+import com.cloud.utils.db.Attribute;
+import com.cloud.utils.db.Filter;
+import com.cloud.utils.db.GenericSearchBuilder;
+import com.cloud.utils.db.SearchBuilder;
+import com.cloud.utils.db.SearchCriteria;
+
+public class MockUsageEventDao implements UsageEventDao{
+
+List persistedItems;
+
+public MockUsageEventDao() {
+persistedItems = new ArrayList();
+}
+
+@Override
+public UsageEventVO findById(Long id) {
+// TODO Auto-generated method stub
+return null;
+}
+
+@Override
+public UsageEventVO findByIdIncludingRemoved(Long id) {
+// TODO Auto-generated method stub
+return null;
+}
+
+@Override
+public UsageEventVO findById(Long id, boolean fresh) {
+// TODO Auto-generated method stub
+return null;
+}
+
+@Override
+public UsageEventVO findByUuid(String uuid) {
+// TODO Auto-generated method stub
+return null;
+}
+
+@Override
+public UsageEventVO findByUuidIncludingRemoved(String uuid) {
+// TODO Auto-generated method stub
+return null;
+}
+
+@Override
+public UsageEventVO createForUpdate() {
+// TODO Auto-generated method stub
+return null;
+}
+
+@Override
+public SearchBuilder createSearchBuilder() {
+// TODO Auto-generated method stub
+return null;
+}
+
+@Override
+public  GenericSearchBuilder createSearchBuilder(
+Class clazz) {
+// TODO Auto-generated method stub
+return null;
+}
+
+@Override
+public UsageEventVO createForUpdate(Long id) {
+// TODO Auto-generated method stub
+return null;
+}
+
+@Override
+public SearchCriteria createSearchCriteria() {
+// TODO Auto-generated method stub
+return null;
+}
+
+@Override
+public List lockRows(SearchCriteria sc,
+Filter filter, boolean exclusive) {
+// TODO Auto-generated method stub
+return null;
+}
+
+@Override
+public UsageEventVO lockOneRandomRow(SearchCriteria sc,
+boolean exclusive) {
+// TODO Auto-generated method stub
--- End diff --

Is there a TODO to be resolved?


---
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 #1624: Fixes regarding VOLUME_DELETE events resultin...

2016-08-10 Thread jburwell
Github user jburwell commented on a diff in the pull request:

https://github.com/apache/cloudstack/pull/1624#discussion_r74314166
  
--- Diff: server/test/com/cloud/user/MockUsageEventDao.java ---
@@ -0,0 +1,356 @@
+// 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.user;
+
+import java.util.ArrayList;
+import java.util.Date;
+import java.util.List;
+import java.util.Map;
+
+import javax.naming.ConfigurationException;
+
+import com.cloud.event.UsageEventVO;
+import com.cloud.event.dao.UsageEventDao;
+import com.cloud.utils.Pair;
+import com.cloud.utils.db.Attribute;
+import com.cloud.utils.db.Filter;
+import com.cloud.utils.db.GenericSearchBuilder;
+import com.cloud.utils.db.SearchBuilder;
+import com.cloud.utils.db.SearchCriteria;
+
+public class MockUsageEventDao implements UsageEventDao{
+
+List persistedItems;
+
+public MockUsageEventDao() {
+persistedItems = new ArrayList();
+}
+
+@Override
+public UsageEventVO findById(Long id) {
+// TODO Auto-generated method stub
+return null;
+}
+
+@Override
+public UsageEventVO findByIdIncludingRemoved(Long id) {
+// TODO Auto-generated method stub
+return null;
+}
+
+@Override
+public UsageEventVO findById(Long id, boolean fresh) {
+// TODO Auto-generated method stub
+return null;
+}
+
+@Override
+public UsageEventVO findByUuid(String uuid) {
+// TODO Auto-generated method stub
+return null;
+}
+
+@Override
+public UsageEventVO findByUuidIncludingRemoved(String uuid) {
+// TODO Auto-generated method stub
+return null;
+}
+
+@Override
+public UsageEventVO createForUpdate() {
+// TODO Auto-generated method stub
+return null;
+}
+
+@Override
+public SearchBuilder createSearchBuilder() {
+// TODO Auto-generated method stub
+return null;
+}
+
+@Override
+public  GenericSearchBuilder createSearchBuilder(
+Class clazz) {
+// TODO Auto-generated method stub
+return null;
+}
+
+@Override
+public UsageEventVO createForUpdate(Long id) {
+// TODO Auto-generated method stub
--- End diff --

Is there a TODO to be resolved?


---
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 #1624: Fixes regarding VOLUME_DELETE events resultin...

2016-08-10 Thread jburwell
Github user jburwell commented on a diff in the pull request:

https://github.com/apache/cloudstack/pull/1624#discussion_r74314190
  
--- Diff: server/test/com/cloud/user/MockUsageEventDao.java ---
@@ -0,0 +1,356 @@
+// 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.user;
+
+import java.util.ArrayList;
+import java.util.Date;
+import java.util.List;
+import java.util.Map;
+
+import javax.naming.ConfigurationException;
+
+import com.cloud.event.UsageEventVO;
+import com.cloud.event.dao.UsageEventDao;
+import com.cloud.utils.Pair;
+import com.cloud.utils.db.Attribute;
+import com.cloud.utils.db.Filter;
+import com.cloud.utils.db.GenericSearchBuilder;
+import com.cloud.utils.db.SearchBuilder;
+import com.cloud.utils.db.SearchCriteria;
+
+public class MockUsageEventDao implements UsageEventDao{
+
+List persistedItems;
+
+public MockUsageEventDao() {
+persistedItems = new ArrayList();
+}
+
+@Override
+public UsageEventVO findById(Long id) {
+// TODO Auto-generated method stub
+return null;
+}
+
+@Override
+public UsageEventVO findByIdIncludingRemoved(Long id) {
+// TODO Auto-generated method stub
+return null;
+}
+
+@Override
+public UsageEventVO findById(Long id, boolean fresh) {
+// TODO Auto-generated method stub
+return null;
+}
+
+@Override
+public UsageEventVO findByUuid(String uuid) {
+// TODO Auto-generated method stub
+return null;
+}
+
+@Override
+public UsageEventVO findByUuidIncludingRemoved(String uuid) {
+// TODO Auto-generated method stub
+return null;
+}
+
+@Override
+public UsageEventVO createForUpdate() {
+// TODO Auto-generated method stub
+return null;
+}
+
+@Override
+public SearchBuilder createSearchBuilder() {
+// TODO Auto-generated method stub
+return null;
+}
+
+@Override
+public  GenericSearchBuilder createSearchBuilder(
+Class clazz) {
+// TODO Auto-generated method stub
+return null;
+}
+
+@Override
+public UsageEventVO createForUpdate(Long id) {
+// TODO Auto-generated method stub
+return null;
+}
+
+@Override
+public SearchCriteria createSearchCriteria() {
+// TODO Auto-generated method stub
+return null;
+}
+
+@Override
+public List lockRows(SearchCriteria sc,
+Filter filter, boolean exclusive) {
+// TODO Auto-generated method stub
--- End diff --

Is there a TODO to be resolved?


---
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 #1624: Fixes regarding VOLUME_DELETE events resultin...

2016-08-10 Thread jburwell
Github user jburwell commented on a diff in the pull request:

https://github.com/apache/cloudstack/pull/1624#discussion_r74314149
  
--- Diff: server/test/com/cloud/user/MockUsageEventDao.java ---
@@ -0,0 +1,356 @@
+// 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.user;
+
+import java.util.ArrayList;
+import java.util.Date;
+import java.util.List;
+import java.util.Map;
+
+import javax.naming.ConfigurationException;
+
+import com.cloud.event.UsageEventVO;
+import com.cloud.event.dao.UsageEventDao;
+import com.cloud.utils.Pair;
+import com.cloud.utils.db.Attribute;
+import com.cloud.utils.db.Filter;
+import com.cloud.utils.db.GenericSearchBuilder;
+import com.cloud.utils.db.SearchBuilder;
+import com.cloud.utils.db.SearchCriteria;
+
+public class MockUsageEventDao implements UsageEventDao{
+
+List persistedItems;
+
+public MockUsageEventDao() {
+persistedItems = new ArrayList();
+}
+
+@Override
+public UsageEventVO findById(Long id) {
+// TODO Auto-generated method stub
+return null;
+}
+
+@Override
+public UsageEventVO findByIdIncludingRemoved(Long id) {
+// TODO Auto-generated method stub
+return null;
+}
+
+@Override
+public UsageEventVO findById(Long id, boolean fresh) {
+// TODO Auto-generated method stub
+return null;
+}
+
+@Override
+public UsageEventVO findByUuid(String uuid) {
+// TODO Auto-generated method stub
+return null;
+}
+
+@Override
+public UsageEventVO findByUuidIncludingRemoved(String uuid) {
+// TODO Auto-generated method stub
+return null;
+}
+
+@Override
+public UsageEventVO createForUpdate() {
+// TODO Auto-generated method stub
+return null;
+}
+
+@Override
+public SearchBuilder createSearchBuilder() {
+// TODO Auto-generated method stub
+return null;
+}
+
+@Override
+public  GenericSearchBuilder createSearchBuilder(
+Class clazz) {
+// TODO Auto-generated method stub
--- End diff --

Is there a TODO to be resolved?


---
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 #1624: Fixes regarding VOLUME_DELETE events resultin...

2016-08-10 Thread jburwell
Github user jburwell commented on a diff in the pull request:

https://github.com/apache/cloudstack/pull/1624#discussion_r74314127
  
--- Diff: server/test/com/cloud/user/MockUsageEventDao.java ---
@@ -0,0 +1,356 @@
+// 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.user;
+
+import java.util.ArrayList;
+import java.util.Date;
+import java.util.List;
+import java.util.Map;
+
+import javax.naming.ConfigurationException;
+
+import com.cloud.event.UsageEventVO;
+import com.cloud.event.dao.UsageEventDao;
+import com.cloud.utils.Pair;
+import com.cloud.utils.db.Attribute;
+import com.cloud.utils.db.Filter;
+import com.cloud.utils.db.GenericSearchBuilder;
+import com.cloud.utils.db.SearchBuilder;
+import com.cloud.utils.db.SearchCriteria;
+
+public class MockUsageEventDao implements UsageEventDao{
+
+List persistedItems;
+
+public MockUsageEventDao() {
+persistedItems = new ArrayList();
+}
+
+@Override
+public UsageEventVO findById(Long id) {
+// TODO Auto-generated method stub
+return null;
+}
+
+@Override
+public UsageEventVO findByIdIncludingRemoved(Long id) {
+// TODO Auto-generated method stub
+return null;
+}
+
+@Override
+public UsageEventVO findById(Long id, boolean fresh) {
+// TODO Auto-generated method stub
+return null;
+}
+
+@Override
+public UsageEventVO findByUuid(String uuid) {
+// TODO Auto-generated method stub
+return null;
+}
+
+@Override
+public UsageEventVO findByUuidIncludingRemoved(String uuid) {
+// TODO Auto-generated method stub
+return null;
+}
+
+@Override
+public UsageEventVO createForUpdate() {
+// TODO Auto-generated method stub
+return null;
+}
+
+@Override
+public SearchBuilder createSearchBuilder() {
+// TODO Auto-generated method stub
--- End diff --

Is there a TODO to be resolved?


---
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 #1624: Fixes regarding VOLUME_DELETE events resultin...

2016-08-10 Thread jburwell
Github user jburwell commented on a diff in the pull request:

https://github.com/apache/cloudstack/pull/1624#discussion_r74314104
  
--- Diff: server/test/com/cloud/user/MockUsageEventDao.java ---
@@ -0,0 +1,356 @@
+// 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.user;
+
+import java.util.ArrayList;
+import java.util.Date;
+import java.util.List;
+import java.util.Map;
+
+import javax.naming.ConfigurationException;
+
+import com.cloud.event.UsageEventVO;
+import com.cloud.event.dao.UsageEventDao;
+import com.cloud.utils.Pair;
+import com.cloud.utils.db.Attribute;
+import com.cloud.utils.db.Filter;
+import com.cloud.utils.db.GenericSearchBuilder;
+import com.cloud.utils.db.SearchBuilder;
+import com.cloud.utils.db.SearchCriteria;
+
+public class MockUsageEventDao implements UsageEventDao{
+
+List persistedItems;
+
+public MockUsageEventDao() {
+persistedItems = new ArrayList();
+}
+
+@Override
+public UsageEventVO findById(Long id) {
+// TODO Auto-generated method stub
+return null;
+}
+
+@Override
+public UsageEventVO findByIdIncludingRemoved(Long id) {
+// TODO Auto-generated method stub
+return null;
+}
+
+@Override
+public UsageEventVO findById(Long id, boolean fresh) {
+// TODO Auto-generated method stub
+return null;
+}
+
+@Override
+public UsageEventVO findByUuid(String uuid) {
+// TODO Auto-generated method stub
+return null;
+}
+
+@Override
+public UsageEventVO findByUuidIncludingRemoved(String uuid) {
+// TODO Auto-generated method stub
--- End diff --

Is there a TODO to be resolved?


---
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 #1624: Fixes regarding VOLUME_DELETE events resultin...

2016-08-10 Thread jburwell
Github user jburwell commented on a diff in the pull request:

https://github.com/apache/cloudstack/pull/1624#discussion_r74314114
  
--- Diff: server/test/com/cloud/user/MockUsageEventDao.java ---
@@ -0,0 +1,356 @@
+// 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.user;
+
+import java.util.ArrayList;
+import java.util.Date;
+import java.util.List;
+import java.util.Map;
+
+import javax.naming.ConfigurationException;
+
+import com.cloud.event.UsageEventVO;
+import com.cloud.event.dao.UsageEventDao;
+import com.cloud.utils.Pair;
+import com.cloud.utils.db.Attribute;
+import com.cloud.utils.db.Filter;
+import com.cloud.utils.db.GenericSearchBuilder;
+import com.cloud.utils.db.SearchBuilder;
+import com.cloud.utils.db.SearchCriteria;
+
+public class MockUsageEventDao implements UsageEventDao{
+
+List persistedItems;
+
+public MockUsageEventDao() {
+persistedItems = new ArrayList();
+}
+
+@Override
+public UsageEventVO findById(Long id) {
+// TODO Auto-generated method stub
+return null;
+}
+
+@Override
+public UsageEventVO findByIdIncludingRemoved(Long id) {
+// TODO Auto-generated method stub
+return null;
+}
+
+@Override
+public UsageEventVO findById(Long id, boolean fresh) {
+// TODO Auto-generated method stub
+return null;
+}
+
+@Override
+public UsageEventVO findByUuid(String uuid) {
+// TODO Auto-generated method stub
+return null;
+}
+
+@Override
+public UsageEventVO findByUuidIncludingRemoved(String uuid) {
+// TODO Auto-generated method stub
+return null;
+}
+
+@Override
+public UsageEventVO createForUpdate() {
+// TODO Auto-generated method stub
--- End diff --

Is there a TODO to be resolved?


---
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 #1624: Fixes regarding VOLUME_DELETE events resultin...

2016-08-10 Thread jburwell
Github user jburwell commented on a diff in the pull request:

https://github.com/apache/cloudstack/pull/1624#discussion_r74314074
  
--- Diff: server/test/com/cloud/user/MockUsageEventDao.java ---
@@ -0,0 +1,356 @@
+// 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.user;
+
+import java.util.ArrayList;
+import java.util.Date;
+import java.util.List;
+import java.util.Map;
+
+import javax.naming.ConfigurationException;
+
+import com.cloud.event.UsageEventVO;
+import com.cloud.event.dao.UsageEventDao;
+import com.cloud.utils.Pair;
+import com.cloud.utils.db.Attribute;
+import com.cloud.utils.db.Filter;
+import com.cloud.utils.db.GenericSearchBuilder;
+import com.cloud.utils.db.SearchBuilder;
+import com.cloud.utils.db.SearchCriteria;
+
+public class MockUsageEventDao implements UsageEventDao{
+
+List persistedItems;
+
+public MockUsageEventDao() {
+persistedItems = new ArrayList();
+}
+
+@Override
+public UsageEventVO findById(Long id) {
+// TODO Auto-generated method stub
+return null;
+}
+
+@Override
+public UsageEventVO findByIdIncludingRemoved(Long id) {
+// TODO Auto-generated method stub
+return null;
+}
+
+@Override
+public UsageEventVO findById(Long id, boolean fresh) {
+// TODO Auto-generated method stub
--- End diff --

Is there a TODO to be resolved?


---
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 #1624: Fixes regarding VOLUME_DELETE events resultin...

2016-08-10 Thread jburwell
Github user jburwell commented on a diff in the pull request:

https://github.com/apache/cloudstack/pull/1624#discussion_r74314037
  
--- Diff: server/test/com/cloud/user/MockUsageEventDao.java ---
@@ -0,0 +1,356 @@
+// 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.user;
+
+import java.util.ArrayList;
+import java.util.Date;
+import java.util.List;
+import java.util.Map;
+
+import javax.naming.ConfigurationException;
+
+import com.cloud.event.UsageEventVO;
+import com.cloud.event.dao.UsageEventDao;
+import com.cloud.utils.Pair;
+import com.cloud.utils.db.Attribute;
+import com.cloud.utils.db.Filter;
+import com.cloud.utils.db.GenericSearchBuilder;
+import com.cloud.utils.db.SearchBuilder;
+import com.cloud.utils.db.SearchCriteria;
+
+public class MockUsageEventDao implements UsageEventDao{
+
+List persistedItems;
+
+public MockUsageEventDao() {
+persistedItems = new ArrayList();
+}
+
+@Override
+public UsageEventVO findById(Long id) {
+// TODO Auto-generated method stub
--- End diff --

Is there a TODO to be resolved?


---
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 #1624: Fixes regarding VOLUME_DELETE events resultin...

2016-08-10 Thread jburwell
Github user jburwell commented on a diff in the pull request:

https://github.com/apache/cloudstack/pull/1624#discussion_r74314062
  
--- Diff: server/test/com/cloud/user/MockUsageEventDao.java ---
@@ -0,0 +1,356 @@
+// 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.user;
+
+import java.util.ArrayList;
+import java.util.Date;
+import java.util.List;
+import java.util.Map;
+
+import javax.naming.ConfigurationException;
+
+import com.cloud.event.UsageEventVO;
+import com.cloud.event.dao.UsageEventDao;
+import com.cloud.utils.Pair;
+import com.cloud.utils.db.Attribute;
+import com.cloud.utils.db.Filter;
+import com.cloud.utils.db.GenericSearchBuilder;
+import com.cloud.utils.db.SearchBuilder;
+import com.cloud.utils.db.SearchCriteria;
+
+public class MockUsageEventDao implements UsageEventDao{
+
+List persistedItems;
+
+public MockUsageEventDao() {
+persistedItems = new ArrayList();
+}
+
+@Override
+public UsageEventVO findById(Long id) {
+// TODO Auto-generated method stub
+return null;
+}
+
+@Override
+public UsageEventVO findByIdIncludingRemoved(Long id) {
+// TODO Auto-generated method stub
--- End diff --

Is there a TODO to be resolved?


---
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 #1624: Fixes regarding VOLUME_DELETE events resultin...

2016-08-10 Thread jburwell
Github user jburwell commented on a diff in the pull request:

https://github.com/apache/cloudstack/pull/1624#discussion_r74313918
  
--- Diff: server/test/com/cloud/user/AccountManagerImplTest.java ---
@@ -231,6 +253,73 @@ public void cleanup() {
 CallContext.unregister();
 }
 
+public UsageEventUtils setupUsageUtils() {
+_usageEventDao = new MockUsageEventDao();
+UsageEventUtils utils = new UsageEventUtils();
+
+Map usageUtilsFields = new HashMap();
+usageUtilsFields.put("usageEventDao", "_usageEventDao");
+usageUtilsFields.put("accountDao", "_accountDao");
+usageUtilsFields.put("dcDao", "_dcDao");
+usageUtilsFields.put("configDao", "_configDao");
+
+for (String fieldName : usageUtilsFields.keySet()) {
+try {
+Field f = 
UsageEventUtils.class.getDeclaredField(fieldName);
+f.setAccessible(true);
+//Remember the old fields for cleanup later (see 
cleanupUsageUtils)
+Field staticField = 
UsageEventUtils.class.getDeclaredField("s_" + fieldName);
+staticField.setAccessible(true);
+oldFields.put(f.getName(), staticField.get(null));
+f.set(utils, 
this.getClass().getDeclaredField(usageUtilsFields.get(fieldName)).get(this));
+} catch (IllegalArgumentException | IllegalAccessException
+| NoSuchFieldException | SecurityException e) {
+// TODO Auto-generated catch block
+e.printStackTrace();
+}
+}
+
+Method method;
+try {
+method = UsageEventUtils.class.getDeclaredMethod("init");
+method.setAccessible(true);
+method.invoke(utils);
+} catch (NoSuchMethodException | SecurityException | 
IllegalAccessException |
+IllegalArgumentException | InvocationTargetException 
e) {
+// TODO Auto-generated catch block
+e.printStackTrace();
+}
+
+return utils;
+}
+
+public void cleanupUsageUtils() {
+UsageEventUtils utils = new UsageEventUtils();
+
+for (String fieldName : oldFields.keySet()) {
+try {
+Field f = 
UsageEventUtils.class.getDeclaredField(fieldName);
+f.setAccessible(true);
+f.set(utils, oldFields.get(fieldName));
+} catch (IllegalArgumentException | IllegalAccessException
+| NoSuchFieldException | SecurityException e) {
+// TODO Auto-generated catch block
+e.printStackTrace();
+}
+
+}
+try {
+Method method = 
UsageEventUtils.class.getDeclaredMethod("init");
+method.setAccessible(true);
+method.invoke(utils);
+} catch (SecurityException | NoSuchMethodException
+| IllegalAccessException | IllegalArgumentException
+| InvocationTargetException e) {
+// TODO Auto-generated catch block
--- End diff --

Is there a TODO to be resolved?


---
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 #1624: Fixes regarding VOLUME_DELETE events resultin...

2016-08-10 Thread jburwell
Github user jburwell commented on a diff in the pull request:

https://github.com/apache/cloudstack/pull/1624#discussion_r74313796
  
--- Diff: server/test/com/cloud/user/AccountManagerImplTest.java ---
@@ -231,6 +253,73 @@ public void cleanup() {
 CallContext.unregister();
 }
 
+public UsageEventUtils setupUsageUtils() {
+_usageEventDao = new MockUsageEventDao();
+UsageEventUtils utils = new UsageEventUtils();
+
+Map usageUtilsFields = new HashMap();
+usageUtilsFields.put("usageEventDao", "_usageEventDao");
+usageUtilsFields.put("accountDao", "_accountDao");
+usageUtilsFields.put("dcDao", "_dcDao");
+usageUtilsFields.put("configDao", "_configDao");
--- End diff --

Why not declare this map as a static constant?  It would shorten this 
method and make it easier to understand.   Also, consider using the 
``ImmutableMap`` type for the type of the constant.


---
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 #1624: Fixes regarding VOLUME_DELETE events resultin...

2016-08-10 Thread jburwell
Github user jburwell commented on a diff in the pull request:

https://github.com/apache/cloudstack/pull/1624#discussion_r74313885
  
--- Diff: server/test/com/cloud/user/AccountManagerImplTest.java ---
@@ -231,6 +253,73 @@ public void cleanup() {
 CallContext.unregister();
 }
 
+public UsageEventUtils setupUsageUtils() {
+_usageEventDao = new MockUsageEventDao();
+UsageEventUtils utils = new UsageEventUtils();
+
+Map usageUtilsFields = new HashMap();
+usageUtilsFields.put("usageEventDao", "_usageEventDao");
+usageUtilsFields.put("accountDao", "_accountDao");
+usageUtilsFields.put("dcDao", "_dcDao");
+usageUtilsFields.put("configDao", "_configDao");
+
+for (String fieldName : usageUtilsFields.keySet()) {
+try {
+Field f = 
UsageEventUtils.class.getDeclaredField(fieldName);
+f.setAccessible(true);
+//Remember the old fields for cleanup later (see 
cleanupUsageUtils)
+Field staticField = 
UsageEventUtils.class.getDeclaredField("s_" + fieldName);
+staticField.setAccessible(true);
+oldFields.put(f.getName(), staticField.get(null));
+f.set(utils, 
this.getClass().getDeclaredField(usageUtilsFields.get(fieldName)).get(this));
+} catch (IllegalArgumentException | IllegalAccessException
+| NoSuchFieldException | SecurityException e) {
+// TODO Auto-generated catch block
+e.printStackTrace();
+}
+}
+
+Method method;
+try {
+method = UsageEventUtils.class.getDeclaredMethod("init");
+method.setAccessible(true);
+method.invoke(utils);
+} catch (NoSuchMethodException | SecurityException | 
IllegalAccessException |
+IllegalArgumentException | InvocationTargetException 
e) {
+// TODO Auto-generated catch block
+e.printStackTrace();
+}
+
+return utils;
+}
+
+public void cleanupUsageUtils() {
+UsageEventUtils utils = new UsageEventUtils();
+
+for (String fieldName : oldFields.keySet()) {
+try {
+Field f = 
UsageEventUtils.class.getDeclaredField(fieldName);
+f.setAccessible(true);
+f.set(utils, oldFields.get(fieldName));
+} catch (IllegalArgumentException | IllegalAccessException
+| NoSuchFieldException | SecurityException e) {
+// TODO Auto-generated catch block
--- End diff --

Is there a TODO to be resolved? 


---
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 #1624: Fixes regarding VOLUME_DELETE events resultin...

2016-08-10 Thread jburwell
Github user jburwell commented on a diff in the pull request:

https://github.com/apache/cloudstack/pull/1624#discussion_r74313401
  
--- Diff: server/test/com/cloud/user/AccountManagerImplTest.java ---
@@ -231,6 +253,73 @@ public void cleanup() {
 CallContext.unregister();
 }
 
+public UsageEventUtils setupUsageUtils() {
+_usageEventDao = new MockUsageEventDao();
+UsageEventUtils utils = new UsageEventUtils();
+
+Map usageUtilsFields = new HashMap();
+usageUtilsFields.put("usageEventDao", "_usageEventDao");
+usageUtilsFields.put("accountDao", "_accountDao");
+usageUtilsFields.put("dcDao", "_dcDao");
+usageUtilsFields.put("configDao", "_configDao");
+
+for (String fieldName : usageUtilsFields.keySet()) {
+try {
+Field f = 
UsageEventUtils.class.getDeclaredField(fieldName);
+f.setAccessible(true);
+//Remember the old fields for cleanup later (see 
cleanupUsageUtils)
+Field staticField = 
UsageEventUtils.class.getDeclaredField("s_" + fieldName);
+staticField.setAccessible(true);
+oldFields.put(f.getName(), staticField.get(null));
+f.set(utils, 
this.getClass().getDeclaredField(usageUtilsFields.get(fieldName)).get(this));
+} catch (IllegalArgumentException | IllegalAccessException
+| NoSuchFieldException | SecurityException e) {
+// TODO Auto-generated catch block
--- End diff --

Is there a TODO to be resolved?


---
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 #1624: Fixes regarding VOLUME_DELETE events resultin...

2016-08-10 Thread jburwell
Github user jburwell commented on a diff in the pull request:

https://github.com/apache/cloudstack/pull/1624#discussion_r74313420
  
--- Diff: server/test/com/cloud/user/AccountManagerImplTest.java ---
@@ -231,6 +253,73 @@ public void cleanup() {
 CallContext.unregister();
 }
 
+public UsageEventUtils setupUsageUtils() {
+_usageEventDao = new MockUsageEventDao();
+UsageEventUtils utils = new UsageEventUtils();
+
+Map usageUtilsFields = new HashMap();
+usageUtilsFields.put("usageEventDao", "_usageEventDao");
+usageUtilsFields.put("accountDao", "_accountDao");
+usageUtilsFields.put("dcDao", "_dcDao");
+usageUtilsFields.put("configDao", "_configDao");
+
+for (String fieldName : usageUtilsFields.keySet()) {
+try {
+Field f = 
UsageEventUtils.class.getDeclaredField(fieldName);
+f.setAccessible(true);
+//Remember the old fields for cleanup later (see 
cleanupUsageUtils)
+Field staticField = 
UsageEventUtils.class.getDeclaredField("s_" + fieldName);
+staticField.setAccessible(true);
+oldFields.put(f.getName(), staticField.get(null));
+f.set(utils, 
this.getClass().getDeclaredField(usageUtilsFields.get(fieldName)).get(this));
+} catch (IllegalArgumentException | IllegalAccessException
+| NoSuchFieldException | SecurityException e) {
+// TODO Auto-generated catch block
+e.printStackTrace();
+}
+}
+
+Method method;
+try {
+method = UsageEventUtils.class.getDeclaredMethod("init");
+method.setAccessible(true);
+method.invoke(utils);
+} catch (NoSuchMethodException | SecurityException | 
IllegalAccessException |
+IllegalArgumentException | InvocationTargetException 
e) {
+// TODO Auto-generated catch block
--- End diff --

Is there a TODO to be resolved?


---
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 #1624: Fixes regarding VOLUME_DELETE events resultin...

2016-08-02 Thread ProjectMoon
GitHub user ProjectMoon opened a pull request:

https://github.com/apache/cloudstack/pull/1624

Fixes regarding VOLUME_DELETE events resulting from account deletion

New version of #1491.

**Original Description**
New version of #1373, but updated for the 4.7 branch with another fix that 
allows it to properly find expunged root volumes. This is a bug fix, which is 
why we target the 4.7 branch.

Original pull request:
Fixes regarding usage event emission.

UsageEventUtils was previously not checking deleted accounts, which meant 
that if an account was deleted that had some resources running on it, those 
resources would get destroyed without emitting any events.

Furthermore, the VOLUME_DELETE event of ROOT volumes is the responsibility 
of the UserVmManager, which gets circumvented when expunging resources 
following the account deletion. Added a check to the AccountManager which 
catches the ROOT volumes that need to be deleted and emits events for them.

To test this: Create a new user. As that user, create and destroy an 
instance. This should cause the VM_CREATE, VM_START, VM_STOP, VM_DESTROY, 
VOLUME_CREATE, and VOLUME_DELETE events to be emitted. 
Create a new instance as the same user. Log in as admin, and delete the 
user. The same set of events should be emitted, and there should be no 
duplicate DELETE events for the ROOT volume of the previous instance.

You can merge this pull request into a Git repository by running:

$ git pull https://github.com/greenqloud/cloudstack 
pr-volume-usage-events-fixes-4.8

Alternatively you can review and apply these changes as the patch at:

https://github.com/apache/cloudstack/pull/1624.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

This closes #1624


commit c861e1a4922ce9030d0a0d8542572d3a444c1509
Author: nnesic 
Date:   2015-10-12T13:15:30Z

Emit a VOLUME_DELETE usage event when account deletion destroys an instance.

Currently the logic about volume deletion seems to be that an event
should be emitted when the volume delete is requested, not when the
deletion completes.

The VolumeStateListener specifically ignores destroy events for ROOT
volumes, assuming that the ROOT volume only gets deleted when the
instance is destroyed and the UserVmManager should take care of it.

When deleting an account, all of its resources get destroyed, but the
instance expunging circumvents the UserVmManager, and thus we miss the
VOLUME_DESTROY usage event.  Added a check in the AccountManager to
emit the deletion event for ROOT volumes belonging to instances which
weren't destroyed prior to the account deletion.




---
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.
---