cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From t..@apache.org
Subject [05/90] [abbrv] [partial] Moved most of the VOs and DAOs from server package into engine-schema as well
Date Wed, 08 May 2013 11:59:34 GMT
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/572e71e5/server/src/com/cloud/projects/ProjectInvitationVO.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/projects/ProjectInvitationVO.java b/server/src/com/cloud/projects/ProjectInvitationVO.java
deleted file mode 100644
index 78f05c7..0000000
--- a/server/src/com/cloud/projects/ProjectInvitationVO.java
+++ /dev/null
@@ -1,150 +0,0 @@
-// 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 com.cloud.projects;
-
-import java.util.Date;
-import java.util.UUID;
-
-import javax.persistence.Column;
-import javax.persistence.Entity;
-import javax.persistence.EnumType;
-import javax.persistence.Enumerated;
-import javax.persistence.GeneratedValue;
-import javax.persistence.GenerationType;
-import javax.persistence.Id;
-import javax.persistence.Table;
-
-import org.apache.cloudstack.api.Identity;
-import com.cloud.utils.db.GenericDao;
-import org.apache.cloudstack.api.InternalIdentity;
-
-@Entity
-@Table(name = "project_invitations")
-public class ProjectInvitationVO implements ProjectInvitation {
-    @Id
-    @GeneratedValue(strategy = GenerationType.IDENTITY)
-    @Column(name = "id")
-    private long id;
-
-    @Column(name = "project_id")
-    private long projectId;
-
-    @Column(name = "account_id")
-    private Long forAccountId;
-
-    @Column(name = "domain_id")
-    private Long inDomainId;
-
-    @Column(name = "token")
-    private String token;
-
-    @Column(name = "email")
-    private String email;
-
-    @Column(name = "state")
-    @Enumerated(value = EnumType.STRING)
-    private State state = State.Pending;
-
-    @Column(name = GenericDao.CREATED_COLUMN)
-    private Date created;
-
-    @Column(name = "uuid")
-    private String uuid;
-
-    protected ProjectInvitationVO() {
-        this.uuid = UUID.randomUUID().toString();
-    }
-
-    public ProjectInvitationVO(long projectId, Long accountId, Long domainId, String email, String token) {
-        this.forAccountId = accountId;
-        this.inDomainId = domainId;
-        this.projectId = projectId;
-        this.email = email;
-        this.token = token;
-        this.uuid = UUID.randomUUID().toString();
-    }
-
-    @Override
-    public long getId() {
-        return id;
-    }
-
-    @Override
-    public long getProjectId() {
-        return projectId;
-    }
-
-    @Override
-    public Long getForAccountId() {
-        return forAccountId;
-    }
-
-    @Override
-    public String getToken() {
-        return token;
-    }
-
-    @Override
-    public String getEmail() {
-        return email;
-    }
-
-    @Override
-    public Date getCreated() {
-        return created;
-    }
-
-    @Override
-    public State getState() {
-        return state;
-    }
-
-    public void setState(State state) {
-        this.state = state;
-    }
-
-    @Override
-    public String toString() {
-        StringBuilder buf = new StringBuilder("ProjectInvitation[");
-        buf.append(id).append("|projectId=").append(projectId).append("|accountId=").append(forAccountId).append("]");
-        return buf.toString();
-    }
-
-    @Override
-    public Long getInDomainId() {
-        return inDomainId;
-    }
-
-    @Override
-    public String getUuid() {
-        return this.uuid;
-    }
-
-    public void setUuid(String uuid) {
-        this.uuid = uuid;
-    }
-
-    @Override
-    public long getDomainId() {
-        return inDomainId == null ? -1 : inDomainId;
-    }
-
-    @Override
-    public long getAccountId() {
-        return forAccountId == null ? -1 : forAccountId;
-    }
-}

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/572e71e5/server/src/com/cloud/projects/ProjectVO.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/projects/ProjectVO.java b/server/src/com/cloud/projects/ProjectVO.java
deleted file mode 100644
index 53947f1..0000000
--- a/server/src/com/cloud/projects/ProjectVO.java
+++ /dev/null
@@ -1,163 +0,0 @@
-// 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 com.cloud.projects;
-
-import java.util.Date;
-import java.util.UUID;
-
-import javax.persistence.Column;
-import javax.persistence.Entity;
-import javax.persistence.EnumType;
-import javax.persistence.Enumerated;
-import javax.persistence.GeneratedValue;
-import javax.persistence.GenerationType;
-import javax.persistence.Id;
-import javax.persistence.Table;
-
-import org.apache.cloudstack.api.Identity;
-import com.cloud.utils.db.GenericDao;
-import org.apache.cloudstack.api.InternalIdentity;
-
-@Entity
-@Table(name="projects")
-public class ProjectVO implements Project, Identity, InternalIdentity {
-    @Id
-    @GeneratedValue(strategy=GenerationType.IDENTITY)
-    @Column(name="id")
-    private long id;
-    
-    @Column(name="name")
-    private String name;
-    
-    @Column(name="display_text")
-    String displayText;
-    
-    @Column(name="domain_id")
-    long domainId;
-
-    @Column(name="project_account_id")
-    long projectAccountId;
-    
-    @Column(name="state")
-    @Enumerated(value=EnumType.STRING)
-    private State state;
-    
-    @Column(name=GenericDao.CREATED_COLUMN)
-    private Date created;
-    
-    @Column(name=GenericDao.REMOVED_COLUMN)
-    private Date removed;
-    
-    @Column(name="uuid")
-    private String uuid;
-    
-    protected ProjectVO(){
-    	this.uuid = UUID.randomUUID().toString();
-    }
-    
-    public ProjectVO(String name, String displayText, long domainId, long projectAccountId) {
-        this.name = name;
-        this.displayText = displayText;
-        this.projectAccountId = projectAccountId;
-        this.domainId = domainId;
-        this.state = State.Disabled;
-    	this.uuid = UUID.randomUUID().toString();
-    }
-    
-    @Override
-    public String getName() {
-        return name;
-    }
-
-    @Override
-    public String getDisplayText() {
-        return displayText;
-    }
-
-    public void setDisplayText(String displayText) {
-        this.displayText = displayText;
-    }
-
-    @Override
-    public long getDomainId() {
-        return domainId;
-    }
-
-    @Override
-    public long getId() {
-        return id;
-    }
-
-    @Override
-    public Date getCreated() {
-        return created;
-    }
-
-    @Override
-    public Date getRemoved() {
-        return removed;
-    }
-
-    @Override
-    public String toString() {
-        StringBuilder buf = new StringBuilder("Project[");
-        buf.append(id).append("|name=").append(name).append("|domainid=").append(domainId).append("]");
-        return buf.toString();
-    }
-    
-    @Override
-    public boolean equals(Object obj) {
-        if (!(obj instanceof ProjectVO)) {
-            return false;
-        }
-        ProjectVO that = (ProjectVO)obj;
-        if (this.id != that.id) {
-            return false;
-        }
-        
-        return true;
-    }
-
-    @Override
-    public long getProjectAccountId() {
-        return projectAccountId;
-    }
-
-    public void setName(String name) {
-        this.name = name;
-    }
-
-    @Override
-    public State getState() {
-        return state;
-    }
-
-    @Override
-    public void setState(State state) {
-        this.state = state;
-    }
-    
-    @Override
-    public String getUuid() {
-    	return this.uuid; 
-    }
-    
-    public void setUuid(String uuid) {
-    	this.uuid = uuid;
-    }
-    
-}

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/572e71e5/server/src/com/cloud/projects/dao/ProjectAccountDao.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/projects/dao/ProjectAccountDao.java b/server/src/com/cloud/projects/dao/ProjectAccountDao.java
deleted file mode 100644
index 4ff59be..0000000
--- a/server/src/com/cloud/projects/dao/ProjectAccountDao.java
+++ /dev/null
@@ -1,43 +0,0 @@
-// 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 com.cloud.projects.dao;
-
-import java.util.List;
-
-import com.cloud.projects.ProjectAccount;
-import com.cloud.projects.ProjectAccountVO;
-import com.cloud.utils.db.GenericDao;
-
-public interface ProjectAccountDao extends GenericDao<ProjectAccountVO, Long> {
-    ProjectAccountVO getProjectOwner(long projectId);
-
-    List<ProjectAccountVO> listByProjectId(long projectId);
-
-    ProjectAccountVO findByProjectIdAccountId(long projectId, long accountId);
-
-    boolean canAccessProjectAccount(long accountId, long projectAccountId);
-
-    boolean canModifyProjectAccount(long accountId, long projectAccountId);
-
-    List<Long> listPermittedAccountIds(long accountId);
-
-    List<Long> listAdministratedProjectIds(long adminAccountId);
-
-    Long countByAccountIdAndRole(long accountId, ProjectAccount.Role role);
-    
-    void removeAccountFromProjects(long accountId);
-}

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/572e71e5/server/src/com/cloud/projects/dao/ProjectAccountDaoImpl.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/projects/dao/ProjectAccountDaoImpl.java b/server/src/com/cloud/projects/dao/ProjectAccountDaoImpl.java
deleted file mode 100644
index b089e58..0000000
--- a/server/src/com/cloud/projects/dao/ProjectAccountDaoImpl.java
+++ /dev/null
@@ -1,157 +0,0 @@
-// 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 com.cloud.projects.dao;
-
-import java.util.List;
-
-import javax.ejb.Local;
-
-import org.apache.log4j.Logger;
-import org.springframework.stereotype.Component;
-
-import com.cloud.projects.ProjectAccount;
-import com.cloud.projects.ProjectAccountVO;
-import com.cloud.utils.db.GenericDaoBase;
-import com.cloud.utils.db.GenericSearchBuilder;
-import com.cloud.utils.db.SearchBuilder;
-import com.cloud.utils.db.SearchCriteria;
-import com.cloud.utils.db.SearchCriteria.Func;
-import com.cloud.utils.db.SearchCriteria.Op;
-
-@Component
-@Local(value = { ProjectAccountDao.class })
-public class ProjectAccountDaoImpl extends GenericDaoBase<ProjectAccountVO, Long> implements ProjectAccountDao {
-    protected final SearchBuilder<ProjectAccountVO> AllFieldsSearch;
-    final GenericSearchBuilder<ProjectAccountVO, Long> AdminSearch;
-    final GenericSearchBuilder<ProjectAccountVO, Long> ProjectAccountSearch;
-    final GenericSearchBuilder<ProjectAccountVO, Long> CountByRoleSearch;
-    public static final Logger s_logger = Logger.getLogger(ProjectAccountDaoImpl.class.getName());
-
-    protected ProjectAccountDaoImpl() {
-        AllFieldsSearch = createSearchBuilder();
-        AllFieldsSearch.and("role", AllFieldsSearch.entity().getAccountRole(), SearchCriteria.Op.EQ);
-        AllFieldsSearch.and("projectId", AllFieldsSearch.entity().getProjectId(), SearchCriteria.Op.EQ);
-        AllFieldsSearch.and("accountId", AllFieldsSearch.entity().getAccountId(), SearchCriteria.Op.EQ);
-        AllFieldsSearch.and("projectAccountId", AllFieldsSearch.entity().getProjectAccountId(), SearchCriteria.Op.EQ);
-        AllFieldsSearch.done();
-
-        AdminSearch = createSearchBuilder(Long.class);
-        AdminSearch.selectField(AdminSearch.entity().getProjectId());
-        AdminSearch.and("role", AdminSearch.entity().getAccountRole(), Op.EQ);
-        AdminSearch.and("accountId", AdminSearch.entity().getAccountId(), Op.EQ);
-        AdminSearch.done();
-
-        ProjectAccountSearch = createSearchBuilder(Long.class);
-        ProjectAccountSearch.selectField(ProjectAccountSearch.entity().getProjectAccountId());
-        ProjectAccountSearch.and("accountId", ProjectAccountSearch.entity().getAccountId(), Op.EQ);
-        ProjectAccountSearch.done();
-
-        CountByRoleSearch = createSearchBuilder(Long.class);
-        CountByRoleSearch.select(null, Func.COUNT, CountByRoleSearch.entity().getId());
-        CountByRoleSearch.and("accountId", CountByRoleSearch.entity().getAccountId(), Op.EQ);
-        CountByRoleSearch.and("role", CountByRoleSearch.entity().getAccountRole(), Op.EQ);
-        CountByRoleSearch.done();
-    }
-
-    @Override
-    public ProjectAccountVO getProjectOwner(long projectId) {
-        SearchCriteria<ProjectAccountVO> sc = AllFieldsSearch.create();
-        sc.setParameters("role", ProjectAccount.Role.Admin);
-        sc.setParameters("projectId", projectId);
-
-        return findOneBy(sc);
-    }
-
-    @Override
-    public List<ProjectAccountVO> listByProjectId(long projectId) {
-        SearchCriteria<ProjectAccountVO> sc = AllFieldsSearch.create();
-        sc.setParameters("projectId", projectId);
-
-        return listBy(sc);
-    }
-
-    @Override
-    public ProjectAccountVO findByProjectIdAccountId(long projectId, long accountId) {
-        SearchCriteria<ProjectAccountVO> sc = AllFieldsSearch.create();
-        sc.setParameters("projectId", projectId);
-        sc.setParameters("accountId", accountId);
-
-        return findOneBy(sc);
-    }
-
-    @Override
-    public boolean canAccessProjectAccount(long accountId, long projectAccountId) {
-        SearchCriteria<ProjectAccountVO> sc = AllFieldsSearch.create();
-        sc.setParameters("accountId", accountId);
-        sc.setParameters("projectAccountId", projectAccountId);
-
-        if (findOneBy(sc) != null) {
-            return true;
-        } else {
-            return false;
-        }
-    }
-
-    @Override
-    public boolean canModifyProjectAccount(long accountId, long projectAccountId) {
-        SearchCriteria<ProjectAccountVO> sc = AllFieldsSearch.create();
-        sc.setParameters("accountId", accountId);
-        sc.setParameters("projectAccountId", projectAccountId);
-        sc.setParameters("role", ProjectAccount.Role.Admin);
-
-        if (findOneBy(sc) != null) {
-            return true;
-        } else {
-            return false;
-        }
-    }
-
-    @Override
-    public List<Long> listPermittedAccountIds(long accountId) {
-        SearchCriteria<Long> sc = ProjectAccountSearch.create();
-        sc.setParameters("accountId", accountId);
-        return customSearch(sc, null);
-    }
-
-    @Override
-    public List<Long> listAdministratedProjectIds(long adminAccountId) {
-        SearchCriteria<Long> sc = AdminSearch.create();
-        sc.setParameters("role", ProjectAccount.Role.Admin);
-        sc.setParameters("accountId", adminAccountId);
-        return customSearch(sc, null);
-    }
-
-    @Override
-    public Long countByAccountIdAndRole(long accountId, ProjectAccount.Role role) {
-        SearchCriteria<Long> sc = CountByRoleSearch.create();
-        sc.setParameters("accountId", accountId);
-        sc.setParameters("role", role);
-        return customSearch(sc, null).get(0);
-    }
-    
-    @Override
-    public void removeAccountFromProjects(long accountId) {
-        SearchCriteria<ProjectAccountVO> sc = AllFieldsSearch.create();
-        sc.setParameters("accountId", accountId);
-
-        int rowsRemoved = remove(sc);
-        if (rowsRemoved > 0) {
-            s_logger.debug("Removed account id=" + accountId + " from " + rowsRemoved + " projects");
-        }
-    }
-
-}

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/572e71e5/server/src/com/cloud/projects/dao/ProjectDao.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/projects/dao/ProjectDao.java b/server/src/com/cloud/projects/dao/ProjectDao.java
deleted file mode 100644
index e741f24..0000000
--- a/server/src/com/cloud/projects/dao/ProjectDao.java
+++ /dev/null
@@ -1,37 +0,0 @@
-// 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 com.cloud.projects.dao;
-
-import java.util.List;
-
-import com.cloud.projects.Project;
-import com.cloud.projects.ProjectVO;
-import com.cloud.utils.db.GenericDao;
-
-public interface ProjectDao extends GenericDao<ProjectVO, Long> {
-
-    ProjectVO findByNameAndDomain(String name, long domainId);
-
-    Long countProjectsForDomain(long domainId);
-
-    ProjectVO findByProjectAccountId(long projectAccountId);
-
-    List<ProjectVO> listByState(Project.State state);
-    
-    ProjectVO findByProjectAccountIdIncludingRemoved(long projectAccountId);
-
-}

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/572e71e5/server/src/com/cloud/projects/dao/ProjectDaoImpl.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/projects/dao/ProjectDaoImpl.java b/server/src/com/cloud/projects/dao/ProjectDaoImpl.java
deleted file mode 100644
index ecf40da..0000000
--- a/server/src/com/cloud/projects/dao/ProjectDaoImpl.java
+++ /dev/null
@@ -1,124 +0,0 @@
-// 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 com.cloud.projects.dao;
-
-import java.util.List;
-
-import javax.ejb.Local;
-import javax.inject.Inject;
-
-import org.apache.log4j.Logger;
-import org.springframework.stereotype.Component;
-
-import com.cloud.projects.Project;
-import com.cloud.projects.ProjectVO;
-import com.cloud.server.ResourceTag.TaggedResourceType;
-import com.cloud.tags.dao.ResourceTagDao;
-import com.cloud.tags.dao.ResourceTagsDaoImpl;
-
-import com.cloud.utils.db.DB;
-import com.cloud.utils.db.GenericDaoBase;
-import com.cloud.utils.db.GenericSearchBuilder;
-import com.cloud.utils.db.SearchBuilder;
-import com.cloud.utils.db.SearchCriteria;
-import com.cloud.utils.db.SearchCriteria.Func;
-import com.cloud.utils.db.Transaction;
-
-@Component
-@Local(value = { ProjectDao.class })
-public class ProjectDaoImpl extends GenericDaoBase<ProjectVO, Long> implements ProjectDao {
-    private static final Logger s_logger = Logger.getLogger(ProjectDaoImpl.class);
-    protected final SearchBuilder<ProjectVO> AllFieldsSearch;
-    protected GenericSearchBuilder<ProjectVO, Long> CountByDomain;
-    protected GenericSearchBuilder<ProjectVO, Long> ProjectAccountSearch;
-    // ResourceTagsDaoImpl _tagsDao = ComponentLocator.inject(ResourceTagsDaoImpl.class);
-    @Inject ResourceTagDao _tagsDao;
-
-    protected ProjectDaoImpl() {
-        AllFieldsSearch = createSearchBuilder();
-        AllFieldsSearch.and("name", AllFieldsSearch.entity().getName(), SearchCriteria.Op.EQ);
-        AllFieldsSearch.and("domainId", AllFieldsSearch.entity().getDomainId(), SearchCriteria.Op.EQ);
-        AllFieldsSearch.and("projectAccountId", AllFieldsSearch.entity().getProjectAccountId(), SearchCriteria.Op.EQ);
-        AllFieldsSearch.and("state", AllFieldsSearch.entity().getState(), SearchCriteria.Op.EQ);
-        AllFieldsSearch.done();
-
-        CountByDomain = createSearchBuilder(Long.class);
-        CountByDomain.select(null, Func.COUNT, null);
-        CountByDomain.and("domainId", CountByDomain.entity().getDomainId(), SearchCriteria.Op.EQ);
-        CountByDomain.done();
-    }
-
-    @Override
-    public ProjectVO findByNameAndDomain(String name, long domainId) {
-        SearchCriteria<ProjectVO> sc = AllFieldsSearch.create();
-        sc.setParameters("name", name);
-        sc.setParameters("domainId", domainId);
-
-        return findOneBy(sc);
-    }
-
-    @Override
-    @DB
-    public boolean remove(Long projectId) {
-        boolean result = false;
-        Transaction txn = Transaction.currentTxn();
-        txn.start();
-        ProjectVO projectToRemove = findById(projectId);
-        projectToRemove.setName(null);
-        if (!update(projectId, projectToRemove)) {
-            s_logger.warn("Failed to reset name for the project id=" + projectId + " as a part of project remove");
-            return false;
-        } 
-        
-        _tagsDao.removeByIdAndType(projectId, TaggedResourceType.Project);
-        result = super.remove(projectId);
-        txn.commit();
-
-        return result;
-
-    }
-
-    @Override
-    public Long countProjectsForDomain(long domainId) {
-        SearchCriteria<Long> sc = CountByDomain.create();
-        sc.setParameters("domainId", domainId);
-        return customSearch(sc, null).get(0);
-    }
-
-    @Override
-    public ProjectVO findByProjectAccountId(long projectAccountId) {
-        SearchCriteria<ProjectVO> sc = AllFieldsSearch.create();
-        sc.setParameters("projectAccountId", projectAccountId);
-
-        return findOneBy(sc);
-    }
-
-    @Override
-    public List<ProjectVO> listByState(Project.State state) {
-        SearchCriteria<ProjectVO> sc = AllFieldsSearch.create();
-        sc.setParameters("state", state);
-        return listBy(sc);
-    }
-    
-    @Override
-    public ProjectVO findByProjectAccountIdIncludingRemoved(long projectAccountId) {
-        SearchCriteria<ProjectVO> sc = AllFieldsSearch.create();
-        sc.setParameters("projectAccountId", projectAccountId);
-
-        return findOneIncludingRemovedBy(sc);
-    }
-}

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/572e71e5/server/src/com/cloud/projects/dao/ProjectInvitationDao.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/projects/dao/ProjectInvitationDao.java b/server/src/com/cloud/projects/dao/ProjectInvitationDao.java
deleted file mode 100644
index 3788641..0000000
--- a/server/src/com/cloud/projects/dao/ProjectInvitationDao.java
+++ /dev/null
@@ -1,44 +0,0 @@
-// 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 com.cloud.projects.dao;
-
-import java.util.List;
-
-import com.cloud.projects.ProjectInvitation.State;
-import com.cloud.projects.ProjectInvitationVO;
-import com.cloud.utils.db.GenericDao;
-
-public interface ProjectInvitationDao extends GenericDao<ProjectInvitationVO, Long> {
-    ProjectInvitationVO findByAccountIdProjectId(long accountId, long projectId, State... inviteState);
-
-    List<ProjectInvitationVO> listExpiredInvitations();
-
-    boolean expirePendingInvitations(long timeOut);
-
-    boolean isActive(long id, long timeout);
-
-    ProjectInvitationVO findByEmailAndProjectId(String email, long projectId, State... inviteState);
-
-    ProjectInvitationVO findPendingByTokenAndProjectId(String token, long projectId, State... inviteState);
-
-    void cleanupInvitations(long projectId);
-
-    ProjectInvitationVO findPendingById(long id);
-
-    List<ProjectInvitationVO> listInvitationsToExpire(long timeOut);
-
-}

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/572e71e5/server/src/com/cloud/projects/dao/ProjectInvitationDaoImpl.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/projects/dao/ProjectInvitationDaoImpl.java b/server/src/com/cloud/projects/dao/ProjectInvitationDaoImpl.java
deleted file mode 100644
index 4491512..0000000
--- a/server/src/com/cloud/projects/dao/ProjectInvitationDaoImpl.java
+++ /dev/null
@@ -1,171 +0,0 @@
-// 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 com.cloud.projects.dao;
-
-import java.sql.Date;
-import java.util.List;
-
-import javax.ejb.Local;
-
-import org.apache.log4j.Logger;
-import org.springframework.stereotype.Component;
-
-import com.cloud.projects.ProjectInvitation.State;
-import com.cloud.projects.ProjectInvitationVO;
-import com.cloud.utils.DateUtil;
-import com.cloud.utils.db.GenericDaoBase;
-import com.cloud.utils.db.SearchBuilder;
-import com.cloud.utils.db.SearchCriteria;
-
-@Component
-@Local(value = { ProjectInvitationDao.class })
-public class ProjectInvitationDaoImpl extends GenericDaoBase<ProjectInvitationVO, Long> implements ProjectInvitationDao {
-    private static final Logger s_logger = Logger.getLogger(ProjectInvitationDaoImpl.class);
-    protected final SearchBuilder<ProjectInvitationVO> AllFieldsSearch;
-    protected final SearchBuilder<ProjectInvitationVO> InactiveSearch;
-
-    protected ProjectInvitationDaoImpl() {
-        AllFieldsSearch = createSearchBuilder();
-        AllFieldsSearch.and("accountId", AllFieldsSearch.entity().getForAccountId(), SearchCriteria.Op.EQ);
-        AllFieldsSearch.and("projectId", AllFieldsSearch.entity().getProjectId(), SearchCriteria.Op.EQ);
-        AllFieldsSearch.and("created", AllFieldsSearch.entity().getCreated(), SearchCriteria.Op.EQ);
-        AllFieldsSearch.and("projectAccountId", AllFieldsSearch.entity().getState(), SearchCriteria.Op.EQ);
-        AllFieldsSearch.and("state", AllFieldsSearch.entity().getState(), SearchCriteria.Op.IN);
-        AllFieldsSearch.and("email", AllFieldsSearch.entity().getEmail(), SearchCriteria.Op.EQ);
-        AllFieldsSearch.and("token", AllFieldsSearch.entity().getToken(), SearchCriteria.Op.EQ);
-        AllFieldsSearch.and("id", AllFieldsSearch.entity().getId(), SearchCriteria.Op.EQ);
-        AllFieldsSearch.done();
-
-        InactiveSearch = createSearchBuilder();
-        InactiveSearch.and("id", InactiveSearch.entity().getId(), SearchCriteria.Op.EQ);
-        InactiveSearch.and("accountId", InactiveSearch.entity().getForAccountId(), SearchCriteria.Op.EQ);
-        InactiveSearch.and("projectId", InactiveSearch.entity().getProjectId(), SearchCriteria.Op.EQ);
-        InactiveSearch.and("created", InactiveSearch.entity().getCreated(), SearchCriteria.Op.LTEQ);
-        InactiveSearch.and("state", InactiveSearch.entity().getState(), SearchCriteria.Op.EQ);
-        InactiveSearch.done();
-    }
-
-    @Override
-    public ProjectInvitationVO findByAccountIdProjectId(long accountId, long projectId, State... inviteState) {
-        SearchCriteria<ProjectInvitationVO> sc = AllFieldsSearch.create();
-        sc.setParameters("accountId", accountId);
-        sc.setParameters("projectId", projectId);
-        if (inviteState != null && inviteState.length > 0) {
-            sc.setParameters("state", (Object[]) inviteState);
-        }
-
-        return findOneBy(sc);
-    }
-
-    @Override
-    public List<ProjectInvitationVO> listExpiredInvitations() {
-        SearchCriteria<ProjectInvitationVO> sc = AllFieldsSearch.create();
-        sc.setParameters("state", State.Expired);
-
-        return listBy(sc);
-    }
-
-    @Override
-    public boolean expirePendingInvitations(long timeout) {
-        boolean success = true;
-
-        SearchCriteria<ProjectInvitationVO> sc = InactiveSearch.create();
-        sc.setParameters("created", new Date((DateUtil.currentGMTTime().getTime() >> 10) - timeout));
-        sc.setParameters("state", State.Pending);
-
-        List<ProjectInvitationVO> invitationsToExpire = listBy(sc);
-        for (ProjectInvitationVO invitationToExpire : invitationsToExpire) {
-            invitationToExpire.setState(State.Expired);
-            if (!update(invitationToExpire.getId(), invitationToExpire)) {
-                s_logger.warn("Fail to expire invitation " + invitationToExpire.toString());
-                success = false;
-            }
-        }
-        return success;
-    }
-
-    @Override
-    public List<ProjectInvitationVO> listInvitationsToExpire(long timeOut) {
-        SearchCriteria<ProjectInvitationVO> sc = InactiveSearch.create();
-        sc.setParameters("created", new Date((DateUtil.currentGMTTime().getTime()) - timeOut));
-        sc.setParameters("state", State.Pending);
-        return listBy(sc);
-    }
-
-    @Override
-    public boolean isActive(long id, long timeout) {
-        SearchCriteria<ProjectInvitationVO> sc = InactiveSearch.create();
-
-        sc.setParameters("id", id);
-
-        if (findOneBy(sc) == null) {
-            s_logger.warn("Unable to find project invitation by id " + id);
-            return false;
-        }
-
-        sc.setParameters("created", new Date((DateUtil.currentGMTTime().getTime()) - timeout));
-
-        if (findOneBy(sc) == null) {
-            return true;
-        } else {
-            return false;
-        }
-    }
-
-    @Override
-    public ProjectInvitationVO findByEmailAndProjectId(String email, long projectId, State... inviteState) {
-        SearchCriteria<ProjectInvitationVO> sc = AllFieldsSearch.create();
-        sc.setParameters("email", email);
-        sc.setParameters("projectId", projectId);
-        if (inviteState != null && inviteState.length > 0) {
-            sc.setParameters("state", (Object[]) inviteState);
-        }
-
-        return findOneBy(sc);
-    }
-
-    @Override
-    public ProjectInvitationVO findPendingByTokenAndProjectId(String token, long projectId, State... inviteState) {
-        SearchCriteria<ProjectInvitationVO> sc = AllFieldsSearch.create();
-        sc.setParameters("token", token);
-        sc.setParameters("projectId", projectId);
-        if (inviteState != null && inviteState.length > 0) {
-            sc.setParameters("state", (Object[]) inviteState);
-        }
-
-        return findOneBy(sc);
-    }
-
-    @Override
-    public ProjectInvitationVO findPendingById(long id) {
-        SearchCriteria<ProjectInvitationVO> sc = AllFieldsSearch.create();
-        sc.setParameters("id", id);
-        sc.setParameters("state", State.Pending);
-
-        return findOneBy(sc);
-    }
-
-    @Override
-    public void cleanupInvitations(long projectId) {
-        SearchCriteria<ProjectInvitationVO> sc = AllFieldsSearch.create();
-        sc.setParameters("projectId", projectId);
-
-        int numberRemoved = remove(sc);
-        s_logger.debug("Removed " + numberRemoved + " invitations for project id=" + projectId);
-    }
-
-}

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/572e71e5/server/src/com/cloud/secstorage/CommandExecLogDao.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/secstorage/CommandExecLogDao.java b/server/src/com/cloud/secstorage/CommandExecLogDao.java
deleted file mode 100644
index 9a7bb6c..0000000
--- a/server/src/com/cloud/secstorage/CommandExecLogDao.java
+++ /dev/null
@@ -1,25 +0,0 @@
-// 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 com.cloud.secstorage;
-
-import java.util.Date;
-
-import com.cloud.utils.db.GenericDao;
-
-public interface CommandExecLogDao extends GenericDao<CommandExecLogVO, Long> {
-	public void expungeExpiredRecords(Date cutTime);
-}

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/572e71e5/server/src/com/cloud/secstorage/CommandExecLogDaoImpl.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/secstorage/CommandExecLogDaoImpl.java b/server/src/com/cloud/secstorage/CommandExecLogDaoImpl.java
deleted file mode 100644
index 8fa9e41..0000000
--- a/server/src/com/cloud/secstorage/CommandExecLogDaoImpl.java
+++ /dev/null
@@ -1,49 +0,0 @@
-// 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 com.cloud.secstorage;
-
-import java.util.Date;
-
-import javax.ejb.Local;
-
-import org.springframework.stereotype.Component;
-
-import com.cloud.utils.db.GenericDaoBase;
-import com.cloud.utils.db.SearchBuilder;
-import com.cloud.utils.db.SearchCriteria;
-import com.cloud.utils.db.SearchCriteria.Op;
-
-@Component
-@Local(value={CommandExecLogDao.class})
-public class CommandExecLogDaoImpl extends GenericDaoBase<CommandExecLogVO, Long> implements CommandExecLogDao {
-
-    protected final SearchBuilder<CommandExecLogVO> ExpungeSearch;
-	
-	public CommandExecLogDaoImpl() {
-		ExpungeSearch = createSearchBuilder();
-		ExpungeSearch.and("created", ExpungeSearch.entity().getCreated(), Op.LT);
-		ExpungeSearch.done();
-	}
-	
-	@Override
-	public void expungeExpiredRecords(Date cutTime) {
-		SearchCriteria<CommandExecLogVO> sc = ExpungeSearch.create();
-		sc.setParameters("created", cutTime);
-		expunge(sc);
-	}
-}
-

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/572e71e5/server/src/com/cloud/secstorage/CommandExecLogVO.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/secstorage/CommandExecLogVO.java b/server/src/com/cloud/secstorage/CommandExecLogVO.java
deleted file mode 100644
index 4ec023e..0000000
--- a/server/src/com/cloud/secstorage/CommandExecLogVO.java
+++ /dev/null
@@ -1,112 +0,0 @@
-// 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 com.cloud.secstorage;
-
-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 javax.persistence.Temporal;
-import javax.persistence.TemporalType;
-
-import com.cloud.utils.DateUtil;
-import org.apache.cloudstack.api.InternalIdentity;
-
-@Entity
-@Table(name="cmd_exec_log")
-public class CommandExecLogVO implements InternalIdentity {
-	
-    @Id
-    @GeneratedValue(strategy=GenerationType.IDENTITY)
-    @Column(name="id")
-	private long id;
-    
-    @Column(name="host_id")
-	private long hostId;
-    
-    @Column(name="instance_id")
-	private long instanceId;
-	
-    @Column(name="command_name")
-	private String commandName;
-    
-    @Column(name="weight")
-    private int weight;
-	
-    @Column(name="created")
-    @Temporal(value=TemporalType.TIMESTAMP)
-    private Date created;
-    
-    public CommandExecLogVO() {
-    }
-    
-    public CommandExecLogVO(long hostId, long instanceId, String commandName, int weight) {
-    	this.hostId = hostId;
-    	this.instanceId = instanceId;
-    	this.commandName = commandName;
-    	this.weight = weight;
-    	this.created = DateUtil.currentGMTTime();
-    }
-    
-    public long getId() {
-    	return this.id;
-    }
-    
-    public long getHostId() {
-    	return this.hostId;
-    }
-    
-    public void setHostId(long hostId) {
-    	this.hostId = hostId;
-    }
-    
-    public long getInstanceId() {
-    	return this.instanceId;
-    }
-    
-    public void setInstanceId(long instanceId) {
-    	this.instanceId = instanceId;
-    }
-    
-    public String getCommandName() {
-    	return this.commandName;
-    }
-    
-    public void setCommandName(String commandName) {
-    	this.commandName = commandName;
-    }
-    
-    public int getWeight() {
-    	return weight;
-    }
-    
-    public void setWeight(int weight) {
-    	this.weight = weight;
-    }
-    
-    public Date getCreated() {
-    	return this.created;
-    }
-    
-    public void setCreated(Date created) {
-    	this.created = created;
-    }
-}

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/572e71e5/server/src/com/cloud/service/ServiceOfferingVO.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/service/ServiceOfferingVO.java b/server/src/com/cloud/service/ServiceOfferingVO.java
deleted file mode 100755
index 94a7351..0000000
--- a/server/src/com/cloud/service/ServiceOfferingVO.java
+++ /dev/null
@@ -1,211 +0,0 @@
-// 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 com.cloud.service;
-
-import javax.persistence.Column;
-import javax.persistence.DiscriminatorValue;
-import javax.persistence.Entity;
-import javax.persistence.PrimaryKeyJoinColumn;
-import javax.persistence.Table;
-import javax.persistence.Transient;
-
-import com.cloud.offering.ServiceOffering;
-import com.cloud.storage.DiskOfferingVO;
-import com.cloud.vm.VirtualMachine;
-
-@Entity
-@Table(name="service_offering")
-@DiscriminatorValue(value="Service")
-@PrimaryKeyJoinColumn(name="id")
-public class ServiceOfferingVO extends DiskOfferingVO implements ServiceOffering {
-    @Column(name="cpu")
-	private int cpu;
-
-    @Column(name="speed")
-    private int speed;
-
-    @Column(name="ram_size")
-	private int ramSize;
-
-    @Column(name="nw_rate")
-    private Integer rateMbps;
-
-    @Column(name="mc_rate")
-    private Integer multicastRateMbps;
-
-    @Column(name="ha_enabled")
-    private boolean offerHA;
-
-    @Column(name="limit_cpu_use")
-    private boolean limitCpuUse;
-
-    @Column(name="is_volatile")
-    private boolean volatileVm;
-
-    @Column(name="host_tag")
-    private String hostTag;
-
-    @Column(name="default_use")
-    private boolean default_use;
-
-    @Column(name="vm_type")
-    private String vm_type;
-
-    @Column(name="sort_key")
-    int sortKey;
-
-    protected ServiceOfferingVO() {
-        super();
-    }
-
-    public ServiceOfferingVO(String name, int cpu, int ramSize, int speed, Integer rateMbps, Integer multicastRateMbps, boolean offerHA, String displayText, boolean useLocalStorage, boolean recreatable, String tags, boolean systemUse, VirtualMachine.Type vm_type, boolean defaultUse) {
-        super(name, displayText, false, tags, recreatable, useLocalStorage, systemUse, true);
-        this.cpu = cpu;
-        this.ramSize = ramSize;
-        this.speed = speed;
-        this.rateMbps = rateMbps;
-        this.multicastRateMbps = multicastRateMbps;
-        this.offerHA = offerHA;
-        this.limitCpuUse = false;
-        this.volatileVm = false;
-        this.default_use = defaultUse;
-        this.vm_type = vm_type == null ? null : vm_type.toString().toLowerCase();
-    }
-
-    public ServiceOfferingVO(String name, int cpu, int ramSize, int speed, Integer rateMbps, Integer multicastRateMbps, boolean offerHA, boolean limitCpuUse, boolean volatileVm, String displayText, boolean useLocalStorage, boolean recreatable, String tags, boolean systemUse, VirtualMachine.Type vm_type, Long domainId) {
-        super(name, displayText, false, tags, recreatable, useLocalStorage, systemUse, true, domainId);
-        this.cpu = cpu;
-        this.ramSize = ramSize;
-        this.speed = speed;
-        this.rateMbps = rateMbps;
-        this.multicastRateMbps = multicastRateMbps;
-        this.offerHA = offerHA;
-        this.limitCpuUse = limitCpuUse;
-        this.volatileVm = volatileVm;
-        this.vm_type = vm_type == null ? null : vm_type.toString().toLowerCase();
-    }
-
-    public ServiceOfferingVO(String name, int cpu, int ramSize, int speed, Integer rateMbps, Integer multicastRateMbps, boolean offerHA, boolean limitResourceUse, boolean volatileVm, String displayText, boolean useLocalStorage, boolean recreatable, String tags, boolean systemUse, VirtualMachine.Type vm_type, Long domainId, String hostTag) {
-        this(name, cpu, ramSize, speed, rateMbps, multicastRateMbps, offerHA, limitResourceUse, volatileVm, displayText, useLocalStorage, recreatable, tags, systemUse, vm_type, domainId);
-        this.hostTag = hostTag;
-    }
-
-    @Override
-	public boolean getOfferHA() {
-	    return offerHA;
-	}
-
-	public void setOfferHA(boolean offerHA) {
-		this.offerHA = offerHA;
-	}
-
-    @Override
-	public boolean getLimitCpuUse() {
-	    return limitCpuUse;
-	}
-
-	public void setLimitResourceUse(boolean limitCpuUse) {
-		this.limitCpuUse = limitCpuUse;
-	}
-
-	@Override
-    public boolean getDefaultUse() {
-        return default_use;
-    }
-
-	@Override
-    @Transient
-	public String[] getTagsArray() {
-	    String tags = getTags();
-	    if (tags == null || tags.length() == 0) {
-	        return new String[0];
-	    }
-
-	    return tags.split(",");
-	}
-
-	@Override
-	public int getCpu() {
-	    return cpu;
-	}
-
-	public void setCpu(int cpu) {
-		this.cpu = cpu;
-	}
-
-	public void setSpeed(int speed) {
-		this.speed = speed;
-	}
-
-	public void setRamSize(int ramSize) {
-		this.ramSize = ramSize;
-	}
-
-	@Override
-	public int getSpeed() {
-	    return speed;
-	}
-
-	@Override
-	public int getRamSize() {
-	    return ramSize;
-	}
-
-	public void setRateMbps(Integer rateMbps) {
-		this.rateMbps = rateMbps;
-	}
-
-	@Override
-    public Integer getRateMbps() {
-		return rateMbps;
-	}
-
-	public void setMulticastRateMbps(Integer multicastRateMbps) {
-		this.multicastRateMbps = multicastRateMbps;
-	}
-
-	@Override
-    public Integer getMulticastRateMbps() {
-		return multicastRateMbps;
-	}
-
-	public void setHostTag(String hostTag) {
-		this.hostTag = hostTag;
-	}
-
-	public String getHostTag() {
-		return hostTag;
-	}
-
-	public String getSystemVmType(){
-	    return vm_type;
-	}
-
-	public void setSortKey(int key) {
-		sortKey = key;
-	}
-
-	public int getSortKey() {
-		return sortKey;
-	}
-
-    @Override
-    public boolean getVolatileVm() {
-        return volatileVm;
-    }
-
-}

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/572e71e5/server/src/com/cloud/service/dao/ServiceOfferingDao.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/service/dao/ServiceOfferingDao.java b/server/src/com/cloud/service/dao/ServiceOfferingDao.java
deleted file mode 100644
index 589de7c..0000000
--- a/server/src/com/cloud/service/dao/ServiceOfferingDao.java
+++ /dev/null
@@ -1,34 +0,0 @@
-// 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 com.cloud.service.dao;
-
-import java.util.List;
-
-import com.cloud.service.ServiceOfferingVO;
-import com.cloud.utils.db.GenericDao;
-
-/*
- * Data Access Object for service_offering table
- */
-public interface ServiceOfferingDao extends GenericDao<ServiceOfferingVO, Long> {
-    ServiceOfferingVO findByName(String name);
-    ServiceOfferingVO persistSystemServiceOffering(ServiceOfferingVO vo);
-	List<ServiceOfferingVO> findPublicServiceOfferings();
-	List<ServiceOfferingVO> findServiceOfferingByDomainId(Long domainId);
-    List<ServiceOfferingVO> findSystemOffering(Long domainId, Boolean isSystem, String vm_type);
-    ServiceOfferingVO persistDeafultServiceOffering(ServiceOfferingVO offering);
-}

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/572e71e5/server/src/com/cloud/service/dao/ServiceOfferingDaoImpl.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/service/dao/ServiceOfferingDaoImpl.java b/server/src/com/cloud/service/dao/ServiceOfferingDaoImpl.java
deleted file mode 100644
index 062103e..0000000
--- a/server/src/com/cloud/service/dao/ServiceOfferingDaoImpl.java
+++ /dev/null
@@ -1,157 +0,0 @@
-// 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 com.cloud.service.dao;
-
-import java.util.Date;
-import java.util.List;
-
-import javax.ejb.Local;
-import javax.persistence.EntityExistsException;
-
-import org.apache.log4j.Logger;
-import org.springframework.stereotype.Component;
-
-import com.cloud.service.ServiceOfferingVO;
-import com.cloud.storage.DiskOfferingVO;
-import com.cloud.utils.db.DB;
-import com.cloud.utils.db.GenericDaoBase;
-import com.cloud.utils.db.SearchBuilder;
-import com.cloud.utils.db.SearchCriteria;
-
-@Component
-@Local(value={ServiceOfferingDao.class}) @DB(txn=false)
-public class ServiceOfferingDaoImpl extends GenericDaoBase<ServiceOfferingVO, Long> implements ServiceOfferingDao {
-    protected static final Logger s_logger = Logger.getLogger(ServiceOfferingDaoImpl.class);
-
-    protected final SearchBuilder<ServiceOfferingVO> UniqueNameSearch;
-    protected final SearchBuilder<ServiceOfferingVO> ServiceOfferingsByDomainIdSearch;
-    protected final SearchBuilder<ServiceOfferingVO> SystemServiceOffering;
-    protected final SearchBuilder<ServiceOfferingVO> ServiceOfferingsByKeywordSearch;
-    protected final SearchBuilder<ServiceOfferingVO> PublicServiceOfferingSearch;
-    
-    public ServiceOfferingDaoImpl() {
-        super();
-        
-        UniqueNameSearch = createSearchBuilder();
-        UniqueNameSearch.and("name", UniqueNameSearch.entity().getUniqueName(), SearchCriteria.Op.EQ);
-        UniqueNameSearch.and("system", UniqueNameSearch.entity().getSystemUse(), SearchCriteria.Op.EQ);
-        UniqueNameSearch.done();
-        
-        ServiceOfferingsByDomainIdSearch = createSearchBuilder();
-        ServiceOfferingsByDomainIdSearch.and("domainId", ServiceOfferingsByDomainIdSearch.entity().getDomainId(), SearchCriteria.Op.EQ);
-        ServiceOfferingsByDomainIdSearch.done();
-        
-        SystemServiceOffering = createSearchBuilder();
-        SystemServiceOffering.and("domainId", SystemServiceOffering.entity().getDomainId(), SearchCriteria.Op.EQ);
-        SystemServiceOffering.and("system", SystemServiceOffering.entity().getSystemUse(), SearchCriteria.Op.EQ);
-        SystemServiceOffering.and("vm_type", SystemServiceOffering.entity().getSpeed(), SearchCriteria.Op.EQ);
-        SystemServiceOffering.and("removed", SystemServiceOffering.entity().getRemoved(), SearchCriteria.Op.NULL);
-        SystemServiceOffering.done();
-        
-        
-        PublicServiceOfferingSearch = createSearchBuilder();
-        PublicServiceOfferingSearch.and("domainId", PublicServiceOfferingSearch.entity().getDomainId(), SearchCriteria.Op.NULL);
-        PublicServiceOfferingSearch.and("system", PublicServiceOfferingSearch.entity().getSystemUse(), SearchCriteria.Op.EQ);
-        PublicServiceOfferingSearch.and("removed", PublicServiceOfferingSearch.entity().getRemoved(), SearchCriteria.Op.NULL);
-        PublicServiceOfferingSearch.done();
-        
-        ServiceOfferingsByKeywordSearch = createSearchBuilder();
-        ServiceOfferingsByKeywordSearch.or("name", ServiceOfferingsByKeywordSearch.entity().getName(), SearchCriteria.Op.EQ);        
-        ServiceOfferingsByKeywordSearch.or("displayText", ServiceOfferingsByKeywordSearch.entity().getDisplayText(), SearchCriteria.Op.EQ);
-        ServiceOfferingsByKeywordSearch.done();
-    }
-    
-    @Override
-    public ServiceOfferingVO findByName(String name) {
-        SearchCriteria<ServiceOfferingVO> sc = UniqueNameSearch.create();
-        sc.setParameters("name", name);
-        sc.setParameters("system", true);
-        List<ServiceOfferingVO> vos = search(sc, null, null, false);
-        if (vos.size() == 0) {
-            return null;
-        }
-        
-        return vos.get(0);
-    }
-    
-    @Override @DB
-    public ServiceOfferingVO persistSystemServiceOffering(ServiceOfferingVO offering) {
-        assert offering.getUniqueName() != null : "how are you going to find this later if you don't set it?";
-        ServiceOfferingVO vo = findByName(offering.getUniqueName());
-        if (vo != null) {
-        	// check invalid CPU speed in system service offering, set it to default value of 500 Mhz if 0 CPU speed is found
-        	if(vo.getSpeed() <= 0) {
-        		vo.setSpeed(500);
-        		update(vo.getId(), vo);
-        	}
-            return vo;
-        }
-        try {
-            return persist(offering);
-        } catch (EntityExistsException e) {
-            // Assume it's conflict on unique name
-            return findByName(offering.getUniqueName());
-        }
-    }
-    
-    @Override
-    public List<ServiceOfferingVO> findServiceOfferingByDomainId(Long domainId){
-    	SearchCriteria<ServiceOfferingVO> sc = ServiceOfferingsByDomainIdSearch.create();
-    	sc.setParameters("domainId", domainId);
-        return listBy(sc);    	
-    }
-    
-
-    @Override
-    public List<ServiceOfferingVO> findSystemOffering(Long domainId, Boolean isSystem, String vm_type){
-        SearchCriteria<ServiceOfferingVO> sc = SystemServiceOffering.create();
-        sc.setParameters("domainId", domainId);
-        sc.setParameters("system", isSystem);
-        sc.setParameters("vm_type", vm_type);
-        return listBy(sc);      
-    }
-    
-    @Override
-    public List<ServiceOfferingVO> findPublicServiceOfferings(){
-    	SearchCriteria<ServiceOfferingVO> sc = PublicServiceOfferingSearch.create();
-    	sc.setParameters("system", false);
-        return listBy(sc);    	
-    }
-    
-    @Override @DB
-    public ServiceOfferingVO persistDeafultServiceOffering(ServiceOfferingVO offering) {
-        assert offering.getUniqueName() != null : "unique name should be set for the service offering";
-        ServiceOfferingVO vo = findByName(offering.getUniqueName());
-        if (vo != null) {
-            return vo;
-        }
-        try {
-            return persist(offering);
-        } catch (EntityExistsException e) {
-            // Assume it's conflict on unique name
-            return findByName(offering.getUniqueName());
-        }
-    }
-    
-    @Override
-    public boolean remove(Long id) {
-        ServiceOfferingVO offering = createForUpdate();
-        offering.setRemoved(new Date());
-
-        return update(id, offering);
-    }
-}

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/572e71e5/server/src/com/cloud/storage/dao/DiskOfferingDao.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/storage/dao/DiskOfferingDao.java b/server/src/com/cloud/storage/dao/DiskOfferingDao.java
deleted file mode 100644
index c17e319..0000000
--- a/server/src/com/cloud/storage/dao/DiskOfferingDao.java
+++ /dev/null
@@ -1,31 +0,0 @@
-// 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 com.cloud.storage.dao;
-
-import java.util.List;
-
-import com.cloud.storage.DiskOfferingVO;
-import com.cloud.utils.db.GenericDao;
-
-public interface DiskOfferingDao extends GenericDao<DiskOfferingVO, Long> {
-    List<DiskOfferingVO> listByDomainId(long domainId);
-    List<DiskOfferingVO> findPrivateDiskOffering();
-	List<DiskOfferingVO> findPublicDiskOfferings();
-    DiskOfferingVO findByUniqueName(String uniqueName);
-    DiskOfferingVO persistDeafultDiskOffering(DiskOfferingVO offering);
-    
-}

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/572e71e5/server/src/com/cloud/storage/dao/DiskOfferingDaoImpl.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/storage/dao/DiskOfferingDaoImpl.java b/server/src/com/cloud/storage/dao/DiskOfferingDaoImpl.java
deleted file mode 100644
index 1f68c50..0000000
--- a/server/src/com/cloud/storage/dao/DiskOfferingDaoImpl.java
+++ /dev/null
@@ -1,152 +0,0 @@
-// 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 com.cloud.storage.dao;
-
-import java.util.Date;
-import java.util.List;
-
-import javax.ejb.Local;
-import javax.persistence.EntityExistsException;
-
-import org.apache.log4j.Logger;
-import org.springframework.stereotype.Component;
-
-import com.cloud.storage.DiskOfferingVO;
-import com.cloud.storage.DiskOfferingVO.Type;
-import com.cloud.utils.db.Attribute;
-import com.cloud.utils.db.Filter;
-import com.cloud.utils.db.GenericDaoBase;
-import com.cloud.utils.db.SearchBuilder;
-import com.cloud.utils.db.SearchCriteria;
-import com.cloud.utils.db.SearchCriteria.Op;
-
-@Component
-@Local(value={DiskOfferingDao.class})
-public class DiskOfferingDaoImpl extends GenericDaoBase<DiskOfferingVO, Long> implements DiskOfferingDao {
-    private static final Logger s_logger = Logger.getLogger(DiskOfferingDaoImpl.class);
-
-    private final SearchBuilder<DiskOfferingVO> DomainIdSearch;
-    private final SearchBuilder<DiskOfferingVO> PrivateDiskOfferingSearch;
-    private final SearchBuilder<DiskOfferingVO> PublicDiskOfferingSearch;
-    protected final SearchBuilder<DiskOfferingVO> UniqueNameSearch;
-    private final Attribute _typeAttr;
-
-    protected DiskOfferingDaoImpl() {
-        DomainIdSearch  = createSearchBuilder();
-        DomainIdSearch.and("domainId", DomainIdSearch.entity().getDomainId(), SearchCriteria.Op.EQ);
-        DomainIdSearch.and("removed", DomainIdSearch.entity().getRemoved(), SearchCriteria.Op.NULL);
-        DomainIdSearch.done();
-        
-        PrivateDiskOfferingSearch  = createSearchBuilder();
-        PrivateDiskOfferingSearch.and("diskSize", PrivateDiskOfferingSearch.entity().getDiskSize(), SearchCriteria.Op.EQ);
-        PrivateDiskOfferingSearch.done();
-        
-        PublicDiskOfferingSearch = createSearchBuilder();
-        PublicDiskOfferingSearch.and("domainId", PublicDiskOfferingSearch.entity().getDomainId(), SearchCriteria.Op.NULL);
-        PublicDiskOfferingSearch.and("system", PublicDiskOfferingSearch.entity().getSystemUse(), SearchCriteria.Op.EQ);
-        PublicDiskOfferingSearch.and("removed", PublicDiskOfferingSearch.entity().getRemoved(), SearchCriteria.Op.NULL);
-        PublicDiskOfferingSearch.done();
-        
-        UniqueNameSearch = createSearchBuilder();
-        UniqueNameSearch.and("name", UniqueNameSearch.entity().getUniqueName(), SearchCriteria.Op.EQ);
-        UniqueNameSearch.done();
-        
-        _typeAttr = _allAttributes.get("type");
-    }
-
-    @Override
-    public List<DiskOfferingVO> listByDomainId(long domainId) {
-        SearchCriteria<DiskOfferingVO> sc = DomainIdSearch.create();
-        sc.setParameters("domainId", domainId);
-        // FIXME:  this should not be exact match, but instead should find all available disk offerings from parent domains
-        return listBy(sc);
-    }
-    
-    @Override
-    public List<DiskOfferingVO> findPrivateDiskOffering() {
-        SearchCriteria<DiskOfferingVO> sc = PrivateDiskOfferingSearch.create();
-        sc.setParameters("diskSize", 0);
-        return listBy(sc);
-    }
-    
-    @Override
-    public List<DiskOfferingVO> searchIncludingRemoved(SearchCriteria<DiskOfferingVO> sc, final Filter filter, final Boolean lock, final boolean cache) {
-        sc.addAnd(_typeAttr, Op.EQ, Type.Disk);
-        return super.searchIncludingRemoved(sc, filter, lock, cache);
-    }
-    
-    @Override
-    public <K> List<K> customSearchIncludingRemoved(SearchCriteria<K> sc, final Filter filter) {
-        sc.addAnd(_typeAttr, Op.EQ, Type.Disk);
-        return super.customSearchIncludingRemoved(sc, filter);
-    }
-    
-    @Override
-    protected List<DiskOfferingVO> executeList(final String sql, final Object... params) {
-        StringBuilder builder = new StringBuilder(sql);
-        int index = builder.indexOf("WHERE");
-        if (index == -1) {
-            builder.append(" WHERE type=?");
-        } else {
-            builder.insert(index + 6, "type=? ");
-        }
-        
-        return super.executeList(sql, Type.Disk, params);
-    }
-    
-    @Override
-    public List<DiskOfferingVO> findPublicDiskOfferings(){
-    	SearchCriteria<DiskOfferingVO> sc = PublicDiskOfferingSearch.create();
-    	sc.setParameters("system", false);
-        return listBy(sc);    	
-    }
-    
-    @Override
-    public DiskOfferingVO findByUniqueName(String uniqueName) {
-        SearchCriteria<DiskOfferingVO> sc = UniqueNameSearch.create();
-        sc.setParameters("name", uniqueName);
-        List<DiskOfferingVO> vos = search(sc, null, null, false);
-        if (vos.size() == 0) {
-            return null;
-        }
-        
-        return vos.get(0);
-    }
-    
-    @Override
-    public DiskOfferingVO persistDeafultDiskOffering(DiskOfferingVO offering) {
-        assert offering.getUniqueName() != null : "unique name shouldn't be null for the disk offering";
-        DiskOfferingVO vo = findByUniqueName(offering.getUniqueName());
-        if (vo != null) {
-            return vo;
-        }
-        try {
-            return persist(offering);
-        } catch (EntityExistsException e) {
-            // Assume it's conflict on unique name
-            return findByUniqueName(offering.getUniqueName());
-        }
-    }
-    
-    @Override
-    public boolean remove(Long id) {
-        DiskOfferingVO diskOffering = createForUpdate();
-        diskOffering.setRemoved(new Date());
-
-        return update(id, diskOffering);
-    }
-}

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/572e71e5/server/src/com/cloud/storage/dao/GuestOSCategoryDao.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/storage/dao/GuestOSCategoryDao.java b/server/src/com/cloud/storage/dao/GuestOSCategoryDao.java
deleted file mode 100644
index 0f7ea32..0000000
--- a/server/src/com/cloud/storage/dao/GuestOSCategoryDao.java
+++ /dev/null
@@ -1,24 +0,0 @@
-// 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 com.cloud.storage.dao;
-
-import com.cloud.storage.GuestOSCategoryVO;
-import com.cloud.utils.db.GenericDao;
-
-public interface GuestOSCategoryDao extends GenericDao<GuestOSCategoryVO, Long> {
-   
-}

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/572e71e5/server/src/com/cloud/storage/dao/GuestOSCategoryDaoImpl.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/storage/dao/GuestOSCategoryDaoImpl.java b/server/src/com/cloud/storage/dao/GuestOSCategoryDaoImpl.java
deleted file mode 100644
index d017b99..0000000
--- a/server/src/com/cloud/storage/dao/GuestOSCategoryDaoImpl.java
+++ /dev/null
@@ -1,34 +0,0 @@
-// 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 com.cloud.storage.dao;
-
-import javax.ejb.Local;
-
-import org.springframework.stereotype.Component;
-
-import com.cloud.storage.GuestOSCategoryVO;
-import com.cloud.utils.db.GenericDaoBase;
-
-@Component
-@Local (value={GuestOSCategoryDao.class})
-public class GuestOSCategoryDaoImpl extends GenericDaoBase<GuestOSCategoryVO, Long> implements GuestOSCategoryDao {
-    
-	protected GuestOSCategoryDaoImpl() {
-
-	}
-	
-}

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/572e71e5/server/src/com/cloud/storage/dao/GuestOSDao.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/storage/dao/GuestOSDao.java b/server/src/com/cloud/storage/dao/GuestOSDao.java
deleted file mode 100755
index 19e423b..0000000
--- a/server/src/com/cloud/storage/dao/GuestOSDao.java
+++ /dev/null
@@ -1,26 +0,0 @@
-// 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 com.cloud.storage.dao;
-
-import com.cloud.storage.GuestOSVO;
-import com.cloud.utils.db.GenericDao;
-
-public interface GuestOSDao extends GenericDao<GuestOSVO, Long> {
-
-    GuestOSVO listByDisplayName(String displayName);
-   
-}

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/572e71e5/server/src/com/cloud/storage/dao/GuestOSDaoImpl.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/storage/dao/GuestOSDaoImpl.java b/server/src/com/cloud/storage/dao/GuestOSDaoImpl.java
deleted file mode 100755
index c39fae8..0000000
--- a/server/src/com/cloud/storage/dao/GuestOSDaoImpl.java
+++ /dev/null
@@ -1,51 +0,0 @@
-// 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 com.cloud.storage.dao;
-
-import java.util.List;
-
-import javax.ejb.Local;
-
-import org.springframework.stereotype.Component;
-
-import com.cloud.storage.GuestOSVO;
-import com.cloud.storage.VMTemplateHostVO;
-import com.cloud.utils.db.GenericDaoBase;
-import com.cloud.utils.db.SearchBuilder;
-import com.cloud.utils.db.SearchCriteria;
-
-@Component
-@Local (value={GuestOSDao.class})
-public class GuestOSDaoImpl extends GenericDaoBase<GuestOSVO, Long> implements GuestOSDao {
-    
-    
-    protected final SearchBuilder<GuestOSVO> Search;
-    
-	protected GuestOSDaoImpl() {
-        Search = createSearchBuilder();
-        Search.and("display_name", Search.entity().getDisplayName(), SearchCriteria.Op.EQ);
-        Search.done();
-	}
-	
-   @Override
-    public GuestOSVO listByDisplayName(String displayName) {
-        SearchCriteria<GuestOSVO> sc = Search.create();
-        sc.setParameters("display_name", displayName);
-        return findOneBy(sc);
-    }
-
-}

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/572e71e5/server/src/com/cloud/storage/dao/LaunchPermissionDao.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/storage/dao/LaunchPermissionDao.java b/server/src/com/cloud/storage/dao/LaunchPermissionDao.java
deleted file mode 100644
index 0ad60b5..0000000
--- a/server/src/com/cloud/storage/dao/LaunchPermissionDao.java
+++ /dev/null
@@ -1,61 +0,0 @@
-// 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 com.cloud.storage.dao;
-
-import java.util.List;
-
-
-import com.cloud.storage.LaunchPermissionVO;
-import com.cloud.storage.VMTemplateVO;
-import com.cloud.utils.db.GenericDao;
-
-public interface LaunchPermissionDao extends GenericDao<LaunchPermissionVO, Long> {
-    /**
-     * remove the ability to launch vms from the given template for the given account names which are valid in the given domain
-     * @param templateId id of the template to modify launch permissions
-     * @param accountIds list of account ids
-     */
-    void removePermissions(long templateId, List<Long> accountIds);
-
-    /**
-     * remove all launch permissions associated with a template
-     * @param templateId
-     */
-    void removeAllPermissions(long templateId);
-
-    /**
-     * Find a launch permission by templateId, accountName, and domainId
-     * @param templateId the id of the template to search for
-     * @param accountId the id of the account for which permission is being searched
-     * @return launch permission if found, null otherwise
-     */
-    LaunchPermissionVO findByTemplateAndAccount(long templateId, long accountId);
-
-    /**
-     * List all launch permissions for the given template
-     * @param templateId id of the template for which launch permissions will be queried
-     * @return list of launch permissions
-     */
-    List<LaunchPermissionVO> findByTemplate(long templateId);
-
-    /**
-     * List all templates for which permission to launch instances has been granted to the given account
-     * @param accountId
-     * @return
-     */
-    List<VMTemplateVO> listPermittedTemplates(long accountId);
-}

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/572e71e5/server/src/com/cloud/storage/dao/LaunchPermissionDaoImpl.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/storage/dao/LaunchPermissionDaoImpl.java b/server/src/com/cloud/storage/dao/LaunchPermissionDaoImpl.java
deleted file mode 100644
index 286b1d9..0000000
--- a/server/src/com/cloud/storage/dao/LaunchPermissionDaoImpl.java
+++ /dev/null
@@ -1,158 +0,0 @@
-// 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 com.cloud.storage.dao;
-
-import java.sql.PreparedStatement;
-import java.sql.ResultSet;
-import java.util.ArrayList;
-import java.util.Date;
-import java.util.List;
-
-import javax.ejb.Local;
-
-import org.apache.log4j.Logger;
-import org.springframework.stereotype.Component;
-
-import com.cloud.storage.LaunchPermissionVO;
-import com.cloud.storage.VMTemplateVO;
-import com.cloud.storage.Storage.TemplateType;
-import com.cloud.storage.Storage.ImageFormat;
-import com.cloud.utils.DateUtil;
-import com.cloud.utils.db.GenericDaoBase;
-import com.cloud.utils.db.SearchBuilder;
-import com.cloud.utils.db.SearchCriteria;
-import com.cloud.utils.db.Transaction;
-import com.cloud.utils.exception.CloudRuntimeException;
-
-@Component
-@Local(value={LaunchPermissionDao.class})
-public class LaunchPermissionDaoImpl extends GenericDaoBase<LaunchPermissionVO, Long> implements LaunchPermissionDao {
-    private static final Logger s_logger = Logger.getLogger(LaunchPermissionDaoImpl.class);
-    private static final String REMOVE_LAUNCH_PERMISSION = "DELETE FROM `cloud`.`launch_permission`" +
-                                                           "  WHERE template_id = ? AND account_id = ?";
-
-    private static final String LIST_PERMITTED_TEMPLATES = "SELECT t.id, t.unique_name, t.name, t.public, t.format, t.type, t.hvm, t.bits, t.url, t.created, t.account_id, t.checksum, t.display_text, t.enable_password, t.guest_os_id, t.featured" +
-                                                           "  FROM `cloud`.`vm_template` t INNER JOIN (SELECT lp.template_id as lptid" +
-                                                                                                      " FROM `cloud`.`launch_permission` lp" +
-                                                                                                      " WHERE lp.account_id = ?) joinlp" +
-                                                           "  WHERE t.id = joinlp.lptid" +
-                                                           "  ORDER BY t.created DESC";
-
-    private final SearchBuilder<LaunchPermissionVO> TemplateAndAccountSearch;
-    private final SearchBuilder<LaunchPermissionVO> TemplateIdSearch;
-
-    protected LaunchPermissionDaoImpl() {
-        TemplateAndAccountSearch = createSearchBuilder();
-        TemplateAndAccountSearch.and("templateId", TemplateAndAccountSearch.entity().getTemplateId(), SearchCriteria.Op.EQ);
-        TemplateAndAccountSearch.and("accountId", TemplateAndAccountSearch.entity().getAccountId(), SearchCriteria.Op.EQ);
-        TemplateAndAccountSearch.done();
-
-        TemplateIdSearch = createSearchBuilder();
-        TemplateIdSearch.and("templateId", TemplateIdSearch.entity().getTemplateId(), SearchCriteria.Op.EQ);
-        TemplateIdSearch.done();
-    }
-
-    @Override
-    public void removePermissions(long templateId, List<Long> accountIds) {
-        Transaction txn = Transaction.currentTxn();
-        PreparedStatement pstmt = null;
-        try {
-            txn.start();
-            String sql = REMOVE_LAUNCH_PERMISSION;
-            pstmt = txn.prepareAutoCloseStatement(sql);
-            for (Long accountId : accountIds) {
-                pstmt.setLong(1, templateId);
-                pstmt.setLong(2, accountId.longValue());
-                pstmt.addBatch();
-            }
-            pstmt.executeBatch();
-            txn.commit();
-        } catch (Exception e) {
-            txn.rollback();
-            s_logger.warn("Error removing launch permissions", e);
-            throw new CloudRuntimeException("Error removing launch permissions", e);
-        }
-    }
-
-    @Override
-    public void removeAllPermissions(long templateId) {
-        SearchCriteria<LaunchPermissionVO> sc = TemplateIdSearch.create();
-        sc.setParameters("templateId", templateId);
-        expunge(sc);
-    }
-
-    @Override
-    public LaunchPermissionVO findByTemplateAndAccount(long templateId, long accountId) {
-        SearchCriteria<LaunchPermissionVO> sc = TemplateAndAccountSearch.create();
-        sc.setParameters("templateId", templateId);
-        sc.setParameters("accountId", accountId);
-        return findOneBy(sc);
-    }
-
-    @Override
-    public List<VMTemplateVO> listPermittedTemplates(long accountId) {
-        Transaction txn = Transaction.currentTxn();
-        List<VMTemplateVO> permittedTemplates = new ArrayList<VMTemplateVO>();
-        PreparedStatement pstmt = null;
-        try {
-            String sql = LIST_PERMITTED_TEMPLATES;
-            pstmt = txn.prepareAutoCloseStatement(sql);
-            pstmt.setLong(1, accountId);
-            ResultSet rs = pstmt.executeQuery();
-            while (rs.next()) {
-                long id = rs.getLong(1);
-                String uniqueName = rs.getString(2);
-                String name = rs.getString(3);
-                boolean isPublic = rs.getBoolean(4);
-                String value = rs.getString(5);
-                ImageFormat format = ImageFormat.valueOf(value);
-                String tmpltType = rs.getString(6);
-                boolean requiresHVM = rs.getBoolean(7);
-                int bits = rs.getInt(8);
-                String url = rs.getString(9);
-                String createdTS = rs.getString(10);
-                long templateAccountId = rs.getLong(11);
-                String checksum = rs.getString(12);
-                String displayText = rs.getString(13);
-                boolean enablePassword = rs.getBoolean(14);
-                long guestOSId = rs.getLong(15);
-                boolean featured = rs.getBoolean(16);
-                Date createdDate = null;
-
-                if (createdTS != null) {
-                    createdDate = DateUtil.parseDateString(s_gmtTimeZone, createdTS);
-                }
-
-                if (isPublic) {
-                    continue; // if it's public already, skip adding it to permitted templates as this for private templates only
-                }
-                VMTemplateVO template = new VMTemplateVO(id, uniqueName, name, format, isPublic, featured, TemplateType.valueOf(tmpltType), url, createdDate, requiresHVM, bits, templateAccountId, checksum, displayText, enablePassword, guestOSId, true, null);
-                permittedTemplates.add(template);
-            }
-        } catch (Exception e) {
-            s_logger.warn("Error listing permitted templates", e);
-        }
-        return permittedTemplates;
-    }
-
-    @Override
-    public List<LaunchPermissionVO> findByTemplate(long templateId) {
-        SearchCriteria<LaunchPermissionVO> sc = TemplateIdSearch.create();
-        sc.setParameters("templateId", templateId);
-        return listBy(sc);
-    }
-}

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/572e71e5/server/src/com/cloud/storage/dao/S3Dao.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/storage/dao/S3Dao.java b/server/src/com/cloud/storage/dao/S3Dao.java
deleted file mode 100644
index ebea353..0000000
--- a/server/src/com/cloud/storage/dao/S3Dao.java
+++ /dev/null
@@ -1,29 +0,0 @@
-/*
- * 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 com.cloud.storage.dao;
-
-import com.cloud.agent.api.to.S3TO;
-import com.cloud.storage.S3VO;
-import com.cloud.utils.db.GenericDao;
-
-public interface S3Dao extends GenericDao<S3VO, Long> {
-
-    S3TO getS3TO(final Long id);
-
-}

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/572e71e5/server/src/com/cloud/storage/dao/S3DaoImpl.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/storage/dao/S3DaoImpl.java b/server/src/com/cloud/storage/dao/S3DaoImpl.java
deleted file mode 100644
index f0dd078..0000000
--- a/server/src/com/cloud/storage/dao/S3DaoImpl.java
+++ /dev/null
@@ -1,50 +0,0 @@
-/*
- * 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 com.cloud.storage.dao;
-
-import com.cloud.agent.api.to.S3TO;
-import com.cloud.storage.S3VO;
-import com.cloud.utils.db.GenericDaoBase;
-
-import javax.ejb.Local;
-
-import org.springframework.stereotype.Component;
-
-@Component
-@Local(S3Dao.class)
-public class S3DaoImpl extends GenericDaoBase<S3VO, Long> implements S3Dao {
-
-    @Override
-    public S3TO getS3TO(final Long id) {
-
-        if (id != null) {
-
-            final S3VO s3VO = findById(id);
-            if (s3VO != null) {
-                return s3VO.toS3TO();
-            }
-
-        }
-
-        // NOTE: Excluded listAll / shuffle operation implemented in SwiftDaoImpl ...
-
-        return null;
-
-    }
-}


Mime
View raw message