BUG-6650: ep-ip/sgt, rename groupbasedpolicy-ise-adapter to sxp-ise-adapter
[groupbasedpolicy.git] / sxp-integration / sxp-ise-adapter / src / main / java / org / opendaylight / groupbasedpolicy / sxp_ise_adapter / impl / GbpIseSgtHarvesterImpl.java
@@ -6,7 +6,7 @@
  * and is available at http://www.eclipse.org/legal/epl-v10.html
  */
 
-package org.opendaylight.groupbasedpolicy.gbp_ise_adapter.impl;
+package org.opendaylight.groupbasedpolicy.sxp_ise_adapter.impl;
 
 import com.google.common.base.Function;
 import com.google.common.util.concurrent.AsyncFunction;
@@ -28,10 +28,10 @@ import javax.xml.xpath.XPath;
 import javax.xml.xpath.XPathConstants;
 import javax.xml.xpath.XPathExpressionException;
 import javax.xml.xpath.XPathFactory;
-import org.opendaylight.groupbasedpolicy.gbp_ise_adapter.impl.util.RestClientFactory;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller.config.groupbasedpolicy.gbp.ise.adapter.model.rev160630.gbp.ise.adapter.IseHarvestConfig;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller.config.groupbasedpolicy.gbp.ise.adapter.model.rev160630.gbp.ise.adapter.ise.harvest.config.ConnectionConfig;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller.config.groupbasedpolicy.gbp.ise.adapter.model.rev160630.gbp.ise.adapter.ise.harvest.config.connection.config.Header;
+import org.opendaylight.groupbasedpolicy.sxp_ise_adapter.impl.util.RestClientFactory;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller.config.groupbasedpolicy.gbp.sxp.ise.adapter.model.rev160630.gbp.sxp.ise.adapter.IseSourceConfig;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller.config.groupbasedpolicy.gbp.sxp.ise.adapter.model.rev160630.gbp.sxp.ise.adapter.ise.source.config.ConnectionConfig;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller.config.groupbasedpolicy.gbp.sxp.ise.adapter.model.rev160630.gbp.sxp.ise.adapter.ise.source.config.connection.config.Header;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.sxp.database.rev160308.Sgt;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
@@ -48,7 +48,7 @@ public class GbpIseSgtHarvesterImpl implements GbpIseSgtHarvester {
 
     public static final String PATH_ERS_CONFIG_SGT = "/ers/config/sgt";
     public static final String EXPRESSION_SGT_ALL_LINK_HREFS = "/ns3:searchResult/ns3:resources/ns5:resource/link/@href";
-    public static final String EXPRESSION_SGT_DETAIL  = "./ns4:sgt";
+    public static final String EXPRESSION_SGT_DETAIL = "./ns4:sgt";
     public static final String EXPRESSION_SGT_NAME_ATTR = "./@name";
     public static final String EXPRESSION_SGT_VALUE = "./value/text()";
 
@@ -62,7 +62,7 @@ public class GbpIseSgtHarvesterImpl implements GbpIseSgtHarvester {
     }
 
     @Override
-    public ListenableFuture<Integer> harvest(@Nonnull final IseHarvestConfig configuration) {
+    public ListenableFuture<Integer> harvest(@Nonnull final IseSourceConfig configuration) {
         final ConnectionConfig connectionConfig = configuration.getConnectionConfig();
         ListenableFuture<Integer> result;
         try {
@@ -135,10 +135,10 @@ public class GbpIseSgtHarvesterImpl implements GbpIseSgtHarvester {
                 final String rawSgtDetail = deliverResponse(requestBuilder);
                 LOG.trace("rawSgtDetail: {}", rawSgtDetail);
 
-                final Node sgtNode = (Node) xpath.evaluate(EXPRESSION_SGT_DETAIL,  new InputSource(new StringReader(rawSgtDetail)),
+                final Node sgtNode = (Node) xpath.evaluate(EXPRESSION_SGT_DETAIL, new InputSource(new StringReader(rawSgtDetail)),
                         XPathConstants.NODE);
-                final Node sgtName = (Node) xpath.evaluate(EXPRESSION_SGT_NAME_ATTR,  sgtNode, XPathConstants.NODE);
-                final Node sgtValue = (Node) xpath.evaluate(EXPRESSION_SGT_VALUE,  sgtNode, XPathConstants.NODE);
+                final Node sgtName = (Node) xpath.evaluate(EXPRESSION_SGT_NAME_ATTR, sgtNode, XPathConstants.NODE);
+                final Node sgtValue = (Node) xpath.evaluate(EXPRESSION_SGT_VALUE, sgtNode, XPathConstants.NODE);
                 LOG.debug("sgt value [{}]: {} -> {}", i, sgtValue, sgtName);
 
                 // store replies into list of SgtInfo