Skip to content

Commit 54cce5f

Browse files
author
Alex Huang
committed
Getting things to compile
1 parent 259e6d5 commit 54cce5f

16 files changed

Lines changed: 462 additions & 38 deletions

File tree

engine/api/pom.xml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,9 +37,9 @@
3737
</exclusions>
3838
</dependency>
3939
<dependency>
40-
<groupId>org.codehaus.jackson</groupId>
41-
<artifactId>jackson-jaxrs</artifactId>
42-
<version>1.9.9</version>
40+
<groupId>org.apache.cloudstack</groupId>
41+
<artifactId>cloud-framework-rest</artifactId>
42+
<version>${project.version}</version>
4343
</dependency>
4444
</dependencies>
4545
<build>

engine/api/src/org/apache/cloudstack/engine/datacenter/entity/api/ZoneEntity.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,9 @@
2424
import javax.ws.rs.Path;
2525
import javax.xml.bind.annotation.XmlRootElement;
2626

27+
import org.apache.cloudstack.engine.service.api.ProvisioningService;
28+
import org.apache.cloudstack.framework.ws.jackson.Url;
29+
2730
import com.cloud.dc.DataCenter;
2831

2932
/**
@@ -35,5 +38,6 @@ public interface ZoneEntity extends DataCenterResourceEntity, DataCenter {
3538
@Path("/pods")
3639
List<PodEntity> listPods();
3740

41+
@Url(clazz=ProvisioningService.class, method="getPod", name="id", type=List.class)
3842
List<String> listPodIds();
3943
}

engine/api/src/org/apache/cloudstack/engine/rest/service/api/ProvisioningRestService.java

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,10 +36,8 @@
3636
import org.apache.cloudstack.engine.rest.datacenter.entity.api.ZoneRestTO;
3737
import org.apache.cloudstack.engine.service.api.ProvisioningService;
3838
import org.springframework.stereotype.Component;
39-
import org.springframework.stereotype.Service;
4039

4140

42-
@Service("provisioningService")
4341
@Path("/provisioning")
4442
@Produces({"application/xml", "application/json"})
4543
@Component

engine/api/src/org/apache/cloudstack/engine/service/api/ProvisioningService.java

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,10 @@
2121
import java.util.List;
2222
import java.util.Map;
2323

24+
import javax.ws.rs.GET;
25+
import javax.ws.rs.Path;
26+
import javax.ws.rs.Produces;
27+
2428
import org.apache.cloudstack.engine.datacenter.entity.api.ClusterEntity;
2529
import org.apache.cloudstack.engine.datacenter.entity.api.PodEntity;
2630
import org.apache.cloudstack.engine.datacenter.entity.api.StorageEntity;
@@ -35,6 +39,8 @@
3539
* ProvisioningService registers and deregisters physical and virtual
3640
* resources that the management server can use.
3741
*/
42+
@Path("/provisioning")
43+
@Produces({"application/json"})
3844
public interface ProvisioningService {
3945

4046
StorageEntity registerStorage(String name, List<String> tags, Map<String, String> details);
@@ -61,11 +67,15 @@ public interface ProvisioningService {
6167

6268
List<Host> listHosts();
6369

70+
@GET
71+
@Path("/zone/{zoneid}/pods")
6472
List<PodEntity> listPods();
6573

6674
List<ZoneEntity> listZones();
6775

6876
List<StoragePool> listStorage();
6977

78+
@GET
79+
@Path("/{zoneid}")
7080
ZoneEntity getZone(String id);
7181
}

engine/orchestration/src/org/apache/cloudstack/engine/service/api/ProvisioningServiceImpl.java

Lines changed: 32 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -29,44 +29,16 @@
2929
import org.apache.cloudstack.engine.datacenter.entity.api.ZoneEntity;
3030
import org.apache.cloudstack.engine.datacenter.entity.api.ZoneEntityImpl;
3131
import org.springframework.stereotype.Component;
32+
import org.springframework.stereotype.Service;
3233

3334
import com.cloud.host.Host;
3435
import com.cloud.host.Status;
3536
import com.cloud.storage.StoragePool;
3637

3738
@Component
39+
@Service("provisioningService")
3840
public class ProvisioningServiceImpl implements ProvisioningService {
3941

40-
@Override
41-
public StorageEntity registerStorage(String name, List<String> tags, Map<String, String> details) {
42-
// TODO Auto-generated method stub
43-
return null;
44-
}
45-
46-
@Override
47-
public ZoneEntity registerZone(String name, List<String> tags, Map<String, String> details) {
48-
// TODO Auto-generated method stub
49-
return null;
50-
}
51-
52-
@Override
53-
public PodEntity registerPod(String name, List<String> tags, Map<String, String> details) {
54-
// TODO Auto-generated method stub
55-
return null;
56-
}
57-
58-
@Override
59-
public ClusterEntity registerCluster(String name, List<String> tags, Map<String, String> details) {
60-
// TODO Auto-generated method stub
61-
return null;
62-
}
63-
64-
@Override
65-
public String registerHost(String name, List<String> tags, Map<String, String> details) {
66-
// TODO Auto-generated method stub
67-
return null;
68-
}
69-
7042
@Override
7143
public void deregisterStorage(String uuid) {
7244
// TODO Auto-generated method stub
@@ -137,4 +109,34 @@ public ZoneEntity getZone(String uuid) {
137109
return impl;
138110
}
139111

112+
@Override
113+
public StorageEntity registerStorage(String name, List<String> tags, Map<String, String> details) {
114+
// TODO Auto-generated method stub
115+
return null;
116+
}
117+
118+
@Override
119+
public ZoneEntity registerZone(String name, List<String> tags, Map<String, String> details) {
120+
// TODO Auto-generated method stub
121+
return null;
122+
}
123+
124+
@Override
125+
public PodEntity registerPod(String name, List<String> tags, Map<String, String> details) {
126+
// TODO Auto-generated method stub
127+
return null;
128+
}
129+
130+
@Override
131+
public ClusterEntity registerCluster(String name, List<String> tags, Map<String, String> details) {
132+
// TODO Auto-generated method stub
133+
return null;
134+
}
135+
136+
@Override
137+
public String registerHost(String name, List<String> tags, Map<String, String> details) {
138+
// TODO Auto-generated method stub
139+
return null;
140+
}
141+
140142
}

engine/pom.xml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,6 @@
4242
<module>storage/imagemotion</module>
4343
<module>storage/backup</module>
4444
<module>storage/snapshot</module>
45-
<module>storage/integration-test</module>
4645
<module>components-api</module>
4746
<module>schema</module>
4847
<module>network</module>

engine/service/src/main/webapp/WEB-INF/beans.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
<ref bean="zoneService" />
1919
</jaxrs:serviceBeans>
2020
<jaxrs:providers>
21-
<bean class="org.codehaus.jackson.jaxrs.JacksonJsonProvider" />
21+
<bean class="com.fasterxml.jackson.jaxrs.json.JacksonJsonProvider" />
2222
</jaxrs:providers>
2323
</jaxrs:server>
2424
</beans>

engine/storage/volume/src/org/apache/cloudstack/storage/datastore/provider/DefaultPrimaryDatastoreProviderImpl.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,11 @@ public DefaultPrimaryDatastoreProviderImpl(@Qualifier("defaultProvider") List<Pr
5151
configuratorMaps.put(key, configurator);
5252
}
5353
}
54+
55+
// TODO: Remove this. I put this in to get over the compilation problem. Edison needs to look at Solidfire's implementation which requires this.
56+
public DefaultPrimaryDatastoreProviderImpl() {
57+
58+
}
5459

5560
protected String generateKey(HypervisorType hypervisor, String poolType) {
5661
return hypervisor.toString().toLowerCase() + "_" + poolType.toString().toLowerCase();

framework/rest/pom.xml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,5 +40,16 @@
4040
<artifactId>jackson-jaxrs-json-provider</artifactId>
4141
<version>2.1.1</version>
4242
</dependency>
43+
<dependency>
44+
<groupId>org.apache.cxf</groupId>
45+
<artifactId>cxf-bundle-jaxrs</artifactId>
46+
<version>2.7.0</version>
47+
<exclusions>
48+
<exclusion>
49+
<groupId>org.eclipse.jetty</groupId>
50+
<artifactId>jetty-server</artifactId>
51+
</exclusion>
52+
</exclusions>
53+
</dependency>
4354
</dependencies>
4455
</project>
Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
/*
2+
* Licensed to the Apache Software Foundation (ASF) under one
3+
* or more contributor license agreements. See the NOTICE file
4+
* distributed with this work for additional information
5+
* regarding copyright ownership. The ASF licenses this file
6+
* to you under the Apache License, Version 2.0 (the
7+
* "License"); you may not use this file except in compliance
8+
* with the License. You may obtain a copy of the License at
9+
*
10+
* http://www.apache.org/licenses/LICENSE-2.0
11+
*
12+
* Unless required by applicable law or agreed to in writing,
13+
* software distributed under the License is distributed on an
14+
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15+
* KIND, either express or implied. See the License for the
16+
* specific language governing permissions and limitations
17+
* under the License.
18+
*/
19+
package org.apache.cloudstack.framework.ws.jackson;
20+
21+
import java.lang.reflect.AnnotatedElement;
22+
import java.util.List;
23+
24+
import com.fasterxml.jackson.core.Version;
25+
import com.fasterxml.jackson.databind.introspect.Annotated;
26+
import com.fasterxml.jackson.databind.introspect.NopAnnotationIntrospector;
27+
28+
29+
/**
30+
* Adds introspectors for the annotations added specifically for CloudStack
31+
* Web Services.
32+
*
33+
*/
34+
public class CSJacksonAnnotationIntrospector extends NopAnnotationIntrospector {
35+
36+
private static final long serialVersionUID = 5532727887216652602L;
37+
38+
@Override
39+
public Version version() {
40+
return new Version(1, 7, 0, "abc", "org.apache.cloudstack", "cloudstack-framework-rest");
41+
}
42+
43+
@Override
44+
public Object findSerializer(Annotated a) {
45+
AnnotatedElement ae = a.getAnnotated();
46+
Url an = ae.getAnnotation(Url.class);
47+
if (an == null) {
48+
return null;
49+
}
50+
51+
if (an.type() == String.class) {
52+
return new UriSerializer(an);
53+
} else if (an.type() == List.class){
54+
return new UrisSerializer(an);
55+
}
56+
57+
throw new UnsupportedOperationException("Unsupported type " + an.type());
58+
59+
}
60+
}

0 commit comments

Comments
 (0)