diff --git a/engine/orchestration/src/org/apache/cloudstack/engine/datacenter/entity/api/db/ClusterDetailsVO.java b/engine/orchestration/src/org/apache/cloudstack/engine/datacenter/entity/api/db/ClusterDetailsVO.java index d735c47dc18..7c10de613a9 100644 --- a/engine/orchestration/src/org/apache/cloudstack/engine/datacenter/entity/api/db/ClusterDetailsVO.java +++ b/engine/orchestration/src/org/apache/cloudstack/engine/datacenter/entity/api/db/ClusterDetailsVO.java @@ -1,15 +1,19 @@ -// 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 +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with 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. package org.apache.cloudstack.engine.datacenter.entity.api.db; import javax.persistence.Column; @@ -27,19 +31,19 @@ public class ClusterDetailsVO { @GeneratedValue(strategy=GenerationType.IDENTITY) @Column(name="id") private long id; - + @Column(name="cluster_id") private long clusterId; - + @Column(name="name") private String name; - + @Column(name="value") private String value; - + protected ClusterDetailsVO() { } - + public ClusterDetailsVO(long clusterId, String name, String value) { this.clusterId = clusterId; this.name = name; diff --git a/engine/orchestration/src/org/apache/cloudstack/engine/datacenter/entity/api/db/DcDetailVO.java b/engine/orchestration/src/org/apache/cloudstack/engine/datacenter/entity/api/db/DcDetailVO.java index ef59118ef81..903d39413bd 100644 --- a/engine/orchestration/src/org/apache/cloudstack/engine/datacenter/entity/api/db/DcDetailVO.java +++ b/engine/orchestration/src/org/apache/cloudstack/engine/datacenter/entity/api/db/DcDetailVO.java @@ -1,15 +1,19 @@ -// 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 +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with 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. package org.apache.cloudstack.engine.datacenter.entity.api.db; import javax.persistence.Column; @@ -26,19 +30,19 @@ public class DcDetailVO { @GeneratedValue(strategy=GenerationType.IDENTITY) @Column(name="id") private long id; - + @Column(name="dc_id") private long dcId; - + @Column(name="name") private String name; - + @Column(name="value") private String value; - + protected DcDetailVO() { } - + public DcDetailVO(long dcId, String name, String value) { this.dcId = dcId; this.name = name; diff --git a/engine/orchestration/src/org/apache/cloudstack/engine/datacenter/entity/api/db/EngineClusterVO.java b/engine/orchestration/src/org/apache/cloudstack/engine/datacenter/entity/api/db/EngineClusterVO.java index 21db144caee..86453a63af2 100644 --- a/engine/orchestration/src/org/apache/cloudstack/engine/datacenter/entity/api/db/EngineClusterVO.java +++ b/engine/orchestration/src/org/apache/cloudstack/engine/datacenter/entity/api/db/EngineClusterVO.java @@ -1,15 +1,19 @@ -// 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 +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with 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. package org.apache.cloudstack.engine.datacenter.entity.api.db; import java.util.Date; @@ -239,5 +243,5 @@ public class EngineClusterVO implements EngineCluster, Identity { public State getState() { return state; - } + } } diff --git a/engine/orchestration/src/org/apache/cloudstack/engine/datacenter/entity/api/db/EngineDataCenterVO.java b/engine/orchestration/src/org/apache/cloudstack/engine/datacenter/entity/api/db/EngineDataCenterVO.java index 4ac0662692a..84f20c15309 100644 --- a/engine/orchestration/src/org/apache/cloudstack/engine/datacenter/entity/api/db/EngineDataCenterVO.java +++ b/engine/orchestration/src/org/apache/cloudstack/engine/datacenter/entity/api/db/EngineDataCenterVO.java @@ -1,15 +1,19 @@ -// 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. +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at // -// Automatically generated by addcopyright.py at 04/03/2012 +// 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. package org.apache.cloudstack.engine.datacenter.entity.api.db; import java.util.Date; @@ -86,7 +90,7 @@ public class EngineDataCenterVO implements EngineDataCenter, Identity { private String domain; @Column(name="networktype") - @Enumerated(EnumType.STRING) + @Enumerated(EnumType.STRING) NetworkType networkType; @Column(name="dns_provider") @@ -115,7 +119,7 @@ public class EngineDataCenterVO implements EngineDataCenter, Identity { private long macAddress = 1; @Column(name="zone_token") - private String zoneToken; + private String zoneToken; @Column(name=GenericDao.REMOVED_COLUMN) private Date removed; @@ -131,7 +135,7 @@ public class EngineDataCenterVO implements EngineDataCenter, Identity { AllocationState allocationState; @Column(name="uuid") - private String uuid; + private String uuid; @Column(name="is_security_group_enabled") boolean securityGroupEnabled; @@ -199,7 +203,7 @@ public class EngineDataCenterVO implements EngineDataCenter, Identity { @Override public String getFirewallProvider() { - return firewallProvider; + return firewallProvider; } public void setFirewallProvider(String firewallProvider) { @@ -371,7 +375,7 @@ public class EngineDataCenterVO implements EngineDataCenter, Identity { return networkType; } - @Override + @Override public boolean isSecurityGroupEnabled() { return securityGroupEnabled; } @@ -396,7 +400,7 @@ public class EngineDataCenterVO implements EngineDataCenter, Identity { @Override public void setDetails(Map details2) { - details = details2; + details = details2; } public String getDetail(String name) { diff --git a/engine/orchestration/src/org/apache/cloudstack/engine/datacenter/entity/api/db/EngineHostPodVO.java b/engine/orchestration/src/org/apache/cloudstack/engine/datacenter/entity/api/db/EngineHostPodVO.java index 9fcc349da16..8c6b2d6428d 100644 --- a/engine/orchestration/src/org/apache/cloudstack/engine/datacenter/entity/api/db/EngineHostPodVO.java +++ b/engine/orchestration/src/org/apache/cloudstack/engine/datacenter/entity/api/db/EngineHostPodVO.java @@ -1,15 +1,19 @@ -// 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. +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at // -// Automatically generated by addcopyright.py at 04/03/2012 +// 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. package org.apache.cloudstack.engine.datacenter.entity.api.db; import java.util.Date; @@ -82,7 +86,7 @@ public class EngineHostPodVO implements EnginePod, Identity { @Column(name="lastUpdated", updatable=true) @Temporal(value=TemporalType.TIMESTAMP) - protected Date lastUpdated; + protected Date lastUpdated; /** * Note that state is intentionally missing the setter. Any updates to diff --git a/engine/orchestration/src/org/apache/cloudstack/engine/datacenter/entity/api/db/dao/DcDetailsDao.java b/engine/orchestration/src/org/apache/cloudstack/engine/datacenter/entity/api/db/dao/DcDetailsDao.java index ef1b3a0a57e..fc7636a86f8 100644 --- a/engine/orchestration/src/org/apache/cloudstack/engine/datacenter/entity/api/db/dao/DcDetailsDao.java +++ b/engine/orchestration/src/org/apache/cloudstack/engine/datacenter/entity/api/db/dao/DcDetailsDao.java @@ -1,15 +1,19 @@ -// 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 +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with 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. package org.apache.cloudstack.engine.datacenter.entity.api.db.dao; import java.util.Map; @@ -18,11 +22,11 @@ import org.apache.cloudstack.engine.datacenter.entity.api.db.DcDetailVO; import com.cloud.utils.db.GenericDao; -public interface DcDetailsDao extends GenericDao { +public interface DcDetailsDao extends GenericDao { Map findDetails(long dcId); - + void persist(long dcId, Map details); - + DcDetailVO findDetail(long dcId, String name); void deleteDetails(long dcId); diff --git a/engine/orchestration/src/org/apache/cloudstack/engine/datacenter/entity/api/db/dao/DcDetailsDaoImpl.java b/engine/orchestration/src/org/apache/cloudstack/engine/datacenter/entity/api/db/dao/DcDetailsDaoImpl.java index 60eec4cf913..2ace8a0fbcb 100644 --- a/engine/orchestration/src/org/apache/cloudstack/engine/datacenter/entity/api/db/dao/DcDetailsDaoImpl.java +++ b/engine/orchestration/src/org/apache/cloudstack/engine/datacenter/entity/api/db/dao/DcDetailsDaoImpl.java @@ -1,15 +1,19 @@ -// 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 +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with 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. package org.apache.cloudstack.engine.datacenter.entity.api.db.dao; import java.util.HashMap; @@ -32,12 +36,12 @@ import com.cloud.utils.db.Transaction; public class DcDetailsDaoImpl extends GenericDaoBase implements DcDetailsDao { protected final SearchBuilder DcSearch; protected final SearchBuilder DetailSearch; - + protected DcDetailsDaoImpl() { DcSearch = createSearchBuilder(); DcSearch.and("dcId", DcSearch.entity().getDcId(), SearchCriteria.Op.EQ); DcSearch.done(); - + DetailSearch = createSearchBuilder(); DetailSearch.and("dcId", DetailSearch.entity().getDcId(), SearchCriteria.Op.EQ); DetailSearch.and("name", DetailSearch.entity().getName(), SearchCriteria.Op.EQ); @@ -49,7 +53,7 @@ public class DcDetailsDaoImpl extends GenericDaoBase implement SearchCriteria sc = DetailSearch.create(); sc.setParameters("dcId", dcId); sc.setParameters("name", name); - + return findOneIncludingRemovedBy(sc); } @@ -57,7 +61,7 @@ public class DcDetailsDaoImpl extends GenericDaoBase implement public Map findDetails(long dcId) { SearchCriteria sc = DcSearch.create(); sc.setParameters("dcId", dcId); - + List results = search(sc, null); Map details = new HashMap(results.size()); for (DcDetailVO result : results) { @@ -65,12 +69,12 @@ public class DcDetailsDaoImpl extends GenericDaoBase implement } return details; } - + @Override public void deleteDetails(long dcId) { SearchCriteria sc = DcSearch.create(); sc.setParameters("dcId", dcId); - + List results = search(sc, null); for (DcDetailVO result : results) { remove(result.getId()); @@ -84,7 +88,7 @@ public class DcDetailsDaoImpl extends GenericDaoBase implement SearchCriteria sc = DcSearch.create(); sc.setParameters("dcId", dcId); expunge(sc); - + for (Map.Entry detail : details.entrySet()) { DcDetailVO vo = new DcDetailVO(dcId, detail.getKey(), detail.getValue()); persist(vo); diff --git a/engine/orchestration/src/org/apache/cloudstack/engine/datacenter/entity/api/db/dao/EngineClusterDao.java b/engine/orchestration/src/org/apache/cloudstack/engine/datacenter/entity/api/db/dao/EngineClusterDao.java index af1b1536e26..4cdad5f42ce 100644 --- a/engine/orchestration/src/org/apache/cloudstack/engine/datacenter/entity/api/db/dao/EngineClusterDao.java +++ b/engine/orchestration/src/org/apache/cloudstack/engine/datacenter/entity/api/db/dao/EngineClusterDao.java @@ -1,15 +1,19 @@ -// 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 +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with 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. package org.apache.cloudstack.engine.datacenter.entity.api.db.dao; import java.util.List; diff --git a/engine/orchestration/src/org/apache/cloudstack/engine/datacenter/entity/api/db/dao/EngineClusterDaoImpl.java b/engine/orchestration/src/org/apache/cloudstack/engine/datacenter/entity/api/db/dao/EngineClusterDaoImpl.java index 1f0bd4d84af..75d0bbddf57 100644 --- a/engine/orchestration/src/org/apache/cloudstack/engine/datacenter/entity/api/db/dao/EngineClusterDaoImpl.java +++ b/engine/orchestration/src/org/apache/cloudstack/engine/datacenter/entity/api/db/dao/EngineClusterDaoImpl.java @@ -1,15 +1,19 @@ -// 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 +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with 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. package org.apache.cloudstack.engine.datacenter.entity.api.db.dao; import java.sql.PreparedStatement; @@ -35,7 +39,6 @@ import org.springframework.stereotype.Component; import com.cloud.hypervisor.Hypervisor.HypervisorType; import com.cloud.org.Grouping; import com.cloud.utils.db.GenericDaoBase; -import com.cloud.utils.db.GenericSearchBuilder; import com.cloud.utils.db.JoinBuilder; import com.cloud.utils.db.SearchBuilder; import com.cloud.utils.db.SearchCriteria; @@ -98,13 +101,13 @@ public class EngineClusterDaoImpl extends GenericDaoBase StateChangeSearch = createSearchBuilder(); StateChangeSearch.and("id", StateChangeSearch.entity().getId(), SearchCriteria.Op.EQ); StateChangeSearch.and("state", StateChangeSearch.entity().getState(), SearchCriteria.Op.EQ); - StateChangeSearch.done(); + StateChangeSearch.done(); } @Override public List listByZoneId(long zoneId) { SearchCriteria sc = ZoneSearch.create(); - sc.setParameters("dataCenterId", zoneId); + sc.setParameters("dataCenterId", zoneId); return listBy(sc); } @@ -254,9 +257,9 @@ public class EngineClusterDaoImpl extends GenericDaoBase @Override public boolean updateState(State currentState, Event event, State nextState, DataCenterResourceEntity clusterEntity, Object data) { - + EngineClusterVO vo = findById(clusterEntity.getId()); - + Date oldUpdatedTime = vo.getLastUpdated(); SearchCriteria sc = StateChangeSearch.create(); diff --git a/engine/orchestration/src/org/apache/cloudstack/engine/datacenter/entity/api/db/dao/EngineDataCenterDao.java b/engine/orchestration/src/org/apache/cloudstack/engine/datacenter/entity/api/db/dao/EngineDataCenterDao.java index 83060cfee2f..10fe70d3ccc 100644 --- a/engine/orchestration/src/org/apache/cloudstack/engine/datacenter/entity/api/db/dao/EngineDataCenterDao.java +++ b/engine/orchestration/src/org/apache/cloudstack/engine/datacenter/entity/api/db/dao/EngineDataCenterDao.java @@ -1,15 +1,19 @@ -// 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 +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with 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. package org.apache.cloudstack.engine.datacenter.entity.api.db.dao; import java.util.List; @@ -24,7 +28,7 @@ import com.cloud.utils.fsm.StateDao; public interface EngineDataCenterDao extends GenericDao, StateDao { EngineDataCenterVO findByName(String name); - + /** * @param id data center id * @return a pair of mac address strings. The first one is private and second is public. @@ -39,13 +43,13 @@ public interface EngineDataCenterDao extends GenericDao listDisabledZones(); List listEnabledZones(); - EngineDataCenterVO findByToken(String zoneToken); + EngineDataCenterVO findByToken(String zoneToken); EngineDataCenterVO findByTokenOrIdOrName(String tokenIdOrName); - + List findZonesByDomainId(Long domainId, String keyword); diff --git a/engine/orchestration/src/org/apache/cloudstack/engine/datacenter/entity/api/db/dao/EngineDataCenterDaoImpl.java b/engine/orchestration/src/org/apache/cloudstack/engine/datacenter/entity/api/db/dao/EngineDataCenterDaoImpl.java index f99bc6c0c09..5d8ef8d3243 100644 --- a/engine/orchestration/src/org/apache/cloudstack/engine/datacenter/entity/api/db/dao/EngineDataCenterDaoImpl.java +++ b/engine/orchestration/src/org/apache/cloudstack/engine/datacenter/entity/api/db/dao/EngineDataCenterDaoImpl.java @@ -1,15 +1,19 @@ -// 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 +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with 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. package org.apache.cloudstack.engine.datacenter.entity.api.db.dao; import java.util.Date; @@ -75,7 +79,7 @@ public class EngineDataCenterDaoImpl extends GenericDaoBase sc = TokenSearch.create(); @@ -87,7 +91,7 @@ public class EngineDataCenterDaoImpl extends GenericDaoBase findZonesByDomainId(Long domainId){ SearchCriteria sc = ListZonesByDomainIdSearch.create(); sc.setParameters("domainId", domainId); - return listBy(sc); + return listBy(sc); } @Override @@ -100,7 +104,7 @@ public class EngineDataCenterDaoImpl extends GenericDaoBase UUIDSearch = createSearchBuilder(); UUIDSearch.and("uuid", UUIDSearch.entity().getUuid(), SearchCriteria.Op.EQ); UUIDSearch.done(); - + StateChangeSearch = createSearchBuilder(); StateChangeSearch.and("id", StateChangeSearch.entity().getId(), SearchCriteria.Op.EQ); StateChangeSearch.and("state", StateChangeSearch.entity().getState(), SearchCriteria.Op.EQ); @@ -123,7 +126,7 @@ public class EngineHostPodDaoImpl extends GenericDaoBase txn.start(); EngineHostPodVO pod = createForUpdate(); pod.setName(null); - + update(id, pod); boolean result = super.remove(id); @@ -139,7 +142,7 @@ public class EngineHostPodDaoImpl extends GenericDaoBase podIdSearch.and("allocationState", podIdSearch.entity().getAllocationState(), Op.EQ); podIdSearch.done(); - + SearchCriteria sc = podIdSearch.create(); sc.addAnd("dataCenterId", SearchCriteria.Op.EQ, zoneId); sc.addAnd("allocationState", SearchCriteria.Op.EQ, Grouping.AllocationState.Disabled); @@ -149,9 +152,9 @@ public class EngineHostPodDaoImpl extends GenericDaoBase @Override public boolean updateState(State currentState, Event event, State nextState, DataCenterResourceEntity podEntity, Object data) { - + EngineHostPodVO vo = findById(podEntity.getId()); - + Date oldUpdatedTime = vo.getLastUpdated(); SearchCriteria sc = StateChangeSearch.create(); @@ -163,7 +166,7 @@ public class EngineHostPodDaoImpl extends GenericDaoBase builder.set(vo, "lastUpdated", new Date()); int rows = update((EngineHostPodVO) vo, sc); - + if (rows == 0 && s_logger.isDebugEnabled()) { EngineHostPodVO dbDC = findByIdIncludingRemoved(vo.getId()); if (dbDC != null) { @@ -177,7 +180,7 @@ public class EngineHostPodDaoImpl extends GenericDaoBase } } return rows > 0; - + }