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

java.lang.Object
  extended by org.wso2.carbon.registry.rest.api.RegistryRestSuper
      extended by org.wso2.carbon.registry.rest.api.PaginationCalculation<org.wso2.carbon.registry.core.Association>
          extended by org.wso2.carbon.registry.rest.api.Associations

public class Associations
extends PaginationCalculation<org.wso2.carbon.registry.core.Association>

his class is to handle the associations related REST verb GET.


Constructor Summary
Associations()
           
 
Method Summary
 javax.ws.rs.core.Response addAssociations(String sourcePath, AssociationModel[] association, String JWTToken)
          This method add the array of association sent as payload with the request for the given source
 javax.ws.rs.core.Response getAssociations(String sourcePath, String type, int start, int size, String JWTToken)
          This method takes the following parameters:
protected  javax.ws.rs.core.Response getPaginatedResults(org.wso2.carbon.registry.core.Association[] associations, int start, int size, String sortBy, String sortOrder)
           
 
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

Associations

public Associations()
Method Detail

addAssociations

public javax.ws.rs.core.Response addAssociations(String sourcePath,
                                                 AssociationModel[] association,
                                                 @HeaderParam(value="X-JWT-Assertion")
                                                 String JWTToken)
This method add the array of association sent as payload with the request for the given source

Parameters:
sourcePath - - Path of the source resource which is going to add the associations.
association - - JSON array of association objects[{"target":"","type":""}]
Returns:
Response HTTP 204 No Content.

getAssociations

public javax.ws.rs.core.Response getAssociations(String sourcePath,
                                                 String type,
                                                 int start,
                                                 int size,
                                                 @HeaderParam(value="X-JWT-Assertion")
                                                 String JWTToken)
This method takes the following parameters:

Parameters:
sourcePath - - Path of the resource,
type- - - Type of association,
start- - - Start page number,
size- - - Number of records to be retrieved
Returns:
Response the array of AssociationModel. HTTP 200 OK.

getPaginatedResults

protected javax.ws.rs.core.Response getPaginatedResults(org.wso2.carbon.registry.core.Association[] associations,
                                                        int start,
                                                        int size,
                                                        String sortBy,
                                                        String sortOrder)
Specified by:
getPaginatedResults in class PaginationCalculation<org.wso2.carbon.registry.core.Association>


Copyright © 2015 WSO2. All rights reserved.