/** * Retrieve the meta.version attribute of the resource. * * @param resource The resource whose version to retrieve. * @return The resource version. * @throws IllegalArgumentException if the resource does not contain a the * meta.version attribute. */ static String getResourceVersion(final ScimResource resource) throws IllegalArgumentException { if(resource == null || resource.getMeta() == null || resource.getMeta().getVersion() == null) { throw new IllegalArgumentException( "Resource version must be specified by meta.version"); } return resource.getMeta().getVersion(); }
schemaSet.add("urn:pingidentity:schemas:favoriteColor"); Assert.assertTrue(cso.getSchemaUrns().containsAll(schemaSet)); Assert.assertEquals(cso.getId(), "user:id"); Assert.assertEquals(cso.getExternalId(), "user:externalId"); Meta meta = cso.getMeta();
requestResource.asGenericScimResource().getObjectNode(); requestAttributes = new LinkedHashSet<Path>(); collectAttributes(Path.root(), requestAttributes, requestObject); returnedResource.asGenericScimResource(); ScimResourceTrimmer trimmer = new ScimResourceTrimmer(resourceType, requestAttributes,
private void setMeta(Class<?> resourceClass, ScimResource scimResource) { ResourceTypeResource resourceType = ResourceTypeDefinition.fromJaxRsResource( resourceClass).toScimResource(); UriBuilder locationBuilder = UriBuilder.fromUri(getBaseUri()).path( resourceType.getEndpoint().getPath()); if(scimResource.getId() != null) { locationBuilder.path(scimResource.getId()); } Meta meta = scimResource.getMeta(); if(meta == null) { meta = new Meta(); scimResource.setMeta(meta); } meta.setLocation(locationBuilder.build()); meta.setResourceType(resourceType.getName()); }
ObjectNode n1 = o1.asGenericScimResource().getObjectNode(); ObjectNode n2 = o2.asGenericScimResource().getObjectNode();
/** * Retrieve the meta.version attribute of the resource. * * @param resource The resource whose version to retrieve. * @return The resource version. * @throws IllegalArgumentException if the resource does not contain a the * meta.version attribute. */ static String getResourceVersion(final ScimResource resource) throws IllegalArgumentException { if(resource == null || resource.getMeta() == null || resource.getMeta().getVersion() == null) { throw new IllegalArgumentException( "Resource version must be specified by meta.version"); } return resource.getMeta().getVersion(); }
genericResource = resource.asGenericScimResource();
/** * Get the meta.location attribute value of the SCIM resource. * * @param resource The SCIM resource. * @return The meta.location attribute value. * @throws IllegalArgumentException if the resource does not contain the * meta.location attribute value. */ private URI checkAndGetLocation(final ScimResource resource) throws IllegalArgumentException { Meta meta = resource.getMeta(); if(meta == null || meta.getLocation() == null) { throw new IllegalArgumentException( "Resource URI must be specified by meta.location"); } return meta.getLocation(); }
/** * Get the meta.location attribute value of the SCIM resource. * * @param resource The SCIM resource. * @return The meta.location attribute value. * @throws IllegalArgumentException if the resource does not contain the * meta.location attribute value. */ private URI checkAndGetLocation(final ScimResource resource) throws IllegalArgumentException { Meta meta = resource.getMeta(); if(meta == null || meta.getLocation() == null) { throw new IllegalArgumentException( "Resource URI must be specified by meta.location"); } return meta.getLocation(); }