Fix artifact and document naming 80/3080/1
authorSerban Jora <sj2381@att.com>
Fri, 5 Oct 2018 18:07:03 +0000 (14:07 -0400)
committerSerban Jora <sj2381@att.com>
Fri, 5 Oct 2018 18:08:29 +0000 (14:08 -0400)
Change-Id: I9b92f70d8f1160621682eb642e77fcf64bf9233e
Signed-off-by: Serban Jora <sj2381@att.com>
Issue-ID: ACUMOS-1780

gateway/src/main/java/org/acumos/federation/gateway/adapter/PeerGateway.java
gateway/src/main/java/org/acumos/federation/gateway/cds/Artifact.java
gateway/src/main/java/org/acumos/federation/gateway/cds/Document.java
gateway/src/main/java/org/acumos/federation/gateway/controller/CatalogController.java
gateway/src/main/java/org/acumos/federation/gateway/service/ContentService.java
gateway/src/main/java/org/acumos/federation/gateway/service/impl/ContentServiceImpl.java
gateway/src/main/java/org/acumos/federation/gateway/service/impl/ContentServiceLocalImpl.java
gateway/src/test/resources/mockPeerSolutionRevisionResponse.json

index 1d3cc8b..8e81bb1 100644 (file)
@@ -173,7 +173,7 @@ public class PeerGateway {
                        //return (ICommonDataServiceRestClient)theContext.getAttribute(AbstractServiceImpl.Attributes.cdsClient);
                }
 
-               private MLPArtifact createMLPArtifact(String theSolutionId, String theRevisionId, MLPArtifact peerArtifact,
+               private Artifact createArtifact(String theSolutionId, String theRevisionId, Artifact peerArtifact,
                                ServiceContext theContext) throws Exception {
 
                        Artifact artifact = Artifact.buildFrom(peerArtifact)
@@ -196,7 +196,7 @@ public class PeerGateway {
                }
 
                /* we create a new one as nothing is preserved. assumes matching ids. */
-               private MLPArtifact copyMLPArtifact(MLPArtifact peerArtifact, MLPArtifact localArtifact) {
+               private Artifact copyArtifact(Artifact peerArtifact, Artifact localArtifact) {
 
                        return Artifact.buildFrom(peerArtifact)
                                                                .withId(localArtifact.getArtifactId())
@@ -204,7 +204,7 @@ public class PeerGateway {
                                                                .build();
                }
 
-               private MLPDocument createMLPDocument(String theSolutionId, String theRevisionId, MLPDocument peerDocument,
+               private Document createDocument(String theSolutionId, String theRevisionId, Document peerDocument,
                                ServiceContext theContext) {
 
                        Document document = Document.buildFrom(peerDocument)
@@ -226,7 +226,7 @@ public class PeerGateway {
                        }
                }
 
-               private MLPDocument copyMLPDocument(MLPDocument peerDocument, MLPDocument localDocument) {
+               private Document copyDocument(Document peerDocument, Document localDocument) {
 
                        return Document.buildFrom(peerDocument)
                                                                .withId(localDocument.getDocumentId())
@@ -324,34 +324,35 @@ public class PeerGateway {
                                        continue; //try procecssing the next revision
                                }
 
-                               List<MLPArtifact> peerArtifacts = (List)((SolutionRevision)peerRevision).getArtifacts();
-                               List<MLPDocument> peerDocuments = (List)((SolutionRevision)peerRevision).getDocuments();
+                               List<Artifact> peerArtifacts = (List)((SolutionRevision)peerRevision).getArtifacts();
+                               List<Document> peerDocuments = (List)((SolutionRevision)peerRevision).getDocuments();
 
-                               List<MLPArtifact> catalogArtifacts = (List)((SolutionRevision)localRevision).getArtifacts();
-                               List<MLPDocument>       catalogDocuments = (List)((SolutionRevision)localRevision).getDocuments();
+                               List<Artifact> catalogArtifacts = (List)((SolutionRevision)localRevision).getArtifacts();
+                               List<Document> catalogDocuments = (List)((SolutionRevision)localRevision).getDocuments();
 
-                               final List<MLPArtifact> localArtifacts = catalogArtifacts;
+                               final List<Artifact> localArtifacts = catalogArtifacts;
                                // map the artifacts
                                // TODO: track deleted artifacts
-                               Map<MLPArtifact, MLPArtifact> peerToLocalArtifacts = new HashMap<MLPArtifact, MLPArtifact>();
+                               Map<Artifact, Artifact> peerToLocalArtifacts = new HashMap<Artifact, Artifact>();
                                peerArtifacts.forEach(peerArtifact -> peerToLocalArtifacts.put(peerArtifact, localArtifacts.stream()
                                                .filter(localArtifact -> localArtifact.getArtifactId().equals(peerArtifact.getArtifactId()))
                                                .findFirst().orElse(null)));
 
-                               for (Map.Entry<MLPArtifact, MLPArtifact> artifactEntry : peerToLocalArtifacts.entrySet()) {
-                                       MLPArtifact peerArtifact = artifactEntry.getKey(), localArtifact = artifactEntry.getValue();
+                               for (Map.Entry<Artifact, Artifact> artifactEntry : peerToLocalArtifacts.entrySet()) {
+                                       Artifact peerArtifact = artifactEntry.getKey(),
+                                                                        localArtifact = artifactEntry.getValue();
                                        boolean doUpdate = false;
                                        boolean doContent = (peerArtifact.getUri() != null) &&
                                                                                                                        (SubscriptionScope.Full == SubscriptionScope.forCode(this.sub.getScopeType()));
 
                                        if (localArtifact == null) {
-                                               localArtifact = createMLPArtifact(localSolution.getSolutionId(), localRevision.getRevisionId(),
+                                               localArtifact = createArtifact(localSolution.getSolutionId(), localRevision.getRevisionId(),
                                                                peerArtifact, theContext);
                                        }
                                        else {
                                                if (!peerArtifact.getVersion().equals(localArtifact.getVersion())) {
                                                        // update local artifact
-                                                       localArtifact = copyMLPArtifact(peerArtifact, localArtifact);
+                                                       localArtifact = copyArtifact(peerArtifact, localArtifact);
                                                        doUpdate = true;
                                                }
                                                else {
@@ -407,23 +408,23 @@ public class PeerGateway {
                                } //end map artifacts loop
 
 
-                               final List<MLPDocument> localDocuments = catalogDocuments;
+                               final List<Document> localDocuments = catalogDocuments;
                                // map the documents
                                // TODO: track deleted documents
-                               Map<MLPDocument, MLPDocument> peerToLocalDocuments = new HashMap<MLPDocument, MLPDocument>();
+                               Map<Document, Document> peerToLocalDocuments = new HashMap<Document, Document>();
                                peerDocuments.forEach(peerDocument -> peerToLocalDocuments.put(peerDocument, localDocuments.stream()
                                                .filter(localDocument -> localDocument.getDocumentId().equals(peerDocument.getDocumentId()))
                                                .findFirst().orElse(null)));
 
-                               for (Map.Entry<MLPDocument, MLPDocument> documentEntry : peerToLocalDocuments.entrySet()) {
-                                       MLPDocument peerDocument = documentEntry.getKey(),
-                                                                                       localDocument = documentEntry.getValue();
+                               for (Map.Entry<Document, Document> documentEntry : peerToLocalDocuments.entrySet()) {
+                                       Document peerDocument = documentEntry.getKey(),
+                                                                        localDocument = documentEntry.getValue();
                                        boolean doUpdate = false;
                                        boolean doContent = (peerDocument.getUri() != null) &&
                                                                                                                        (SubscriptionScope.Full == SubscriptionScope.forCode(this.sub.getScopeType()));
 
                                        if (localDocument == null) {
-                                               localDocument = createMLPDocument(localSolution.getSolutionId(), localRevision.getRevisionId(),
+                                               localDocument = createDocument(localSolution.getSolutionId(), localRevision.getRevisionId(),
                                                                peerDocument, theContext);
                                        }
                                        else {
@@ -431,7 +432,7 @@ public class PeerGateway {
                                                if (peerDocument.getVersion() != null && localDocument.getVersion() != null &&
                                                                !peerDocument.getVersion().equals(localDocument.getVersion())) {
                                                        // update local doc
-                                                       localDocument = copyMLPDocument(peerDocument, localDocument);
+                                                       localDocument = copyDocument(peerDocument, localDocument);
                                                        doUpdate = true;
                                                }
                                                else {
index 4edd0e8..11abcd1 100644 (file)
  */
 package org.acumos.federation.gateway.cds;
 
+import java.net.URI;
+import java.net.URISyntaxException;
+
 import org.acumos.cds.domain.MLPArtifact;
 
+import org.apache.commons.io.FilenameUtils;
+
+import com.fasterxml.jackson.annotation.JsonIgnore;
+
 /**
  */
 public class Artifact extends MLPArtifact {
 
+       private String filename;
+
        public Artifact() {
        }
 
        public Artifact(MLPArtifact theCDSArtifact) {
                super(theCDSArtifact);
+               setFilename(getUriFilename());
        }
        
        public Artifact(Artifact theArtifact) {
                super(theArtifact);
+               this.filename = theArtifact.getFilename();
        }
 
        public static ArtifactBuilder build() {
@@ -44,6 +55,23 @@ public class Artifact extends MLPArtifact {
                return new ArtifactBuilder(new Artifact(theArtifact));
        }
 
-}
+       public void setFilename(String theFilename) {
+               this.filename = theFilename;
+       }
 
+       public String getFilename() {
+               return this.filename;
+       }
+
+       @JsonIgnore
+       public String getUriFilename() {
+               try {
+                       return FilenameUtils.getName(new URI(getUri()).getPath());
+               }
+               catch (URISyntaxException urisx) {
+                       throw new IllegalStateException("Invalid artifact uri", urisx);
+               }
+       }
+
+}
 
index f8c6c78..bb9d6a6 100644 (file)
  */
 package org.acumos.federation.gateway.cds;
 
+import java.net.URI;
+import java.net.URISyntaxException;
+
 import org.acumos.cds.domain.MLPDocument;
 
+import org.apache.commons.io.FilenameUtils;
+
+import com.fasterxml.jackson.annotation.JsonIgnore;
+
 /**
  */
 public class Document extends MLPDocument {
 
+       private String filename;
+
        public Document() {
        }
 
        public Document(MLPDocument theCDSDocument) {
                super(theCDSDocument);
+               setFilename(getUriFilename());
        }
        
        public Document(Document theDocument) {
                super(theDocument);
+               this.filename = theDocument.getFilename();
        }
 
        public static DocumentBuilder build() {
@@ -44,6 +55,25 @@ public class Document extends MLPDocument {
                return new DocumentBuilder(new Document(theDocument));
        }
 
+       public void setFilename(String theFilename) {
+               this.filename = theFilename;
+       }
+
+       public String getFilename() {
+               return this.filename;
+       }
+
+       @JsonIgnore
+       public String getUriFilename() {
+               try {
+                       return FilenameUtils.getName(new URI(getUri()).getPath());
+               }
+               catch (URISyntaxException urisx) {
+                       throw new IllegalStateException("Invalid document uri", urisx);
+               }
+       }
+
+
 }
 
 
index 09dcda5..5254e71 100644 (file)
@@ -35,6 +35,8 @@ import org.acumos.cds.domain.MLPDocument;
 import org.acumos.cds.domain.MLPSolution;
 import org.acumos.cds.domain.MLPSolutionRevision;
 import org.acumos.federation.gateway.cds.ArtifactType;
+import org.acumos.federation.gateway.cds.Artifact;
+import org.acumos.federation.gateway.cds.Document;
 import org.acumos.federation.gateway.cds.SolutionRevision;
 import org.acumos.federation.gateway.common.API;
 import org.acumos.federation.gateway.common.JsonResponse;
@@ -243,12 +245,12 @@ public class CatalogController extends AbstractController {
                        else {
                                for (MLPArtifact artifact : solutionRevision.getArtifacts()) {
                                        if (!context.getPeer().getPeerInfo().isLocal()) {
-                                               encodeArtifact(theSolutionId, theRevisionId, artifact, theHttpRequest);
+                                               encodeArtifact(theSolutionId, theRevisionId, (Artifact)artifact, theHttpRequest);
                                        }
                                }
                                for (MLPDocument document : solutionRevision.getDocuments()) {
                                        if (!context.getPeer().getPeerInfo().isLocal()) {
-                                               encodeDocument(theSolutionId, theRevisionId, document, theHttpRequest);
+                                               encodeDocument(theSolutionId, theRevisionId, (Document)document, theHttpRequest);
                                        }
                                }
        
@@ -305,7 +307,7 @@ public class CatalogController extends AbstractController {
                        else {
                                for (MLPArtifact artifact : solutionRevisionArtifacts) {
                                        if (!context.getPeer().getPeerInfo().isLocal()) {
-                                               encodeArtifact(theSolutionId, theRevisionId, artifact, theHttpRequest);
+                                               encodeArtifact(theSolutionId, theRevisionId, (Artifact)artifact, theHttpRequest);
                                        }
                                }
                                response = JsonResponse.<List<MLPArtifact>> buildResponse()
@@ -363,7 +365,7 @@ public class CatalogController extends AbstractController {
                        else {
                                for (MLPDocument document : solutionRevisionDocuments) {
                                        if (!context.getPeer().getPeerInfo().isLocal()) {
-                                               encodeDocument(theSolutionId, theRevisionId, document, theHttpRequest);
+                                               encodeDocument(theSolutionId, theRevisionId, (Document)document, theHttpRequest);
                                        }
                                }
                                response = JsonResponse.<List<MLPDocument>> buildResponse()
@@ -489,10 +491,13 @@ public class CatalogController extends AbstractController {
        }
        
        /** */
-       private void encodeArtifact(String theSolutionId, String theRevisionId, MLPArtifact theArtifact, HttpServletRequest theRequest)
+       private void encodeArtifact(String theSolutionId, String theRevisionId, Artifact theArtifact, HttpServletRequest theRequest)
                                                                                                                                                                                                                                                                                                                throws URISyntaxException {
                String artifactUri = theArtifact.getUri();
 
+               //remember the artifact filename before redirecting
+               theArtifact.setFilename(theArtifact.getUriFilename());
+
                //redirect              
                {
                        URI requestUri = new URI(theRequest.getRequestURL().toString());
@@ -515,10 +520,13 @@ public class CatalogController extends AbstractController {
        }
        
        /** */
-       private void encodeDocument(String theSolutionId, String theRevisionId, MLPDocument theDocument, HttpServletRequest theRequest)
+       private void encodeDocument(String theSolutionId, String theRevisionId, Document theDocument, HttpServletRequest theRequest)
                                                                                                                                                                                                                                                                                                                        throws URISyntaxException {
                String artifactUri = theDocument.getUri();
 
+               //remember the document filename before redirecting
+               theDocument.setFilename(theDocument.getUriFilename());
+
                //redirect              
                {
                        URI requestUri = new URI(theRequest.getRequestURL().toString());
index 474a8b1..83c34c6 100644 (file)
@@ -23,8 +23,8 @@
  */
 package org.acumos.federation.gateway.service;
 
-import org.acumos.cds.domain.MLPArtifact;
-import org.acumos.cds.domain.MLPDocument;
+import org.acumos.federation.gateway.cds.Artifact;
+import org.acumos.federation.gateway.cds.Document;
 import org.springframework.core.io.Resource;
 
 /**
@@ -44,7 +44,7 @@ public interface ContentService {
         * @return resource containing access to the actual artifact content
         */
        public Resource getArtifactContent(
-                       String theSolutionId, String theRevisionId, MLPArtifact theArtifact, ServiceContext theContext)
+                       String theSolutionId, String theRevisionId, Artifact theArtifact, ServiceContext theContext)
                                                                                                                                                                                                                                                                                                                                                throws ServiceException;
 
        /**
@@ -57,7 +57,7 @@ public interface ContentService {
         * @return resource containing access to the actual artifact content
         */
        public default Resource getArtifactContent(
-                       String theSolutionId, String theRevisionId, MLPArtifact theArtifact)                                    throws ServiceException {
+                       String theSolutionId, String theRevisionId, Artifact theArtifact)                                       throws ServiceException {
                return getArtifactContent(theSolutionId, theRevisionId, theArtifact, selfService());
        }
 
@@ -75,7 +75,7 @@ public interface ContentService {
         *            the service execution context
         */
        public void putArtifactContent(
-               String theSolutionId, String theRevisionId, MLPArtifact theArtifact, Resource theResource, ServiceContext theContext)
+               String theSolutionId, String theRevisionId, Artifact theArtifact, Resource theResource, ServiceContext theContext)
                                                                                                                                                                                                                                                                                                                                                throws ServiceException;
        /**
         * If the call is succesful the artifact information is updated with the content uri.
@@ -89,7 +89,7 @@ public interface ContentService {
         *            the resource providing the artifact content
         */
        public default void putArtifactContent(
-               String theSolutionId, String theRevisionId, MLPArtifact theArtifact, Resource theResource)
+               String theSolutionId, String theRevisionId, Artifact theArtifact, Resource theResource)
                                                                                                                                                                                                                                                                                                                                                throws ServiceException {
                putArtifactContent(theSolutionId, theRevisionId, theArtifact, theResource, selfService());
        }
@@ -106,7 +106,7 @@ public interface ContentService {
         * @return resource containing access to the actual document content
         */
        public Resource getDocumentContent(
-               String theSolutionId, String theRevisionId, MLPDocument theDocument, ServiceContext theContext)
+               String theSolutionId, String theRevisionId, Document theDocument, ServiceContext theContext)
                                                                                                                                                                                                                                                                                                                                                throws ServiceException;
 
        /**
@@ -119,7 +119,7 @@ public interface ContentService {
         * @return resource containing access to the actual document content
         */
        public default Resource getDocumentContent(
-               String theSolutionId, String theRevisionId, MLPDocument theDocument) throws ServiceException {
+               String theSolutionId, String theRevisionId, Document theDocument) throws ServiceException {
 
                return getDocumentContent(theSolutionId, theRevisionId, theDocument, selfService());
        }
@@ -138,7 +138,7 @@ public interface ContentService {
         *            the execution context
         */
        public void putDocumentContent(
-               String theSolutionId, String theRevisionId, MLPDocument theDocument, Resource theResource, ServiceContext theContext)
+               String theSolutionId, String theRevisionId, Document theDocument, Resource theResource, ServiceContext theContext)
                                                                                                                                                                                                                                                                                                                                                throws ServiceException;
 
        /**
@@ -153,7 +153,7 @@ public interface ContentService {
         *            the resource providing the document content
         */
        public default void putDocumentContent(
-               String theSolutionId, String theRevisionId, MLPDocument theDocument, Resource theResource)
+               String theSolutionId, String theRevisionId, Document theDocument, Resource theResource)
                                                                                                                                                                                                                                                                                                                                                throws ServiceException {
                putDocumentContent(theSolutionId, theRevisionId, theDocument, theResource, selfService());
        }
index d74d0e1..749263f 100644 (file)
@@ -34,8 +34,8 @@ import java.net.URISyntaxException;
 import java.lang.invoke.MethodHandles;
 
 import org.acumos.cds.AccessTypeCode;
-import org.acumos.cds.domain.MLPArtifact;
-import org.acumos.cds.domain.MLPDocument;
+import org.acumos.federation.gateway.cds.Artifact;
+import org.acumos.federation.gateway.cds.Document;
 import org.acumos.federation.gateway.cds.ArtifactType;
 import org.acumos.federation.gateway.config.DockerConfiguration;
 import org.acumos.federation.gateway.config.EELFLoggerDelegate;
@@ -82,7 +82,7 @@ public class ContentServiceImpl extends AbstractServiceImpl
 
        @Override
        public Resource getArtifactContent(
-               String theSolutionId, String theRevisionId, MLPArtifact theArtifact, ServiceContext theContext)
+               String theSolutionId, String theRevisionId, Artifact theArtifact, ServiceContext theContext)
                                                                                                                                                                                                                                                                                                                                                                                        throws ServiceException {
                if (theArtifact.getUri() == null) {
                        throw new ServiceException("No artifact uri available for " + theArtifact);
@@ -118,7 +118,7 @@ public class ContentServiceImpl extends AbstractServiceImpl
 
        @Override
        public void putArtifactContent(
-               String theSolutionId, String theRevisionId, MLPArtifact theArtifact, Resource theResource, ServiceContext theContext)
+               String theSolutionId, String theRevisionId, Artifact theArtifact, Resource theResource, ServiceContext theContext)
                                                                                                                                                                                                                                                                                                                                                                                throws ServiceException {
 
                if (ArtifactType.DockerImage == ArtifactType.forCode(theArtifact.getArtifactTypeCode())) {
@@ -134,7 +134,7 @@ public class ContentServiceImpl extends AbstractServiceImpl
                                        theArtifact, imageSource.size(), imageSource.duration()/1000);
 
                                List<Image> images = docker.listImagesCmd().exec();
-                               log.debug(EELFLoggerDelegate.debugLogger, "Available docker images: {}", images);
+                               log.trace(EELFLoggerDelegate.debugLogger, "Available docker images: {}", images);
 
                                //this relies on the presence of the original uri/tag in the description (which is what the controller does), otherwise
                                //we'd need to pick this information from the manifest
@@ -143,15 +143,16 @@ public class ContentServiceImpl extends AbstractServiceImpl
                                                                                                .findFirst()
                                                                                                .orElse(null);
                                if (image == null) {
-                                       log.debug(EELFLoggerDelegate.debugLogger, "Could not find loaded docker image: {}", theArtifact.getUri());
+                                       log.debug(EELFLoggerDelegate.debugLogger, "Could not find loaded docker image with tag {}", theArtifact.getDescription());
                                        throw new ServiceException("Could not find loaded docker image for " + theArtifact);
                                }
        
                                //new image name for re-tagging
-                               String imageName = dockerConfig.getRegistryUrl() + "/" + theArtifact.getName() + "_" + theSolutionId;
+                               String imageName = dockerConfig.getRegistryUrl() + "/" + theArtifact.getName().toLowerCase() + "_" + theSolutionId;
                                String imageTag = imageName;
+                               log.debug(EELFLoggerDelegate.debugLogger, "Attempt re-tagging of docker image {} with {}:{}", image, imageTag, theArtifact.getVersion());
                                docker.tagImageCmd(image.getId(), imageTag, theArtifact.getVersion()).exec();
-                               log.debug(EELFLoggerDelegate.debugLogger, "Re-tagged (1) docker image: {} to {}:{}", image, imageTag, theArtifact.getVersion());
+                               log.debug(EELFLoggerDelegate.debugLogger, "Re-tagged docker image: {} to {}:{}", image, imageTag, theArtifact.getVersion());
                                //remove old tag that came with the load
                                docker.removeImageCmd(theArtifact.getDescription())
                                                        .withForce(Boolean.TRUE)
@@ -194,7 +195,7 @@ public class ContentServiceImpl extends AbstractServiceImpl
                        }
                }
                else {
-                       String[] nameParts = splitName(theArtifact.getName());
+                       String[] nameParts = splitName(theArtifact.getFilename());
                        String uri = putNexusContent(
                                nexusPrefix(theSolutionId, theRevisionId), nameParts[0], theArtifact.getVersion(), nameParts[1], theResource);
                        // update artifact with local repo reference
@@ -204,7 +205,7 @@ public class ContentServiceImpl extends AbstractServiceImpl
 
        @Override
        public Resource getDocumentContent(
-               String theSolutionId, String theRevisionId, MLPDocument theDocument, ServiceContext theContext)
+               String theSolutionId, String theRevisionId, Document theDocument, ServiceContext theContext)
                                                                                                                                                                                                                                                                                                                                                throws ServiceException {
                if (theDocument.getUri() == null) {
                        throw new ServiceException("No document uri available for " + theDocument);
@@ -215,9 +216,9 @@ public class ContentServiceImpl extends AbstractServiceImpl
 
        @Override
        public void putDocumentContent(
-               String theSolutionId, String theRevisionId, MLPDocument theDocument, Resource theResource, ServiceContext theContext)
+               String theSolutionId, String theRevisionId, Document theDocument, Resource theResource, ServiceContext theContext)
                                                                                                                                                                                                                                                                                                                                                throws ServiceException {
-               String[] nameParts = splitName(theDocument.getName());
+               String[] nameParts = splitName(theDocument.getFilename());
                String uri = putNexusContent(
                        nexusPrefix(theSolutionId, theRevisionId), nameParts[0], AccessTypeCode.PB.name(), nameParts[1], theResource);
                theDocument.setUri(uri);
index eaa0aa2..f1896f6 100644 (file)
@@ -24,8 +24,8 @@ import java.io.IOException;
 import java.lang.invoke.MethodHandles;
 import java.net.URI;
 
-import org.acumos.cds.domain.MLPArtifact;
-import org.acumos.cds.domain.MLPDocument;
+import org.acumos.federation.gateway.cds.Artifact;
+import org.acumos.federation.gateway.cds.Document;
 import org.acumos.federation.gateway.config.EELFLoggerDelegate;
 import org.acumos.federation.gateway.service.ContentService;
 import org.acumos.federation.gateway.service.ServiceContext;
@@ -51,7 +51,7 @@ public class ContentServiceLocalImpl extends AbstractServiceImpl
         */
        @Override
        public Resource getArtifactContent(
-               String theSolutionId, String theRevisionId, MLPArtifact theArtifact, ServiceContext theContext)
+               String theSolutionId, String theRevisionId, Artifact theArtifact, ServiceContext theContext)
                                                                                                                                                                                                                                                                                                                                                                                        throws ServiceException {
                if (theArtifact.getUri() == null) {
                        throw new ServiceException("No artifact uri available for " + theArtifact);
@@ -71,7 +71,7 @@ public class ContentServiceLocalImpl extends AbstractServiceImpl
         */
        @Override
        public void putArtifactContent(
-               String theSolutionId, String theRevisionId, MLPArtifact theArtifact, Resource theResource, ServiceContext theContext)
+               String theSolutionId, String theRevisionId, Artifact theArtifact, Resource theResource, ServiceContext theContext)
                                                                                                                                                                                                                                                                                                                                                throws ServiceException {
                File target = null;
                try {
@@ -88,7 +88,7 @@ public class ContentServiceLocalImpl extends AbstractServiceImpl
 
        @Override
        public Resource getDocumentContent(
-               String theSolutionId, String theRevisionId, MLPDocument theDocument, ServiceContext theContext)
+               String theSolutionId, String theRevisionId, Document theDocument, ServiceContext theContext)
                                                                                                                                                                                                                                                                                                                                                throws ServiceException {
                if (theDocument.getUri() == null) {
                        throw new ServiceException("No document uri available for " + theDocument);
@@ -105,7 +105,7 @@ public class ContentServiceLocalImpl extends AbstractServiceImpl
 
        @Override
        public void putDocumentContent(
-               String theSolutionId, String theRevisionId, MLPDocument theDocument, Resource theResource, ServiceContext theContext)
+               String theSolutionId, String theRevisionId, Document theDocument, Resource theResource, ServiceContext theContext)
                                                                                                                                                                                                                                                                                                                                                throws ServiceException {
                File target = null;
                try {
index 0770441..dc6fe57 100644 (file)
@@ -19,7 +19,8 @@
     "size":0,
     "metadata":"mock artifact",
     "created":"2017-09-10",
-    "modified":"2017-09-11"
+    "modified":"2017-09-11",
+               "uri":"/somewhere/artifact.log"
    }],
  "documents":[]
  }