From 94c3b67f3811408bb4f81ba2b8ab6175b02baec2 Mon Sep 17 00:00:00 2001 From: David Goldberg Date: Wed, 26 Mar 2014 15:40:04 +0200 Subject: [PATCH] Improved ILispDAO interface. Signed-off-by: David Goldberg --- .../interfaces/dao/ILispDAO.java | 35 ++++++---------- .../interfaces/dao/IQueryAll.java | 16 -------- .../interfaces/lisp/IGeneralMapServer.java | 6 +-- .../clusterdao/ClusterDAOService.java | 21 ++++------ .../implementation/LispMappingService.java | 41 ++++++++----------- .../implementation/lisp/MapServer.java | 6 +-- .../implementation/lisp/MapServerTest.java | 5 ++- .../MappingServiceIntegrationTest.java | 21 ++++------ .../northbound/LispMappingNorthbound.java | 37 ++++------------- mappingservice/yangmodel/.gitignore | 4 ++ 10 files changed, 68 insertions(+), 124 deletions(-) delete mode 100644 mappingservice/api/src/main/java/org/opendaylight/lispflowmapping/interfaces/dao/IQueryAll.java diff --git a/mappingservice/api/src/main/java/org/opendaylight/lispflowmapping/interfaces/dao/ILispDAO.java b/mappingservice/api/src/main/java/org/opendaylight/lispflowmapping/interfaces/dao/ILispDAO.java index 8d856f9c0..4d950ef13 100644 --- a/mappingservice/api/src/main/java/org/opendaylight/lispflowmapping/interfaces/dao/ILispDAO.java +++ b/mappingservice/api/src/main/java/org/opendaylight/lispflowmapping/interfaces/dao/ILispDAO.java @@ -9,9 +9,8 @@ package org.opendaylight.lispflowmapping.interfaces.dao; import java.util.Map; -import java.util.concurrent.TimeUnit; -public interface ILispDAO extends IQueryAll { +public interface ILispDAO { /** * Put a entry into the DAO. @@ -41,16 +40,19 @@ public interface ILispDAO extends IQueryAll { * The key. * @return The value from the DAO. */ - public Map get(K key); + public Map get(Object key); /** - * Remove an entry from the DAO + * Enumerate all the entries from the DAO * - * @param key - * The key of the entry - * @return true if success, false otherwise + * @param visitor + */ + public void getAll(IRowVisitor visitor); + + /** + * Remove an entry from the DAO */ - public boolean remove(Object key); + public void remove(Object key); /** * Remove an entry from the DAO @@ -59,25 +61,12 @@ public interface ILispDAO extends IQueryAll { * The key of the entry * @param valueKey * The value to delete - * @return true if success, false otherwise */ - public boolean removeSpecific(Object key, String valueKey); + public void removeSpecific(Object key, String valueKey); /** * Clear the DAO and remove all of the entries. */ - public void clearAll(); - - /** - * @return The time unit of the DAO cleaner - */ - public TimeUnit getTimeUnit(); - - /** - * Set the time unit of the DAO cleaner - * - * @param timeUnit - */ - public void setTimeUnit(TimeUnit timeUnit); + public void removeAll(); } diff --git a/mappingservice/api/src/main/java/org/opendaylight/lispflowmapping/interfaces/dao/IQueryAll.java b/mappingservice/api/src/main/java/org/opendaylight/lispflowmapping/interfaces/dao/IQueryAll.java deleted file mode 100644 index 0a31c3236..000000000 --- a/mappingservice/api/src/main/java/org/opendaylight/lispflowmapping/interfaces/dao/IQueryAll.java +++ /dev/null @@ -1,16 +0,0 @@ -/* - * Copyright (c) 2014 Contextream, Inc. and others. All rights reserved. - * - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License v1.0 which accompanies this distribution, - * and is available at http://www.eclipse.org/legal/epl-v10.html - */ - -package org.opendaylight.lispflowmapping.interfaces.dao; - -/** - * An interface for allowing iteration over all of the entries in the DAO - */ -public interface IQueryAll { - public void getAll(IRowVisitor visitor); -} diff --git a/mappingservice/api/src/main/java/org/opendaylight/lispflowmapping/interfaces/lisp/IGeneralMapServer.java b/mappingservice/api/src/main/java/org/opendaylight/lispflowmapping/interfaces/lisp/IGeneralMapServer.java index b8c04d97e..e7ff8ec14 100644 --- a/mappingservice/api/src/main/java/org/opendaylight/lispflowmapping/interfaces/lisp/IGeneralMapServer.java +++ b/mappingservice/api/src/main/java/org/opendaylight/lispflowmapping/interfaces/lisp/IGeneralMapServer.java @@ -42,7 +42,7 @@ public interface IGeneralMapServer { void setShouldAuthenticate(boolean shouldAuthenticate); - public void setOverwrite(boolean overwrite); + void setOverwrite(boolean overwrite); /** * This method removes the given authentication key from the map server. @@ -51,7 +51,7 @@ public interface IGeneralMapServer { * @param maskLen * @return */ - boolean removeAuthenticationKey(LispAddressContainer address, int maskLen); + void removeAuthenticationKey(LispAddressContainer address, int maskLen); /** * This method adds an authentication key to the address. @@ -61,5 +61,5 @@ public interface IGeneralMapServer { * @param key * @return */ - boolean addAuthenticationKey(LispAddressContainer address, int maskLen, String key); + void addAuthenticationKey(LispAddressContainer address, int maskLen, String key); } diff --git a/mappingservice/clusterdao/src/main/java/org/opendaylight/lispflowmapping/clusterdao/ClusterDAOService.java b/mappingservice/clusterdao/src/main/java/org/opendaylight/lispflowmapping/clusterdao/ClusterDAOService.java index dc28e26ae..0c89ac15a 100644 --- a/mappingservice/clusterdao/src/main/java/org/opendaylight/lispflowmapping/clusterdao/ClusterDAOService.java +++ b/mappingservice/clusterdao/src/main/java/org/opendaylight/lispflowmapping/clusterdao/ClusterDAOService.java @@ -21,14 +21,13 @@ import org.opendaylight.controller.clustering.services.CacheExistException; import org.opendaylight.controller.clustering.services.IClusterContainerServices; import org.opendaylight.controller.clustering.services.IClusterServices; import org.opendaylight.lispflowmapping.interfaces.dao.ILispDAO; -import org.opendaylight.lispflowmapping.interfaces.dao.IQueryAll; import org.opendaylight.lispflowmapping.interfaces.dao.IRowVisitor; import org.opendaylight.lispflowmapping.interfaces.dao.MappingEntry; import org.opendaylight.lispflowmapping.interfaces.dao.MappingServiceRLOCGroup; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -public class ClusterDAOService implements ILispDAO, IQueryAll { +public class ClusterDAOService implements ILispDAO { protected static final Logger logger = LoggerFactory.getLogger(ClusterDAOService.class); private IClusterContainerServices clusterContainerService = null; @@ -60,7 +59,6 @@ public class ClusterDAOService implements ILispDAO, IQueryAll { scheduler.shutdownNow(); } - @SuppressWarnings("deprecation") private void allocateCache() { if (this.clusterContainerService == null) { logger.warn("un-initialized clusterContainerService, can't create cache"); @@ -77,7 +75,7 @@ public class ClusterDAOService implements ILispDAO, IQueryAll { logger.trace("Cache successfully created for ClusterDAOService"); } - @SuppressWarnings({ "unchecked", "deprecation" }) + @SuppressWarnings({ "unchecked" }) private void retrieveCache() { if (this.clusterContainerService == null) { logger.warn("un-initialized clusterContainerService, can't retrieve cache"); @@ -133,22 +131,21 @@ public class ClusterDAOService implements ILispDAO, IQueryAll { return keyToValues.get(valueKey); } - public Map get(K key) { + public Map get(Object key) { return data.get(key); } - public boolean remove(Object key) { - return data.remove(key) != null; + public void remove(Object key) { + data.remove(key); } - public boolean removeSpecific(Object key, String valueKey) { - if (!data.containsKey(key) || !data.get(key).containsKey(valueKey)) { - return false; + public void removeSpecific(Object key, String valueKey) { + if (data.containsKey(key) && data.get(key).containsKey(valueKey)) { + data.get(key).remove(valueKey); } - return data.get(key).remove(valueKey) != null; } - public void clearAll() { + public void removeAll() { data.clear(); } diff --git a/mappingservice/implementation/src/main/java/org/opendaylight/lispflowmapping/implementation/LispMappingService.java b/mappingservice/implementation/src/main/java/org/opendaylight/lispflowmapping/implementation/LispMappingService.java index 0f39a018a..727bd8e04 100644 --- a/mappingservice/implementation/src/main/java/org/opendaylight/lispflowmapping/implementation/LispMappingService.java +++ b/mappingservice/implementation/src/main/java/org/opendaylight/lispflowmapping/implementation/LispMappingService.java @@ -27,7 +27,6 @@ import org.opendaylight.lispflowmapping.implementation.util.LispAFIConvertor; import org.opendaylight.lispflowmapping.implementation.util.LispNotificationHelper; import org.opendaylight.lispflowmapping.interfaces.dao.ILispDAO; import org.opendaylight.lispflowmapping.interfaces.dao.ILispTypeConverter; -import org.opendaylight.lispflowmapping.interfaces.dao.IQueryAll; import org.opendaylight.lispflowmapping.interfaces.dao.IRowVisitor; import org.opendaylight.lispflowmapping.interfaces.lisp.IFlowMapping; import org.opendaylight.lispflowmapping.interfaces.lisp.IMapNotifyHandler; @@ -135,24 +134,20 @@ public class LispMappingService implements CommandProvider, IFlowMapping, Bindin public void _dumpAll(final CommandInterpreter ci) { ci.println("EID\tRLOCs"); - if (lispDao instanceof IQueryAll) { - ((IQueryAll) lispDao).getAll(new IRowVisitor() { - String lastKey = ""; - - public void visitRow(Object keyId, String valueKey, Object value) { - String key = keyId.getClass().getSimpleName() + "#" + keyId; - if (!lastKey.equals(key)) { - ci.println(); - ci.print(key + "\t"); - } - ci.print(valueKey + "=" + value + "\t"); - lastKey = key; + lispDao.getAll(new IRowVisitor() { + String lastKey = ""; + + public void visitRow(Object keyId, String valueKey, Object value) { + String key = keyId.getClass().getSimpleName() + "#" + keyId; + if (!lastKey.equals(key)) { + ci.println(); + ci.print(key + "\t"); } - }); - ci.println(); - } else { - ci.println("Not implemented by this DAO"); - } + ci.print(valueKey + "=" + value + "\t"); + lastKey = key; + } + }); + ci.println(); return; } @@ -208,12 +203,12 @@ public class LispMappingService implements CommandProvider, IFlowMapping, Bindin return mapServer.getAuthenticationKey(address, maskLen); } - public boolean removeAuthenticationKey(LispAddressContainer address, int maskLen) { - return mapServer.removeAuthenticationKey(address, maskLen); + public void removeAuthenticationKey(LispAddressContainer address, int maskLen) { + mapServer.removeAuthenticationKey(address, maskLen); } - public boolean addAuthenticationKey(LispAddressContainer address, int maskLen, String key) { - return mapServer.addAuthenticationKey(address, maskLen, key); + public void addAuthenticationKey(LispAddressContainer address, int maskLen, String key) { + mapServer.addAuthenticationKey(address, maskLen, key); } public boolean shouldIterateMask() { @@ -288,7 +283,7 @@ public class LispMappingService implements CommandProvider, IFlowMapping, Bindin @Override public void clean() { - lispDao.clearAll(); + lispDao.removeAll(); } @Override diff --git a/mappingservice/implementation/src/main/java/org/opendaylight/lispflowmapping/implementation/lisp/MapServer.java b/mappingservice/implementation/src/main/java/org/opendaylight/lispflowmapping/implementation/lisp/MapServer.java index c4ac321dd..06719d718 100644 --- a/mappingservice/implementation/src/main/java/org/opendaylight/lispflowmapping/implementation/lisp/MapServer.java +++ b/mappingservice/implementation/src/main/java/org/opendaylight/lispflowmapping/implementation/lisp/MapServer.java @@ -124,16 +124,14 @@ public class MapServer extends AbstractLispComponent implements IMapServerAsync return getPassword(address, maskLen); } - public boolean removeAuthenticationKey(LispAddressContainer address, int maskLen) { + public void removeAuthenticationKey(LispAddressContainer address, int maskLen) { IMappingServiceKey key = MappingServiceKeyUtil.generateMappingServiceKey(address, maskLen); dao.removeSpecific(key, PASSWORD_SUBKEY); - return true; } - public boolean addAuthenticationKey(LispAddressContainer address, int maskLen, String key) { + public void addAuthenticationKey(LispAddressContainer address, int maskLen, String key) { IMappingServiceKey mappingServiceKey = MappingServiceKeyUtil.generateMappingServiceKey(address, maskLen); dao.put(mappingServiceKey, new MappingEntry(PASSWORD_SUBKEY, key)); - return true; } public boolean shouldOverwrite() { diff --git a/mappingservice/implementation/src/test/java/org/opendaylight/lispflowmapping/implementation/lisp/MapServerTest.java b/mappingservice/implementation/src/test/java/org/opendaylight/lispflowmapping/implementation/lisp/MapServerTest.java index e82a33e86..cc59eb79c 100644 --- a/mappingservice/implementation/src/test/java/org/opendaylight/lispflowmapping/implementation/lisp/MapServerTest.java +++ b/mappingservice/implementation/src/test/java/org/opendaylight/lispflowmapping/implementation/lisp/MapServerTest.java @@ -566,13 +566,14 @@ public class MapServerTest extends BaseTestCase { assertEquals(mapNotify, null); } + @SuppressWarnings("unchecked") @Test public void handleAddAuthenticationKey() throws Exception { String password = "pass"; IMappingServiceKey key = getDefualtKey(); oneOf(lispDAO).put(weq(key), weq((MappingEntry[]) (Arrays.asList(new MappingEntry(AbstractLispComponent.PASSWORD_SUBKEY, password)).toArray()))); - assertEquals(true, testedMapServer.addAuthenticationKey(LispAFIConvertor.toContainer(eid), key.getMask(), password)); + testedMapServer.addAuthenticationKey(LispAFIConvertor.toContainer(eid), key.getMask(), password); } @Test @@ -598,7 +599,7 @@ public class MapServerTest extends BaseTestCase { public void handleRemoveAuthenticationKey() throws Exception { IMappingServiceKey key = getDefualtKey(); oneOf(lispDAO).removeSpecific(weq(key), with(AbstractLispComponent.PASSWORD_SUBKEY)); - assertEquals(true, testedMapServer.removeAuthenticationKey(LispAFIConvertor.toContainer(eid), key.getMask())); + testedMapServer.removeAuthenticationKey(LispAFIConvertor.toContainer(eid), key.getMask()); } private void addDefaultPutAndGetExpectations(LispAFIAddress addr, int mask) { diff --git a/mappingservice/integrationtest/src/test/java/org/opendaylight/lispflowmapping/integrationtest/MappingServiceIntegrationTest.java b/mappingservice/integrationtest/src/test/java/org/opendaylight/lispflowmapping/integrationtest/MappingServiceIntegrationTest.java index 55bfafbee..cdefc8b6a 100644 --- a/mappingservice/integrationtest/src/test/java/org/opendaylight/lispflowmapping/integrationtest/MappingServiceIntegrationTest.java +++ b/mappingservice/integrationtest/src/test/java/org/opendaylight/lispflowmapping/integrationtest/MappingServiceIntegrationTest.java @@ -82,7 +82,6 @@ import org.opendaylight.yang.gen.v1.lispflowmapping.rev131031.lcafsourcedestaddr import org.opendaylight.yang.gen.v1.lispflowmapping.rev131031.lcaftrafficengineeringaddress.Hops; import org.opendaylight.yang.gen.v1.lispflowmapping.rev131031.lcaftrafficengineeringaddress.HopsBuilder; import org.opendaylight.yang.gen.v1.lispflowmapping.rev131031.lispaddress.LispAddressContainer; -import org.opendaylight.yang.gen.v1.lispflowmapping.rev131031.lispaddress.LispAddressContainerBuilder; import org.opendaylight.yang.gen.v1.lispflowmapping.rev131031.lispaddress.lispaddresscontainer.address.Ipv4; import org.opendaylight.yang.gen.v1.lispflowmapping.rev131031.lispaddress.lispaddresscontainer.address.Ipv4Builder; import org.opendaylight.yang.gen.v1.lispflowmapping.rev131031.lispaddress.lispaddresscontainer.address.LcafApplicationDataBuilder; @@ -139,7 +138,6 @@ public class MappingServiceIntegrationTest { public static final String ODL = "org.opendaylight.controller"; public static final String YANG = "org.opendaylight.yangtools"; public static final String JERSEY = "com.sun.jersey"; - private static final String DEBUG_PORT = "8005"; private static final int MAX_SERVICE_LOAD_RETRIES = 45; @After @@ -907,8 +905,7 @@ public class MappingServiceIntegrationTest { sendMapRegister(mapRegister.build()); - // this will fail if no MapNotify arrives for 6 seconds - MapNotify notify = receiveMapNotify(); + assertMapNotifyRecieved(); } public void testPasswordMaskMatch() throws Exception { @@ -947,8 +944,7 @@ public class MappingServiceIntegrationTest { sendMapRegister(mapRegister.build()); - // this will fail if no MapNotify arrives for 6 seconds - MapNotify notify = receiveMapNotify(); + assertMapNotifyRecieved(); etlr.setLispAddressContainer(LispAFIConvertor.toContainer(addressOutOfRange)); mapRegister @@ -1279,7 +1275,7 @@ public class MappingServiceIntegrationTest { private void registerForTTL(LispIpv4Address eid) throws SocketTimeoutException { MapRegister mapRegister = createMapRegister(eid); sendMapRegister(mapRegister); - receiveMapNotify(); + assertMapNotifyRecieved(); } private void testTTLBeforeRegister(MapRequest mapRequest) throws SocketTimeoutException { @@ -1352,7 +1348,7 @@ public class MappingServiceIntegrationTest { LispAFIConvertor.toContainer(LispAFIConvertor.asIPAfiAddress(rloc))).build(); mr.getEidToLocatorRecord().get(0).getLocatorRecord().set(0, record); sendMapRegister(mr); - receiveMapNotify(); + assertMapNotifyRecieved(); MapRequest mapRequest = createMapRequest(LispAFIConvertor.asIPAfiAddress(eid)); MapRequestBuilder builder = new MapRequestBuilder(mapRequest); builder.setPitr(true); @@ -1367,6 +1363,10 @@ public class MappingServiceIntegrationTest { } + private void assertMapNotifyRecieved() throws SocketTimeoutException { + receiveMapNotify(); + } + private MapReply receiveMapReply() throws SocketTimeoutException { return MapReplySerializer.getInstance().deserialize(ByteBuffer.wrap(receivePacket().getData())); } @@ -1466,6 +1466,7 @@ public class MappingServiceIntegrationTest { } } + @SuppressWarnings({ "rawtypes", "unchecked" }) private void areWeReady() throws InvalidSyntaxException { assertNotNull(bc); boolean debugit = false; @@ -1545,10 +1546,6 @@ public class MappingServiceIntegrationTest { } } - private LispAddressContainer getIPContainer(String ip) { - return new LispAddressContainerBuilder().setAddress(asIPAfiAddress(ip)).build(); - } - private Ipv4 asIPAfiAddress(String ip) { return new Ipv4Builder().setIpv4Address(new Ipv4Address(ip)).setAfi((short) AddressFamilyNumberEnum.IP.getIanaCode()).build(); } diff --git a/mappingservice/northbound/src/main/java/org/opendaylight/lispflowmapping/northbound/LispMappingNorthbound.java b/mappingservice/northbound/src/main/java/org/opendaylight/lispflowmapping/northbound/LispMappingNorthbound.java index 03ebe5fe3..108f80ecc 100644 --- a/mappingservice/northbound/src/main/java/org/opendaylight/lispflowmapping/northbound/LispMappingNorthbound.java +++ b/mappingservice/northbound/src/main/java/org/opendaylight/lispflowmapping/northbound/LispMappingNorthbound.java @@ -18,8 +18,8 @@ import javax.ws.rs.PathParam; import javax.ws.rs.Produces; import javax.ws.rs.core.Context; import javax.ws.rs.core.MediaType; -import javax.ws.rs.core.SecurityContext; import javax.ws.rs.core.Response; +import javax.ws.rs.core.SecurityContext; import org.codehaus.enunciate.jaxrs.ResponseCode; import org.codehaus.enunciate.jaxrs.StatusCodes; @@ -27,10 +27,10 @@ import org.codehaus.enunciate.jaxrs.TypeHint; import org.opendaylight.controller.containermanager.IContainerManager; import org.opendaylight.controller.northbound.commons.RestMessages; import org.opendaylight.controller.northbound.commons.exception.BadRequestException; +import org.opendaylight.controller.northbound.commons.exception.InternalServerErrorException; import org.opendaylight.controller.northbound.commons.exception.ResourceNotFoundException; import org.opendaylight.controller.northbound.commons.exception.ServiceUnavailableException; import org.opendaylight.controller.northbound.commons.exception.UnauthorizedException; -import org.opendaylight.controller.northbound.commons.exception.InternalServerErrorException; import org.opendaylight.controller.northbound.commons.utils.NorthboundUtils; import org.opendaylight.controller.sal.authorization.Privilege; import org.opendaylight.controller.sal.utils.ServiceHelper; @@ -38,8 +38,6 @@ import org.opendaylight.lispflowmapping.interfaces.lisp.IFlowMapping; import org.opendaylight.lispflowmapping.type.AddressFamilyNumberEnum; import org.opendaylight.lispflowmapping.type.LispCanonicalAddressFormatEnum; import org.opendaylight.lispflowmapping.type.lisp.EidRecord; -import org.opendaylight.lispflowmapping.type.lisp.LocatorRecord; -import org.opendaylight.lispflowmapping.type.lisp.MapRegister; import org.opendaylight.lispflowmapping.type.lisp.MapRequest; import org.opendaylight.lispflowmapping.type.lisp.address.LispAddress; import org.opendaylight.lispflowmapping.type.lisp.address.LispAddressGeneric; @@ -146,11 +144,7 @@ public class LispMappingNorthbound implements ILispmappingNorthbound { throw new InternalServerErrorException(RestMessages.INTERNALERROR.toString() + " : There was an error looking up the EID"); } - EidToLocatorRecord record = null; - - record = mapReply.getEidToLocatorRecord().get(0); - - return record; + return mapReply.getEidToLocatorRecord().get(0); } private void keyCheck(IFlowMapping mappingService, MapRegisterNB mapRegisterNB) { @@ -267,7 +261,7 @@ public class LispMappingNorthbound implements ILispmappingNorthbound { ILispmappingNorthbound nbService = (ILispmappingNorthbound) ServiceHelper.getInstance(ILispmappingNorthbound.class, containerName, this); try { - keyCheck(nbService.getMappingService(), mapRegisterNB); + keyCheck(nbService.getMappingService(), mapRegisterNB); LispAddressConvertorNB.convertGenericToLispAddresses(mapRegisterNB.getMapRegister()); } catch (Exception e) { @@ -510,18 +504,13 @@ public class LispMappingNorthbound implements ILispmappingNorthbound { } ILispmappingNorthbound nbService = (ILispmappingNorthbound) ServiceHelper.getInstance(ILispmappingNorthbound.class, containerName, this); - boolean success = false; - try { - success = nbService.getMappingService().addAuthenticationKey(YangTransformerNB.transformLispAddress(lispAddress), - authKeyNB.getMaskLength(), authKeyNB.getKey()); + nbService.getMappingService().addAuthenticationKey(YangTransformerNB.transformLispAddress(lispAddress), authKeyNB.getMaskLength(), + authKeyNB.getKey()); } catch (Exception e) { throw new InternalServerErrorException(RestMessages.INTERNALERROR.toString() + " : There was an error while adding the key"); } - if (!success) { - throw new InternalServerErrorException(RestMessages.INTERNALERROR.toString() + " : There was an error while adding the key"); - } return Response.status(Response.Status.OK).build(); } @@ -723,17 +712,12 @@ public class LispMappingNorthbound implements ILispmappingNorthbound { ILispmappingNorthbound nbService = (ILispmappingNorthbound) ServiceHelper.getInstance(ILispmappingNorthbound.class, containerName, this); - boolean success = false; try { - success = nbService.getMappingService().removeAuthenticationKey(YangTransformerNB.transformLispAddress(lispAddress), mask); + nbService.getMappingService().removeAuthenticationKey(YangTransformerNB.transformLispAddress(lispAddress), mask); } catch (Exception e) { throw new InternalServerErrorException(RestMessages.INTERNALERROR.toString() + " : There was an error while deleting the key"); } - if (!success) { - throw new InternalServerErrorException(RestMessages.INTERNALERROR.toString() + " : There was an error while deleting the key"); - } - return Response.status(Response.Status.OK).build(); } @@ -797,17 +781,12 @@ public class LispMappingNorthbound implements ILispmappingNorthbound { int mask = 0; // Not used here - boolean success = false; try { - success = nbService.getMappingService().removeAuthenticationKey(YangTransformerNB.transformLispAddress(lispAddress), mask); + nbService.getMappingService().removeAuthenticationKey(YangTransformerNB.transformLispAddress(lispAddress), mask); } catch (Exception e) { throw new InternalServerErrorException(RestMessages.INTERNALERROR.toString() + " : There was an error while deleting the key"); } - if (!success) { - throw new InternalServerErrorException(RestMessages.INTERNALERROR.toString() + " : There was an error while deleting the key"); - } - return Response.status(Response.Status.OK).build(); } diff --git a/mappingservice/yangmodel/.gitignore b/mappingservice/yangmodel/.gitignore index 512487c11..c85277432 100644 --- a/mappingservice/yangmodel/.gitignore +++ b/mappingservice/yangmodel/.gitignore @@ -2,3 +2,7 @@ /META-INF /target /target +/target +/target +/target +/target -- 2.36.6