Removed framework-api which is completely useless. Changed framework-ipc to reference gson itself. Move VOs into engine-schema.

This commit is contained in:
Alex Huang 2013-04-30 19:06:20 -07:00
parent 5e87b0a385
commit e0d8f01ecd
34 changed files with 86 additions and 223 deletions

View File

@ -16,12 +16,12 @@
// under the License.
package com.cloud.storage.snapshot;
import org.apache.cloudstack.api.Identity;
import org.apache.cloudstack.api.InternalIdentity;
import java.util.Date;
public interface SnapshotSchedule {
long getId();
String getUuid();
public interface SnapshotSchedule extends InternalIdentity, Identity {
Long getVolumeId();
@ -38,10 +38,9 @@ public interface SnapshotSchedule {
Long getAsyncJobId();
void setAsyncJobId(long asyncJobId);
void setAsyncJobId(Long asyncJobId);
Long getSnapshotId();
void setSnapshotId(Long snapshotId);
}

View File

@ -36,6 +36,11 @@
<artifactId>cloud-engine-api</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.apache.cloudstack</groupId>
<artifactId>cloud-engine-schema</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>commons-httpclient</groupId>
<artifactId>commons-httpclient</artifactId>
@ -55,7 +60,5 @@
</dependencies>
<build>
<defaultGoal>install</defaultGoal>
<sourceDirectory>src</sourceDirectory>
<testSourceDirectory>test</testSourceDirectory>
</build>
</project>

View File

@ -1,46 +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.snapshot;
import org.apache.cloudstack.api.Identity;
import org.apache.cloudstack.api.InternalIdentity;
import java.util.Date;
public interface SnapshotSchedule extends InternalIdentity, Identity {
Long getVolumeId();
Long getPolicyId();
void setPolicyId(long policyId);
/**
* @return the scheduledTimestamp
*/
Date getScheduledTimestamp();
void setScheduledTimestamp(Date scheduledTimestamp);
Long getAsyncJobId();
void setAsyncJobId(Long asyncJobId);
Long getSnapshotId();
void setSnapshotId(Long snapshotId);
}

View File

@ -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.vm;
import com.cloud.storage.Storage;
/**
* VirtualDisk describes the disks that are plugged into
* the virtual machine.
*
*/
public class VirtualDisk {
public Storage.ImageFormat format;
public String url;
public boolean bootable;
public long size;
}

View File

@ -29,8 +29,6 @@
</parent>
<build>
<defaultGoal>install</defaultGoal>
<sourceDirectory>src</sourceDirectory>
<testSourceDirectory>test</testSourceDirectory>
</build>
<modules>
<module>api</module>

View File

@ -20,16 +20,15 @@ import java.util.Date;
import java.util.List;
import com.cloud.event.UsageEventVO;
import com.cloud.exception.UsageServerException;
import com.cloud.utils.db.GenericDao;
public interface UsageEventDao extends GenericDao<UsageEventVO, Long> {
public List<UsageEventVO> listLatestEvents(Date endDate);
public List<UsageEventVO> getLatestEvent();
List<UsageEventVO> getRecentEvents(Date endDate) throws UsageServerException;
List<UsageEventVO> getRecentEvents(Date endDate);
List<UsageEventVO> listDirectIpEvents(Date startDate, Date endDate, long zoneId);

View File

@ -30,7 +30,6 @@ import org.springframework.stereotype.Component;
import com.cloud.dc.Vlan;
import com.cloud.event.EventTypes;
import com.cloud.event.UsageEventVO;
import com.cloud.exception.UsageServerException;
import com.cloud.utils.DateUtil;
import com.cloud.utils.db.DB;
import com.cloud.utils.db.Filter;
@ -38,6 +37,7 @@ 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={UsageEventDao.class})
@ -58,8 +58,8 @@ public class UsageEventDaoImpl extends GenericDaoBase<UsageEventVO, Long> implem
latestEventsSearch.and("processed", latestEventsSearch.entity().isProcessed(), SearchCriteria.Op.EQ);
latestEventsSearch.and("enddate", latestEventsSearch.entity().getCreateDate(), SearchCriteria.Op.LTEQ);
latestEventsSearch.done();
IpeventsSearch = createSearchBuilder();
IpeventsSearch = createSearchBuilder();
IpeventsSearch.and("startdate", IpeventsSearch.entity().getCreateDate(), SearchCriteria.Op.GTEQ);
IpeventsSearch.and("enddate", IpeventsSearch.entity().getCreateDate(), SearchCriteria.Op.LTEQ);
IpeventsSearch.and("zoneid", IpeventsSearch.entity().getZoneId(), SearchCriteria.Op.EQ);
@ -84,10 +84,10 @@ public class UsageEventDaoImpl extends GenericDaoBase<UsageEventVO, Long> implem
Filter filter = new Filter(UsageEventVO.class, "id", Boolean.FALSE, Long.valueOf(0), Long.valueOf(1));
return listAll(filter);
}
@Override
@DB
public synchronized List<UsageEventVO> getRecentEvents(Date endDate) throws UsageServerException {
public synchronized List<UsageEventVO> getRecentEvents(Date endDate) {
long recentEventId = getMostRecentEventId();
long maxEventId = getMaxEventId(endDate);
Transaction txn = Transaction.open(Transaction.USAGE_DB);
@ -114,12 +114,12 @@ public class UsageEventDaoImpl extends GenericDaoBase<UsageEventVO, Long> implem
} catch (Exception ex) {
txn.rollback();
s_logger.error("error copying events from cloud db to usage db", ex);
throw new UsageServerException(ex.getMessage());
throw new CloudRuntimeException(ex.getMessage());
}
}
@DB
private long getMostRecentEventId() throws UsageServerException {
private long getMostRecentEventId() {
Transaction txn = Transaction.open(Transaction.USAGE_DB);
try {
List<UsageEventVO> latestEvents = getLatestEvent();
@ -133,25 +133,25 @@ public class UsageEventDaoImpl extends GenericDaoBase<UsageEventVO, Long> implem
return 0;
} catch (Exception ex) {
s_logger.error("error getting most recent event id", ex);
throw new UsageServerException(ex.getMessage());
throw new CloudRuntimeException(ex.getMessage());
} finally {
txn.close();
}
}
private List<UsageEventVO> findRecentEvents(Date endDate) throws UsageServerException {
private List<UsageEventVO> findRecentEvents(Date endDate) {
Transaction txn = Transaction.open(Transaction.USAGE_DB);
try {
return listLatestEvents(endDate);
} catch (Exception ex) {
s_logger.error("error getting most recent event date", ex);
throw new UsageServerException(ex.getMessage());
throw new CloudRuntimeException(ex.getMessage());
} finally {
txn.close();
}
}
private long getMaxEventId(Date endDate) throws UsageServerException {
private long getMaxEventId(Date endDate) {
Transaction txn = Transaction.currentTxn();
PreparedStatement pstmt = null;
try {
@ -165,7 +165,7 @@ public class UsageEventDaoImpl extends GenericDaoBase<UsageEventVO, Long> implem
return 0;
} catch (Exception ex) {
s_logger.error("error getting max event id", ex);
throw new UsageServerException(ex.getMessage());
throw new CloudRuntimeException(ex.getMessage());
} finally {
txn.close();
}

View File

@ -1,42 +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. -->
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<artifactId>cloud-framework-api</artifactId>
<parent>
<groupId>org.apache.cloudstack</groupId>
<artifactId>cloudstack-framework</artifactId>
<version>4.2.0-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>
<dependencies>
<!-- <dependency> <groupId>org.hornetq</groupId> <artifactId>hornetq-core-client</artifactId>
<version>snap-r9548</version> </dependency> -->
<dependency>
<groupId>org.apache.cloudstack</groupId>
<artifactId>cloud-utils</artifactId>
<version>4.2.0-SNAPSHOT</version>
</dependency>
</dependencies>
<build>
<defaultGoal>install</defaultGoal>
<sourceDirectory>src</sourceDirectory>
<testSourceDirectory>${project.basedir}/test</testSourceDirectory>
<testResources>
<testResource>
<directory>${project.basedir}/test/resources</directory>
</testResource>
</testResources>
</build>
</project>

View File

@ -20,26 +20,24 @@
<relativePath>../pom.xml</relativePath>
</parent>
<dependencies>
<!-- <dependency> <groupId>org.hornetq</groupId> <artifactId>hornetq-core-client</artifactId>
<version>snap-r9548</version> </dependency> -->
<dependency>
<groupId>org.apache.cloudstack</groupId>
<artifactId>cloud-core</artifactId>
<version>4.2.0-SNAPSHOT</version>
<groupId>cglib</groupId>
<artifactId>cglib-nodep</artifactId>
<version>${cs.cglib.version}</version>
</dependency>
<dependency>
<groupId>com.google.code.gson</groupId>
<artifactId>gson</artifactId>
<version>${cs.gson.version}</version>
</dependency>
<dependency>
<groupId>org.apache.cloudstack</groupId>
<artifactId>cloud-utils</artifactId>
<version>4.2.0-SNAPSHOT</version>
<version>${project.version}</version>
</dependency>
</dependencies>
<build>
<defaultGoal>install</defaultGoal>
<sourceDirectory>src</sourceDirectory>
<testSourceDirectory>${project.basedir}/test</testSourceDirectory>
<testResources>
<testResource>
<directory>${project.basedir}/test/resources</directory>

View File

@ -28,7 +28,7 @@ import org.apache.cloudstack.framework.transport.TransportEndpoint;
import org.apache.cloudstack.framework.transport.TransportEndpointSite;
import org.apache.cloudstack.framework.transport.TransportProvider;
import com.cloud.utils.concurrency.NamedThreadFactory;
import com.cloud.utils.concurrency.NamedThreadFactory;
public class ClientTransportProvider implements TransportProvider {
public static final int DEFAULT_WORKER_POOL_SIZE = 5;

View File

@ -33,6 +33,5 @@
<module>ipc</module>
<module>rest</module>
<module>events</module>
<module>api</module>
</modules>
</project>

13
pom.xml
View File

@ -255,6 +255,13 @@
<build>
<defaultGoal>install</defaultGoal>
<sourceDirectory>src</sourceDirectory>
<testSourceDirectory>test</testSourceDirectory>
<testResources>
<testResource>
<directory>test/resources</directory>
</testResource>
</testResources>
<outputDirectory>${basedir}/${cs.target.dir}/classes</outputDirectory>
<testOutputDirectory>${basedir}/${cs.target.dir}/test-classes</testOutputDirectory>
<pluginManagement>
@ -275,8 +282,8 @@
</execution>
</executions>
</plugin>
<!--This plugin's configuration is used to store Eclipse m2e settings
only. It has no influence on the Maven build itself. -->
<!--This plugin's configuration is used to store Eclipse m2e settings only.
It has no influence on the Maven build itself. -->
<plugin>
<groupId>org.eclipse.m2e</groupId>
<artifactId>lifecycle-mapping</artifactId>
@ -298,7 +305,7 @@
</goals>
</pluginExecutionFilter>
<action>
<ignore/>
<ignore />
</action>
</pluginExecution>
</pluginExecutions>

View File

@ -1,22 +1,14 @@
<!--
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.
-->
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<!-- 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. -->
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<artifactId>cloud-server</artifactId>
<name>Apache CloudStack Server</name>
@ -110,35 +102,35 @@
<include>**/*.xml</include>
</includes>
</resource>
</resources>
</resources>
<testResources>
<testResource>
<directory>test/resources</directory>
<excludes>
<exclude>%regex[.*[0-9]*To[0-9]*.*Test.*]</exclude>
</excludes>
<excludes>
<exclude>%regex[.*[0-9]*To[0-9]*.*Test.*]</exclude>
</excludes>
</testResource>
</testResources>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<executions>
<execution>
<id>default-testCompile</id>
<phase>test-compile</phase>
<configuration>
<testExcludes>
<exclude>**/com/cloud/upgrade/*.java</exclude>
<exclude>**/com/cloud/async/*.java</exclude>
</testExcludes>
</configuration>
<goals>
<goal>testCompile</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<executions>
<execution>
<id>default-testCompile</id>
<phase>test-compile</phase>
<configuration>
<testExcludes>
<exclude>**/com/cloud/upgrade/*.java</exclude>
<exclude>**/com/cloud/async/*.java</exclude>
</testExcludes>
</configuration>
<goals>
<goal>testCompile</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
@ -146,8 +138,8 @@
<argLine>-Xmx1024m</argLine>
<excludes>
<exclude>%regex[.*[0-9]*To[0-9]*.*Test.*]</exclude>
<exclude>com/cloud/upgrade/AdvanceZone223To224UpgradeTest</exclude>
<exclude>com/cloud/upgrade/AdvanceZone217To224UpgradeTest</exclude>
<exclude>com/cloud/upgrade/AdvanceZone223To224UpgradeTest</exclude>
<exclude>com/cloud/upgrade/AdvanceZone217To224UpgradeTest</exclude>
<exclude>com/cloud/async/*</exclude>
<exclude>com/cloud/cluster/*</exclude>
<exclude>com/cloud/snapshot/*</exclude>
@ -173,22 +165,18 @@
</goals>
<configuration>
<target>
<copy overwrite="true"
todir="${basedir}/target/conf">
<copy overwrite="true" todir="${basedir}/target/conf">
<fileset dir="${basedir}/conf">
<include name="*.in" />
</fileset>
<globmapper from="*.in" to="*" />
<filterchain>
<filterreader
classname="org.apache.tools.ant.filters.ReplaceTokens">
<param type="propertiesfile"
value="${cs.replace.properties}" />
<filterreader classname="org.apache.tools.ant.filters.ReplaceTokens">
<param type="propertiesfile" value="${cs.replace.properties}" />
</filterreader>
</filterchain>
</copy>
<copy
todir="${basedir}/target/conf">
<copy todir="${basedir}/target/conf">
<fileset dir="${basedir}/conf">
<exclude name="*.in" />
</fileset>

View File

@ -172,15 +172,6 @@
<directory>${project.basedir}/test/resources</directory>
</testResource>
</testResources>
<!--
<testResources>
<testResource>
<directory>test/resources</directory>
</testResource>
<testResource>
<directory>conf</directory>
</testResource>
</testResources> -->
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>