Class Associations


  • @Path("/associations")
    public class Associations
    extends PaginationCalculation<org.wso2.carbon.registry.core.Association>
    his class is to handle the associations related REST verb GET.
    • Constructor Detail

      • Associations

        public Associations()
    • Method Detail

      • addAssociations

        public javax.ws.rs.core.Response addAssociations​(String sourcePath,
                                                         AssociationModel[] association,
                                                         @HeaderParam("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("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>