org.wso2.carbon.registry.rest.api
Class Artifact

java.lang.Object
  extended by org.wso2.carbon.registry.rest.api.RegistryRestSuper
      extended by org.wso2.carbon.registry.rest.api.Artifact

public class Artifact
extends RegistryRestSuper

This class is to handle the resources/collections according to the REST verbs GET,PUT and DELETE.


Constructor Summary
Artifact()
           
 
Method Summary
 javax.ws.rs.core.Response createResource(List<javax.ws.rs.core.PathSegment> path, InputStream contentStream, String contentType, String JWTToken)
          This method creates/update the resource sent as the payload to the registry.
 javax.ws.rs.core.Response deleteResource(List<javax.ws.rs.core.PathSegment> path, String JWTToken)
          This method delete the requested resource.
 javax.ws.rs.core.Response getResource(List<javax.ws.rs.core.PathSegment> path, String JWTToken)
          This method get the resource content of the requested resource.
 
Methods inherited from class org.wso2.carbon.registry.rest.api.RegistryRestSuper
getBegin, getEnd, getPageSize, getResourcePath, getTenantID, getUserRegistry, getUserRegistry, setBegin, setEnd, setPageSize, setUserRegistry
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Artifact

public Artifact()
Method Detail

getResource

public javax.ws.rs.core.Response getResource(List<javax.ws.rs.core.PathSegment> path,
                                             @HeaderParam(value="X-JWT-Assertion")
                                             String JWTToken)
This method get the resource content of the requested resource. If the path is collection it returns the paths inside that collection. If resource it return the content of the resource.

Parameters:
path - - Path of the resource/collection in the registry.
Returns:
Response, if resource content stream, else resource paths array.HTTP 200 OK.

createResource

public javax.ws.rs.core.Response createResource(List<javax.ws.rs.core.PathSegment> path,
                                                InputStream contentStream,
                                                @HeaderParam(value="Content-Type")
                                                String contentType,
                                                @HeaderParam(value="X-JWT-Assertion")
                                                String JWTToken)
This method creates/update the resource sent as the payload to the registry.

Parameters:
path - - List of path segment of the resource path after the (/resource) in the URI
contentStream - - Resource content sent as stream
Returns:
Response - HTTP 200 OK with the resource/collection path.

deleteResource

public javax.ws.rs.core.Response deleteResource(List<javax.ws.rs.core.PathSegment> path,
                                                @HeaderParam(value="X-JWT-Assertion")
                                                String JWTToken)
This method delete the requested resource.

Parameters:
path - - path segment of the resource path
Returns:
Response - HTTP 204 No Content.


Copyright © 2015 WSO2. All rights reserved.