Search in sources :

Example 6 with ListedResource

use of org.wso2.charon3.core.objects.ListedResource in project charon by wso2.

the class GroupResourceManager method createListedResource.

/*
     * Creates the Listed Resource.
     *
     * @param groups
     * @return
     */
public ListedResource createListedResource(List<Object> groups, int startIndex, int totalResults) throws CharonException, NotFoundException {
    ListedResource listedResource = new ListedResource();
    listedResource.setSchema(SCIMConstants.LISTED_RESOURCE_CORE_SCHEMA_URI);
    listedResource.setTotalResults(totalResults);
    listedResource.setStartIndex(startIndex);
    listedResource.setItemsPerPage(groups.size());
    for (Object group : groups) {
        Map<String, Attribute> userAttributes = ((Group) group).getAttributeList();
        listedResource.setResources(userAttributes);
    }
    return listedResource;
}
Also used : Group(org.wso2.charon3.core.objects.Group) ListedResource(org.wso2.charon3.core.objects.ListedResource) Attribute(org.wso2.charon3.core.attributes.Attribute)

Aggregations

ListedResource (org.wso2.charon3.core.objects.ListedResource)6 HashMap (java.util.HashMap)4 JSONEncoder (org.wso2.charon3.core.encoder.JSONEncoder)4 BadRequestException (org.wso2.charon3.core.exceptions.BadRequestException)4 CharonException (org.wso2.charon3.core.exceptions.CharonException)4 InternalErrorException (org.wso2.charon3.core.exceptions.InternalErrorException)4 NotFoundException (org.wso2.charon3.core.exceptions.NotFoundException)4 NotImplementedException (org.wso2.charon3.core.exceptions.NotImplementedException)4 SCIMResponse (org.wso2.charon3.core.protocol.SCIMResponse)4 SCIMResourceTypeSchema (org.wso2.charon3.core.schema.SCIMResourceTypeSchema)4 IOException (java.io.IOException)2 Attribute (org.wso2.charon3.core.attributes.Attribute)2 JSONDecoder (org.wso2.charon3.core.encoder.JSONDecoder)2 FilterTreeManager (org.wso2.charon3.core.utils.codeutils.FilterTreeManager)2 Node (org.wso2.charon3.core.utils.codeutils.Node)2 SearchRequest (org.wso2.charon3.core.utils.codeutils.SearchRequest)2 Group (org.wso2.charon3.core.objects.Group)1 User (org.wso2.charon3.core.objects.User)1