// Copyright 2012 Citrix Systems, Inc. Licensed under the
// Apache License, Version 2.0 (the "License"); you may not use this
// file except in compliance with the License. Citrix Systems, Inc.
// reserves all rights not expressly granted by 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.
//
// Automatically generated by addcopyright.py at 04/03/2012
package com.cloud.vm;
import java.util.Date;
import javax.persistence.Column;
import javax.persistence.DiscriminatorValue;
import javax.persistence.Entity;
import javax.persistence.PrimaryKeyJoinColumn;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import javax.persistence.Transient;
import com.cloud.hypervisor.Hypervisor.HypervisorType;
/**
* ConsoleProxyVO domain object
*/
@Entity
@Table(name = "console_proxy")
@PrimaryKeyJoinColumn(name = "id")
@DiscriminatorValue(value = "ConsoleProxy")
public class ConsoleProxyVO extends VMInstanceVO implements ConsoleProxy {
@Column(name = "public_ip_address", nullable = false)
private String publicIpAddress;
@Column(name = "public_mac_address", nullable = false)
private String publicMacAddress;
@Column(name = "public_netmask", nullable = false)
private String publicNetmask;
@Column(name = "active_session", updatable = true, nullable = false)
private int activeSession;
@Temporal(TemporalType.TIMESTAMP)
@Column(name = "last_update", updatable = true, nullable = true)
private Date lastUpdateTime;
@Column(name = "session_details", updatable = true, nullable = true)
private byte[] sessionDetails;
@Transient
private boolean sslEnabled = false;
@Transient
private int port;
/**
* Correct constructor to use.
*
*/
public ConsoleProxyVO(long id, long serviceOfferingId, String name, long templateId, HypervisorType hypervisorType, long guestOSId, long dataCenterId, long domainId, long accountId,
int activeSession, boolean haEnabled) {
super(id, serviceOfferingId, name, name, Type.ConsoleProxy, templateId, hypervisorType, guestOSId, domainId, accountId, haEnabled);
this.activeSession = activeSession;
}
protected ConsoleProxyVO() {
super();
}
public void setPublicIpAddress(String publicIpAddress) {
this.publicIpAddress = publicIpAddress;
}
public void setPublicNetmask(String publicNetmask) {
this.publicNetmask = publicNetmask;
}
public void setPublicMacAddress(String publicMacAddress) {
this.publicMacAddress = publicMacAddress;
}
public void setActiveSession(int activeSession) {
this.activeSession = activeSession;
}
public void setLastUpdateTime(Date time) {
this.lastUpdateTime = time;
}
public void setSessionDetails(byte[] details) {
this.sessionDetails = details;
}
@Override
public String getPublicIpAddress() {
return this.publicIpAddress;
}
@Override
public String getPublicNetmask() {
return this.publicNetmask;
}
@Override
public String getPublicMacAddress() {
return this.publicMacAddress;
}
@Override
public int getActiveSession() {
return this.activeSession;
}
@Override
public Date getLastUpdateTime() {
return this.lastUpdateTime;
}
@Override
public byte[] getSessionDetails() {
return this.sessionDetails;
}
public boolean isSslEnabled() {
return sslEnabled;
}
public void setSslEnabled(boolean sslEnabled) {
this.sslEnabled = sslEnabled;
}
public void setPort(int port) {
this.port = port;
}
public int getPort() {
return port;
}
}