|
| 1 | +// Licensed to the Apache Software Foundation (ASF) under one |
| 2 | +// or more contributor license agreements. See the NOTICE file |
| 3 | +// distributed with this work for additional information |
| 4 | +// regarding copyright ownership. The ASF licenses this file |
| 5 | +// to you under the Apache License, Version 2.0 (the |
| 6 | +// "License"); you may not use this file except in compliance |
| 7 | +// with the License. You may obtain a copy of the License at |
| 8 | +// |
| 9 | +// http://www.apache.org/licenses/LICENSE-2.0 |
| 10 | +// |
| 11 | +// Unless required by applicable law or agreed to in writing, |
| 12 | +// software distributed under the License is distributed on an |
| 13 | +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY |
| 14 | +// KIND, either express or implied. See the License for the |
| 15 | +// specific language governing permissions and limitations |
| 16 | +// under the License. |
| 17 | +package com.cloud.usage; |
| 18 | + |
| 19 | +import javax.persistence.Column; |
| 20 | +import javax.persistence.Entity; |
| 21 | +import javax.persistence.GeneratedValue; |
| 22 | +import javax.persistence.GenerationType; |
| 23 | +import javax.persistence.Id; |
| 24 | +import javax.persistence.Table; |
| 25 | +import javax.persistence.Temporal; |
| 26 | +import javax.persistence.TemporalType; |
| 27 | +import org.apache.cloudstack.api.InternalIdentity; |
| 28 | + |
| 29 | +import java.util.Date; |
| 30 | + |
| 31 | +@Entity |
| 32 | +@Table(name = "usage_networks") |
| 33 | +public class UsageNetworksVO implements InternalIdentity { |
| 34 | + @Id |
| 35 | + @GeneratedValue(strategy = GenerationType.IDENTITY) |
| 36 | + @Column(name = "id") |
| 37 | + private long id; |
| 38 | + |
| 39 | + @Column(name = "network_id") |
| 40 | + private long networkId; |
| 41 | + |
| 42 | + @Column(name = "network_offering_id") |
| 43 | + private long networkOfferingId; |
| 44 | + |
| 45 | + @Column(name = "zone_id") |
| 46 | + private long zoneId; |
| 47 | + |
| 48 | + @Column(name = "account_id") |
| 49 | + private long accountId; |
| 50 | + |
| 51 | + @Column(name = "domain_id") |
| 52 | + private long domainId; |
| 53 | + |
| 54 | + @Column(name = "state") |
| 55 | + private String state; |
| 56 | + |
| 57 | + @Column(name = "created") |
| 58 | + @Temporal(value = TemporalType.TIMESTAMP) |
| 59 | + private Date created = null; |
| 60 | + |
| 61 | + @Column(name = "removed") |
| 62 | + @Temporal(value = TemporalType.TIMESTAMP) |
| 63 | + private Date removed = null; |
| 64 | + |
| 65 | + protected UsageNetworksVO() { |
| 66 | + } |
| 67 | + |
| 68 | + public UsageNetworksVO(long id, long networkId, long networkOfferingId, long zoneId, long accountId, long domainId, String state, Date created, Date removed) { |
| 69 | + this.id = id; |
| 70 | + this.networkId = networkId; |
| 71 | + this.networkOfferingId = networkOfferingId; |
| 72 | + this.zoneId = zoneId; |
| 73 | + this.domainId = domainId; |
| 74 | + this.accountId = accountId; |
| 75 | + this.state = state; |
| 76 | + this.created = created; |
| 77 | + this.removed = removed; |
| 78 | + } |
| 79 | + |
| 80 | + public UsageNetworksVO(long networkId, long networkOfferingId, long zoneId, long accountId, long domainId, String state, Date created, Date removed) { |
| 81 | + this.networkId = networkId; |
| 82 | + this.networkOfferingId = networkOfferingId; |
| 83 | + this.zoneId = zoneId; |
| 84 | + this.domainId = domainId; |
| 85 | + this.accountId = accountId; |
| 86 | + this.state = state; |
| 87 | + this.created = created; |
| 88 | + this.removed = removed; |
| 89 | + } |
| 90 | + |
| 91 | + @Override |
| 92 | + public long getId() { |
| 93 | + return id; |
| 94 | + } |
| 95 | + |
| 96 | + public long getZoneId() { |
| 97 | + return zoneId; |
| 98 | + } |
| 99 | + |
| 100 | + public long getAccountId() { |
| 101 | + return accountId; |
| 102 | + } |
| 103 | + |
| 104 | + public long getDomainId() { |
| 105 | + return domainId; |
| 106 | + } |
| 107 | + |
| 108 | + public long getNetworkId() { |
| 109 | + return networkId; |
| 110 | + } |
| 111 | + |
| 112 | + public void setNetworkId(long networkId) { |
| 113 | + this.networkId = networkId; |
| 114 | + } |
| 115 | + |
| 116 | + public long getNetworkOfferingId() { |
| 117 | + return networkOfferingId; |
| 118 | + } |
| 119 | + |
| 120 | + public void setNetworkOfferingId(long networkOfferingId) { |
| 121 | + this.networkOfferingId = networkOfferingId; |
| 122 | + } |
| 123 | + |
| 124 | + public String getState() { |
| 125 | + return state; |
| 126 | + } |
| 127 | + |
| 128 | + public void setState(String state) { |
| 129 | + this.state = state; |
| 130 | + } |
| 131 | + |
| 132 | + public Date getCreated() { |
| 133 | + return created; |
| 134 | + } |
| 135 | + |
| 136 | + public Date getRemoved() { |
| 137 | + return removed; |
| 138 | + } |
| 139 | + |
| 140 | + public void setRemoved(Date removed) { |
| 141 | + this.removed = removed; |
| 142 | + } |
| 143 | +} |
0 commit comments