Updated Branches:
refs/heads/object_store 47f6d650f -> 342624e0e
Moved over the VLAN daos
Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/2639b9f9
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/2639b9f9
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/2639b9f9
Branch: refs/heads/object_store
Commit: 2639b9f91eaeefe46901598467fda34a520f52be
Parents: e5d331e
Author: Alex Huang <alex.huang@gmail.com>
Authored: Mon May 6 10:34:22 2013 -0700
Committer: Alex Huang <alex.huang@gmail.com>
Committed: Mon May 6 16:34:41 2013 -0700
----------------------------------------------------------------------
.../cloud/network/dao/AccountGuestVlanMapDao.java | 34 +++++
.../network/dao/AccountGuestVlanMapDaoImpl.java | 83 +++++++++++++
.../cloud/network/dao/AccountGuestVlanMapVO.java | 94 +++++++++++++++
.../cloud/network/dao/AccountGuestVlanMapDao.java | 34 -----
.../network/dao/AccountGuestVlanMapDaoImpl.java | 83 -------------
.../cloud/network/dao/AccountGuestVlanMapVO.java | 94 ---------------
6 files changed, 211 insertions(+), 211 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/2639b9f9/engine/schema/src/com/cloud/network/dao/AccountGuestVlanMapDao.java
----------------------------------------------------------------------
diff --git a/engine/schema/src/com/cloud/network/dao/AccountGuestVlanMapDao.java b/engine/schema/src/com/cloud/network/dao/AccountGuestVlanMapDao.java
new file mode 100644
index 0000000..dc1ec89
--- /dev/null
+++ b/engine/schema/src/com/cloud/network/dao/AccountGuestVlanMapDao.java
@@ -0,0 +1,34 @@
+// 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.network.dao;
+
+import com.cloud.network.dao.AccountGuestVlanMapVO;
+import com.cloud.utils.db.GenericDao;
+
+import java.util.List;
+
+public interface AccountGuestVlanMapDao extends GenericDao<AccountGuestVlanMapVO, Long>
{
+
+ public List<AccountGuestVlanMapVO> listAccountGuestVlanMapsByAccount(long accountId);
+
+ public List<AccountGuestVlanMapVO> listAccountGuestVlanMapsByVlan(long guestVlanId);
+
+ public List<AccountGuestVlanMapVO> listAccountGuestVlanMapsByPhysicalNetwork(long
physicalNetworkId);
+
+ public int removeByAccountId(long accountId);
+
+}
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/2639b9f9/engine/schema/src/com/cloud/network/dao/AccountGuestVlanMapDaoImpl.java
----------------------------------------------------------------------
diff --git a/engine/schema/src/com/cloud/network/dao/AccountGuestVlanMapDaoImpl.java b/engine/schema/src/com/cloud/network/dao/AccountGuestVlanMapDaoImpl.java
new file mode 100644
index 0000000..e7a7b34
--- /dev/null
+++ b/engine/schema/src/com/cloud/network/dao/AccountGuestVlanMapDaoImpl.java
@@ -0,0 +1,83 @@
+// 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.network.dao;
+
+import com.cloud.network.dao.AccountGuestVlanMapVO;
+import com.cloud.network.dao.AccountGuestVlanMapDao;
+
+import java.util.List;
+import javax.ejb.Local;
+import org.springframework.stereotype.Component;
+
+import com.cloud.utils.db.DB;
+import com.cloud.utils.db.GenericDaoBase;
+import com.cloud.utils.db.SearchBuilder;
+import com.cloud.utils.db.SearchCriteria;
+
+@Component
+@Local(value={AccountGuestVlanMapDao.class})
+@DB(txn=false)
+public class AccountGuestVlanMapDaoImpl extends GenericDaoBase<AccountGuestVlanMapVO,
Long> implements AccountGuestVlanMapDao {
+
+ protected SearchBuilder<AccountGuestVlanMapVO> AccountSearch;
+ protected SearchBuilder<AccountGuestVlanMapVO> GuestVlanSearch;
+ protected SearchBuilder<AccountGuestVlanMapVO> PhysicalNetworkSearch;
+
+ @Override
+ public List<AccountGuestVlanMapVO> listAccountGuestVlanMapsByAccount(long accountId)
{
+ SearchCriteria<AccountGuestVlanMapVO> sc = AccountSearch.create();
+ sc.setParameters("accountId", accountId);
+ return listIncludingRemovedBy(sc);
+ }
+
+ @Override
+ public List<AccountGuestVlanMapVO> listAccountGuestVlanMapsByVlan(long guestVlanId)
{
+ SearchCriteria<AccountGuestVlanMapVO> sc = GuestVlanSearch.create();
+ sc.setParameters("guestVlanId", guestVlanId);
+ return listIncludingRemovedBy(sc);
+ }
+
+ @Override
+ public List<AccountGuestVlanMapVO> listAccountGuestVlanMapsByPhysicalNetwork(long
physicalNetworkId) {
+ SearchCriteria<AccountGuestVlanMapVO> sc = GuestVlanSearch.create();
+ sc.setParameters("physicalNetworkId", physicalNetworkId);
+ return listIncludingRemovedBy(sc);
+ }
+
+ @Override
+ public int removeByAccountId(long accountId) {
+ SearchCriteria<AccountGuestVlanMapVO> sc = AccountSearch.create();
+ sc.setParameters("accountId", accountId);
+ return expunge(sc);
+ }
+
+ public AccountGuestVlanMapDaoImpl() {
+ super();
+ AccountSearch = createSearchBuilder();
+ AccountSearch.and("accountId", AccountSearch.entity().getAccountId(), SearchCriteria.Op.EQ);
+ AccountSearch.done();
+
+ GuestVlanSearch = createSearchBuilder();
+ GuestVlanSearch.and("guestVlanId", GuestVlanSearch.entity().getId(), SearchCriteria.Op.EQ);
+ GuestVlanSearch.done();
+
+ PhysicalNetworkSearch = createSearchBuilder();
+ PhysicalNetworkSearch.and("physicalNetworkId", PhysicalNetworkSearch.entity().getId(),
SearchCriteria.Op.EQ);
+ PhysicalNetworkSearch.done();
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/2639b9f9/engine/schema/src/com/cloud/network/dao/AccountGuestVlanMapVO.java
----------------------------------------------------------------------
diff --git a/engine/schema/src/com/cloud/network/dao/AccountGuestVlanMapVO.java b/engine/schema/src/com/cloud/network/dao/AccountGuestVlanMapVO.java
new file mode 100644
index 0000000..17c941a
--- /dev/null
+++ b/engine/schema/src/com/cloud/network/dao/AccountGuestVlanMapVO.java
@@ -0,0 +1,94 @@
+// 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.network.dao;
+
+import com.cloud.network.GuestVlan;
+
+import javax.persistence.*;
+import java.util.UUID;
+
+@Entity
+@Table(name="account_vnet_map")
+public class AccountGuestVlanMapVO implements GuestVlan {
+
+ @Id
+ @GeneratedValue(strategy=GenerationType.IDENTITY)
+ @Column(name="id")
+ private long id;
+
+ @Column(name="account_id")
+ private long accountId;
+
+ @Column(name="uuid")
+ private String uuid;
+
+ @Column(name="vnet_range")
+ private String guestVlanRange;
+
+ @Column(name="physical_network_id")
+ private long physicalNetworkId;
+
+ public AccountGuestVlanMapVO(long accountId,long physicalNetworkId) {
+ this.accountId = accountId;
+ this.physicalNetworkId = physicalNetworkId;
+ this.guestVlanRange = null;
+ this.uuid = UUID.randomUUID().toString();
+ }
+
+ public AccountGuestVlanMapVO() {
+
+ }
+
+ @Override
+ public long getId() {
+ return id;
+ }
+
+ @Override
+ public long getAccountId() {
+ return accountId;
+ }
+
+ @Override
+ public String getGuestVlanRange() {
+ return guestVlanRange;
+ }
+
+
+ public void setGuestVlanRange(String guestVlanRange) {
+ this.guestVlanRange = guestVlanRange;
+ }
+
+ @Override
+ public String getUuid() {
+ return this.uuid;
+ }
+
+ public void setUuid(String uuid) {
+ this.uuid = uuid;
+ }
+
+ @Override
+ public long getPhysicalNetworkId() {
+ return this.physicalNetworkId;
+ }
+
+ public void setPhysicalNetworkId(long physicalNetworkId) {
+ this.physicalNetworkId = physicalNetworkId;
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/2639b9f9/server/src/com/cloud/network/dao/AccountGuestVlanMapDao.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/network/dao/AccountGuestVlanMapDao.java b/server/src/com/cloud/network/dao/AccountGuestVlanMapDao.java
deleted file mode 100644
index dc1ec89..0000000
--- a/server/src/com/cloud/network/dao/AccountGuestVlanMapDao.java
+++ /dev/null
@@ -1,34 +0,0 @@
-// 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.network.dao;
-
-import com.cloud.network.dao.AccountGuestVlanMapVO;
-import com.cloud.utils.db.GenericDao;
-
-import java.util.List;
-
-public interface AccountGuestVlanMapDao extends GenericDao<AccountGuestVlanMapVO, Long>
{
-
- public List<AccountGuestVlanMapVO> listAccountGuestVlanMapsByAccount(long accountId);
-
- public List<AccountGuestVlanMapVO> listAccountGuestVlanMapsByVlan(long guestVlanId);
-
- public List<AccountGuestVlanMapVO> listAccountGuestVlanMapsByPhysicalNetwork(long
physicalNetworkId);
-
- public int removeByAccountId(long accountId);
-
-}
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/2639b9f9/server/src/com/cloud/network/dao/AccountGuestVlanMapDaoImpl.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/network/dao/AccountGuestVlanMapDaoImpl.java b/server/src/com/cloud/network/dao/AccountGuestVlanMapDaoImpl.java
deleted file mode 100644
index e7a7b34..0000000
--- a/server/src/com/cloud/network/dao/AccountGuestVlanMapDaoImpl.java
+++ /dev/null
@@ -1,83 +0,0 @@
-// 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.network.dao;
-
-import com.cloud.network.dao.AccountGuestVlanMapVO;
-import com.cloud.network.dao.AccountGuestVlanMapDao;
-
-import java.util.List;
-import javax.ejb.Local;
-import org.springframework.stereotype.Component;
-
-import com.cloud.utils.db.DB;
-import com.cloud.utils.db.GenericDaoBase;
-import com.cloud.utils.db.SearchBuilder;
-import com.cloud.utils.db.SearchCriteria;
-
-@Component
-@Local(value={AccountGuestVlanMapDao.class})
-@DB(txn=false)
-public class AccountGuestVlanMapDaoImpl extends GenericDaoBase<AccountGuestVlanMapVO,
Long> implements AccountGuestVlanMapDao {
-
- protected SearchBuilder<AccountGuestVlanMapVO> AccountSearch;
- protected SearchBuilder<AccountGuestVlanMapVO> GuestVlanSearch;
- protected SearchBuilder<AccountGuestVlanMapVO> PhysicalNetworkSearch;
-
- @Override
- public List<AccountGuestVlanMapVO> listAccountGuestVlanMapsByAccount(long accountId)
{
- SearchCriteria<AccountGuestVlanMapVO> sc = AccountSearch.create();
- sc.setParameters("accountId", accountId);
- return listIncludingRemovedBy(sc);
- }
-
- @Override
- public List<AccountGuestVlanMapVO> listAccountGuestVlanMapsByVlan(long guestVlanId)
{
- SearchCriteria<AccountGuestVlanMapVO> sc = GuestVlanSearch.create();
- sc.setParameters("guestVlanId", guestVlanId);
- return listIncludingRemovedBy(sc);
- }
-
- @Override
- public List<AccountGuestVlanMapVO> listAccountGuestVlanMapsByPhysicalNetwork(long
physicalNetworkId) {
- SearchCriteria<AccountGuestVlanMapVO> sc = GuestVlanSearch.create();
- sc.setParameters("physicalNetworkId", physicalNetworkId);
- return listIncludingRemovedBy(sc);
- }
-
- @Override
- public int removeByAccountId(long accountId) {
- SearchCriteria<AccountGuestVlanMapVO> sc = AccountSearch.create();
- sc.setParameters("accountId", accountId);
- return expunge(sc);
- }
-
- public AccountGuestVlanMapDaoImpl() {
- super();
- AccountSearch = createSearchBuilder();
- AccountSearch.and("accountId", AccountSearch.entity().getAccountId(), SearchCriteria.Op.EQ);
- AccountSearch.done();
-
- GuestVlanSearch = createSearchBuilder();
- GuestVlanSearch.and("guestVlanId", GuestVlanSearch.entity().getId(), SearchCriteria.Op.EQ);
- GuestVlanSearch.done();
-
- PhysicalNetworkSearch = createSearchBuilder();
- PhysicalNetworkSearch.and("physicalNetworkId", PhysicalNetworkSearch.entity().getId(),
SearchCriteria.Op.EQ);
- PhysicalNetworkSearch.done();
- }
-
-}
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/2639b9f9/server/src/com/cloud/network/dao/AccountGuestVlanMapVO.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/network/dao/AccountGuestVlanMapVO.java b/server/src/com/cloud/network/dao/AccountGuestVlanMapVO.java
deleted file mode 100644
index 17c941a..0000000
--- a/server/src/com/cloud/network/dao/AccountGuestVlanMapVO.java
+++ /dev/null
@@ -1,94 +0,0 @@
-// 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.network.dao;
-
-import com.cloud.network.GuestVlan;
-
-import javax.persistence.*;
-import java.util.UUID;
-
-@Entity
-@Table(name="account_vnet_map")
-public class AccountGuestVlanMapVO implements GuestVlan {
-
- @Id
- @GeneratedValue(strategy=GenerationType.IDENTITY)
- @Column(name="id")
- private long id;
-
- @Column(name="account_id")
- private long accountId;
-
- @Column(name="uuid")
- private String uuid;
-
- @Column(name="vnet_range")
- private String guestVlanRange;
-
- @Column(name="physical_network_id")
- private long physicalNetworkId;
-
- public AccountGuestVlanMapVO(long accountId,long physicalNetworkId) {
- this.accountId = accountId;
- this.physicalNetworkId = physicalNetworkId;
- this.guestVlanRange = null;
- this.uuid = UUID.randomUUID().toString();
- }
-
- public AccountGuestVlanMapVO() {
-
- }
-
- @Override
- public long getId() {
- return id;
- }
-
- @Override
- public long getAccountId() {
- return accountId;
- }
-
- @Override
- public String getGuestVlanRange() {
- return guestVlanRange;
- }
-
-
- public void setGuestVlanRange(String guestVlanRange) {
- this.guestVlanRange = guestVlanRange;
- }
-
- @Override
- public String getUuid() {
- return this.uuid;
- }
-
- public void setUuid(String uuid) {
- this.uuid = uuid;
- }
-
- @Override
- public long getPhysicalNetworkId() {
- return this.physicalNetworkId;
- }
-
- public void setPhysicalNetworkId(long physicalNetworkId) {
- this.physicalNetworkId = physicalNetworkId;
- }
-
-}
|