mirror of https://github.com/apache/cloudstack.git
98 lines
2.7 KiB
Java
98 lines
2.7 KiB
Java
/**
|
|
* Copyright (C) 2010 Cloud.com, Inc. All rights reserved.
|
|
*
|
|
* This software is licensed under the GNU General Public License v3 or later.
|
|
*
|
|
* It is free software: you can redistribute it and/or modify
|
|
* it under the terms of the GNU General Public License as published by
|
|
* the Free Software Foundation, either version 3 of the License, or any later version.
|
|
* This program is distributed in the hope that it will be useful,
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
* GNU General Public License for more details.
|
|
*
|
|
* You should have received a copy of the GNU General Public License
|
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
*
|
|
*/
|
|
|
|
package com.cloud.network;
|
|
|
|
import java.util.List;
|
|
|
|
import javax.persistence.Column;
|
|
import javax.persistence.DiscriminatorValue;
|
|
import javax.persistence.Entity;
|
|
import javax.persistence.PrimaryKeyJoinColumn;
|
|
import javax.persistence.Table;
|
|
|
|
import com.cloud.network.rules.FirewallRuleVO;
|
|
import com.cloud.network.rules.LoadBalancer;
|
|
import com.cloud.utils.net.Ip;
|
|
import com.cloud.utils.net.NetUtils;
|
|
|
|
@Entity
|
|
@Table(name=("load_balancer"))
|
|
@DiscriminatorValue(value="LoadBalancing")
|
|
@PrimaryKeyJoinColumn(name="id")
|
|
public class LoadBalancerVO extends FirewallRuleVO implements LoadBalancer {
|
|
|
|
@Column(name="name")
|
|
private String name;
|
|
|
|
@Column(name="description")
|
|
private String description;
|
|
|
|
@Column(name="algorithm")
|
|
private String algorithm;
|
|
|
|
@Column(name="dest_port_start")
|
|
private int defaultPortStart;
|
|
|
|
@Column(name="dest_port_end")
|
|
private int defaultPortEnd;
|
|
|
|
public LoadBalancerVO() {
|
|
}
|
|
|
|
public LoadBalancerVO(String xId, String name, String description, Ip srcIp, int srcPort, int dstPort, String algorithm, long networkId, long accountId, long domainId) {
|
|
super(xId, srcIp, srcPort, NetUtils.TCP_PROTO, networkId, accountId, domainId, Purpose.LoadBalancing);
|
|
this.name = name;
|
|
this.description = description;
|
|
this.algorithm = algorithm;
|
|
this.defaultPortStart = dstPort;
|
|
this.defaultPortEnd = dstPort;
|
|
}
|
|
|
|
@Override
|
|
public String getName() {
|
|
return name;
|
|
}
|
|
|
|
@Override
|
|
public String getDescription() {
|
|
return description;
|
|
}
|
|
|
|
@Override
|
|
public String getAlgorithm() {
|
|
return algorithm;
|
|
}
|
|
|
|
@Override
|
|
public int getDefaultPortStart() {
|
|
return defaultPortStart;
|
|
}
|
|
|
|
@Override
|
|
public int getDefaultPortEnd() {
|
|
return defaultPortEnd;
|
|
}
|
|
|
|
@Override
|
|
public List<? extends Destination> getDestinations() {
|
|
// TODO Auto-generated method stub
|
|
return null;
|
|
}
|
|
}
|