Class InMemoryGroupService

java.lang.Object
org.apache.directory.scim.example.jersey.service.InMemoryGroupService
All Implemented Interfaces:
Repository<ScimGroup>

@Named @ApplicationScoped public class InMemoryGroupService extends Object implements Repository<ScimGroup>
  • Constructor Details

    • InMemoryGroupService

      @Inject public InMemoryGroupService(SchemaRegistry schemaRegistry, PatchHandler patchHandler)
    • InMemoryGroupService

      protected InMemoryGroupService()
  • Method Details

    • init

      @PostConstruct public void init()
    • getResourceClass

      public Class<ScimGroup> getResourceClass()
      Description copied from interface: Repository
      Returns the type of ScimResource this repository manages.
      Specified by:
      getResourceClass in interface Repository<ScimGroup>
      Returns:
      The type of resource this repository manages.
    • create

      public ScimGroup create(ScimGroup resource) throws UnableToCreateResourceException
      Description copied from interface: Repository
      Allows the SCIM server's REST implementation to create a resource via a POST to a valid end-point.
      Specified by:
      create in interface Repository<ScimGroup>
      Parameters:
      resource - The ScimResource to create and persist.
      Returns:
      The newly created ScimResource.
      Throws:
      UnableToCreateResourceException
    • update

      public ScimGroup update(String id, String version, ScimGroup resource, Set<AttributeReference> includedAttributeReferences, Set<AttributeReference> excludedAttributeReferences) throws ResourceException
      Description copied from interface: Repository
      Allows the SCIM server's REST implementation to update and existing resource via a PUT to a valid end-point.
      SCIM Implementation NOTE: SCIM supports versioning of resources via HTTP ETags, if the (optional) version parameter is present, (and supported by the server), it can be used as a mechanism for caching and to ensure clients do not inadvertently overwrite other changes.
      Specified by:
      update in interface Repository<ScimGroup>
      Parameters:
      id - the identifier of the ScimResource to update and persist.
      version - an optional version (usually used as an ETag) that can be used to optimize update requests, may be compared against, the current ScimResource.meta.version.
      resource - an updated resource to persist
      includedAttributeReferences - optional set of attributes to include from ScimResource, may be used to optimize queries.
      excludedAttributeReferences - optional set of attributes to exclude from ScimResource, may be used to optimize queries.
      Returns:
      The newly updated ScimResource.
      Throws:
      ResourceException - When the ScimResource cannot be updated.
    • patch

      public ScimGroup patch(String id, String version, List<PatchOperation> patchOperations, Set<AttributeReference> includedAttributeReferences, Set<AttributeReference> excludedAttributeReferences) throws ResourceException
      Description copied from interface: Repository
      Allows the SCIM server's REST implementation to update and existing resource via a PATCH to a valid end-point.
      SCIM Implementation NOTE: SCIM supports versioning of resources via HTTP ETags, if the (optional) version parameter is present, (and supported by the server), it can be used as a mechanism for caching and to ensure clients do not inadvertently overwrite other changes.
      Specified by:
      patch in interface Repository<ScimGroup>
      Parameters:
      id - the identifier of the ScimResource to update and persist.
      version - an optional version (usually used as an ETag) that can be used to optimize update requests, may be compared against, the current ScimResource.meta.version.
      patchOperations - a list of patch operations to apply to an existing resource.
      includedAttributeReferences - optional set of attributes to include from ScimResource, may be used to optimize queries.
      excludedAttributeReferences - optional set of attributes to exclude from ScimResource, may be used to optimize queries.
      Returns:
      The newly updated ScimResource.
      Throws:
      ResourceException - When the ScimResource cannot be updated.
    • get

      public ScimGroup get(String id)
      Description copied from interface: Repository
      Retrieves the ScimResource associated with the provided identifier.
      Specified by:
      get in interface Repository<ScimGroup>
      Parameters:
      id - The identifier of the target ScimResource.
      Returns:
      The requested ScimResource.
    • delete

      public void delete(String id)
      Description copied from interface: Repository
      Deletes the ScimResource with the provided identifier (if it exists). This interface makes no distinction between hard and soft deletes but rather leaves that to the designer of the persistence layer.
      Specified by:
      delete in interface Repository<ScimGroup>
      Parameters:
      id - The ScimResource's identifier.
    • find

      public FilterResponse<ScimGroup> find(Filter filter, PageRequest pageRequest, SortRequest sortRequest)
      Description copied from interface: Repository
      Finds and retrieves all ScimResource objects known to the persistence layer that match the criteria specified by the passed Filter. The results may be truncated by the scope specified by the passed PageRequest and the order of the returned resources may be controlled by the passed SortRequest.
      Specified by:
      find in interface Repository<ScimGroup>
      Parameters:
      filter - The filter that determines the ScimResources that will be part of the ResultList
      pageRequest - For paged requests, this object specifies the start index and number of ScimResources that should be returned.
      sortRequest - Specifies which fields the returned ScimResources should be sorted by and whether the sort order is ascending or descending.
      Returns:
      A list of the ScimResources that pass the filter criteria, truncated to match the requested "page" and sorted according to the provided requirements.
    • getExtensionList

      public List<Class<? extends ScimExtension>> getExtensionList()
      Description copied from interface: Repository
      Returns a list of the SCIM Extensions that this repository considers to be associated with the ScimResource of type T.
      Specified by:
      getExtensionList in interface Repository<ScimGroup>
      Returns:
      A list of ScimExtension classes.