2 new revisions:
Revision: b1d97a2df25e
Author: [email protected] <[email protected]>
Date: Thu Apr 11 12:58:41 2013
Log: Update issue 104
http://code.google.com/p/jain-sip/source/detail?r=b1d97a2df25e&repo=ha
Revision: b9bb4f96f4c1
Author: [email protected] <[email protected]>
Date: Tue Apr 16 06:26:36 2013
Log: Update issue 106
http://code.google.com/p/jain-sip/source/detail?r=b9bb4f96f4c1&repo=ha
==============================================================================
Revision: b1d97a2df25e
Author: [email protected] <[email protected]>
Date: Thu Apr 11 12:58:41 2013
Log: Update issue 104
http://code.google.com/p/jain-sip/source/detail?r=b1d97a2df25e&repo=ha
Modified:
/core/src/main/java/org/mobicents/ha/javax/sip/LoadBalancerHeartBeatingServiceImpl.java
=======================================
---
/core/src/main/java/org/mobicents/ha/javax/sip/LoadBalancerHeartBeatingServiceImpl.java
Fri Mar 15 03:27:34 2013
+++
/core/src/main/java/org/mobicents/ha/javax/sip/LoadBalancerHeartBeatingServiceImpl.java
Thu Apr 11 12:58:41 2013
@@ -384,6 +384,7 @@
ArrayList<SIPNode> info = new ArrayList<SIPNode>();
Integer sipTcpPort = null;
Integer sipUdpPort = null;
+ Integer sipWsPort = null;
String address = null;
String hostName = null;
// Gathering info about server' sip listening points
@@ -398,8 +399,10 @@
String transport = listeningPoint.getTransport();
if(transport.equalsIgnoreCase("tcp")) {
sipTcpPort = port;
- } else if(transport.equals("udp")) {
+ } else if(transport.equalsIgnoreCase("udp")) {
sipUdpPort = port;
+ } else if(transport.equalsIgnoreCase("ws")) {
+ sipWsPort = port;
}
try {
@@ -467,6 +470,7 @@
if(sipTcpPort != null)
node.getProperties().put("tcpPort", sipTcpPort);
if(sipUdpPort != null)
node.getProperties().put("udpPort", sipUdpPort);
+ if(sipWsPort != null)
node.getProperties().put("wsPort", sipWsPort);
if(jvmRoute != null)
node.getProperties().put("jvmRoute", jvmRoute);
//, port,
// transports, jvmRoute, httpPort,
sslPort, null);
==============================================================================
Revision: b9bb4f96f4c1
Author: [email protected] <[email protected]>
Date: Tue Apr 16 06:26:36 2013
Log: Update issue 106
http://code.google.com/p/jain-sip/source/detail?r=b9bb4f96f4c1&repo=ha
Modified:
/core/src/main/java/org/mobicents/ha/javax/sip/LoadBalancerHeartBeatingService.java
/core/src/main/java/org/mobicents/ha/javax/sip/LoadBalancerHeartBeatingServiceImpl.java
/core/src/main/java/org/mobicents/ha/javax/sip/LoadBalancerHeartBeatingServiceImplMBean.java
/core/src/main/java/org/mobicents/ha/javax/sip/SipLoadBalancer.java
=======================================
---
/core/src/main/java/org/mobicents/ha/javax/sip/LoadBalancerHeartBeatingService.java
Tue Apr 19 06:45:18 2011
+++
/core/src/main/java/org/mobicents/ha/javax/sip/LoadBalancerHeartBeatingService.java
Tue Apr 16 06:26:36 2013
@@ -72,7 +72,7 @@
*/
String[] getBalancers();
- boolean addBalancer(String addr, int sipPort, int rmiPort)
+ boolean addBalancer(String addr, int sipPort, int httpPort, int rmiPort)
throws IllegalArgumentException, NullPointerException,
IOException;
/**
@@ -91,7 +91,7 @@
* </ul>
* @throws IllegalArgumentException if something goes wrong when adding
the balancer address or while trying to connect to it
*/
- boolean addBalancer(String hostName, int sipPort, int index, int
rmiPort)
+ boolean addBalancer(String hostName, int sipPort, int httpPort, int
index, int rmiPort)
throws IllegalArgumentException;
/**
@@ -118,10 +118,10 @@
* @throws IllegalArgumentException -
* if there is no balancer with that name on the list.
*/
- boolean removeBalancer(String addr, int sipPort, int rmiPort)
+ boolean removeBalancer(String addr, int sipPort, int httpPort, int
rmiPort)
throws IllegalArgumentException;
- boolean removeBalancer(String hostName, int sipPort, int index, int
rmiPort)
+ boolean removeBalancer(String hostName, int sipPort, int httpPort, int
index, int rmiPort)
throws IllegalArgumentException;
=======================================
---
/core/src/main/java/org/mobicents/ha/javax/sip/LoadBalancerHeartBeatingServiceImpl.java
Thu Apr 11 12:58:41 2013
+++
/core/src/main/java/org/mobicents/ha/javax/sip/LoadBalancerHeartBeatingServiceImpl.java
Tue Apr 16 06:26:36 2013
@@ -68,7 +68,8 @@
public static final int DEFAULT_RMI_PORT = 2000;
public static final String BALANCER_SIP_PORT_CHAR_SEPARATOR = ":";
public static final String BALANCERS_CHAR_SEPARATOR = ";";
- public static final int DEFAULT_LB_SIP_PORT = 5065;
+ public static final int DEFAULT_LB_SIP_PORT = 5065;
+ public static final int DEFAULT_LB_HTTP_PORT = 2080;
ClusteredSipStack sipStack = null;
//the logger
@@ -117,14 +118,19 @@
for (String balancerDescription :
balancerDescriptions) {
String balancerAddress =
balancerDescription;
int sipPort = DEFAULT_LB_SIP_PORT;
+ int httpPort = DEFAULT_LB_HTTP_PORT;
int rmiPort = DEFAULT_RMI_PORT;
if(balancerDescription.indexOf(BALANCER_SIP_PORT_CHAR_SEPARATOR) !=
-1) {
String[] balancerDescriptionSplitted =
balancerDescription.split(BALANCER_SIP_PORT_CHAR_SEPARATOR);
balancerAddress =
balancerDescriptionSplitted[0];
try {
+
//sipPort:httpPort:rmiPort
sipPort =
Integer.parseInt(balancerDescriptionSplitted[1]);
if(balancerDescriptionSplitted.length>2) {
- rmiPort =
Integer.parseInt(balancerDescriptionSplitted[2]);
+ httpPort =
Integer.parseInt(balancerDescriptionSplitted[2]);
+
if(balancerDescriptionSplitted.length>3){
+ rmiPort
= Integer.parseInt(balancerDescriptionSplitted[3]);
+ }
}
} catch (NumberFormatException
e) {
logger.logError("Impossible to parse the following sip balancer
port " + balancerDescriptionSplitted[1], e);
@@ -132,12 +138,12 @@
}
if(Inet6Util.isValidIP6Address(balancerAddress) ||
Inet6Util.isValidIPV4Address(balancerAddress)) {
try {
-
this.addBalancer(InetAddress.getByName(balancerAddress).getHostAddress(),
sipPort, rmiPort);
+
this.addBalancer(InetAddress.getByName(balancerAddress).getHostAddress(),
sipPort, httpPort, rmiPort);
} catch (UnknownHostException
e) {
logger.logError("Impossible to parse the following sip balancer
address " + balancerAddress, e);
}
} else {
-
this.addBalancer(balancerAddress, sipPort, 0, rmiPort);
+
this.addBalancer(balancerAddress, sipPort, httpPort, 0, rmiPort);
}
}
}
@@ -271,7 +277,7 @@
/**
* {@inheritDoc}
*/
- public boolean addBalancer(String addr, int sipPort, int rmiPort) {
+ public boolean addBalancer(String addr, int sipPort, int httpPort, int
rmiPort) {
if (addr == null)
throw new NullPointerException("addr cant be null!!!");
@@ -289,7 +295,7 @@
return false;
}
- SipLoadBalancer sipLoadBalancer = new SipLoadBalancer(this, address,
sipPort, rmiPort);
+ SipLoadBalancer sipLoadBalancer = new SipLoadBalancer(this, address,
sipPort, httpPort, rmiPort);
register.put(balancerName, sipLoadBalancer);
// notify the listeners
@@ -307,15 +313,15 @@
/**
* {@inheritDoc}
*/
- public boolean addBalancer(String hostName, int sipPort, int index, int
rmiPort) {
+ public boolean addBalancer(String hostName, int sipPort, int httpPort,
int index, int rmiPort) {
return this.addBalancer(fetchHostAddress(hostName, index)
- .getHostAddress(), sipPort, rmiPort);
+ .getHostAddress(), sipPort, httpPort, rmiPort);
}
/**
* {@inheritDoc}
*/
- public boolean removeBalancer(String addr, int sipPort, int rmiPort) {
+ public boolean removeBalancer(String addr, int sipPort, int httpPort, int
rmiPort) {
if (addr == null)
throw new NullPointerException("addr cant be null!!!");
@@ -327,7 +333,7 @@
"Something wrong with host creation.",
e);
}
- SipLoadBalancer sipLoadBalancer = new SipLoadBalancer(this, address,
sipPort, rmiPort);
+ SipLoadBalancer sipLoadBalancer = new SipLoadBalancer(this, address,
sipPort, httpPort, rmiPort);
String keyToRemove = null;
Iterator<String> keyIterator = register.keySet().iterator();
@@ -359,7 +365,7 @@
/**
* {@inheritDoc}
*/
- public boolean removeBalancer(String hostName, int sipPort, int index,
int rmiPort) {
+ public boolean removeBalancer(String hostName, int sipPort, int httpPort,
int index, int rmiPort) {
InetAddress[] hostAddr = null;
try {
hostAddr = InetAddress.getAllByName(hostName);
@@ -377,7 +383,7 @@
InetAddress address = hostAddr[index];
- return this.removeBalancer(address.getHostAddress(), sipPort,
rmiPort);
+ return this.removeBalancer(address.getHostAddress(), sipPort, httpPort,
rmiPort);
}
protected ArrayList<SIPNode> getConnectorsAsSIPNode() {
=======================================
---
/core/src/main/java/org/mobicents/ha/javax/sip/LoadBalancerHeartBeatingServiceImplMBean.java
Tue Apr 19 06:45:18 2011
+++
/core/src/main/java/org/mobicents/ha/javax/sip/LoadBalancerHeartBeatingServiceImplMBean.java
Tue Apr 16 06:26:36 2013
@@ -34,8 +34,8 @@
void stop();
String[] getBalancers();
- boolean addBalancer(String addr, int sipPort, int rmiPort) throws
IOException;
- boolean removeBalancer(String addr, int sipPort, int rmiPort);
+ boolean addBalancer(String addr, int sipPort, int httpPort, int rmiPort)
throws IOException;
+ boolean removeBalancer(String addr, int sipPort, int httpPort, int
rmiPort);
long getHeartBeatInterval();
void setHeartBeatInterval(long heartBeatInterval);
=======================================
--- /core/src/main/java/org/mobicents/ha/javax/sip/SipLoadBalancer.java Tue
Apr 19 06:45:18 2011
+++ /core/src/main/java/org/mobicents/ha/javax/sip/SipLoadBalancer.java Tue
Apr 16 06:26:36 2013
@@ -70,6 +70,7 @@
private static final long serialVersionUID = 1L;
private InetAddress address;
private int sipPort;
+ private int httpPort;
private int rmiPort;
private transient LoadBalancerHeartBeatingService
loadBalancerHeartBeatingService;
private transient RouteHeader balancerRouteHeaderUdp;
@@ -82,12 +83,13 @@
* @param sipPort
* @param hostName
*/
- public SipLoadBalancer(LoadBalancerHeartBeatingService
loadBalancerHeartBeatingService, InetAddress address, int sipPort, int
rmiPort) {
+ public SipLoadBalancer(LoadBalancerHeartBeatingService
loadBalancerHeartBeatingService, InetAddress address, int sipPort, int
httpPort, int rmiPort) {
super();
this.available = false;
this.displayWarning = true;
this.address = address;
this.sipPort = sipPort;
+ this.httpPort = httpPort;
this.rmiPort = rmiPort;
this.loadBalancerHeartBeatingService =
loadBalancerHeartBeatingService;
try {
@@ -139,6 +141,12 @@
public int getSipPort() {
return sipPort;
}
+ public void setHttpPort(int httpPort){
+ this.httpPort = httpPort;
+ }
+ public int getHttpPort(){
+ return httpPort;
+ }
public int getRmiPort() {
return rmiPort;
}
@@ -178,6 +186,7 @@
int result = 1;
result = prime * result + ((address == null) ? 0 :
address.hashCode());
result = prime * result + sipPort;
+ result = prime * result + httpPort;
result = prime * result + rmiPort;
return result;
}
@@ -200,6 +209,8 @@
return false;
if (sipPort != other.sipPort)
return false;
+ if (httpPort != other.httpPort)
+ return false;
if (rmiPort != other.rmiPort)
return false;
return true;
@@ -207,7 +218,7 @@
@Override
public String toString() {
- return getAddress() + ":" + getSipPort() + ":" + getRmiPort();
+ return getAddress() + ":" + getSipPort() + ":" + getHttpPort()+ ":" +
getRmiPort();
}
public void switchover(String fromJvmRoute, String toJvmRoute) {
--
---
You received this message because you are subscribed to the Google Groups "mobicents-commits" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.