org.overlord.sramp.server.atom.services
Class ArtifactResource

java.lang.Object
  extended by org.overlord.sramp.server.atom.services.AbstractResource
      extended by org.overlord.sramp.server.atom.services.ArtifactResource

public class ArtifactResource
extends AbstractResource

The JAX-RS resource that handles artifact specific tasks, including:

Author:
eric.wittmann@redhat.com

Constructor Summary
ArtifactResource()
          Constructor.
 
Method Summary
 org.jboss.resteasy.plugins.providers.atom.Entry create(javax.servlet.http.HttpServletRequest request, String contentType, String fileName, String model, String type, InputStream is)
          S-RAMP atom POST to upload an artifact to the repository.
 org.jboss.resteasy.plugins.providers.atom.Entry createMultiPart(javax.servlet.http.HttpServletRequest request, String contentType, String model, String type, org.jboss.resteasy.plugins.providers.multipart.MultipartRelatedInput input)
          Handles multi-part creates.
 void delete(String model, String type, String uuid)
          Called to delete an s-ramp artifact from the repository.
 javax.ws.rs.core.Response getContent(String model, String type, String uuid)
          Returns the content of an artifact in the s-ramp repository.
 org.jboss.resteasy.plugins.providers.atom.Entry getMetaData(javax.servlet.http.HttpServletRequest request, String model, String type, String uuid)
          Called to get the meta data for an s-ramp artifact.
 void updateContent(String contentType, String fileName, String model, String type, String uuid, InputStream content)
          S-RAMP atom PUT to upload a new version of the artifact into the repository.
 void updateMetaData(String model, String type, String uuid, org.jboss.resteasy.plugins.providers.atom.Entry atomEntry)
          Called to update the meta data for an artifact.
 
Methods inherited from class org.overlord.sramp.server.atom.services.AbstractResource
logError
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ArtifactResource

public ArtifactResource()
Constructor.

Method Detail

create

public org.jboss.resteasy.plugins.providers.atom.Entry create(@Context
                                                              javax.servlet.http.HttpServletRequest request,
                                                              @HeaderParam(value="Content-Type")
                                                              String contentType,
                                                              @HeaderParam(value="Slug")
                                                              String fileName,
                                                              String model,
                                                              String type,
                                                              InputStream is)
                                                       throws SrampAtomException
S-RAMP atom POST to upload an artifact to the repository. The artifact content should be POSTed raw.

Parameters:
fileName -
model -
type -
content -
Throws:
SrampAtomException

createMultiPart

public org.jboss.resteasy.plugins.providers.atom.Entry createMultiPart(@Context
                                                                       javax.servlet.http.HttpServletRequest request,
                                                                       @HeaderParam(value="Content-Type")
                                                                       String contentType,
                                                                       String model,
                                                                       String type,
                                                                       org.jboss.resteasy.plugins.providers.multipart.MultipartRelatedInput input)
                                                                throws SrampAtomException
Handles multi-part creates. In S-RAMP, an HTTP multi-part request can be POST'd to the endpoint, which allows Atom Entry formatted meta-data to be included in the same request as the artifact content.

Parameters:
contentType -
model -
type -
input -
Returns:
the newly created artifact as an Atom Entry
Throws:
SrampAtomException

updateMetaData

public void updateMetaData(String model,
                           String type,
                           String uuid,
                           org.jboss.resteasy.plugins.providers.atom.Entry atomEntry)
                    throws SrampAtomException
Called to update the meta data for an artifact. Note that this does *not* update the content of the artifact, just the meta data.

Parameters:
model -
type -
uuid -
atomEntry -
Throws:
SrampAtomException

updateContent

public void updateContent(@HeaderParam(value="Content-Type")
                          String contentType,
                          @HeaderParam(value="Slug")
                          String fileName,
                          String model,
                          String type,
                          String uuid,
                          InputStream content)
                   throws SrampAtomException
S-RAMP atom PUT to upload a new version of the artifact into the repository.

Parameters:
model -
type -
uuid -
content -
Throws:
SrampAtomException

getMetaData

public org.jboss.resteasy.plugins.providers.atom.Entry getMetaData(@Context
                                                                   javax.servlet.http.HttpServletRequest request,
                                                                   String model,
                                                                   String type,
                                                                   String uuid)
                                                            throws SrampAtomException
Called to get the meta data for an s-ramp artifact. This will return an Atom Entry with the full information about the artifact.

Parameters:
model -
type -
uuid -
Throws:
SrampAtomException

getContent

public javax.ws.rs.core.Response getContent(String model,
                                            String type,
                                            String uuid)
                                     throws SrampAtomException
Returns the content of an artifact in the s-ramp repository.

Parameters:
model -
type -
uuid -
Throws:
SrampAtomException

delete

public void delete(String model,
                   String type,
                   String uuid)
            throws SrampAtomException
Called to delete an s-ramp artifact from the repository.

Parameters:
model -
type -
uuid -
Throws:
SrampAtomException


Copyright © 2011-2013 JBoss, a division of Red Hat. All Rights Reserved.