Removed mon-http dependencies
updated mon-common dep
This commit is contained in:
parent
bf659158be
commit
80bf39cc03
9
pom.xml
9
pom.xml
@ -15,7 +15,7 @@
|
|||||||
<properties>
|
<properties>
|
||||||
<computedVersion>${project.version}-${timestamp}-${buildNumber}</computedVersion>
|
<computedVersion>${project.version}-${timestamp}-${buildNumber}</computedVersion>
|
||||||
<computedName>${project.artifactId}-${computedVersion}</computedName>
|
<computedName>${project.artifactId}-${computedVersion}</computedName>
|
||||||
<mon.common.version>1.0.0.42</mon.common.version>
|
<mon.common.version>1.0.0.46</mon.common.version>
|
||||||
<dropwizard.version>0.7.0</dropwizard.version>
|
<dropwizard.version>0.7.0</dropwizard.version>
|
||||||
|
|
||||||
<skipITs>true</skipITs>
|
<skipITs>true</skipITs>
|
||||||
@ -64,11 +64,6 @@
|
|||||||
<artifactId>mon-model</artifactId>
|
<artifactId>mon-model</artifactId>
|
||||||
<version>${mon.common.version}</version>
|
<version>${mon.common.version}</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
|
||||||
<groupId>com.hpcloud</groupId>
|
|
||||||
<artifactId>mon-http</artifactId>
|
|
||||||
<version>${mon.common.version}</version>
|
|
||||||
</dependency>
|
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.hpcloud</groupId>
|
<groupId>com.hpcloud</groupId>
|
||||||
<artifactId>mon-persistence</artifactId>
|
<artifactId>mon-persistence</artifactId>
|
||||||
@ -81,7 +76,7 @@
|
|||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.hpcloud</groupId>
|
<groupId>com.hpcloud</groupId>
|
||||||
<artifactId>mon-messaging</artifactId>
|
<artifactId>mon-kafka</artifactId>
|
||||||
<version>${mon.common.version}</version>
|
<version>${mon.common.version}</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
|
@ -53,7 +53,6 @@ import com.hpcloud.mon.resource.exception.IllegalArgumentExceptionMapper;
|
|||||||
import com.hpcloud.mon.resource.exception.InvalidEntityExceptionMapper;
|
import com.hpcloud.mon.resource.exception.InvalidEntityExceptionMapper;
|
||||||
import com.hpcloud.mon.resource.exception.JsonMappingExceptionManager;
|
import com.hpcloud.mon.resource.exception.JsonMappingExceptionManager;
|
||||||
import com.hpcloud.mon.resource.exception.JsonProcessingExceptionMapper;
|
import com.hpcloud.mon.resource.exception.JsonProcessingExceptionMapper;
|
||||||
import com.hpcloud.mon.resource.exception.ResourceNotFoundExceptionMapper;
|
|
||||||
import com.hpcloud.mon.resource.exception.ThrowableExceptionMapper;
|
import com.hpcloud.mon.resource.exception.ThrowableExceptionMapper;
|
||||||
import com.hpcloud.mon.resource.serialization.SubAlarmExpressionSerializer;
|
import com.hpcloud.mon.resource.serialization.SubAlarmExpressionSerializer;
|
||||||
import com.hpcloud.util.Injector;
|
import com.hpcloud.util.Injector;
|
||||||
@ -95,7 +94,6 @@ public class MonApiApplication extends Application<MonApiConfiguration> {
|
|||||||
removeExceptionMappers(environment.jersey().getResourceConfig().getSingletons());
|
removeExceptionMappers(environment.jersey().getResourceConfig().getSingletons());
|
||||||
environment.jersey().register(new EntityExistsExceptionMapper());
|
environment.jersey().register(new EntityExistsExceptionMapper());
|
||||||
environment.jersey().register(new EntityNotFoundExceptionMapper());
|
environment.jersey().register(new EntityNotFoundExceptionMapper());
|
||||||
environment.jersey().register(new ResourceNotFoundExceptionMapper());
|
|
||||||
environment.jersey().register(new IllegalArgumentExceptionMapper());
|
environment.jersey().register(new IllegalArgumentExceptionMapper());
|
||||||
environment.jersey().register(new InvalidEntityExceptionMapper());
|
environment.jersey().register(new InvalidEntityExceptionMapper());
|
||||||
environment.jersey().register(new JsonProcessingExceptionMapper());
|
environment.jersey().register(new JsonProcessingExceptionMapper());
|
||||||
|
@ -1,39 +0,0 @@
|
|||||||
/*
|
|
||||||
* Copyright (c) 2014 Hewlett-Packard Development Company, L.P.
|
|
||||||
*
|
|
||||||
* Licensed 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.hpcloud.mon.resource.exception;
|
|
||||||
|
|
||||||
import javax.ws.rs.core.MediaType;
|
|
||||||
import javax.ws.rs.core.Response;
|
|
||||||
import javax.ws.rs.core.Response.Status;
|
|
||||||
import javax.ws.rs.ext.ExceptionMapper;
|
|
||||||
import javax.ws.rs.ext.Provider;
|
|
||||||
|
|
||||||
import com.hpcloud.http.rest.ResourceNotFoundException;
|
|
||||||
import com.hpcloud.mon.resource.exception.Exceptions.FaultType;
|
|
||||||
|
|
||||||
@Provider
|
|
||||||
public class ResourceNotFoundExceptionMapper implements ExceptionMapper<ResourceNotFoundException> {
|
|
||||||
@Override
|
|
||||||
public Response toResponse(ResourceNotFoundException e) {
|
|
||||||
return Response.status(Status.BAD_REQUEST)
|
|
||||||
.type(MediaType.APPLICATION_JSON)
|
|
||||||
.entity(
|
|
||||||
Exceptions.buildLoggedErrorMessage(FaultType.BAD_REQUEST,
|
|
||||||
"The referenced %s resource id %s could not be found", e.service, e.resourceId))
|
|
||||||
.build();
|
|
||||||
}
|
|
||||||
}
|
|
@ -10,7 +10,6 @@ import com.hpcloud.mon.resource.exception.IllegalArgumentExceptionMapper;
|
|||||||
import com.hpcloud.mon.resource.exception.InvalidEntityExceptionMapper;
|
import com.hpcloud.mon.resource.exception.InvalidEntityExceptionMapper;
|
||||||
import com.hpcloud.mon.resource.exception.JsonMappingExceptionManager;
|
import com.hpcloud.mon.resource.exception.JsonMappingExceptionManager;
|
||||||
import com.hpcloud.mon.resource.exception.JsonProcessingExceptionMapper;
|
import com.hpcloud.mon.resource.exception.JsonProcessingExceptionMapper;
|
||||||
import com.hpcloud.mon.resource.exception.ResourceNotFoundExceptionMapper;
|
|
||||||
import com.hpcloud.mon.resource.exception.ThrowableExceptionMapper;
|
import com.hpcloud.mon.resource.exception.ThrowableExceptionMapper;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -20,10 +19,9 @@ public abstract class AbstractMonApiResourceTest extends AbstractResourceTest {
|
|||||||
@Override
|
@Override
|
||||||
protected void setupResources() throws Exception {
|
protected void setupResources() throws Exception {
|
||||||
addSingletons(new EntityExistsExceptionMapper(), new EntityNotFoundExceptionMapper(),
|
addSingletons(new EntityExistsExceptionMapper(), new EntityNotFoundExceptionMapper(),
|
||||||
new ResourceNotFoundExceptionMapper(), new IllegalArgumentExceptionMapper(),
|
new IllegalArgumentExceptionMapper(), new InvalidEntityExceptionMapper(),
|
||||||
new InvalidEntityExceptionMapper(), new JsonProcessingExceptionMapper(),
|
new JsonProcessingExceptionMapper(), new JsonMappingExceptionManager(),
|
||||||
new JsonMappingExceptionManager(), new ConstraintViolationExceptionMapper(),
|
new ConstraintViolationExceptionMapper(), new ThrowableExceptionMapper<Throwable>() {
|
||||||
new ThrowableExceptionMapper<Throwable>() {
|
|
||||||
});
|
});
|
||||||
|
|
||||||
objectMapper.setPropertyNamingStrategy(PropertyNamingStrategy.CAMEL_CASE_TO_LOWER_CASE_WITH_UNDERSCORES);
|
objectMapper.setPropertyNamingStrategy(PropertyNamingStrategy.CAMEL_CASE_TO_LOWER_CASE_WITH_UNDERSCORES);
|
||||||
|
Loading…
Reference in New Issue
Block a user