revert pac ip update code
This commit is contained in:
parent
8069fea36b
commit
551bb74712
@ -10,7 +10,6 @@ import java.util.Date;
|
|||||||
import java.util.HashSet;
|
import java.util.HashSet;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
|
|
||||||
import javax.persistence.CascadeType;
|
|
||||||
import javax.persistence.Column;
|
import javax.persistence.Column;
|
||||||
import javax.persistence.Entity;
|
import javax.persistence.Entity;
|
||||||
import javax.persistence.EntityManager;
|
import javax.persistence.EntityManager;
|
||||||
@ -78,7 +77,7 @@ public class Pac extends AbstractEntity implements Serializable {
|
|||||||
private boolean free = false;
|
private boolean free = false;
|
||||||
|
|
||||||
@JoinColumn(name = "cur_inet_addr_id", nullable = true)
|
@JoinColumn(name = "cur_inet_addr_id", nullable = true)
|
||||||
@ManyToOne(fetch = EAGER, cascade = CascadeType.MERGE)
|
@ManyToOne(fetch = EAGER)
|
||||||
@AnnFieldIO(rw=ReadWriteAccess.WRITEONCE,validation="[0-9\\.]*",overwriteName="curinetaddr")
|
@AnnFieldIO(rw=ReadWriteAccess.WRITEONCE,validation="[0-9\\.]*",overwriteName="curinetaddr")
|
||||||
private INetAddress curINetAddr;
|
private INetAddress curINetAddr;
|
||||||
|
|
||||||
|
@ -130,16 +130,6 @@ public class PacModuleImpl extends AbstractModuleImpl {
|
|||||||
Pac newState = (Pac) entity;
|
Pac newState = (Pac) entity;
|
||||||
EntityManager em = getTransaction().getEntityManager();
|
EntityManager em = getTransaction().getEntityManager();
|
||||||
Pac oldState = em.find(Pac.class, newState.getId());
|
Pac oldState = em.find(Pac.class, newState.getId());
|
||||||
|
|
||||||
String oldCurINetAddr = oldState.getCurINetAddr().getInet4Addr();
|
|
||||||
String newCurINetAddr = newState.getCurINetAddr().getInet4Addr();
|
|
||||||
|
|
||||||
System.out.println("new IP: " + newCurINetAddr);
|
|
||||||
System.out.println("old IP: " + oldCurINetAddr);
|
|
||||||
if (newCurINetAddr != null && !newCurINetAddr.isEmpty() && !newCurINetAddr.equals(oldCurINetAddr)) {
|
|
||||||
System.out.println("needs IP update");
|
|
||||||
}
|
|
||||||
|
|
||||||
String oldBasepacName = oldState.getBasepac().getName();
|
String oldBasepacName = oldState.getBasepac().getName();
|
||||||
BasePac newBasepac = newState.getBasepac();
|
BasePac newBasepac = newState.getBasepac();
|
||||||
String newBasepacName = newBasepac.getName();
|
String newBasepacName = newBasepac.getName();
|
||||||
|
@ -80,11 +80,6 @@ public class PacRemote extends AbstractRemote {
|
|||||||
curINetAddr = new INetAddress(inetAddrString);
|
curINetAddr = new INetAddress(inetAddrString);
|
||||||
pac.setCurINetAddr(curINetAddr);
|
pac.setCurINetAddr(curINetAddr);
|
||||||
}
|
}
|
||||||
if (curINetAddr != null && curINetAddr.getInet4Addr() != null && assertNotNull(inetAddrString) && !curINetAddr.getInet4Addr().equals(inetAddrString)) {
|
|
||||||
System.out.println("IP Update: " + inetAddrString);
|
|
||||||
curINetAddr = new INetAddress(inetAddrString);
|
|
||||||
pac.setCurINetAddr(curINetAddr);
|
|
||||||
}
|
|
||||||
Customer customer = pac.getCustomer();
|
Customer customer = pac.getCustomer();
|
||||||
String memberCode = (String) setParams.get("customer");
|
String memberCode = (String) setParams.get("customer");
|
||||||
if (customer == null && assertNotNull(memberCode)) {
|
if (customer == null && assertNotNull(memberCode)) {
|
||||||
|
Loading…
Reference in New Issue
Block a user