openmeetings-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From solo...@apache.org
Subject svn commit: r1452657 - /openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/persistence/beans/sip/asterisk/AsteriskSipUser.java
Date Tue, 05 Mar 2013 04:06:31 GMT
Author: solomax
Date: Tue Mar  5 04:06:30 2013
New Revision: 1452657

URL: http://svn.apache.org/r1452657
Log:
SIP: column types are updated to correspond Asterisk 11 sipusers table definition

Modified:
    openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/persistence/beans/sip/asterisk/AsteriskSipUser.java

Modified: openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/persistence/beans/sip/asterisk/AsteriskSipUser.java
URL: http://svn.apache.org/viewvc/openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/persistence/beans/sip/asterisk/AsteriskSipUser.java?rev=1452657&r1=1452656&r2=1452657&view=diff
==============================================================================
--- openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/persistence/beans/sip/asterisk/AsteriskSipUser.java
(original)
+++ openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/persistence/beans/sip/asterisk/AsteriskSipUser.java
Tue Mar  5 04:06:30 2013
@@ -22,6 +22,8 @@ import java.io.Serializable;
 
 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;
@@ -35,6 +37,11 @@ import org.simpleframework.xml.Root;
 @Root(name="asterisksipuser")
 public class AsteriskSipUser implements Serializable {
 	private static final long serialVersionUID = -565831761546365623L;
+	public enum Type {
+		friend,
+		user,
+		peer
+	}
 
 	@Id
 	@Column(name = "id")
@@ -43,8 +50,9 @@ public class AsteriskSipUser implements 
 	private long id;
 
 	@Column(name = "type", nullable = false, length=6)
+	@Enumerated(EnumType.STRING)
 	@Element(data=true, required=false)
-	private String type = "friend"; //	Varchar 6
+	private Type type = Type.friend;
 	
 	@Column(name = "name", nullable = false, length=128)
 	@Element(data=true, required=false)
@@ -66,9 +74,9 @@ public class AsteriskSipUser implements 
 	@Element(data=true, required=false)
 	private String ipaddr = ""; //	Varchar 128
 	
-	@Column(name = "port", nullable = false, length=5)
+	@Column(name = "port", nullable = false, length=8)
 	@Element(data=true, required=false)
-	private String port = ""; //	Varchar 5
+	private Integer port = 0; //	mediumint(8)
 	
 	@Column(name = "regseconds", nullable = false)
 	@Element(data=true, required = false)
@@ -114,11 +122,11 @@ public class AsteriskSipUser implements 
 		this.id = id;
 	}
 
-	public String getType() {
+	public Type getType() {
 		return type;
 	}
 
-	public void setType(String type) {
+	public void setType(Type type) {
 		this.type = type;
 	}
 
@@ -162,11 +170,11 @@ public class AsteriskSipUser implements 
 		this.ipaddr = ipaddr;
 	}
 
-	public String getPort() {
+	public Integer getPort() {
 		return port;
 	}
 
-	public void setPort(String port) {
+	public void setPort(Integer port) {
 		this.port = port;
 	}
 



Mime
View raw message