blob: 6cbf9fabb7b08d1bdf75ab54a4a6a5e0c8428783 [file] [log] [blame]
/**
* Copyright (C) 2011 Citrix Systems, 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.Date;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Table;
import com.cloud.network.Network.Provider;
import com.cloud.network.Network.Service;
import com.cloud.utils.db.GenericDao;
@Entity
@Table(name="ntwk_service_map")
public class NetworkServiceMapVO {
@Id
@GeneratedValue(strategy=GenerationType.IDENTITY)
@Column(name="id")
long id;
@Column(name="network_id")
long networkId;
@Column(name="service")
String service;
@Column(name="provider")
String provider;
@Column(name=GenericDao.CREATED_COLUMN)
Date created;
public long getId() {
return id;
}
public long getNetworkId() {
return networkId;
}
public String getService() {
return service;
}
public String getProvider() {
return provider;
}
public Date getCreated() {
return created;
}
public NetworkServiceMapVO() {
}
public NetworkServiceMapVO(long networkId, Service service, Provider provider) {
this.networkId = networkId;
this.service = service.getName();
this.provider = provider.getName();
}
public String toString() {
StringBuilder buf = new StringBuilder("[Network Service[");
return buf.append(networkId).append("-").append(service).append("-").append(provider).append("]").toString();
}
}