cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kelv...@apache.org
Subject [23/43] git commit: refs/heads/javelin - IPv6: Rename public_ipv6_address to user_ipv6_address
Date Fri, 01 Feb 2013 01:29:17 GMT
IPv6: Rename public_ipv6_address to user_ipv6_address


Project: http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/commit/ed547d91
Tree: http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/tree/ed547d91
Diff: http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/diff/ed547d91

Branch: refs/heads/javelin
Commit: ed547d91f7882774794e4076a6073c902d67a3d9
Parents: c5b2a65
Author: Sheng Yang <sheng.yang@citrix.com>
Authored: Wed Jan 30 16:02:07 2013 -0800
Committer: Sheng Yang <sheng.yang@citrix.com>
Committed: Wed Jan 30 17:05:47 2013 -0800

----------------------------------------------------------------------
 client/tomcatconf/components.xml.in                |    2 +-
 .../configuration/DefaultComponentLibrary.java     |    4 +-
 .../src/com/cloud/network/Ipv6AddressManager.java  |    2 +-
 .../com/cloud/network/Ipv6AddressManagerImpl.java  |   12 +-
 .../src/com/cloud/network/NetworkManagerImpl.java  |    6 +-
 server/src/com/cloud/network/NetworkModelImpl.java |    4 +-
 .../src/com/cloud/network/PublicIpv6Address.java   |   52 ----
 .../src/com/cloud/network/PublicIpv6AddressVO.java |  188 ---------------
 server/src/com/cloud/network/UserIpv6Address.java  |   52 ++++
 .../src/com/cloud/network/UserIpv6AddressVO.java   |  188 +++++++++++++++
 .../cloud/network/dao/PublicIpv6AddressDao.java    |   23 --
 .../network/dao/PublicIpv6AddressDaoImpl.java      |   96 --------
 .../com/cloud/network/dao/UserIpv6AddressDao.java  |   23 ++
 .../cloud/network/dao/UserIpv6AddressDaoImpl.java  |   96 ++++++++
 .../com/cloud/network/guru/DirectNetworkGuru.java  |    6 +-
 .../test/com/cloud/vpc/MockNetworkManagerImpl.java |    2 +-
 setup/db/create-schema.sql                         |   16 +-
 17 files changed, 386 insertions(+), 386 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/ed547d91/client/tomcatconf/components.xml.in
----------------------------------------------------------------------
diff --git a/client/tomcatconf/components.xml.in b/client/tomcatconf/components.xml.in
index b274b86..e9bd56a 100755
--- a/client/tomcatconf/components.xml.in
+++ b/client/tomcatconf/components.xml.in
@@ -271,7 +271,7 @@ under the License.
         <dao name="Site2SiteCustomerGatewayDao" class="com.cloud.network.dao.Site2SiteCustomerGatewayDaoImpl"
singleton="false"/>
         <dao name="Site2SiteVpnGatewayDao" class="com.cloud.network.dao.Site2SiteVpnGatewayDaoImpl"
singleton="false"/>
         <dao name="Site2SiteVpnConnectionDao" class="com.cloud.network.dao.Site2SiteVpnConnectionDaoImpl"
singleton="false"/>
-        <dao name="PublicIpv6AddressDao" class="com.cloud.network.dao.PublicIpv6AddressDaoImpl"
singleton="false"/>
+        <dao name="UserIpv6AddressDao" class="com.cloud.network.dao.UserIpv6AddressDaoImpl"
singleton="false"/>
     </configuration-server>
     
     <awsapi-ec2server class="com.cloud.bridge.service.EC2MainServlet">

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/ed547d91/server/src/com/cloud/configuration/DefaultComponentLibrary.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/configuration/DefaultComponentLibrary.java b/server/src/com/cloud/configuration/DefaultComponentLibrary.java
index e8fcabe..8939439 100755
--- a/server/src/com/cloud/configuration/DefaultComponentLibrary.java
+++ b/server/src/com/cloud/configuration/DefaultComponentLibrary.java
@@ -123,7 +123,7 @@ import com.cloud.network.dao.PhysicalNetworkDaoImpl;
 import com.cloud.network.dao.PhysicalNetworkServiceProviderDaoImpl;
 import com.cloud.network.dao.PhysicalNetworkTrafficTypeDaoImpl;
 import com.cloud.network.dao.PortProfileDaoImpl;
-import com.cloud.network.dao.PublicIpv6AddressDaoImpl;
+import com.cloud.network.dao.UserIpv6AddressDaoImpl;
 import com.cloud.network.dao.RemoteAccessVpnDaoImpl;
 import com.cloud.network.dao.Site2SiteCustomerGatewayDaoImpl;
 import com.cloud.network.dao.Site2SiteVpnConnectionDaoImpl;
@@ -382,7 +382,7 @@ public class DefaultComponentLibrary extends ComponentLibraryBase implements
Com
         addDao("Site2SiteVpnGatewayDao", Site2SiteVpnGatewayDaoImpl.class);
         addDao("Site2SiteCustomerGatewayDao", Site2SiteCustomerGatewayDaoImpl.class);
         addDao("Site2SiteVpnConnnectionDao", Site2SiteVpnConnectionDaoImpl.class);
-        addDao("PublicIpv6AddressDao", PublicIpv6AddressDaoImpl.class);
+        addDao("UserIpv6AddressDao", UserIpv6AddressDaoImpl.class);
 
         addDao("UserVmJoinDao", UserVmJoinDaoImpl.class);
         addDao("DomainRouterJoinDao", DomainRouterJoinDaoImpl.class);

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/ed547d91/server/src/com/cloud/network/Ipv6AddressManager.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/network/Ipv6AddressManager.java b/server/src/com/cloud/network/Ipv6AddressManager.java
index 21c65a9..2ab7e5a 100644
--- a/server/src/com/cloud/network/Ipv6AddressManager.java
+++ b/server/src/com/cloud/network/Ipv6AddressManager.java
@@ -22,7 +22,7 @@ import com.cloud.user.Account;
 import com.cloud.utils.component.Manager;
 
 public interface Ipv6AddressManager extends Manager {
-    public PublicIpv6Address assignDirectIp6Address(long dcId, Account owner, Long networkId,
String requestedIp6) throws InsufficientAddressCapacityException;
+    public UserIpv6Address assignDirectIp6Address(long dcId, Account owner, Long networkId,
String requestedIp6) throws InsufficientAddressCapacityException;
 
 	public void revokeDirectIpv6Address(long networkId, String ip6Address);
 }

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/ed547d91/server/src/com/cloud/network/Ipv6AddressManagerImpl.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/network/Ipv6AddressManagerImpl.java b/server/src/com/cloud/network/Ipv6AddressManagerImpl.java
index d794ff7..6666596 100644
--- a/server/src/com/cloud/network/Ipv6AddressManagerImpl.java
+++ b/server/src/com/cloud/network/Ipv6AddressManagerImpl.java
@@ -29,7 +29,7 @@ import com.cloud.dc.Vlan;
 import com.cloud.dc.dao.DataCenterDao;
 import com.cloud.dc.dao.VlanDao;
 import com.cloud.exception.InsufficientAddressCapacityException;
-import com.cloud.network.dao.PublicIpv6AddressDao;
+import com.cloud.network.dao.UserIpv6AddressDao;
 import com.cloud.user.Account;
 import com.cloud.utils.component.Inject;
 import com.cloud.utils.exception.CloudRuntimeException;
@@ -48,7 +48,7 @@ public class Ipv6AddressManagerImpl implements Ipv6AddressManager {
     @Inject
     NetworkModel _networkModel;
     @Inject
-    PublicIpv6AddressDao _ipv6Dao;
+    UserIpv6AddressDao _ipv6Dao;
     
 	@Override
 	public boolean configure(String name, Map<String, Object> params)
@@ -73,7 +73,7 @@ public class Ipv6AddressManagerImpl implements Ipv6AddressManager {
 	}
 
 	@Override
-	public PublicIpv6Address assignDirectIp6Address(long dcId, Account owner, Long networkId,
String requestedIp6)
+	public UserIpv6Address assignDirectIp6Address(long dcId, Account owner, Long networkId,
String requestedIp6)
 			throws InsufficientAddressCapacityException {
     	Vlan vlan = _networkModel.getVlanForNetwork(networkId);
     	if (vlan == null) {
@@ -112,10 +112,10 @@ public class Ipv6AddressManagerImpl implements Ipv6AddressManager {
         _dcDao.update(dc.getId(), dc);
         
     	String macAddress = NetUtils.long2Mac(NetUtils.createSequenceBasedMacAddress(mac));
-    	PublicIpv6AddressVO ipVO = new PublicIpv6AddressVO(ip, dcId, macAddress, vlan.getId());
+    	UserIpv6AddressVO ipVO = new UserIpv6AddressVO(ip, dcId, macAddress, vlan.getId());
     	ipVO.setPhysicalNetworkId(vlan.getPhysicalNetworkId());
     	ipVO.setSourceNetworkId(vlan.getNetworkId());
-    	ipVO.setState(PublicIpv6Address.State.Allocated);
+    	ipVO.setState(UserIpv6Address.State.Allocated);
     	ipVO.setDomainId(owner.getDomainId());
     	ipVO.setAccountId(owner.getAccountId());
     	_ipv6Dao.persist(ipVO);
@@ -124,7 +124,7 @@ public class Ipv6AddressManagerImpl implements Ipv6AddressManager {
 
 	@Override
 	public void revokeDirectIpv6Address(long networkId, String ip6Address) {
-		PublicIpv6AddressVO ip = _ipv6Dao.findByNetworkIdAndIp(networkId, ip6Address);
+		UserIpv6AddressVO ip = _ipv6Dao.findByNetworkIdAndIp(networkId, ip6Address);
 		if (ip != null) {
 			_ipv6Dao.remove(ip.getId());
 		}

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/ed547d91/server/src/com/cloud/network/NetworkManagerImpl.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/network/NetworkManagerImpl.java b/server/src/com/cloud/network/NetworkManagerImpl.java
index e06a59b..863b3c1 100755
--- a/server/src/com/cloud/network/NetworkManagerImpl.java
+++ b/server/src/com/cloud/network/NetworkManagerImpl.java
@@ -112,7 +112,7 @@ import com.cloud.network.dao.PhysicalNetworkDao;
 import com.cloud.network.dao.PhysicalNetworkServiceProviderDao;
 import com.cloud.network.dao.PhysicalNetworkTrafficTypeDao;
 import com.cloud.network.dao.PhysicalNetworkTrafficTypeVO;
-import com.cloud.network.dao.PublicIpv6AddressDao;
+import com.cloud.network.dao.UserIpv6AddressDao;
 import com.cloud.network.element.DhcpServiceProvider;
 import com.cloud.network.element.IpDeployer;
 import com.cloud.network.element.LoadBalancingServiceProvider;
@@ -275,7 +275,7 @@ public class NetworkManagerImpl implements NetworkManager, Manager, Listener
{
     @Inject
     NetworkModel _networkModel;
     @Inject
-    PublicIpv6AddressDao _ipv6Dao;
+    UserIpv6AddressDao _ipv6Dao;
     @Inject
     Ipv6AddressManager _ipv6Mgr;
 
@@ -3362,7 +3362,7 @@ public class NetworkManagerImpl implements NetworkManager, Manager,
Listener {
     	if (network.getIp6Gateway() != null) {
     		if (nic.getIp6Address() == null) {
     			ipv6 = true;
-    			PublicIpv6Address ip = _ipv6Mgr.assignDirectIp6Address(dc.getId(), vm.getOwner(),
network.getId(), requestedIpv6);
+    			UserIpv6Address ip = _ipv6Mgr.assignDirectIp6Address(dc.getId(), vm.getOwner(), network.getId(),
requestedIpv6);
     			Vlan vlan = _networkModel.getVlanForNetwork(network.getId());
     			if (vlan == null) {
     				s_logger.debug("Cannot find related vlan or too many vlan attached to network " +
network.getId());

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/ed547d91/server/src/com/cloud/network/NetworkModelImpl.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/network/NetworkModelImpl.java b/server/src/com/cloud/network/NetworkModelImpl.java
index cd0187a..a03acea 100644
--- a/server/src/com/cloud/network/NetworkModelImpl.java
+++ b/server/src/com/cloud/network/NetworkModelImpl.java
@@ -66,7 +66,7 @@ import com.cloud.network.dao.PhysicalNetworkServiceProviderDao;
 import com.cloud.network.dao.PhysicalNetworkServiceProviderVO;
 import com.cloud.network.dao.PhysicalNetworkTrafficTypeDao;
 import com.cloud.network.dao.PhysicalNetworkTrafficTypeVO;
-import com.cloud.network.dao.PublicIpv6AddressDao;
+import com.cloud.network.dao.UserIpv6AddressDao;
 import com.cloud.network.element.NetworkElement;
 import com.cloud.network.element.UserDataServiceProvider;
 import com.cloud.network.rules.FirewallRule.Purpose;
@@ -160,7 +160,7 @@ public class NetworkModelImpl  implements NetworkModel, Manager{
     @Inject
     PrivateIpDao _privateIpDao;
     @Inject
-    PublicIpv6AddressDao _ipv6Dao;
+    UserIpv6AddressDao _ipv6Dao;
 
 
     private final HashMap<String, NetworkOfferingVO> _systemNetworks = new HashMap<String,
NetworkOfferingVO>(5);

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/ed547d91/server/src/com/cloud/network/PublicIpv6Address.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/network/PublicIpv6Address.java b/server/src/com/cloud/network/PublicIpv6Address.java
deleted file mode 100644
index 5c51506..0000000
--- a/server/src/com/cloud/network/PublicIpv6Address.java
+++ /dev/null
@@ -1,52 +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;
-
-import org.apache.cloudstack.acl.ControlledEntity;
-import org.apache.cloudstack.api.Identity;
-import org.apache.cloudstack.api.InternalIdentity;
-
-/**
- * @author Sheng Yang
- *
- */
-public interface PublicIpv6Address extends ControlledEntity, Identity, InternalIdentity {
-    enum State {
-        Allocating, // The IP Address is being propagated to other network elements and is
not ready for use yet.
-        Allocated, // The IP address is in used.
-        Releasing, // The IP address is being released for other network elements and is
not ready for allocation.
-        Free // The IP address is ready to be allocated.
-    }
-
-    long getDataCenterId();
-
-    String getAddress();
-
-    long getVlanId();
-
-    State getState();
-
-    Long getNetworkId();
-    
-    Long getSourceNetworkId();
-
-    Long getPhysicalNetworkId();
-
-    void setState(PublicIpv6Address.State state);
-    
-    String getMacAddress();
-}

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/ed547d91/server/src/com/cloud/network/PublicIpv6AddressVO.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/network/PublicIpv6AddressVO.java b/server/src/com/cloud/network/PublicIpv6AddressVO.java
deleted file mode 100644
index e5d00a1..0000000
--- a/server/src/com/cloud/network/PublicIpv6AddressVO.java
+++ /dev/null
@@ -1,188 +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;
-
-import java.util.Date;
-import java.util.UUID;
-
-import javax.persistence.Column;
-import javax.persistence.Entity;
-import javax.persistence.EnumType;
-import javax.persistence.Enumerated;
-import javax.persistence.GeneratedValue;
-import javax.persistence.GenerationType;
-import javax.persistence.Id;
-import javax.persistence.Table;
-import javax.persistence.Transient;
-
-import com.cloud.utils.db.GenericDao;
-
-@Entity
-@Table(name=("public_ipv6_address"))
-public class PublicIpv6AddressVO implements PublicIpv6Address {
-    @Id
-    @GeneratedValue(strategy=GenerationType.IDENTITY)
-    @Column(name="id")
-    long id;
-
-	@Column(name="ip_address")
-	@Enumerated(value=EnumType.STRING)
-	private String address = null;
-
-	@Column(name="data_center_id", updatable=false)
-	private long dataCenterId;
-
-	@Column(name="vlan_id")
-	private long vlanId;
-
-	@Column(name="state")
-	private State state;
-
-	@Column(name="mac_address")
-	private String macAddress;
-
-	@Column(name="source_network_id")
-    private Long sourceNetworkId;
-
-	@Column(name="network_id")
-	private Long networkId;
-
-	@Column(name="uuid")
-	private String uuid;
-
-    @Column(name="physical_network_id")
-    private Long physicalNetworkId;
-
-	@Column(name="account_id")
-	private Long accountId = null;
-
-    @Column(name="domain_id")
-    private Long domainId = null;
-	
-    @Column(name = GenericDao.CREATED_COLUMN)
-    Date created;
-	
-	protected PublicIpv6AddressVO() {
-		this.uuid = UUID.randomUUID().toString();
-	}
-
-	public PublicIpv6AddressVO(String address, long dataCenterId, String macAddress, long vlanDbId)
{
-		this.address = address;
-		this.dataCenterId = dataCenterId;
-		this.vlanId = vlanDbId;
-		this.state = State.Free;
-		this.setMacAddress(macAddress);
-		this.uuid = UUID.randomUUID().toString();
-	}
-
-
-	@Override
-	public long getAccountId() {
-		return accountId;
-	}
-
-	@Override
-	public long getDomainId() {
-		return domainId;
-	}
-
-	@Override
-	public String getUuid() {
-		return uuid;
-	}
-
-	@Override
-	public long getId() {
-		return id;
-	}
-
-	@Override
-	public long getDataCenterId() {
-		return dataCenterId;
-	}
-
-	@Override
-	public String getAddress() {
-		return address;
-	}
-
-	@Override
-	public long getVlanId() {
-		return vlanId;
-	}
-
-	@Override
-	public State getState() {
-		return state;
-	}
-
-	@Override
-	public Long getNetworkId() {
-		return networkId;
-	}
-
-	@Override
-	public Long getSourceNetworkId() {
-		return sourceNetworkId;
-	}
-
-	@Override
-	public Long getPhysicalNetworkId() {
-		return physicalNetworkId;
-	}
-
-	@Override
-	public void setState(State state) {
-		this.state = state;
-	}
-
-	public String getMacAddress() {
-		return macAddress;
-	}
-
-	public void setMacAddress(String macAddress) {
-		this.macAddress = macAddress;
-	}
-
-	public void setSourceNetworkId(Long sourceNetworkId) {
-		this.sourceNetworkId = sourceNetworkId;
-	}
-
-	public void setNetworkId(Long networkId) {
-		this.networkId = networkId;
-	}
-
-	public void setPhysicalNetworkId(Long physicalNetworkId) {
-		this.physicalNetworkId = physicalNetworkId;
-	}
-
-	public void setDomainId(Long domainId) {
-		this.domainId = domainId;
-	}
-
-	public void setAccountId(Long accountId) {
-		this.accountId = accountId;
-	}
-
-	public Date getCreated() {
-		return created;
-	}
-
-	public void setCreated(Date created) {
-		this.created = created;
-	}
-}

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/ed547d91/server/src/com/cloud/network/UserIpv6Address.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/network/UserIpv6Address.java b/server/src/com/cloud/network/UserIpv6Address.java
new file mode 100644
index 0000000..4c33d45
--- /dev/null
+++ b/server/src/com/cloud/network/UserIpv6Address.java
@@ -0,0 +1,52 @@
+// 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;
+
+import org.apache.cloudstack.acl.ControlledEntity;
+import org.apache.cloudstack.api.Identity;
+import org.apache.cloudstack.api.InternalIdentity;
+
+/**
+ * @author Sheng Yang
+ *
+ */
+public interface UserIpv6Address extends ControlledEntity, Identity, InternalIdentity {
+    enum State {
+        Allocating, // The IP Address is being propagated to other network elements and is
not ready for use yet.
+        Allocated, // The IP address is in used.
+        Releasing, // The IP address is being released for other network elements and is
not ready for allocation.
+        Free // The IP address is ready to be allocated.
+    }
+
+    long getDataCenterId();
+
+    String getAddress();
+
+    long getVlanId();
+
+    State getState();
+
+    Long getNetworkId();
+    
+    Long getSourceNetworkId();
+
+    Long getPhysicalNetworkId();
+
+    void setState(UserIpv6Address.State state);
+    
+    String getMacAddress();
+}

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/ed547d91/server/src/com/cloud/network/UserIpv6AddressVO.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/network/UserIpv6AddressVO.java b/server/src/com/cloud/network/UserIpv6AddressVO.java
new file mode 100644
index 0000000..70eb12d
--- /dev/null
+++ b/server/src/com/cloud/network/UserIpv6AddressVO.java
@@ -0,0 +1,188 @@
+// 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;
+
+import java.util.Date;
+import java.util.UUID;
+
+import javax.persistence.Column;
+import javax.persistence.Entity;
+import javax.persistence.EnumType;
+import javax.persistence.Enumerated;
+import javax.persistence.GeneratedValue;
+import javax.persistence.GenerationType;
+import javax.persistence.Id;
+import javax.persistence.Table;
+import javax.persistence.Transient;
+
+import com.cloud.utils.db.GenericDao;
+
+@Entity
+@Table(name=("user_ipv6_address"))
+public class UserIpv6AddressVO implements UserIpv6Address {
+    @Id
+    @GeneratedValue(strategy=GenerationType.IDENTITY)
+    @Column(name="id")
+    long id;
+
+	@Column(name="ip_address")
+	@Enumerated(value=EnumType.STRING)
+	private String address = null;
+
+	@Column(name="data_center_id", updatable=false)
+	private long dataCenterId;
+
+	@Column(name="vlan_id")
+	private long vlanId;
+
+	@Column(name="state")
+	private State state;
+
+	@Column(name="mac_address")
+	private String macAddress;
+
+	@Column(name="source_network_id")
+    private Long sourceNetworkId;
+
+	@Column(name="network_id")
+	private Long networkId;
+
+	@Column(name="uuid")
+	private String uuid;
+
+    @Column(name="physical_network_id")
+    private Long physicalNetworkId;
+
+	@Column(name="account_id")
+	private Long accountId = null;
+
+    @Column(name="domain_id")
+    private Long domainId = null;
+	
+    @Column(name = GenericDao.CREATED_COLUMN)
+    Date created;
+	
+	protected UserIpv6AddressVO() {
+		this.uuid = UUID.randomUUID().toString();
+	}
+
+	public UserIpv6AddressVO(String address, long dataCenterId, String macAddress, long vlanDbId)
{
+		this.address = address;
+		this.dataCenterId = dataCenterId;
+		this.vlanId = vlanDbId;
+		this.state = State.Free;
+		this.setMacAddress(macAddress);
+		this.uuid = UUID.randomUUID().toString();
+	}
+
+
+	@Override
+	public long getAccountId() {
+		return accountId;
+	}
+
+	@Override
+	public long getDomainId() {
+		return domainId;
+	}
+
+	@Override
+	public String getUuid() {
+		return uuid;
+	}
+
+	@Override
+	public long getId() {
+		return id;
+	}
+
+	@Override
+	public long getDataCenterId() {
+		return dataCenterId;
+	}
+
+	@Override
+	public String getAddress() {
+		return address;
+	}
+
+	@Override
+	public long getVlanId() {
+		return vlanId;
+	}
+
+	@Override
+	public State getState() {
+		return state;
+	}
+
+	@Override
+	public Long getNetworkId() {
+		return networkId;
+	}
+
+	@Override
+	public Long getSourceNetworkId() {
+		return sourceNetworkId;
+	}
+
+	@Override
+	public Long getPhysicalNetworkId() {
+		return physicalNetworkId;
+	}
+
+	@Override
+	public void setState(State state) {
+		this.state = state;
+	}
+
+	public String getMacAddress() {
+		return macAddress;
+	}
+
+	public void setMacAddress(String macAddress) {
+		this.macAddress = macAddress;
+	}
+
+	public void setSourceNetworkId(Long sourceNetworkId) {
+		this.sourceNetworkId = sourceNetworkId;
+	}
+
+	public void setNetworkId(Long networkId) {
+		this.networkId = networkId;
+	}
+
+	public void setPhysicalNetworkId(Long physicalNetworkId) {
+		this.physicalNetworkId = physicalNetworkId;
+	}
+
+	public void setDomainId(Long domainId) {
+		this.domainId = domainId;
+	}
+
+	public void setAccountId(Long accountId) {
+		this.accountId = accountId;
+	}
+
+	public Date getCreated() {
+		return created;
+	}
+
+	public void setCreated(Date created) {
+		this.created = created;
+	}
+}

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/ed547d91/server/src/com/cloud/network/dao/PublicIpv6AddressDao.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/network/dao/PublicIpv6AddressDao.java b/server/src/com/cloud/network/dao/PublicIpv6AddressDao.java
deleted file mode 100644
index c347052..0000000
--- a/server/src/com/cloud/network/dao/PublicIpv6AddressDao.java
+++ /dev/null
@@ -1,23 +0,0 @@
-package com.cloud.network.dao;
-
-import java.util.List;
-
-import com.cloud.network.Network;
-import com.cloud.network.PublicIpv6AddressVO;
-import com.cloud.utils.db.GenericDao;
-
-public interface PublicIpv6AddressDao extends GenericDao<PublicIpv6AddressVO, Long>
{
-	List<PublicIpv6AddressVO> listByAccount(long accountId);
-	
-	List<PublicIpv6AddressVO> listByVlanId(long vlanId);
-	
-	List<PublicIpv6AddressVO> listByDcId(long dcId); 
-	
-	List<PublicIpv6AddressVO> listByNetwork(long networkId);
-	
-	public PublicIpv6AddressVO findByNetworkIdAndIp(long networkId, String ipAddress);
-
-	List<PublicIpv6AddressVO> listByPhysicalNetworkId(long physicalNetworkId);
-
-	long countExistedIpsInNetwork(long networkId);
-}

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/ed547d91/server/src/com/cloud/network/dao/PublicIpv6AddressDaoImpl.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/network/dao/PublicIpv6AddressDaoImpl.java b/server/src/com/cloud/network/dao/PublicIpv6AddressDaoImpl.java
deleted file mode 100644
index 8a6bfcc..0000000
--- a/server/src/com/cloud/network/dao/PublicIpv6AddressDaoImpl.java
+++ /dev/null
@@ -1,96 +0,0 @@
-package com.cloud.network.dao;
-
-import java.util.List;
-import java.util.Map;
-
-import javax.ejb.Local;
-import javax.naming.ConfigurationException;
-
-import org.apache.log4j.Logger;
-
-import com.cloud.network.Network;
-import com.cloud.network.PublicIpv6AddressVO;
-import com.cloud.utils.Pair;
-import com.cloud.utils.db.Filter;
-import com.cloud.utils.db.GenericDaoBase;
-import com.cloud.utils.db.GenericSearchBuilder;
-import com.cloud.utils.db.SearchBuilder;
-import com.cloud.utils.db.SearchCriteria;
-import com.cloud.utils.db.SearchCriteria.Func;
-import com.cloud.utils.db.SearchCriteria.Op;
-import com.cloud.utils.db.SearchCriteria2;
-
-@Local(value=PublicIpv6AddressDao.class)
-public class PublicIpv6AddressDaoImpl extends GenericDaoBase<PublicIpv6AddressVO, Long>
implements PublicIpv6AddressDao {
-    private static final Logger s_logger = Logger.getLogger(IPAddressDaoImpl.class);
-
-    protected final SearchBuilder<PublicIpv6AddressVO> AllFieldsSearch;
-    protected GenericSearchBuilder<PublicIpv6AddressVO, Long> CountFreePublicIps;
-    
-    public PublicIpv6AddressDaoImpl() {
-        AllFieldsSearch = createSearchBuilder();
-        AllFieldsSearch.and("id", AllFieldsSearch.entity().getId(), Op.EQ);
-        AllFieldsSearch.and("dataCenterId", AllFieldsSearch.entity().getDataCenterId(), Op.EQ);
-        AllFieldsSearch.and("ipAddress", AllFieldsSearch.entity().getAddress(), Op.EQ);
-        AllFieldsSearch.and("vlan", AllFieldsSearch.entity().getVlanId(), Op.EQ);
-        AllFieldsSearch.and("accountId", AllFieldsSearch.entity().getAccountId(), Op.EQ);
-        AllFieldsSearch.and("network", AllFieldsSearch.entity().getNetworkId(), Op.EQ);
-        AllFieldsSearch.and("physicalNetworkId", AllFieldsSearch.entity().getPhysicalNetworkId(),
Op.EQ);
-        AllFieldsSearch.done();
-        
-        CountFreePublicIps = createSearchBuilder(Long.class);
-        CountFreePublicIps.select(null, Func.COUNT, null);
-        CountFreePublicIps.and("networkId", CountFreePublicIps.entity().getSourceNetworkId(),
SearchCriteria.Op.EQ);
-        CountFreePublicIps.done();
-    }
-
-	@Override
-	public List<PublicIpv6AddressVO> listByAccount(long accountId) {
-        SearchCriteria<PublicIpv6AddressVO> sc = AllFieldsSearch.create();
-        sc.setParameters("accountId", accountId);
-        return listBy(sc);
-	}
-
-	@Override
-	public List<PublicIpv6AddressVO> listByVlanId(long vlanId) {
-        SearchCriteria<PublicIpv6AddressVO> sc = AllFieldsSearch.create();
-        sc.setParameters("vlan", vlanId);
-        return listBy(sc);
-	}
-
-	@Override
-	public List<PublicIpv6AddressVO> listByDcId(long dcId) {
-        SearchCriteria<PublicIpv6AddressVO> sc = AllFieldsSearch.create();
-        sc.setParameters("dataCenterId", dcId);
-        return listBy(sc);
-	}
-
-	@Override
-	public List<PublicIpv6AddressVO> listByNetwork(long networkId) {
-        SearchCriteria<PublicIpv6AddressVO> sc = AllFieldsSearch.create();
-        sc.setParameters("network", networkId);
-        return listBy(sc);
-	}
-
-	@Override
-	public PublicIpv6AddressVO findByNetworkIdAndIp(long networkId, String ipAddress) {
-        SearchCriteria<PublicIpv6AddressVO> sc = AllFieldsSearch.create();
-        sc.setParameters("networkId", networkId);
-        sc.setParameters("ipAddress", ipAddress);
-        return findOneBy(sc);
-	}
-
-	@Override
-	public List<PublicIpv6AddressVO> listByPhysicalNetworkId(long physicalNetworkId) {
-        SearchCriteria<PublicIpv6AddressVO> sc = AllFieldsSearch.create();
-        sc.setParameters("physicalNetworkId", physicalNetworkId);
-        return listBy(sc);
-	}
-
-	@Override
-	public long countExistedIpsInNetwork(long networkId) {
-        SearchCriteria<Long> sc = CountFreePublicIps.create();
-        sc.setParameters("networkId", networkId);
-        return customSearch(sc, null).get(0);       
-	}
-}

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/ed547d91/server/src/com/cloud/network/dao/UserIpv6AddressDao.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/network/dao/UserIpv6AddressDao.java b/server/src/com/cloud/network/dao/UserIpv6AddressDao.java
new file mode 100644
index 0000000..0e245ef
--- /dev/null
+++ b/server/src/com/cloud/network/dao/UserIpv6AddressDao.java
@@ -0,0 +1,23 @@
+package com.cloud.network.dao;
+
+import java.util.List;
+
+import com.cloud.network.Network;
+import com.cloud.network.UserIpv6AddressVO;
+import com.cloud.utils.db.GenericDao;
+
+public interface UserIpv6AddressDao extends GenericDao<UserIpv6AddressVO, Long> {
+	List<UserIpv6AddressVO> listByAccount(long accountId);
+	
+	List<UserIpv6AddressVO> listByVlanId(long vlanId);
+	
+	List<UserIpv6AddressVO> listByDcId(long dcId); 
+	
+	List<UserIpv6AddressVO> listByNetwork(long networkId);
+	
+	public UserIpv6AddressVO findByNetworkIdAndIp(long networkId, String ipAddress);
+
+	List<UserIpv6AddressVO> listByPhysicalNetworkId(long physicalNetworkId);
+
+	long countExistedIpsInNetwork(long networkId);
+}

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/ed547d91/server/src/com/cloud/network/dao/UserIpv6AddressDaoImpl.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/network/dao/UserIpv6AddressDaoImpl.java b/server/src/com/cloud/network/dao/UserIpv6AddressDaoImpl.java
new file mode 100644
index 0000000..6989c40
--- /dev/null
+++ b/server/src/com/cloud/network/dao/UserIpv6AddressDaoImpl.java
@@ -0,0 +1,96 @@
+package com.cloud.network.dao;
+
+import java.util.List;
+import java.util.Map;
+
+import javax.ejb.Local;
+import javax.naming.ConfigurationException;
+
+import org.apache.log4j.Logger;
+
+import com.cloud.network.Network;
+import com.cloud.network.UserIpv6AddressVO;
+import com.cloud.utils.Pair;
+import com.cloud.utils.db.Filter;
+import com.cloud.utils.db.GenericDaoBase;
+import com.cloud.utils.db.GenericSearchBuilder;
+import com.cloud.utils.db.SearchBuilder;
+import com.cloud.utils.db.SearchCriteria;
+import com.cloud.utils.db.SearchCriteria.Func;
+import com.cloud.utils.db.SearchCriteria.Op;
+import com.cloud.utils.db.SearchCriteria2;
+
+@Local(value=UserIpv6AddressDao.class)
+public class UserIpv6AddressDaoImpl extends GenericDaoBase<UserIpv6AddressVO, Long>
implements UserIpv6AddressDao {
+    private static final Logger s_logger = Logger.getLogger(IPAddressDaoImpl.class);
+
+    protected final SearchBuilder<UserIpv6AddressVO> AllFieldsSearch;
+    protected GenericSearchBuilder<UserIpv6AddressVO, Long> CountFreePublicIps;
+    
+    public UserIpv6AddressDaoImpl() {
+        AllFieldsSearch = createSearchBuilder();
+        AllFieldsSearch.and("id", AllFieldsSearch.entity().getId(), Op.EQ);
+        AllFieldsSearch.and("dataCenterId", AllFieldsSearch.entity().getDataCenterId(), Op.EQ);
+        AllFieldsSearch.and("ipAddress", AllFieldsSearch.entity().getAddress(), Op.EQ);
+        AllFieldsSearch.and("vlan", AllFieldsSearch.entity().getVlanId(), Op.EQ);
+        AllFieldsSearch.and("accountId", AllFieldsSearch.entity().getAccountId(), Op.EQ);
+        AllFieldsSearch.and("network", AllFieldsSearch.entity().getNetworkId(), Op.EQ);
+        AllFieldsSearch.and("physicalNetworkId", AllFieldsSearch.entity().getPhysicalNetworkId(),
Op.EQ);
+        AllFieldsSearch.done();
+        
+        CountFreePublicIps = createSearchBuilder(Long.class);
+        CountFreePublicIps.select(null, Func.COUNT, null);
+        CountFreePublicIps.and("networkId", CountFreePublicIps.entity().getSourceNetworkId(),
SearchCriteria.Op.EQ);
+        CountFreePublicIps.done();
+    }
+
+	@Override
+	public List<UserIpv6AddressVO> listByAccount(long accountId) {
+        SearchCriteria<UserIpv6AddressVO> sc = AllFieldsSearch.create();
+        sc.setParameters("accountId", accountId);
+        return listBy(sc);
+	}
+
+	@Override
+	public List<UserIpv6AddressVO> listByVlanId(long vlanId) {
+        SearchCriteria<UserIpv6AddressVO> sc = AllFieldsSearch.create();
+        sc.setParameters("vlan", vlanId);
+        return listBy(sc);
+	}
+
+	@Override
+	public List<UserIpv6AddressVO> listByDcId(long dcId) {
+        SearchCriteria<UserIpv6AddressVO> sc = AllFieldsSearch.create();
+        sc.setParameters("dataCenterId", dcId);
+        return listBy(sc);
+	}
+
+	@Override
+	public List<UserIpv6AddressVO> listByNetwork(long networkId) {
+        SearchCriteria<UserIpv6AddressVO> sc = AllFieldsSearch.create();
+        sc.setParameters("network", networkId);
+        return listBy(sc);
+	}
+
+	@Override
+	public UserIpv6AddressVO findByNetworkIdAndIp(long networkId, String ipAddress) {
+        SearchCriteria<UserIpv6AddressVO> sc = AllFieldsSearch.create();
+        sc.setParameters("networkId", networkId);
+        sc.setParameters("ipAddress", ipAddress);
+        return findOneBy(sc);
+	}
+
+	@Override
+	public List<UserIpv6AddressVO> listByPhysicalNetworkId(long physicalNetworkId) {
+        SearchCriteria<UserIpv6AddressVO> sc = AllFieldsSearch.create();
+        sc.setParameters("physicalNetworkId", physicalNetworkId);
+        return listBy(sc);
+	}
+
+	@Override
+	public long countExistedIpsInNetwork(long networkId) {
+        SearchCriteria<Long> sc = CountFreePublicIps.create();
+        sc.setParameters("networkId", networkId);
+        return customSearch(sc, null).get(0);       
+	}
+}

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/ed547d91/server/src/com/cloud/network/guru/DirectNetworkGuru.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/network/guru/DirectNetworkGuru.java b/server/src/com/cloud/network/guru/DirectNetworkGuru.java
index ef286bd..0d5425f 100755
--- a/server/src/com/cloud/network/guru/DirectNetworkGuru.java
+++ b/server/src/com/cloud/network/guru/DirectNetworkGuru.java
@@ -43,9 +43,9 @@ import com.cloud.network.NetworkVO;
 import com.cloud.network.Networks.BroadcastDomainType;
 import com.cloud.network.Networks.Mode;
 import com.cloud.network.Networks.TrafficType;
-import com.cloud.network.PublicIpv6AddressVO;
+import com.cloud.network.UserIpv6AddressVO;
 import com.cloud.network.dao.IPAddressDao;
-import com.cloud.network.dao.PublicIpv6AddressDao;
+import com.cloud.network.dao.UserIpv6AddressDao;
 import com.cloud.offering.NetworkOffering;
 import com.cloud.offerings.dao.NetworkOfferingDao;
 import com.cloud.user.Account;
@@ -76,7 +76,7 @@ public class DirectNetworkGuru extends AdapterBase implements NetworkGuru
{
     @Inject
     NetworkOfferingDao _networkOfferingDao;
     @Inject
-    PublicIpv6AddressDao _ipv6Dao;
+    UserIpv6AddressDao _ipv6Dao;
     @Inject
     Ipv6AddressManager _ipv6Mgr;
     

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/ed547d91/server/test/com/cloud/vpc/MockNetworkManagerImpl.java
----------------------------------------------------------------------
diff --git a/server/test/com/cloud/vpc/MockNetworkManagerImpl.java b/server/test/com/cloud/vpc/MockNetworkManagerImpl.java
index 970f5ad..96d9245 100644
--- a/server/test/com/cloud/vpc/MockNetworkManagerImpl.java
+++ b/server/test/com/cloud/vpc/MockNetworkManagerImpl.java
@@ -56,7 +56,7 @@ import com.cloud.network.PhysicalNetwork;
 import com.cloud.network.PhysicalNetworkServiceProvider;
 import com.cloud.network.PhysicalNetworkTrafficType;
 import com.cloud.network.PublicIpAddress;
-import com.cloud.network.PublicIpv6Address;
+import com.cloud.network.UserIpv6Address;
 import com.cloud.network.addr.PublicIp;
 import com.cloud.network.dao.NetworkServiceMapDao;
 import com.cloud.network.element.LoadBalancingServiceProvider;

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/ed547d91/setup/db/create-schema.sql
----------------------------------------------------------------------
diff --git a/setup/db/create-schema.sql b/setup/db/create-schema.sql
index db3a8a5..c79c965 100755
--- a/setup/db/create-schema.sql
+++ b/setup/db/create-schema.sql
@@ -2550,7 +2550,7 @@ INSERT INTO `cloud`.`counter` (id, uuid, source, name, value,created)
VALUES (2,
 INSERT INTO `cloud`.`counter` (id, uuid, source, name, value,created) VALUES (3, UUID(),
'snmp','Linux CPU Idle - percentage', '1.3.6.1.4.1.2021.11.11.0', now());
 INSERT INTO `cloud`.`counter` (id, uuid, source, name, value,created) VALUES (100, UUID(),
'netscaler','Response Time - microseconds', 'RESPTIME', now());
 
-CREATE TABLE  `cloud`.`public_ipv6_address` (
+CREATE TABLE  `cloud`.`user_ipv6_address` (
   `id` bigint unsigned NOT NULL UNIQUE auto_increment,
   `uuid` varchar(40),
   `account_id` bigint unsigned NULL,
@@ -2566,13 +2566,13 @@ CREATE TABLE  `cloud`.`public_ipv6_address` (
   `created` datetime NULL COMMENT 'Date this ip was allocated to someone',
   PRIMARY KEY (`id`),
   UNIQUE (`ip_address`, `source_network_id`),
-  CONSTRAINT `fk_public_ipv6_address__source_network_id` FOREIGN KEY (`source_network_id`)
REFERENCES `networks`(`id`),
-  CONSTRAINT `fk_public_ipv6_address__network_id` FOREIGN KEY (`network_id`) REFERENCES `networks`(`id`),
-  CONSTRAINT `fk_public_ipv6_address__account_id` FOREIGN KEY (`account_id`) REFERENCES `account`(`id`),
-  CONSTRAINT `fk_public_ipv6_address__vlan_id` FOREIGN KEY (`vlan_id`) REFERENCES `vlan`(`id`)
ON DELETE CASCADE,
-  CONSTRAINT `fk_public_ipv6_address__data_center_id` FOREIGN KEY (`data_center_id`) REFERENCES
`data_center`(`id`) ON DELETE CASCADE,
-  CONSTRAINT `uc_public_ipv6_address__uuid` UNIQUE (`uuid`),
-  CONSTRAINT `fk_public_ipv6_address__physical_network_id` FOREIGN KEY (`physical_network_id`)
REFERENCES `physical_network`(`id`) ON DELETE CASCADE
+  CONSTRAINT `fk_user_ipv6_address__source_network_id` FOREIGN KEY (`source_network_id`)
REFERENCES `networks`(`id`),
+  CONSTRAINT `fk_user_ipv6_address__network_id` FOREIGN KEY (`network_id`) REFERENCES `networks`(`id`),
+  CONSTRAINT `fk_user_ipv6_address__account_id` FOREIGN KEY (`account_id`) REFERENCES `account`(`id`),
+  CONSTRAINT `fk_user_ipv6_address__vlan_id` FOREIGN KEY (`vlan_id`) REFERENCES `vlan`(`id`)
ON DELETE CASCADE,
+  CONSTRAINT `fk_user_ipv6_address__data_center_id` FOREIGN KEY (`data_center_id`) REFERENCES
`data_center`(`id`) ON DELETE CASCADE,
+  CONSTRAINT `uc_user_ipv6_address__uuid` UNIQUE (`uuid`),
+  CONSTRAINT `fk_user_ipv6_address__physical_network_id` FOREIGN KEY (`physical_network_id`)
REFERENCES `physical_network`(`id`) ON DELETE CASCADE
 ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
 
 SET foreign_key_checks = 1;


Mime
View raw message