├── .github
├── ISSUE_TEMPLATE
│ ├── bug_report.md
│ └── feature_request.md
├── pull_request_template.md
└── workflows
│ ├── build-and-test.yaml
│ └── codeql.yaml
├── .gitignore
├── .mvn
└── wrapper
│ └── maven-wrapper.properties
├── CHANGELOG.md
├── CONTRIBUTING.md
├── README.md
├── assemblies
└── sonatype-bundle.xml
├── config
├── scim2-parent-checkstyle.xml
├── scim2-parent-gpl.sourceheader
├── scim2-parent-ubid.sourceheader
└── scim2-parent-unit-checkstyle.xml
├── mvnw
├── mvnw.cmd
├── pom.xml
├── resource
├── 3RD_PARTY_LICENSES.txt
├── LICENSE-GPLv2.txt
├── LICENSE-LGPLv2.1.txt
├── LICENSE-UnboundID-SCIM2.txt
└── LICENSE.txt
├── scim2-assembly
├── assemblies
│ └── zip.xml
└── pom.xml
├── scim2-sdk-client
├── pom.xml
└── src
│ ├── main
│ ├── java
│ │ └── com
│ │ │ └── unboundid
│ │ │ └── scim2
│ │ │ └── client
│ │ │ ├── ScimInterface.java
│ │ │ ├── ScimService.java
│ │ │ ├── ScimServiceException.java
│ │ │ ├── SearchResultHandler.java
│ │ │ ├── package-info.java
│ │ │ └── requests
│ │ │ ├── CreateRequestBuilder.java
│ │ │ ├── DeleteRequestBuilder.java
│ │ │ ├── ListResponseBuilder.java
│ │ │ ├── ModifyRequestBuilder.java
│ │ │ ├── ReplaceRequestBuilder.java
│ │ │ ├── RequestBuilder.java
│ │ │ ├── ResourceReturningRequestBuilder.java
│ │ │ ├── RetrieveRequestBuilder.java
│ │ │ ├── SearchRequestBuilder.java
│ │ │ └── package-info.java
│ └── javadoc
│ │ └── overview.html
│ └── test
│ └── java
│ └── com
│ └── unboundid
│ └── scim2
│ └── client
│ ├── ClientNullabilityAnnotationTest.java
│ └── RequestBuilderTest.java
├── scim2-sdk-common
├── pom.xml
└── src
│ ├── main
│ ├── java
│ │ └── com
│ │ │ └── unboundid
│ │ │ └── scim2
│ │ │ └── common
│ │ │ ├── BaseScimResource.java
│ │ │ ├── GenericScimResource.java
│ │ │ ├── Path.java
│ │ │ ├── ScimResource.java
│ │ │ ├── annotations
│ │ │ ├── Attribute.java
│ │ │ ├── NotNull.java
│ │ │ ├── Nullable.java
│ │ │ ├── Schema.java
│ │ │ └── package-info.java
│ │ │ ├── exceptions
│ │ │ ├── BadRequestException.java
│ │ │ ├── ForbiddenException.java
│ │ │ ├── MethodNotAllowedException.java
│ │ │ ├── NotImplementedException.java
│ │ │ ├── NotModifiedException.java
│ │ │ ├── PreconditionFailedException.java
│ │ │ ├── ResourceConflictException.java
│ │ │ ├── ResourceNotFoundException.java
│ │ │ ├── ScimException.java
│ │ │ ├── ServerErrorException.java
│ │ │ ├── UnauthorizedException.java
│ │ │ └── package-info.java
│ │ │ ├── filters
│ │ │ ├── AndFilter.java
│ │ │ ├── CombiningFilter.java
│ │ │ ├── ComparisonFilter.java
│ │ │ ├── ComplexValueFilter.java
│ │ │ ├── ContainsFilter.java
│ │ │ ├── EndsWithFilter.java
│ │ │ ├── EqualFilter.java
│ │ │ ├── Filter.java
│ │ │ ├── FilterType.java
│ │ │ ├── FilterVisitor.java
│ │ │ ├── GreaterThanFilter.java
│ │ │ ├── GreaterThanOrEqualFilter.java
│ │ │ ├── LessThanFilter.java
│ │ │ ├── LessThanOrEqualFilter.java
│ │ │ ├── NotEqualFilter.java
│ │ │ ├── NotFilter.java
│ │ │ ├── OrFilter.java
│ │ │ ├── PresentFilter.java
│ │ │ ├── StartsWithFilter.java
│ │ │ └── package-info.java
│ │ │ ├── messages
│ │ │ ├── ErrorResponse.java
│ │ │ ├── ListResponse.java
│ │ │ ├── PatchOpType.java
│ │ │ ├── PatchOperation.java
│ │ │ ├── PatchRequest.java
│ │ │ ├── SearchRequest.java
│ │ │ ├── SortOrder.java
│ │ │ └── package-info.java
│ │ │ ├── package-info.java
│ │ │ ├── types
│ │ │ ├── Address.java
│ │ │ ├── AttributeDefinition.java
│ │ │ ├── AuthenticationScheme.java
│ │ │ ├── BulkConfig.java
│ │ │ ├── ChangePasswordConfig.java
│ │ │ ├── ETagConfig.java
│ │ │ ├── Email.java
│ │ │ ├── EnterpriseUserExtension.java
│ │ │ ├── Entitlement.java
│ │ │ ├── FilterConfig.java
│ │ │ ├── Group.java
│ │ │ ├── GroupResource.java
│ │ │ ├── InstantMessagingAddress.java
│ │ │ ├── JsonReference.java
│ │ │ ├── Manager.java
│ │ │ ├── Member.java
│ │ │ ├── Meta.java
│ │ │ ├── Name.java
│ │ │ ├── PatchConfig.java
│ │ │ ├── PhoneNumber.java
│ │ │ ├── Photo.java
│ │ │ ├── ResourceTypeResource.java
│ │ │ ├── Role.java
│ │ │ ├── SchemaResource.java
│ │ │ ├── ServiceProviderConfigResource.java
│ │ │ ├── SortConfig.java
│ │ │ ├── UserResource.java
│ │ │ ├── X509Certificate.java
│ │ │ └── package-info.java
│ │ │ └── utils
│ │ │ ├── ApiConstants.java
│ │ │ ├── CalendarDeserializer.java
│ │ │ ├── CalendarSerializer.java
│ │ │ ├── CaseIgnoreMap.java
│ │ │ ├── CaseIgnoreObjectNode.java
│ │ │ ├── DateDeserializer.java
│ │ │ ├── DateSerializer.java
│ │ │ ├── DateTimeUtils.java
│ │ │ ├── Debug.java
│ │ │ ├── DebugType.java
│ │ │ ├── FilterEvaluator.java
│ │ │ ├── GenericScimObjectDeserializer.java
│ │ │ ├── GenericScimObjectSerializer.java
│ │ │ ├── JsonDiff.java
│ │ │ ├── JsonRefBeanSerializer.java
│ │ │ ├── JsonUtils.java
│ │ │ ├── MapperFactory.java
│ │ │ ├── Parser.java
│ │ │ ├── ParserOptions.java
│ │ │ ├── SchemaUtils.java
│ │ │ ├── ScimFilterJsonParser.java
│ │ │ ├── ScimJsonFactory.java
│ │ │ ├── ScimJsonNodeFactory.java
│ │ │ ├── StaticUtils.java
│ │ │ ├── StatusDeserializer.java
│ │ │ ├── StatusSerializer.java
│ │ │ └── package-info.java
│ ├── javadoc
│ │ └── overview.html
│ └── stubs
│ │ └── com
│ │ └── unboundid
│ │ └── scim2
│ │ └── common
│ │ └── utils
│ │ └── Version.java.stub
│ └── test
│ └── java
│ └── com
│ └── unboundid
│ └── scim2
│ └── common
│ ├── AddOperationValueFilterTestCase.java
│ ├── BaseScimResourceTest.java
│ ├── DiffTestCase.java
│ ├── ErrorResponseTest.java
│ ├── ExtensionsTest.java
│ ├── FilterEvaluatorTestCase.java
│ ├── FilterParsingTestCase.java
│ ├── GenericScimResourceObjectTest.java
│ ├── GroupResourceTestCase.java
│ ├── JsonUtilsTestCase.java
│ ├── ListResponseTestCase.java
│ ├── MapperFactoryTest.java
│ ├── MetaTest.java
│ ├── NonStandardRemoveOperationTest.java
│ ├── NullabilityAnnotationTest.java
│ ├── ParserOptionsTestCase.java
│ ├── PatchOpTestCase.java
│ ├── PatchRequestTest.java
│ ├── PathParsingTestCase.java
│ ├── ScimMultiValuedObject.java
│ ├── SearchRequestTestCase.java
│ ├── StaticUtilsTest.java
│ ├── UserResourceTestCase.java
│ ├── UserResourceVarargsTestCase.java
│ ├── exceptions
│ └── ScimExceptionTest.java
│ ├── schema
│ ├── SchemaGenerationTest.java
│ ├── SchemaResourceTestCase.java
│ └── testobjects
│ │ ├── TestObject1.java
│ │ ├── TestObject2.java
│ │ ├── TestObject3.java
│ │ ├── TestObject3_a.java
│ │ ├── TestObject3_b.java
│ │ ├── TestObject3_c.java
│ │ └── TestObject3_d.java
│ └── types
│ └── AuthenticationSchemeTest.java
├── scim2-sdk-server
├── pom.xml
└── src
│ ├── main
│ ├── java
│ │ └── com
│ │ │ └── unboundid
│ │ │ └── scim2
│ │ │ └── server
│ │ │ ├── ListResponseStreamingOutput.java
│ │ │ ├── ListResponseWriter.java
│ │ │ ├── PATCH.java
│ │ │ ├── annotations
│ │ │ ├── ResourceType.java
│ │ │ └── package-info.java
│ │ │ ├── package-info.java
│ │ │ ├── providers
│ │ │ ├── AuthenticatedSubjectAliasFilter.java
│ │ │ ├── DefaultContentTypeFilter.java
│ │ │ ├── DotSearchFilter.java
│ │ │ ├── JsonProcessingExceptionMapper.java
│ │ │ ├── RuntimeExceptionMapper.java
│ │ │ ├── ScimExceptionMapper.java
│ │ │ └── package-info.java
│ │ │ ├── resources
│ │ │ ├── AbstractServiceProviderConfigEndpoint.java
│ │ │ ├── ResourceTypesEndpoint.java
│ │ │ ├── SchemasEndpoint.java
│ │ │ └── package-info.java
│ │ │ └── utils
│ │ │ ├── ResourceComparator.java
│ │ │ ├── ResourceDiff.java
│ │ │ ├── ResourcePreparer.java
│ │ │ ├── ResourceTrimmer.java
│ │ │ ├── ResourceTypeDefinition.java
│ │ │ ├── SchemaAwareFilterEvaluator.java
│ │ │ ├── SchemaCheckFilterVisitor.java
│ │ │ ├── SchemaChecker.java
│ │ │ ├── ScimResourceTrimmer.java
│ │ │ ├── ServerUtils.java
│ │ │ ├── SimpleSearchResults.java
│ │ │ └── package-info.java
│ └── javadoc
│ │ └── overview.html
│ └── test
│ └── java
│ └── com
│ └── unboundid
│ └── scim2
│ └── server
│ ├── CustomContentEndpoint.java
│ ├── ETagTestCase.java
│ ├── ETagTestEndpoint.java
│ ├── EndpointTestCase.java
│ ├── TestAuthenticatedSubjectAliasFilter.java
│ ├── TestRequestFilter.java
│ ├── TestResourceEndpoint.java
│ ├── TestServiceProviderConfigEndpoint.java
│ ├── TestSingletonResourceEndpoint.java
│ └── utils
│ ├── EncodeTemplateNamesTestCase.java
│ ├── ResourcePreparerTestCase.java
│ ├── SchemaAwareFilterEvaluatorTestCase.java
│ ├── SchemaCheckerTestCase.java
│ └── ServerNullabilityAnnotationTest.java
└── scim2-ubid-extensions
├── README.md
├── pom.xml
└── src
├── main
├── java
│ └── com
│ │ └── unboundid
│ │ └── scim2
│ │ └── extension
│ │ └── messages
│ │ ├── consent
│ │ ├── Consent.java
│ │ ├── ConsentHistory.java
│ │ ├── OAuth2Client.java
│ │ ├── Scope.java
│ │ └── package-info.java
│ │ ├── contactvalidation
│ │ ├── EmailValidationRequest.java
│ │ ├── TelephonyValidationRequest.java
│ │ └── package-info.java
│ │ ├── externalidentity
│ │ ├── ExternalIdentity.java
│ │ ├── Provider.java
│ │ └── package-info.java
│ │ ├── pwdmgmt
│ │ ├── AccountState.java
│ │ ├── AccountUsabilityIssue.java
│ │ ├── PasswordQualityRequirementResponse.java
│ │ ├── PasswordRequirementResult.java
│ │ ├── PasswordUpdateErr.java
│ │ ├── PasswordUpdateRequest.java
│ │ ├── RetiredPassword.java
│ │ ├── TOTPSecretRegistrationRequest.java
│ │ └── package-info.java
│ │ └── sessionmgmt
│ │ ├── Session.java
│ │ └── package-info.java
└── javadoc
│ └── overview.html
└── test
└── java
└── com
└── unboundid
└── scim2
└── extension
└── messages
├── UBIDExtensionsNullabilityAnnotationTest.java
├── consent
├── ConsentHistoryTest.java
├── ConsentTest.java
├── OAuth2ClientTest.java
└── ScopeTest.java
├── externalidentity
├── ExternalIdentityTest.java
└── ProviderTest.java
├── pwdmgmt
├── AccountStateTest.java
└── PasswordQualityRequirementResponseTest.java
└── sessionmgmt
└── SessionTest.java
/.github/ISSUE_TEMPLATE/bug_report.md:
--------------------------------------------------------------------------------
1 | ---
2 | name: Bug report
3 | about: Create a report to help us improve
4 | title: ''
5 | labels: ''
6 | assignees: ''
7 |
8 | ---
9 |
10 | **Describe the bug**
11 | A clear and concise description of what the bug is.
12 |
13 | **To Reproduce**
14 | Steps to reproduce the behavior, including a code example, if applicable.
15 |
16 | **Expected behavior**
17 | A clear and concise description of what you expected to happen.
18 |
19 | **Additional context**
20 | Add any other context about the problem here. For example:
21 | - Java version: [e.g. Java 8]
22 | - SCIM 2 SDK version: [e.g. 2.3.7, master branch]
23 |
--------------------------------------------------------------------------------
/.github/ISSUE_TEMPLATE/feature_request.md:
--------------------------------------------------------------------------------
1 | ---
2 | name: Feature request
3 | about: Suggest an idea for this project
4 | title: ''
5 | labels: ''
6 | assignees: ''
7 |
8 | ---
9 |
10 | **Is your feature request related to a problem? Please describe.**
11 | A clear and concise description of the problem that would be solved by this feature.
12 |
13 | **Describe the solution you'd like**
14 | A clear and concise description of what you want to happen.
15 |
16 | **Describe alternatives you've considered**
17 | A clear and concise description of any alternative solutions or features you've considered.
18 |
19 | **Additional context**
20 | Add any other context about the feature request here.
21 |
--------------------------------------------------------------------------------
/.github/pull_request_template.md:
--------------------------------------------------------------------------------
1 | _Please be aware that Ping Identity does not accept third-party contributions at this time! Please see our [contribution guidelines](https://github.com/pingidentity/scim2/blob/master/CONTRIBUTING.md)._
2 |
3 | What does this implement/fix? Explain your changes.
4 | ---------------------------------------------------
5 | …
6 |
7 | Does this close any currently open issues?
8 | ------------------------------------------
9 | …
10 |
--------------------------------------------------------------------------------
/.github/workflows/build-and-test.yaml:
--------------------------------------------------------------------------------
1 | name: Build Status
2 |
3 | on:
4 | push:
5 | # Run tests on any push to the main branch.
6 | branches: [ "master", "main", "ubid-test" ]
7 | pull_request:
8 | branches: [ "master", "main" ]
9 |
10 | jobs:
11 | build:
12 | name: mvn package
13 | runs-on: ubuntu-latest
14 |
15 | # Compile and build with supported LTS releases of Java.
16 | strategy:
17 | matrix:
18 | java-version: [ 17, 21, 25 ]
19 | # Run tests with each Java version sequentially.
20 | max-parallel: 1
21 | steps:
22 | - run: |
23 | echo "This job was triggered by the '${{ github.event_name }}' event."
24 | - uses: actions/checkout@v4
25 | - name: Install JDK ${{ matrix.java-version }}
26 | uses: actions/setup-java@v5
27 | with:
28 | java-version: ${{ matrix.java-version }}
29 | distribution: 'temurin'
30 | cache: maven
31 |
32 | - name: Build
33 | run: |
34 | ./mvnw clean package
35 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | # IntelliJ IDEA files
2 | .idea/
3 | *.iml
4 |
5 | # Build artifacts are placed in this folder.
6 | target/
7 |
8 | # Ignore MacOS metadata.
9 | .DS_Store
10 |
--------------------------------------------------------------------------------
/.mvn/wrapper/maven-wrapper.properties:
--------------------------------------------------------------------------------
1 | # Licensed to the Apache Software Foundation (ASF) under one
2 | # or more contributor license agreements. See the NOTICE file
3 | # distributed with this work for additional information
4 | # regarding copyright ownership. The ASF licenses this file
5 | # to you under the Apache License, Version 2.0 (the
6 | # "License"); you may not use this file except in compliance
7 | # with the License. You may obtain a copy of the License at
8 | #
9 | # http://www.apache.org/licenses/LICENSE-2.0
10 | #
11 | # Unless required by applicable law or agreed to in writing,
12 | # software distributed under the License is distributed on an
13 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14 | # KIND, either express or implied. See the License for the
15 | # specific language governing permissions and limitations
16 | # under the License.
17 | wrapperVersion=3.3.2
18 | distributionType=only-script
19 | distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.9.10/apache-maven-3.9.10-bin.zip
20 |
--------------------------------------------------------------------------------
/CONTRIBUTING.md:
--------------------------------------------------------------------------------
1 | # Contributing to the SCIM 2 SDK
2 |
3 | Thanks for taking the time to contribute!
4 |
5 | ## How can I contribute?
6 |
7 | ### Reporting bugs
8 |
9 | #### Before submitting a bug report
10 |
11 | It can be helpful to review the documentation and examples, including the [Javadocs](https://javadoc.io/doc/com.unboundid.product.scim2/scim2-parent/) and the [wiki](https://github.com/pingidentity/scim2/wiki). It's also a good idea to search the [issue tracker](https://github.com/pingidentity/scim2/issues) to see if your issue or one similar to it has already been reported.
12 |
13 | #### How do I submit a bug report?
14 |
15 | Bugs are tracked as [GitHub Issues](https://guides.github.com/features/issues/). You can report a bug by submitting an issue in the project's [issue tracker](https://github.com/pingidentity/scim2/issues). To help the maintainers understand and reproduce the problem, please try to provide information such as the following:
16 |
17 | * A clear and descriptive title.
18 | * A description of what happened and a description of what you expected to happen.
19 | * An example with the exact steps needed to reproduce the problem. If relevant, example HTTP requests and responses are helpful.
20 |
21 | Please understand that bug reports are reviewed and prioritized internally, and we may not be able to address all bug reports or provide an estimated time for resolution.
22 |
23 | ### Suggesting enhancements
24 |
25 | As with bugs, enhancement requests are tracked as [GitHub Issues](https://guides.github.com/features/issues/). You can suggest an enhancement by submitting an issue in the project's [issue tracker](https://github.com/pingidentity/scim2/issues).
26 |
27 | Please understand that enhancement requests are reviewed and prioritized internally, and we may not be able to address all requests or provide an estimated time for resolution.
28 |
29 | ### Contributing code changes
30 |
31 | Ping Identity does not accept third-party code submissions, such as pull requests.
32 |
--------------------------------------------------------------------------------
/assemblies/sonatype-bundle.xml:
--------------------------------------------------------------------------------
1 |
17 |
18 |
22 | sonatype-bundle
23 | false
24 |
25 | jar
26 |
27 |
28 |
29 | /
30 | ${project.build.directory}
31 |
32 | ${project.build.finalName}.pom
33 | ${project.build.finalName}.jar
34 | ${project.artifactId}-${project.version}-sources.jar
35 | ${project.artifactId}-${project.version}-javadoc.jar
36 |
37 |
38 |
39 | /
40 | ${project.build.directory}
41 |
42 | ${project.build.finalName}.pom.asc
43 | ${project.build.finalName}.jar.asc
44 | ${project.artifactId}-${project.version}-sources.jar.asc
45 | ${project.artifactId}-${project.version}-javadoc.jar.asc
46 |
47 |
48 |
49 |
50 |
--------------------------------------------------------------------------------
/config/scim2-parent-gpl.sourceheader:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (\d\d\d\d-)?(\d\d\d\d) Ping Identity Corporation
3 | *
4 | * This program is free software; you can redistribute it and/or modify
5 | * it under the terms of the GNU General Public License \(GPLv2 only\)
6 | * or the terms of the GNU Lesser General Public License \(LGPLv2.1 only\)
7 | * as published by the Free Software Foundation.
8 | *
9 | * This program is distributed in the hope that it will be useful,
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 | * GNU General Public License for more details.
13 | *
14 | * You should have received a copy of the GNU General Public License
15 | * along with this program; if not, see .
16 | */
17 |
--------------------------------------------------------------------------------
/config/scim2-parent-ubid.sourceheader:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (\d\d\d\d-)?(\d\d\d\d) Ping Identity Corporation
3 | * All Rights Reserved.
4 | */
5 |
--------------------------------------------------------------------------------
/resource/LICENSE.txt:
--------------------------------------------------------------------------------
1 | UnboundID SCIM2 SDK
2 | Copyright 2011-2025 Ping Identity Corporation
3 |
4 | The UnboundID SCIM2 SDK is available under three licenses:
5 | the GNU General Public License version 2 (GPLv2), the GNU Lesser
6 | General Public License version 2.1 (LGPLv2.1), and a free-right-to-use license
7 | created by Ping Identity Corporation.
8 |
9 | See the LICENSE-GPLv2.txt file for the GNU General Public License version 2.
10 |
11 | See the LICENSE-LGPLv2.1.txt file for the GNU Lesser General Public License
12 | version 2.1.
13 |
14 | See the LICENSE-UnboundID-SCIM2.txt file for the UnboundID SCIM 2.0 CLIENT
15 | SDK Free Use License.
16 |
--------------------------------------------------------------------------------
/scim2-assembly/assemblies/zip.xml:
--------------------------------------------------------------------------------
1 |
17 |
21 | scim2-sdk
22 |
23 | zip
24 |
25 |
26 |
27 | licenses
28 | ${main.basedir}/resource
29 | 755
30 | 644
31 |
32 |
33 | docs
34 | ${main.basedir}/target/javadoc
35 | 755
36 | 644
37 |
38 |
39 |
40 |
41 | sources
42 | ${main.basedir}/scim2-sdk-client/target/scim2-sdk-client-${project.version}-sources.jar
43 | 644
44 |
45 |
46 | sources
47 | ${main.basedir}/scim2-sdk-common/target/scim2-sdk-common-${project.version}-sources.jar
48 | 644
49 |
50 |
51 | sources
52 | ${main.basedir}/scim2-sdk-server/target/scim2-sdk-server-${project.version}-sources.jar
53 | 644
54 |
55 |
56 | sources
57 | ${main.basedir}/scim2-ubid-extensions/target/scim2-ubid-extensions-${project.version}-sources.jar
58 | 644
59 |
60 |
61 | .
62 | ${main.basedir}/CHANGELOG.md
63 | 644
64 |
65 |
66 | .
67 | ${main.basedir}/README.md
68 | 644
69 |
70 |
71 |
72 |
73 | lib
74 | false
75 | 755
76 | 644
77 |
78 |
79 |
80 |
--------------------------------------------------------------------------------
/scim2-assembly/pom.xml:
--------------------------------------------------------------------------------
1 |
17 |
18 | 4.0.0
19 |
20 | com.unboundid.product.scim2
21 | scim2-parent
22 | 5.0.0-SNAPSHOT
23 | ../pom.xml
24 |
25 | scim2-assembly
26 | pom
27 | UnboundID SCIM2 Assembly
28 |
29 |
30 | ${project.parent.basedir}
31 |
32 |
33 |
34 |
35 | UnboundID
36 |
37 |
38 |
39 | maven-assembly-plugin
40 |
41 |
42 | create-zip-archive
43 | package
44 |
45 | single
46 |
47 |
48 | scim2-sdk-${project.version}
49 |
50 | ${project.basedir}/assemblies/zip.xml
51 |
52 | false
53 | false
54 |
55 |
56 |
57 |
58 |
59 |
60 |
61 |
62 |
63 |
64 |
65 | org.apache.maven.plugins
66 | maven-checkstyle-plugin
67 |
68 | true
69 |
70 |
71 |
72 |
73 |
74 |
75 | com.unboundid.product.scim2
76 | scim2-sdk-server
77 |
78 |
79 | com.unboundid.product.scim2
80 | scim2-ubid-extensions
81 |
82 |
83 |
84 |
--------------------------------------------------------------------------------
/scim2-sdk-client/src/main/java/com/unboundid/scim2/client/ScimServiceException.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2016-2025 Ping Identity Corporation
3 | *
4 | * This program is free software; you can redistribute it and/or modify
5 | * it under the terms of the GNU General Public License (GPLv2 only)
6 | * or the terms of the GNU Lesser General Public License (LGPLv2.1 only)
7 | * as published by the Free Software Foundation.
8 | *
9 | * This program is distributed in the hope that it will be useful,
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 | * GNU General Public License for more details.
13 | *
14 | * You should have received a copy of the GNU General Public License
15 | * along with this program; if not, see .
16 | */
17 |
18 | package com.unboundid.scim2.client;
19 |
20 | import com.unboundid.scim2.common.annotations.Nullable;
21 | import com.unboundid.scim2.common.exceptions.ScimException;
22 |
23 | /**
24 | * This exception is thrown when problems occur in the {@link ScimService}. This
25 | * class allows a client application to differentiate between errors that
26 | * arise on the client side from errors that come from the server.
27 | */
28 | public class ScimServiceException extends ScimException
29 | {
30 | /**
31 | * Create a new ScimServiceException from the provided information.
32 | *
33 | * @param statusCode The HTTP status code for this exception.
34 | * @param errorMessage The error message for this SCIM exception.
35 | * @param cause The cause (which is saved for later retrieval by the
36 | * {@link #getCause()} method). A {@code null} value
37 | * is permitted, and indicates that the cause is
38 | * nonexistent or unknown.
39 | */
40 |
41 | public ScimServiceException(final int statusCode,
42 | @Nullable final String errorMessage,
43 | @Nullable final Throwable cause)
44 | {
45 | super(statusCode, null, errorMessage, cause);
46 | }
47 | }
48 |
--------------------------------------------------------------------------------
/scim2-sdk-client/src/main/java/com/unboundid/scim2/client/SearchResultHandler.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2015-2025 Ping Identity Corporation
3 | *
4 | * This program is free software; you can redistribute it and/or modify
5 | * it under the terms of the GNU General Public License (GPLv2 only)
6 | * or the terms of the GNU Lesser General Public License (LGPLv2.1 only)
7 | * as published by the Free Software Foundation.
8 | *
9 | * This program is distributed in the hope that it will be useful,
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 | * GNU General Public License for more details.
13 | *
14 | * You should have received a copy of the GNU General Public License
15 | * along with this program; if not, see .
16 | */
17 |
18 | package com.unboundid.scim2.client;
19 |
20 | import com.fasterxml.jackson.databind.node.ObjectNode;
21 | import com.unboundid.scim2.common.annotations.NotNull;
22 |
23 | /**
24 | * An interface for handling the search result response. Methods will be called
25 | * in the order they are received.
26 | */
27 | public interface SearchResultHandler
28 | {
29 | /**
30 | * Handle the startIndex in the search response.
31 | *
32 | * @param startIndex The startIndex.
33 | */
34 | void startIndex(final int startIndex);
35 |
36 | /**
37 | * Handle the itemsPerPage in the search response.
38 | *
39 | * @param itemsPerPage The itemsPerPage.
40 | */
41 | void itemsPerPage(final int itemsPerPage);
42 |
43 | /**
44 | * Handle the totalResults in the search response.
45 | *
46 | * @param totalResults The totalResults.
47 | */
48 | void totalResults(final int totalResults);
49 |
50 | /**
51 | * Handle a search result resource.
52 | *
53 | * @param scimResource A search result resource.
54 | * @return {@code true} to continue processing the search result response or
55 | * {@code false} to immediate stop further processing of the response.
56 | */
57 | boolean resource(@NotNull final T scimResource);
58 |
59 | /**
60 | * Handle a schema extension in the search response.
61 | *
62 | * @param urn The URN of the extension schema.
63 | * @param extensionObjectNode The ObjectNode representing the extension
64 | * schema.
65 | */
66 | void extension(@NotNull final String urn,
67 | @NotNull final ObjectNode extensionObjectNode);
68 | }
69 |
--------------------------------------------------------------------------------
/scim2-sdk-client/src/main/java/com/unboundid/scim2/client/package-info.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2015-2025 Ping Identity Corporation
3 | *
4 | * This program is free software; you can redistribute it and/or modify
5 | * it under the terms of the GNU General Public License (GPLv2 only)
6 | * or the terms of the GNU Lesser General Public License (LGPLv2.1 only)
7 | * as published by the Free Software Foundation.
8 | *
9 | * This program is distributed in the hope that it will be useful,
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 | * GNU General Public License for more details.
13 | *
14 | * You should have received a copy of the GNU General Public License
15 | * along with this program; if not, see .
16 | */
17 |
18 | /**
19 | * Client classes for accessing SCIM 2 resources. SCIM 2 clients are typically
20 | * built around the {@link com.unboundid.scim2.client.ScimService} class,
21 | * which provides methods for accessing a SCIM 2 service provider's resources,
22 | * configuration, schemas, and resource types. Requests for resources may
23 | * designate the type of the return value by specifying a
24 | * {@link com.unboundid.scim2.common.GenericScimResource} or a POJO derived
25 | * from {@link com.unboundid.scim2.common.BaseScimResource}.
26 | *
27 | * @see com.unboundid.scim2.common.GenericScimResource
28 | * @see com.unboundid.scim2.common.BaseScimResource
29 | */
30 |
31 | package com.unboundid.scim2.client;
32 |
--------------------------------------------------------------------------------
/scim2-sdk-client/src/main/java/com/unboundid/scim2/client/requests/CreateRequestBuilder.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2015-2025 Ping Identity Corporation
3 | *
4 | * This program is free software; you can redistribute it and/or modify
5 | * it under the terms of the GNU General Public License (GPLv2 only)
6 | * or the terms of the GNU Lesser General Public License (LGPLv2.1 only)
7 | * as published by the Free Software Foundation.
8 | *
9 | * This program is distributed in the hope that it will be useful,
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 | * GNU General Public License for more details.
13 | *
14 | * You should have received a copy of the GNU General Public License
15 | * along with this program; if not, see .
16 | */
17 |
18 | package com.unboundid.scim2.client.requests;
19 |
20 | import com.unboundid.scim2.common.ScimResource;
21 | import com.unboundid.scim2.common.annotations.NotNull;
22 | import com.unboundid.scim2.common.exceptions.ScimException;
23 |
24 | import jakarta.ws.rs.ProcessingException;
25 | import jakarta.ws.rs.client.Entity;
26 | import jakarta.ws.rs.client.WebTarget;
27 | import jakarta.ws.rs.core.Response;
28 |
29 | import static jakarta.ws.rs.core.Response.Status.Family.SUCCESSFUL;
30 |
31 | /**
32 | * A builder for SCIM create requests.
33 | */
34 | public class CreateRequestBuilder
35 | extends ResourceReturningRequestBuilder>
36 | {
37 | @NotNull
38 | private final T resource;
39 |
40 | /**
41 | * Create a new SCIM create request builder that will POST the given resource
42 | * to the given web target.
43 | *
44 | * @param target The WebTarget to POST to.
45 | * @param resource The SCIM resource to POST.
46 | */
47 | public CreateRequestBuilder(@NotNull final WebTarget target,
48 | @NotNull final T resource)
49 | {
50 | super(target);
51 | this.resource = resource;
52 | }
53 |
54 | /**
55 | * Invoke the SCIM create request.
56 | *
57 | * @return The successfully create SCIM resource.
58 | * @throws ScimException If an error occurred.
59 | */
60 | @NotNull
61 | @SuppressWarnings("unchecked")
62 | public T invoke() throws ScimException
63 | {
64 | return (T) invoke(resource.getClass());
65 | }
66 |
67 | /**
68 | * Invoke the SCIM create request.
69 | *
70 | * @param The type of object to return.
71 | * @param cls The Java class object used to determine the type to return.
72 | * @return The successfully modified SCIM resource.
73 | * @throws ProcessingException If a JAX-RS runtime exception occurred.
74 | * @throws ScimException If the SCIM service provider responded with an error.
75 | */
76 | @NotNull
77 | public C invoke(@NotNull final Class cls) throws ScimException
78 | {
79 | var entity = Entity.entity(generify(resource), getContentType());
80 | try (Response response = buildRequest().post(entity))
81 | {
82 | if (response.getStatusInfo().getFamily() == SUCCESSFUL)
83 | {
84 | return response.readEntity(cls);
85 | }
86 | else
87 | {
88 | throw toScimException(response);
89 | }
90 | }
91 | }
92 | }
93 |
--------------------------------------------------------------------------------
/scim2-sdk-client/src/main/java/com/unboundid/scim2/client/requests/DeleteRequestBuilder.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2015-2025 Ping Identity Corporation
3 | *
4 | * This program is free software; you can redistribute it and/or modify
5 | * it under the terms of the GNU General Public License (GPLv2 only)
6 | * or the terms of the GNU Lesser General Public License (LGPLv2.1 only)
7 | * as published by the Free Software Foundation.
8 | *
9 | * This program is distributed in the hope that it will be useful,
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 | * GNU General Public License for more details.
13 | *
14 | * You should have received a copy of the GNU General Public License
15 | * along with this program; if not, see .
16 | */
17 |
18 | package com.unboundid.scim2.client.requests;
19 |
20 | import com.unboundid.scim2.common.annotations.NotNull;
21 | import com.unboundid.scim2.common.annotations.Nullable;
22 | import com.unboundid.scim2.common.exceptions.ScimException;
23 |
24 | import jakarta.ws.rs.ProcessingException;
25 | import jakarta.ws.rs.client.Invocation;
26 | import jakarta.ws.rs.client.WebTarget;
27 | import jakarta.ws.rs.core.HttpHeaders;
28 | import jakarta.ws.rs.core.Response;
29 |
30 | import static jakarta.ws.rs.core.Response.Status.Family.SUCCESSFUL;
31 |
32 | /**
33 | * A builder for SCIM delete requests.
34 | */
35 | public class DeleteRequestBuilder extends RequestBuilder
36 | {
37 | @Nullable
38 | private String version;
39 |
40 | /**
41 | * Create a new DeleteRequestBuilder.
42 | *
43 | * @param target The WebTarget to DELETE.
44 | */
45 | public DeleteRequestBuilder(@NotNull final WebTarget target)
46 | {
47 | super(target);
48 | }
49 |
50 | /**
51 | * Delete the resource only if the resource has not been modified since the
52 | * provided version.
53 | *
54 | * @param version The version of the resource to compare.
55 | * @return This builder.
56 | */
57 | @NotNull
58 | public DeleteRequestBuilder ifMatch(@Nullable final String version)
59 | {
60 | this.version = version;
61 | return this;
62 | }
63 |
64 | /**
65 | * {@inheritDoc}
66 | */
67 | @Override
68 | @NotNull
69 | protected Invocation.Builder buildRequest()
70 | {
71 | Invocation.Builder request = super.buildRequest();
72 | if (version != null)
73 | {
74 | request.header(HttpHeaders.IF_MATCH, version);
75 | }
76 | return request;
77 | }
78 |
79 | /**
80 | * Invoke the SCIM delete request.
81 | *
82 | * @throws ProcessingException If a JAX-RS runtime exception occurred.
83 | * @throws ScimException If the SCIM service provider responded with an error.
84 | */
85 | public void invoke() throws ScimException
86 | {
87 | try (Response response = buildRequest().delete())
88 | {
89 | if (response.getStatusInfo().getFamily() != SUCCESSFUL)
90 | {
91 | throw toScimException(response);
92 | }
93 | }
94 | }
95 | }
96 |
--------------------------------------------------------------------------------
/scim2-sdk-client/src/main/java/com/unboundid/scim2/client/requests/ListResponseBuilder.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2015-2025 Ping Identity Corporation
3 | *
4 | * This program is free software; you can redistribute it and/or modify
5 | * it under the terms of the GNU General Public License (GPLv2 only)
6 | * or the terms of the GNU Lesser General Public License (LGPLv2.1 only)
7 | * as published by the Free Software Foundation.
8 | *
9 | * This program is distributed in the hope that it will be useful,
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 | * GNU General Public License for more details.
13 | *
14 | * You should have received a copy of the GNU General Public License
15 | * along with this program; if not, see .
16 | */
17 |
18 | package com.unboundid.scim2.client.requests;
19 |
20 | import com.fasterxml.jackson.databind.node.ObjectNode;
21 | import com.unboundid.scim2.client.SearchResultHandler;
22 | import com.unboundid.scim2.common.annotations.NotNull;
23 | import com.unboundid.scim2.common.annotations.Nullable;
24 | import com.unboundid.scim2.common.messages.ListResponse;
25 |
26 | import java.util.LinkedList;
27 | import java.util.List;
28 | import java.util.Optional;
29 |
30 | /**
31 | * A builder for {@link ListResponse} that is also a SearchResultHandler
32 | * implementation.
33 | */
34 | public class ListResponseBuilder
35 | implements SearchResultHandler
36 | {
37 | @Nullable
38 | private Integer totalResults;
39 |
40 | @NotNull
41 | private final List resources = new LinkedList<>();
42 |
43 | @Nullable
44 | private Integer startIndex;
45 |
46 | @Nullable
47 | private Integer itemsPerPage;
48 |
49 | /**
50 | * {@inheritDoc}
51 | */
52 | public void startIndex(final int startIndex)
53 | {
54 | this.startIndex = startIndex;
55 | }
56 |
57 | /**
58 | * {@inheritDoc}
59 | */
60 | public void itemsPerPage(final int itemsPerPage)
61 | {
62 | this.itemsPerPage = itemsPerPage;
63 | }
64 |
65 | /**
66 | * {@inheritDoc}
67 | */
68 | public void totalResults(final int totalResults)
69 | {
70 | this.totalResults = totalResults;
71 | }
72 |
73 | /**
74 | * {@inheritDoc}
75 | */
76 | public boolean resource(@NotNull final T scimResource)
77 | {
78 | this.resources.add(scimResource);
79 | return true;
80 | }
81 |
82 | /**
83 | * {@inheritDoc}
84 | *
85 | * This method currently does not perform any action and should not be used.
86 | */
87 | public void extension(@NotNull final String urn,
88 | @NotNull final ObjectNode extensionObjectNode)
89 | {
90 | // TODO: do nothing for now
91 | }
92 |
93 | /**
94 | * Builds a {@link ListResponse} based on the values supplied to the builder.
95 | *
96 | * @return A generated ListResponse.
97 | */
98 | @NotNull
99 | public ListResponse build()
100 | {
101 | return new ListResponse<>(
102 | Optional.ofNullable(totalResults).orElse(resources.size()),
103 | resources,
104 | startIndex,
105 | itemsPerPage
106 | );
107 | }
108 | }
109 |
--------------------------------------------------------------------------------
/scim2-sdk-client/src/main/java/com/unboundid/scim2/client/requests/package-info.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2015-2025 Ping Identity Corporation
3 | *
4 | * This program is free software; you can redistribute it and/or modify
5 | * it under the terms of the GNU General Public License (GPLv2 only)
6 | * or the terms of the GNU Lesser General Public License (LGPLv2.1 only)
7 | * as published by the Free Software Foundation.
8 | *
9 | * This program is distributed in the hope that it will be useful,
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 | * GNU General Public License for more details.
13 | *
14 | * You should have received a copy of the GNU General Public License
15 | * along with this program; if not, see .
16 | */
17 |
18 | /**
19 | * Classes for building SCIM 2 requests. These classes are typically accessed
20 | * through a {@link com.unboundid.scim2.client.ScimService} instance.
21 | *
22 | * @see com.unboundid.scim2.client.ScimService
23 | */
24 |
25 | package com.unboundid.scim2.client.requests;
26 |
--------------------------------------------------------------------------------
/scim2-sdk-client/src/main/javadoc/overview.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | UnboundID SCIM 2 SDK Client
5 |
6 |
7 |
8 |
This package contains client classes for building SCIM 2 requests and for
9 | accessing resources from SCIM 2 service providers.
10 |
11 |
The most important of these is the
12 | {@link com.unboundid.scim2.client.ScimService} class, which is the
13 | main entry point for the SCIM 2 client API. This class provides methods for
14 | accessing a SCIM 2 service provider's resources, configuration, schemas,
15 | and resource types.
16 |
17 |
18 |
19 |
--------------------------------------------------------------------------------
/scim2-sdk-client/src/test/java/com/unboundid/scim2/client/RequestBuilderTest.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2025 Ping Identity Corporation
3 | *
4 | * This program is free software; you can redistribute it and/or modify
5 | * it under the terms of the GNU General Public License (GPLv2 only)
6 | * or the terms of the GNU Lesser General Public License (LGPLv2.1 only)
7 | * as published by the Free Software Foundation.
8 | *
9 | * This program is distributed in the hope that it will be useful,
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 | * GNU General Public License for more details.
13 | *
14 | * You should have received a copy of the GNU General Public License
15 | * along with this program; if not, see .
16 | */
17 |
18 | package com.unboundid.scim2.client;
19 |
20 | import com.unboundid.scim2.client.requests.CreateRequestBuilder;
21 | import com.unboundid.scim2.client.requests.DeleteRequestBuilder;
22 | import com.unboundid.scim2.client.requests.ReplaceRequestBuilder;
23 | import com.unboundid.scim2.client.requests.SearchRequestBuilder;
24 | import com.unboundid.scim2.common.ScimResource;
25 | import com.unboundid.scim2.common.types.UserResource;
26 | import jakarta.ws.rs.client.WebTarget;
27 | import org.testng.annotations.Test;
28 |
29 | import static org.assertj.core.api.Assertions.assertThat;
30 |
31 |
32 | public class RequestBuilderTest
33 | {
34 | /**
35 | * Ensures that builder classes are not {@code final} and can be extended.
36 | */
37 | @Test
38 | public void testExtendable()
39 | {
40 | final WebTarget target = null;
41 | final UserResource resource = new UserResource();
42 |
43 | // Test CreateRequestBuilder.
44 | class CustomCreate
45 | extends CreateRequestBuilder
46 | {
47 | public String otherField;
48 |
49 | public CustomCreate(WebTarget target, T resource)
50 | {
51 | super(target, resource);
52 | }
53 | }
54 | var createInstance = new CustomCreate<>(target, resource);
55 | createInstance.otherField = "present";
56 | assertThat(createInstance.otherField).isEqualTo("present");
57 |
58 | // Test ReplaceRequestBuilder.
59 | class CustomReplace
60 | extends ReplaceRequestBuilder
61 | {
62 | public String otherField;
63 |
64 | public CustomReplace(WebTarget target, T resource)
65 | {
66 | super(target, resource);
67 | }
68 | }
69 | var replaceInstance = new CustomReplace<>(target, resource);
70 | replaceInstance.otherField = "present";
71 | assertThat(replaceInstance.otherField).isEqualTo("present");
72 |
73 | // Test DeleteRequestBuilder.
74 | class CustomDelete extends DeleteRequestBuilder
75 | {
76 | public String otherField;
77 |
78 | public CustomDelete(WebTarget target)
79 | {
80 | super(target);
81 | }
82 | }
83 | var deleteInstance = new CustomDelete(target);
84 | deleteInstance.otherField = "present";
85 | assertThat(deleteInstance.otherField).isEqualTo("present");
86 |
87 | // Test SearchRequestBuilder.
88 | class CustomSearch extends SearchRequestBuilder
89 | {
90 | public String otherField;
91 |
92 | public CustomSearch(WebTarget target)
93 | {
94 | super(target);
95 | }
96 | }
97 | var searchInstance = new CustomSearch(target);
98 | searchInstance.otherField = "present";
99 | assertThat(searchInstance.otherField).isEqualTo("present");
100 | }
101 | }
102 |
--------------------------------------------------------------------------------
/scim2-sdk-common/src/main/java/com/unboundid/scim2/common/annotations/NotNull.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2023-2025 Ping Identity Corporation
3 | *
4 | * This program is free software; you can redistribute it and/or modify
5 | * it under the terms of the GNU General Public License (GPLv2 only)
6 | * or the terms of the GNU Lesser General Public License (LGPLv2.1 only)
7 | * as published by the Free Software Foundation.
8 | *
9 | * This program is distributed in the hope that it will be useful,
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 | * GNU General Public License for more details.
13 | *
14 | * You should have received a copy of the GNU General Public License
15 | * along with this program; if not, see .
16 | */
17 | /*
18 | * Copyright 2023-2025 Ping Identity Corporation
19 | *
20 | * Licensed under the Apache License, Version 2.0 (the "License");
21 | * you may not use this file except in compliance with the License.
22 | * You may obtain a copy of the License at
23 | *
24 | * http://www.apache.org/licenses/LICENSE-2.0
25 | *
26 | * Unless required by applicable law or agreed to in writing, software
27 | * distributed under the License is distributed on an "AS IS" BASIS,
28 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
29 | * See the License for the specific language governing permissions and
30 | * limitations under the License.
31 | */
32 |
33 | package com.unboundid.scim2.common.annotations;
34 |
35 |
36 |
37 | import java.lang.annotation.Documented;
38 | import java.lang.annotation.ElementType;
39 | import java.lang.annotation.Retention;
40 | import java.lang.annotation.RetentionPolicy;
41 | import java.lang.annotation.Target;
42 |
43 |
44 |
45 | /**
46 | * This annotation type is used to indicate that the associated field, local
47 | * variable, method or constructor parameter, or method return value is not
48 | * allowed to be {@code null}. This annotation type is not strictly enforced by
49 | * the compiler, but development environments may be configured to warn or
50 | * reject attempts to use {@code null} values where non-{@code null} values are
51 | * expected.
52 | *
53 | * This annotation type will appear in the generated Javadoc documentation for
54 | * classes and interfaces that include it.
55 | *
56 | * This annotation class is based on a similar one from the UnboundID LDAP SDK.
57 | *
58 | * @see Nullable
59 | */
60 | @Documented
61 | @Retention(RetentionPolicy.RUNTIME)
62 | @Target({ ElementType.FIELD, ElementType.LOCAL_VARIABLE, ElementType.PARAMETER,
63 | ElementType.METHOD })
64 | public @interface NotNull
65 | {
66 | }
67 |
--------------------------------------------------------------------------------
/scim2-sdk-common/src/main/java/com/unboundid/scim2/common/annotations/Nullable.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2023-2025 Ping Identity Corporation
3 | *
4 | * This program is free software; you can redistribute it and/or modify
5 | * it under the terms of the GNU General Public License (GPLv2 only)
6 | * or the terms of the GNU Lesser General Public License (LGPLv2.1 only)
7 | * as published by the Free Software Foundation.
8 | *
9 | * This program is distributed in the hope that it will be useful,
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 | * GNU General Public License for more details.
13 | *
14 | * You should have received a copy of the GNU General Public License
15 | * along with this program; if not, see .
16 | */
17 | /*
18 | * Copyright 2023-2025 Ping Identity Corporation
19 | *
20 | * Licensed under the Apache License, Version 2.0 (the "License");
21 | * you may not use this file except in compliance with the License.
22 | * You may obtain a copy of the License at
23 | *
24 | * http://www.apache.org/licenses/LICENSE-2.0
25 | *
26 | * Unless required by applicable law or agreed to in writing, software
27 | * distributed under the License is distributed on an "AS IS" BASIS,
28 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
29 | * See the License for the specific language governing permissions and
30 | * limitations under the License.
31 | */
32 |
33 | package com.unboundid.scim2.common.annotations;
34 |
35 |
36 |
37 | import java.lang.annotation.Documented;
38 | import java.lang.annotation.ElementType;
39 | import java.lang.annotation.Retention;
40 | import java.lang.annotation.RetentionPolicy;
41 | import java.lang.annotation.Target;
42 |
43 |
44 |
45 | /**
46 | * This annotation type is used to indicate that the associated field, local
47 | * variable, method or constructor parameter, or method return value is allowed
48 | * to be {@code null}, and that code using nullable elements should be prepared
49 | * to encounter {@code null} values.
50 | *
51 | * This annotation type will appear in the generated Javadoc documentation for
52 | * classes and interfaces that include it.
53 | *
54 | * This annotation class is based on a similar one from the UnboundID LDAP SDK.
55 | *
56 | * @see NotNull
57 | */
58 | @Documented
59 | @Retention(RetentionPolicy.RUNTIME)
60 | @Target({ ElementType.FIELD, ElementType.LOCAL_VARIABLE, ElementType.PARAMETER,
61 | ElementType.METHOD })
62 | public @interface Nullable
63 | {
64 | }
65 |
--------------------------------------------------------------------------------
/scim2-sdk-common/src/main/java/com/unboundid/scim2/common/annotations/Schema.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2015-2025 Ping Identity Corporation
3 | *
4 | * This program is free software; you can redistribute it and/or modify
5 | * it under the terms of the GNU General Public License (GPLv2 only)
6 | * or the terms of the GNU Lesser General Public License (LGPLv2.1 only)
7 | * as published by the Free Software Foundation.
8 | *
9 | * This program is distributed in the hope that it will be useful,
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 | * GNU General Public License for more details.
13 | *
14 | * You should have received a copy of the GNU General Public License
15 | * along with this program; if not, see .
16 | */
17 |
18 | package com.unboundid.scim2.common.annotations;
19 |
20 | import java.lang.annotation.ElementType;
21 | import java.lang.annotation.Retention;
22 | import java.lang.annotation.RetentionPolicy;
23 | import java.lang.annotation.Target;
24 |
25 | /**
26 | * Class level annotation indicating the schema of a SCIM object.
27 | */
28 | @Target(value = ElementType.TYPE)
29 | @Retention(value = RetentionPolicy.RUNTIME)
30 | public @interface Schema
31 | {
32 | /**
33 | * The id for the object. This is the complete URN.
34 | *
35 | * @return The object's id as a URN.
36 | */
37 | @NotNull String id() default "urn:pingidentity:scim:api:messages:2.0";
38 |
39 | /**
40 | * The description for the object.
41 | *
42 | * @return The object's description.
43 | */
44 | @NotNull String description();
45 |
46 | /**
47 | * The human-readable name for the object.
48 | *
49 | * @return The object's human-readable name.
50 | */
51 | @NotNull String name();
52 | }
53 |
--------------------------------------------------------------------------------
/scim2-sdk-common/src/main/java/com/unboundid/scim2/common/annotations/package-info.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2015-2025 Ping Identity Corporation
3 | *
4 | * This program is free software; you can redistribute it and/or modify
5 | * it under the terms of the GNU General Public License (GPLv2 only)
6 | * or the terms of the GNU Lesser General Public License (LGPLv2.1 only)
7 | * as published by the Free Software Foundation.
8 | *
9 | * This program is distributed in the hope that it will be useful,
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 | * GNU General Public License for more details.
13 | *
14 | * You should have received a copy of the GNU General Public License
15 | * along with this program; if not, see .
16 | */
17 |
18 | /**
19 | * Annotation classes to use when describing SCIM 2 resource types and
20 | * attributes.
21 | */
22 |
23 | package com.unboundid.scim2.common.annotations;
24 |
--------------------------------------------------------------------------------
/scim2-sdk-common/src/main/java/com/unboundid/scim2/common/exceptions/MethodNotAllowedException.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2015-2025 Ping Identity Corporation
3 | *
4 | * This program is free software; you can redistribute it and/or modify
5 | * it under the terms of the GNU General Public License (GPLv2 only)
6 | * or the terms of the GNU Lesser General Public License (LGPLv2.1 only)
7 | * as published by the Free Software Foundation.
8 | *
9 | * This program is distributed in the hope that it will be useful,
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 | * GNU General Public License for more details.
13 | *
14 | * You should have received a copy of the GNU General Public License
15 | * along with this program; if not, see .
16 | */
17 |
18 | package com.unboundid.scim2.common.exceptions;
19 |
20 | import com.unboundid.scim2.common.annotations.NotNull;
21 | import com.unboundid.scim2.common.annotations.Nullable;
22 | import com.unboundid.scim2.common.messages.ErrorResponse;
23 |
24 | /**
25 | * This class represents a SCIM exception pertaining to the
26 | * {@code HTTP 405 METHOD NOT ALLOWED} error response code. This exception type
27 | * should be thrown when a client sends a request to a valid endpoint, but
28 | * provides an unsupported REST method (e.g., {@code GET}, {@code POST}).
29 | *
30 | * The following is an example of a MethodNotAllowedException as seen by a SCIM
31 | * client.
32 | *
39 | *
40 | * The MethodNotAllowedException in the above example can be created with the
41 | * following Java code:
42 | *
43 | * throw new MethodNotAllowedException(
44 | * "The /.search endpoint only supports POST requests.");
45 | *
46 | *
47 | * This exception type generally does not have a {@code scimType} value.
48 | */
49 | public class MethodNotAllowedException extends ScimException
50 | {
51 | private static final int METHOD_NOT_ALLOWED_CODE = 405;
52 |
53 |
54 | /**
55 | * Create a new {@code MethodNotAllowedException} from the provided
56 | * information.
57 | *
58 | * @param errorMessage The error message for this SCIM exception.
59 | */
60 | public MethodNotAllowedException(@Nullable final String errorMessage)
61 | {
62 | super(METHOD_NOT_ALLOWED_CODE, errorMessage);
63 | }
64 |
65 |
66 | /**
67 | * Create a new {@code MethodNotAllowedException} from the provided
68 | * information.
69 | *
70 | * @param scimError The SCIM error response.
71 | * @param cause The cause (which is saved for later retrieval by the
72 | * {@link #getCause()} method). A {@code null} value
73 | * is permitted, and indicates that the cause is
74 | * nonexistent or unknown.
75 | */
76 | public MethodNotAllowedException(@NotNull final ErrorResponse scimError,
77 | @Nullable final Throwable cause)
78 | {
79 | super(scimError, cause);
80 | }
81 | }
82 |
--------------------------------------------------------------------------------
/scim2-sdk-common/src/main/java/com/unboundid/scim2/common/exceptions/ServerErrorException.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2015-2025 Ping Identity Corporation
3 | *
4 | * This program is free software; you can redistribute it and/or modify
5 | * it under the terms of the GNU General Public License (GPLv2 only)
6 | * or the terms of the GNU Lesser General Public License (LGPLv2.1 only)
7 | * as published by the Free Software Foundation.
8 | *
9 | * This program is distributed in the hope that it will be useful,
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 | * GNU General Public License for more details.
13 | *
14 | * You should have received a copy of the GNU General Public License
15 | * along with this program; if not, see .
16 | */
17 |
18 | package com.unboundid.scim2.common.exceptions;
19 |
20 | import com.unboundid.scim2.common.annotations.NotNull;
21 | import com.unboundid.scim2.common.annotations.Nullable;
22 | import com.unboundid.scim2.common.messages.ErrorResponse;
23 |
24 | /**
25 | * This class represents a SCIM exception pertaining to the
26 | * {@code HTTP 500 INTERNAL SERVER ERROR} error response code. This exception
27 | * type should be thrown when a SCIM service provider encounters an unexpected
28 | * error.
29 | *
30 | * The following is an example of a ServerErrorException seen by a SCIM client.
31 | *
44 | *
45 | * This exception type generally does not have a {@code scimType} value.
46 | */
47 | public class ServerErrorException extends ScimException
48 | {
49 | /**
50 | * Create a new {@code ServerErrorException} from the provided information.
51 | *
52 | * @param errorMessage The error message for this SCIM exception.
53 | */
54 | public ServerErrorException(@Nullable final String errorMessage)
55 | {
56 | super(500, null, errorMessage);
57 | }
58 |
59 | /**
60 | * Create a new {@code ServerErrorException} from the provided information.
61 | *
62 | * @param errorMessage The error message for this SCIM exception.
63 | * @param scimType The SCIM detailed error keyword.
64 | * @param cause The cause (which is saved for later retrieval by the
65 | * {@link #getCause()} method). A {@code null} value
66 | * is permitted, and indicates that the cause is
67 | * nonexistent or unknown.
68 | */
69 | public ServerErrorException(@Nullable final String errorMessage,
70 | @Nullable final String scimType,
71 | @Nullable final Throwable cause)
72 | {
73 | super(500, scimType, errorMessage, cause);
74 | }
75 |
76 | /**
77 | * Create a new {@code ServerErrorException} from the provided information.
78 | *
79 | * @param scimError The SCIM error response.
80 | * @param cause The cause (which is saved for later retrieval by the
81 | * {@link #getCause()} method). A {@code null} value
82 | * is permitted, and indicates that the cause is
83 | * nonexistent or unknown.
84 | */
85 | public ServerErrorException(@NotNull final ErrorResponse scimError,
86 | @Nullable final Throwable cause)
87 | {
88 | super(scimError, cause);
89 | }
90 | }
91 |
--------------------------------------------------------------------------------
/scim2-sdk-common/src/main/java/com/unboundid/scim2/common/exceptions/package-info.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2015-2025 Ping Identity Corporation
3 | *
4 | * This program is free software; you can redistribute it and/or modify
5 | * it under the terms of the GNU General Public License (GPLv2 only)
6 | * or the terms of the GNU Lesser General Public License (LGPLv2.1 only)
7 | * as published by the Free Software Foundation.
8 | *
9 | * This program is distributed in the hope that it will be useful,
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 | * GNU General Public License for more details.
13 | *
14 | * You should have received a copy of the GNU General Public License
15 | * along with this program; if not, see .
16 | */
17 |
18 | /**
19 | * Exception classes representing SCIM 2 service provider responses.
20 | */
21 |
22 | package com.unboundid.scim2.common.exceptions;
23 |
--------------------------------------------------------------------------------
/scim2-sdk-common/src/main/java/com/unboundid/scim2/common/filters/CombiningFilter.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2015-2025 Ping Identity Corporation
3 | *
4 | * This program is free software; you can redistribute it and/or modify
5 | * it under the terms of the GNU General Public License (GPLv2 only)
6 | * or the terms of the GNU Lesser General Public License (LGPLv2.1 only)
7 | * as published by the Free Software Foundation.
8 | *
9 | * This program is distributed in the hope that it will be useful,
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 | * GNU General Public License for more details.
13 | *
14 | * You should have received a copy of the GNU General Public License
15 | * along with this program; if not, see .
16 | */
17 |
18 | package com.unboundid.scim2.common.filters;
19 |
20 | import com.unboundid.scim2.common.annotations.NotNull;
21 |
22 | import java.util.Collections;
23 | import java.util.List;
24 |
25 | /**
26 | * This class is the superclass of filter types that contains two filters. There
27 | * are two types of combining filters:
28 | *
29 | *
{@link AndFilter}
30 | *
{@link OrFilter}
31 | *
32 | *
33 | *
34 | * "Combining" filters contain subordinate filters, which are also referred to
35 | * as "filter components". To obtain the filter components that comprise a
36 | * combining filter, use the {@link #getCombinedFilters()} method.
37 | *
38 | *
39 | * For more information, see the class-level documentation of the subclasses of
40 | * CombiningFilter.
41 | */
42 | public abstract class CombiningFilter extends Filter
43 | {
44 | @NotNull
45 | private final List filterComponents;
46 |
47 | /**
48 | * Create a new logical combining filter.
49 | *
50 | * @param filterComponents The filter components to combine.
51 | */
52 | CombiningFilter(@NotNull final List filterComponents)
53 | {
54 | this.filterComponents = Collections.unmodifiableList(filterComponents);
55 | }
56 |
57 | /**
58 | * {@inheritDoc}
59 | */
60 | @Override
61 | public boolean isCombiningFilter()
62 | {
63 | return true;
64 | }
65 |
66 | /**
67 | * {@inheritDoc}
68 | */
69 | @Override
70 | @NotNull
71 | public List getCombinedFilters()
72 | {
73 | return filterComponents;
74 | }
75 |
76 | /**
77 | * Append the string representation of the filter to the provided buffer.
78 | *
79 | * @param builder The buffer to which the string representation of the
80 | * filter is to be appended.
81 | */
82 | public void toString(@NotNull final StringBuilder builder)
83 | {
84 | builder.append('(');
85 |
86 | for (int i = 0; i < filterComponents.size(); i++)
87 | {
88 | if (i != 0)
89 | {
90 | builder.append(' ');
91 | builder.append(getFilterType().getStringValue());
92 | builder.append(' ');
93 | }
94 |
95 | builder.append(filterComponents.get(i));
96 | }
97 |
98 | builder.append(')');
99 | }
100 | }
101 |
--------------------------------------------------------------------------------
/scim2-sdk-common/src/main/java/com/unboundid/scim2/common/filters/ComparisonFilter.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2015-2025 Ping Identity Corporation
3 | *
4 | * This program is free software; you can redistribute it and/or modify
5 | * it under the terms of the GNU General Public License (GPLv2 only)
6 | * or the terms of the GNU Lesser General Public License (LGPLv2.1 only)
7 | * as published by the Free Software Foundation.
8 | *
9 | * This program is distributed in the hope that it will be useful,
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 | * GNU General Public License for more details.
13 | *
14 | * You should have received a copy of the GNU General Public License
15 | * along with this program; if not, see .
16 | */
17 |
18 | package com.unboundid.scim2.common.filters;
19 |
20 | import com.fasterxml.jackson.databind.node.ValueNode;
21 | import com.unboundid.scim2.common.Path;
22 | import com.unboundid.scim2.common.annotations.NotNull;
23 | import com.unboundid.scim2.common.annotations.Nullable;
24 | import com.unboundid.scim2.common.utils.JsonUtils;
25 |
26 | /**
27 | * This superclass represents filter types that are used to compare attribute
28 | * values of SCIM resources.
29 | *
30 | *
31 | * For example, an {@link EqualFilter} is a comparison filter. A filter such as
32 | * {@code preferredLanguage eq "en-US"} is used to perform a comparison between
33 | * the filter value, {@code "en-US"}, and the value of a SCIM resource's
34 | * {@code preferredLanguage} attribute.
35 | *
36 | *
37 | * To determine whether a filter is a comparison filter, use the
38 | * {@link Filter#isComparisonFilter()} method.
39 | */
40 | public abstract class ComparisonFilter extends Filter
41 | {
42 | @NotNull
43 | private final Path filterAttribute;
44 |
45 | @NotNull
46 | private final ValueNode filterValue;
47 |
48 | /**
49 | * Create a new attribute comparison filter.
50 | *
51 | * @param filterAttribute The path to the attribute to compare.
52 | * @param filterValue The comparison value.
53 | */
54 | ComparisonFilter(@NotNull final Path filterAttribute,
55 | @Nullable final ValueNode filterValue)
56 | {
57 | this.filterAttribute = filterAttribute;
58 | if (filterValue == null)
59 | {
60 | this.filterValue = JsonUtils.getJsonNodeFactory().nullNode();
61 | }
62 | else
63 | {
64 | this.filterValue = filterValue;
65 | }
66 | }
67 |
68 | /**
69 | * {@inheritDoc}
70 | */
71 | @Override
72 | @Nullable
73 | public Path getAttributePath()
74 | {
75 | return filterAttribute;
76 | }
77 |
78 | /**
79 | * {@inheritDoc}
80 | */
81 | @Override
82 | @Nullable
83 | public ValueNode getComparisonValue()
84 | {
85 | return filterValue;
86 | }
87 |
88 | /**
89 | * {@inheritDoc}
90 | */
91 | @Override
92 | public boolean isComparisonFilter()
93 | {
94 | return true;
95 | }
96 |
97 | /**
98 | * Append the string representation of the filter to the provided buffer.
99 | *
100 | * @param builder The buffer to which the string representation of the
101 | * filter is to be appended.
102 | */
103 | public void toString(@NotNull final StringBuilder builder)
104 | {
105 | builder.append(filterAttribute);
106 | builder.append(' ');
107 | builder.append(getFilterType().getStringValue());
108 | builder.append(' ');
109 | builder.append(filterValue.toString());
110 | }
111 | }
112 |
--------------------------------------------------------------------------------
/scim2-sdk-common/src/main/java/com/unboundid/scim2/common/filters/FilterType.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2015-2025 Ping Identity Corporation
3 | *
4 | * This program is free software; you can redistribute it and/or modify
5 | * it under the terms of the GNU General Public License (GPLv2 only)
6 | * or the terms of the GNU Lesser General Public License (LGPLv2.1 only)
7 | * as published by the Free Software Foundation.
8 | *
9 | * This program is distributed in the hope that it will be useful,
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 | * GNU General Public License for more details.
13 | *
14 | * You should have received a copy of the GNU General Public License
15 | * along with this program; if not, see .
16 | */
17 |
18 | package com.unboundid.scim2.common.filters;
19 |
20 |
21 | import com.unboundid.scim2.common.annotations.NotNull;
22 |
23 | /**
24 | * This enumeration defines the set of possible filter types that may
25 | * be used for SCIM query filters.
26 | */
27 | public enum FilterType
28 | {
29 | /**
30 | * The filter type for {@code and} filters.
31 | */
32 | AND("and"),
33 |
34 |
35 | /**
36 | * The filter type for {@code or} filters.
37 | */
38 | OR("or"),
39 |
40 |
41 | /**
42 | * The filter type for {@code not} filters.
43 | */
44 | NOT("not"),
45 |
46 |
47 | /**
48 | * The filter type for complex attribute value filters.
49 | */
50 | COMPLEX_VALUE("complex"),
51 |
52 |
53 | /**
54 | * The filter type for {@code equal} filters.
55 | */
56 | EQUAL("eq"),
57 |
58 |
59 | /**
60 | * The filter type for {@code not equal} filters.
61 | */
62 | NOT_EQUAL("ne"),
63 |
64 |
65 | /**
66 | * The filter type for {@code contains} filters.
67 | */
68 | CONTAINS("co"),
69 |
70 |
71 | /**
72 | * The filter type for {@code starts with} filters.
73 | */
74 | STARTS_WITH("sw"),
75 |
76 |
77 | /**
78 | * The filter type for {@code starts ends} filters.
79 | */
80 | ENDS_WITH("ew"),
81 |
82 |
83 | /**
84 | * The filter type for {@code present} filters.
85 | */
86 | PRESENT("pr"),
87 |
88 |
89 | /**
90 | * The filter type for {@code greater than} filters.
91 | */
92 | GREATER_THAN("gt"),
93 |
94 |
95 | /**
96 | * The filter type for {@code greater or equal} filters.
97 | */
98 | GREATER_OR_EQUAL("ge"),
99 |
100 |
101 | /**
102 | * The filter type for {@code less than} filters.
103 | */
104 | LESS_THAN("lt"),
105 |
106 |
107 | /**
108 | * The filter type for {@code less or equal} filters.
109 | */
110 | LESS_OR_EQUAL("le");
111 |
112 |
113 | /**
114 | * The lower case string value for this filter type.
115 | */
116 | @NotNull
117 | private String stringValue;
118 |
119 |
120 | /**
121 | * Creates a new filter type with the provided string value.
122 | *
123 | * @param stringValue The lower case string value for this filter type.
124 | */
125 | FilterType(@NotNull final String stringValue)
126 | {
127 | this.stringValue = stringValue;
128 | }
129 |
130 |
131 | /**
132 | * Retrieves the lower case string value for this filter type.
133 | *
134 | * @return The lower case string value for this filter type.
135 | */
136 | @NotNull
137 | public String getStringValue()
138 | {
139 | return stringValue;
140 | }
141 |
142 |
143 | /**
144 | * Retrieves a string representation of this filter type.
145 | *
146 | * @return A string representation of this filter type.
147 | */
148 | @NotNull
149 | public String toString()
150 | {
151 | return getStringValue();
152 | }
153 | }
154 |
155 |
--------------------------------------------------------------------------------
/scim2-sdk-common/src/main/java/com/unboundid/scim2/common/filters/package-info.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2015-2025 Ping Identity Corporation
3 | *
4 | * This program is free software; you can redistribute it and/or modify
5 | * it under the terms of the GNU General Public License (GPLv2 only)
6 | * or the terms of the GNU Lesser General Public License (LGPLv2.1 only)
7 | * as published by the Free Software Foundation.
8 | *
9 | * This program is distributed in the hope that it will be useful,
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 | * GNU General Public License for more details.
13 | *
14 | * You should have received a copy of the GNU General Public License
15 | * along with this program; if not, see .
16 | */
17 |
18 | /**
19 | * Classes used to build SCIM 2 query filters.
20 | */
21 |
22 | package com.unboundid.scim2.common.filters;
23 |
--------------------------------------------------------------------------------
/scim2-sdk-common/src/main/java/com/unboundid/scim2/common/messages/PatchOpType.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2015-2025 Ping Identity Corporation
3 | *
4 | * This program is free software; you can redistribute it and/or modify
5 | * it under the terms of the GNU General Public License (GPLv2 only)
6 | * or the terms of the GNU Lesser General Public License (LGPLv2.1 only)
7 | * as published by the Free Software Foundation.
8 | *
9 | * This program is distributed in the hope that it will be useful,
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 | * GNU General Public License for more details.
13 | *
14 | * You should have received a copy of the GNU General Public License
15 | * along with this program; if not, see .
16 | */
17 |
18 | package com.unboundid.scim2.common.messages;
19 |
20 |
21 | import com.unboundid.scim2.common.annotations.NotNull;
22 |
23 | /**
24 | * This enumeration defines the set of possible operation types that may
25 | * be used for SCIM 2 patch operations.
26 | */
27 | public enum PatchOpType
28 | {
29 | /**
30 | * The add operation type.
31 | */
32 | ADD("add"),
33 |
34 |
35 | /**
36 | * The replace operation type.
37 | */
38 | REPLACE("replace"),
39 |
40 |
41 | /**
42 | * The remove operation type.
43 | */
44 | REMOVE("remove");
45 |
46 |
47 | /**
48 | * The lower case string value for this operation type.
49 | */
50 | @NotNull
51 | private String stringValue;
52 |
53 |
54 | /**
55 | * Creates a new operation type with the provided string value.
56 | *
57 | * @param stringValue The lower case string value for this operation type.
58 | */
59 | PatchOpType(@NotNull final String stringValue)
60 | {
61 | this.stringValue = stringValue;
62 | }
63 |
64 |
65 | /**
66 | * Retrieves the lower case string value for this operation type.
67 | *
68 | * @return The lower case string value for this operation type.
69 | */
70 | @NotNull
71 | public String getStringValue()
72 | {
73 | return stringValue;
74 | }
75 |
76 |
77 | /**
78 | * Retrieves a string representation of this operation type.
79 | *
80 | * @return A string representation of this operation type.
81 | */
82 | @NotNull
83 | public String toString()
84 | {
85 | return getStringValue();
86 | }
87 | }
88 |
89 |
--------------------------------------------------------------------------------
/scim2-sdk-common/src/main/java/com/unboundid/scim2/common/messages/SortOrder.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2015-2025 Ping Identity Corporation
3 | *
4 | * This program is free software; you can redistribute it and/or modify
5 | * it under the terms of the GNU General Public License (GPLv2 only)
6 | * or the terms of the GNU Lesser General Public License (LGPLv2.1 only)
7 | * as published by the Free Software Foundation.
8 | *
9 | * This program is distributed in the hope that it will be useful,
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 | * GNU General Public License for more details.
13 | *
14 | * You should have received a copy of the GNU General Public License
15 | * along with this program; if not, see .
16 | */
17 |
18 | package com.unboundid.scim2.common.messages;
19 |
20 | import com.fasterxml.jackson.annotation.JsonCreator;
21 | import com.fasterxml.jackson.annotation.JsonValue;
22 | import com.unboundid.scim2.common.annotations.NotNull;
23 | import com.unboundid.scim2.common.exceptions.BadRequestException;
24 |
25 | /**
26 | * The order in which the sortBy parameter is applied.
27 | */
28 | public enum SortOrder
29 | {
30 | /**
31 | * The ascending sort order.
32 | */
33 | ASCENDING("ascending"),
34 |
35 |
36 | /**
37 | * The descending sort order.
38 | */
39 | DESCENDING("descending");
40 |
41 |
42 | /**
43 | * The lower case string value for this sort order.
44 | */
45 | @NotNull
46 | private String name;
47 |
48 |
49 | /**
50 | * SortOrder enum private constructor.
51 | *
52 | * @param name the name of the sort order.
53 | */
54 | SortOrder(@NotNull final String name)
55 | {
56 | this.name = name;
57 | }
58 |
59 | /**
60 | * Gets the name of the sort order.
61 | *
62 | * @return the name of the sort order.
63 | */
64 | @NotNull
65 | @JsonValue
66 | public String getName()
67 | {
68 | return name;
69 | }
70 |
71 | /**
72 | * Finds the sort order by name.
73 | *
74 | * @param name the name of the mutability constraint.
75 | * @return the enum value for the given name.
76 | * @throws BadRequestException if the name of the sort order is invalid.
77 | */
78 | @NotNull
79 | @JsonCreator
80 | public static SortOrder fromName(@NotNull final String name)
81 | throws BadRequestException
82 | {
83 | for (SortOrder sortOrder : SortOrder.values())
84 | {
85 | if (sortOrder.getName().equals(name))
86 | {
87 | return sortOrder;
88 | }
89 | }
90 |
91 | throw BadRequestException.invalidSyntax(
92 | "Unknown sort order value " + name);
93 | }
94 | }
95 |
--------------------------------------------------------------------------------
/scim2-sdk-common/src/main/java/com/unboundid/scim2/common/messages/package-info.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2015-2025 Ping Identity Corporation
3 | *
4 | * This program is free software; you can redistribute it and/or modify
5 | * it under the terms of the GNU General Public License (GPLv2 only)
6 | * or the terms of the GNU Lesser General Public License (LGPLv2.1 only)
7 | * as published by the Free Software Foundation.
8 | *
9 | * This program is distributed in the hope that it will be useful,
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 | * GNU General Public License for more details.
13 | *
14 | * You should have received a copy of the GNU General Public License
15 | * along with this program; if not, see .
16 | */
17 |
18 | /**
19 | * Classes representing core SCIM 2 messages, such as error responses, query
20 | * responses, and PATCH requests.
21 | */
22 |
23 | package com.unboundid.scim2.common.messages;
24 |
--------------------------------------------------------------------------------
/scim2-sdk-common/src/main/java/com/unboundid/scim2/common/package-info.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2015-2025 Ping Identity Corporation
3 | *
4 | * This program is free software; you can redistribute it and/or modify
5 | * it under the terms of the GNU General Public License (GPLv2 only)
6 | * or the terms of the GNU Lesser General Public License (LGPLv2.1 only)
7 | * as published by the Free Software Foundation.
8 | *
9 | * This program is distributed in the hope that it will be useful,
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 | * GNU General Public License for more details.
13 | *
14 | * You should have received a copy of the GNU General Public License
15 | * along with this program; if not, see .
16 | */
17 |
18 | /**
19 | * Common SCIM 2 classes, including base classes for representing SCIM 2
20 | * resources.
21 | */
22 |
23 | package com.unboundid.scim2.common;
24 |
--------------------------------------------------------------------------------
/scim2-sdk-common/src/main/java/com/unboundid/scim2/common/types/ChangePasswordConfig.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2015-2025 Ping Identity Corporation
3 | *
4 | * This program is free software; you can redistribute it and/or modify
5 | * it under the terms of the GNU General Public License (GPLv2 only)
6 | * or the terms of the GNU Lesser General Public License (LGPLv2.1 only)
7 | * as published by the Free Software Foundation.
8 | *
9 | * This program is distributed in the hope that it will be useful,
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 | * GNU General Public License for more details.
13 | *
14 | * You should have received a copy of the GNU General Public License
15 | * along with this program; if not, see .
16 | */
17 |
18 | package com.unboundid.scim2.common.types;
19 |
20 | import com.fasterxml.jackson.annotation.JsonCreator;
21 | import com.fasterxml.jackson.annotation.JsonProperty;
22 | import com.unboundid.scim2.common.annotations.Attribute;
23 | import com.unboundid.scim2.common.annotations.Nullable;
24 |
25 | /**
26 | * A complex type that specifies Change Password configuration options.
27 | */
28 | public class ChangePasswordConfig
29 | {
30 | @Attribute(description = "Boolean value specifying whether the " +
31 | "operation is supported.",
32 | mutability = AttributeDefinition.Mutability.READ_ONLY,
33 | isRequired = true)
34 | private final boolean supported;
35 |
36 | /**
37 | * Create a new complex type that specifies Change Password configuration
38 | * options.
39 | *
40 | * @param supported Boolean value specifying whether the operation is
41 | * supported.
42 | */
43 | @JsonCreator
44 | public ChangePasswordConfig(
45 | @JsonProperty(value = "supported", required = true)
46 | final boolean supported)
47 | {
48 | this.supported = supported;
49 | }
50 |
51 | /**
52 | * Retrieves the boolean value specifying whether the operation is
53 | * supported.
54 | *
55 | * @return {@code true} if the operation is supported or {@code false}
56 | * otherwise.
57 | */
58 | public boolean isSupported()
59 | {
60 | return supported;
61 | }
62 |
63 | /**
64 | * Indicates whether the provided object is equal to this Change Password
65 | * configuration.
66 | *
67 | * @param o The object to compare.
68 | * @return {@code true} if the provided object is equal to this Change
69 | * Password configuration, or {@code false} if not.
70 | */
71 | @Override
72 | public boolean equals(@Nullable final Object o)
73 | {
74 | if (this == o)
75 | {
76 | return true;
77 | }
78 | if (o == null || getClass() != o.getClass())
79 | {
80 | return false;
81 | }
82 |
83 | ChangePasswordConfig that = (ChangePasswordConfig) o;
84 | return supported == that.supported;
85 | }
86 |
87 | /**
88 | * Retrieves a hash code for this Change Password configuration.
89 | *
90 | * @return A hash code for this Change Password configuration.
91 | */
92 | @Override
93 | public int hashCode()
94 | {
95 | return (supported ? 1 : 0);
96 | }
97 | }
98 |
--------------------------------------------------------------------------------
/scim2-sdk-common/src/main/java/com/unboundid/scim2/common/types/PatchConfig.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2015-2025 Ping Identity Corporation
3 | *
4 | * This program is free software; you can redistribute it and/or modify
5 | * it under the terms of the GNU General Public License (GPLv2 only)
6 | * or the terms of the GNU Lesser General Public License (LGPLv2.1 only)
7 | * as published by the Free Software Foundation.
8 | *
9 | * This program is distributed in the hope that it will be useful,
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 | * GNU General Public License for more details.
13 | *
14 | * You should have received a copy of the GNU General Public License
15 | * along with this program; if not, see .
16 | */
17 |
18 | package com.unboundid.scim2.common.types;
19 |
20 | import com.fasterxml.jackson.annotation.JsonCreator;
21 | import com.fasterxml.jackson.annotation.JsonProperty;
22 | import com.unboundid.scim2.common.annotations.Attribute;
23 | import com.unboundid.scim2.common.annotations.Nullable;
24 |
25 | /**
26 | * A complex type that specifies PATCH configuration options.
27 | */
28 | public class PatchConfig
29 | {
30 | @Attribute(description = "Boolean value specifying whether the " +
31 | "operation is supported.",
32 | mutability = AttributeDefinition.Mutability.READ_ONLY,
33 | isRequired = true)
34 | private final boolean supported;
35 |
36 | /**
37 | * Create a new complex type that specifies PATCH configuration options.
38 | *
39 | * @param supported Boolean value specifying whether the operation is
40 | * supported.
41 | */
42 | @JsonCreator
43 | public PatchConfig(@JsonProperty(value = "supported", required = true)
44 | final boolean supported)
45 | {
46 | this.supported = supported;
47 | }
48 |
49 | /**
50 | * Retrieves the boolean value specifying whether the operation is
51 | * supported.
52 | *
53 | * @return {@code true} if the operation is supported or {@code false}
54 | * otherwise.
55 | */
56 | public boolean isSupported()
57 | {
58 | return supported;
59 | }
60 |
61 | /**
62 | * Indicates whether the provided object is equal to this PATCH configuration.
63 | *
64 | * @param o The object to compare.
65 | * @return {@code true} if the provided object is equal to this PATCH
66 | * configuration, or {@code false} if not.
67 | */
68 | @Override
69 | public boolean equals(@Nullable final Object o)
70 | {
71 | if (this == o)
72 | {
73 | return true;
74 | }
75 | if (o == null || getClass() != o.getClass())
76 | {
77 | return false;
78 | }
79 |
80 | PatchConfig that = (PatchConfig) o;
81 | return supported == that.supported;
82 | }
83 |
84 | /**
85 | * Retrieves a hash code for this PATCH configuration.
86 | *
87 | * @return A hash code for this PATCH configuration.
88 | */
89 | @Override
90 | public int hashCode()
91 | {
92 | return (supported ? 1 : 0);
93 | }
94 | }
95 |
--------------------------------------------------------------------------------
/scim2-sdk-common/src/main/java/com/unboundid/scim2/common/types/SortConfig.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2015-2025 Ping Identity Corporation
3 | *
4 | * This program is free software; you can redistribute it and/or modify
5 | * it under the terms of the GNU General Public License (GPLv2 only)
6 | * or the terms of the GNU Lesser General Public License (LGPLv2.1 only)
7 | * as published by the Free Software Foundation.
8 | *
9 | * This program is distributed in the hope that it will be useful,
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 | * GNU General Public License for more details.
13 | *
14 | * You should have received a copy of the GNU General Public License
15 | * along with this program; if not, see .
16 | */
17 |
18 | package com.unboundid.scim2.common.types;
19 |
20 | import com.fasterxml.jackson.annotation.JsonCreator;
21 | import com.fasterxml.jackson.annotation.JsonProperty;
22 | import com.unboundid.scim2.common.annotations.Attribute;
23 | import com.unboundid.scim2.common.annotations.Nullable;
24 |
25 | /**
26 | * A complex type that specifies Sort configuration options.
27 | */
28 | public class SortConfig
29 | {
30 | @Attribute(description = "Boolean value specifying whether the " +
31 | "operation is supported.",
32 | mutability = AttributeDefinition.Mutability.READ_ONLY,
33 | isRequired = true)
34 | private final boolean supported;
35 |
36 | /**
37 | * Create a new complex type that specifies Sort configuration options.
38 | *
39 | * @param supported Boolean value specifying whether the operation is
40 | * supported
41 | */
42 | @JsonCreator
43 | public SortConfig(@JsonProperty(value = "supported", required = true)
44 | final boolean supported)
45 | {
46 | this.supported = supported;
47 | }
48 |
49 | /**
50 | * Retrieves the boolean value specifying whether the operation is
51 | * supported.
52 | *
53 | * @return {@code true} if the operation is supported or {@code false}
54 | * otherwise.
55 | */
56 | public boolean isSupported()
57 | {
58 | return supported;
59 | }
60 |
61 | /**
62 | * Indicates whether the provided object is equal to this sort configuration.
63 | *
64 | * @param o The object to compare.
65 | * @return {@code true} if the provided object is equal to this sort
66 | * configuration, or {@code false} if not.
67 | */
68 | @Override
69 | public boolean equals(@Nullable final Object o)
70 | {
71 | if (this == o)
72 | {
73 | return true;
74 | }
75 | if (o == null || getClass() != o.getClass())
76 | {
77 | return false;
78 | }
79 |
80 | SortConfig that = (SortConfig) o;
81 | return supported == that.supported;
82 | }
83 |
84 | /**
85 | * Retrieves a hash code for this sort configuration.
86 | *
87 | * @return A hash code for this sort configuration.
88 | */
89 | @Override
90 | public int hashCode()
91 | {
92 | return (supported ? 1 : 0);
93 | }
94 | }
95 |
--------------------------------------------------------------------------------
/scim2-sdk-common/src/main/java/com/unboundid/scim2/common/types/package-info.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2015-2025 Ping Identity Corporation
3 | *
4 | * This program is free software; you can redistribute it and/or modify
5 | * it under the terms of the GNU General Public License (GPLv2 only)
6 | * or the terms of the GNU Lesser General Public License (LGPLv2.1 only)
7 | * as published by the Free Software Foundation.
8 | *
9 | * This program is distributed in the hope that it will be useful,
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 | * GNU General Public License for more details.
13 | *
14 | * You should have received a copy of the GNU General Public License
15 | * along with this program; if not, see .
16 | */
17 |
18 | /**
19 | * Classes representing core SCIM 2 types.
20 | */
21 |
22 | package com.unboundid.scim2.common.types;
23 |
--------------------------------------------------------------------------------
/scim2-sdk-common/src/main/java/com/unboundid/scim2/common/utils/CalendarDeserializer.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2019-2025 Ping Identity Corporation
3 | *
4 | * This program is free software; you can redistribute it and/or modify
5 | * it under the terms of the GNU General Public License (GPLv2 only)
6 | * or the terms of the GNU Lesser General Public License (LGPLv2.1 only)
7 | * as published by the Free Software Foundation.
8 | *
9 | * This program is distributed in the hope that it will be useful,
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 | * GNU General Public License for more details.
13 | *
14 | * You should have received a copy of the GNU General Public License
15 | * along with this program; if not, see .
16 | */
17 | package com.unboundid.scim2.common.utils;
18 |
19 | import com.fasterxml.jackson.core.JsonParser;
20 | import com.fasterxml.jackson.core.JsonProcessingException;
21 | import com.fasterxml.jackson.databind.DeserializationContext;
22 | import com.fasterxml.jackson.databind.JsonDeserializer;
23 | import com.fasterxml.jackson.databind.exc.InvalidFormatException;
24 | import com.unboundid.scim2.common.annotations.NotNull;
25 | import com.unboundid.scim2.common.annotations.Nullable;
26 |
27 | import java.io.IOException;
28 | import java.util.Calendar;
29 |
30 | /**
31 | * Deserializes SCIM 2 DateTime values to {@link Calendar} objects.
32 | */
33 | public class CalendarDeserializer extends JsonDeserializer
34 | {
35 | /**
36 | * {@inheritDoc}
37 | */
38 | @Override
39 | @NotNull
40 | public Calendar deserialize(@NotNull final JsonParser jp,
41 | @Nullable final DeserializationContext ctxt)
42 | throws IOException, JsonProcessingException
43 | {
44 | String dateStr = jp.getText();
45 | try
46 | {
47 | return DateTimeUtils.parse(dateStr);
48 | }
49 | catch (IllegalArgumentException e)
50 | {
51 | throw new InvalidFormatException(jp, "unable to deserialize value",
52 | dateStr, Calendar.class);
53 | }
54 | }
55 | }
56 |
--------------------------------------------------------------------------------
/scim2-sdk-common/src/main/java/com/unboundid/scim2/common/utils/CalendarSerializer.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2019-2025 Ping Identity Corporation
3 | *
4 | * This program is free software; you can redistribute it and/or modify
5 | * it under the terms of the GNU General Public License (GPLv2 only)
6 | * or the terms of the GNU Lesser General Public License (LGPLv2.1 only)
7 | * as published by the Free Software Foundation.
8 | *
9 | * This program is distributed in the hope that it will be useful,
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 | * GNU General Public License for more details.
13 | *
14 | * You should have received a copy of the GNU General Public License
15 | * along with this program; if not, see .
16 | */
17 | package com.unboundid.scim2.common.utils;
18 |
19 | import com.fasterxml.jackson.core.JsonGenerator;
20 | import com.fasterxml.jackson.databind.JsonSerializer;
21 | import com.fasterxml.jackson.databind.SerializerProvider;
22 | import com.unboundid.scim2.common.annotations.NotNull;
23 | import com.unboundid.scim2.common.annotations.Nullable;
24 |
25 | import java.io.IOException;
26 | import java.util.Calendar;
27 |
28 | /**
29 | * Serializes a {@link Calendar} object to a SCIM 2 DateTime string.
30 | */
31 | public class CalendarSerializer extends JsonSerializer
32 | {
33 | /**
34 | * {@inheritDoc}
35 | */
36 | @Override
37 | public void serialize(@NotNull final Calendar value,
38 | @NotNull final JsonGenerator jgen,
39 | @Nullable final SerializerProvider serializers)
40 | throws IOException
41 | {
42 | jgen.writeString(DateTimeUtils.format(value));
43 | }
44 | }
45 |
--------------------------------------------------------------------------------
/scim2-sdk-common/src/main/java/com/unboundid/scim2/common/utils/DateDeserializer.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2019-2025 Ping Identity Corporation
3 | *
4 | * This program is free software; you can redistribute it and/or modify
5 | * it under the terms of the GNU General Public License (GPLv2 only)
6 | * or the terms of the GNU Lesser General Public License (LGPLv2.1 only)
7 | * as published by the Free Software Foundation.
8 | *
9 | * This program is distributed in the hope that it will be useful,
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 | * GNU General Public License for more details.
13 | *
14 | * You should have received a copy of the GNU General Public License
15 | * along with this program; if not, see .
16 | */
17 | package com.unboundid.scim2.common.utils;
18 |
19 | import com.fasterxml.jackson.core.JsonParser;
20 | import com.fasterxml.jackson.core.JsonProcessingException;
21 | import com.fasterxml.jackson.databind.DeserializationContext;
22 | import com.fasterxml.jackson.databind.JsonDeserializer;
23 | import com.fasterxml.jackson.databind.exc.InvalidFormatException;
24 | import com.unboundid.scim2.common.annotations.NotNull;
25 | import com.unboundid.scim2.common.annotations.Nullable;
26 |
27 | import java.io.IOException;
28 | import java.util.Date;
29 |
30 | /**
31 | * Deserializes SCIM 2 DateTime values to {@link Date} objects.
32 | */
33 | public class DateDeserializer extends JsonDeserializer
34 | {
35 | /**
36 | * {@inheritDoc}
37 | */
38 | @Override
39 | @NotNull
40 | public Date deserialize(@NotNull final JsonParser jp,
41 | @Nullable final DeserializationContext ctxt)
42 | throws IOException, JsonProcessingException
43 | {
44 | String dateStr = jp.getText();
45 | try
46 | {
47 | return DateTimeUtils.parse(dateStr).getTime();
48 | }
49 | catch (IllegalArgumentException e)
50 | {
51 | throw new InvalidFormatException(jp, "unable to deserialize value",
52 | dateStr, Date.class);
53 | }
54 | }
55 | }
56 |
--------------------------------------------------------------------------------
/scim2-sdk-common/src/main/java/com/unboundid/scim2/common/utils/DateSerializer.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2019-2025 Ping Identity Corporation
3 | *
4 | * This program is free software; you can redistribute it and/or modify
5 | * it under the terms of the GNU General Public License (GPLv2 only)
6 | * or the terms of the GNU Lesser General Public License (LGPLv2.1 only)
7 | * as published by the Free Software Foundation.
8 | *
9 | * This program is distributed in the hope that it will be useful,
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 | * GNU General Public License for more details.
13 | *
14 | * You should have received a copy of the GNU General Public License
15 | * along with this program; if not, see .
16 | */
17 | package com.unboundid.scim2.common.utils;
18 |
19 | import com.fasterxml.jackson.core.JsonGenerator;
20 | import com.fasterxml.jackson.databind.JsonSerializer;
21 | import com.fasterxml.jackson.databind.SerializerProvider;
22 | import com.unboundid.scim2.common.annotations.NotNull;
23 | import com.unboundid.scim2.common.annotations.Nullable;
24 |
25 | import java.io.IOException;
26 | import java.util.Date;
27 |
28 | /**
29 | * Serializes a {@link Date} object to a SCIM 2 DateTime string.
30 | */
31 | public class DateSerializer extends JsonSerializer
32 | {
33 | /**
34 | * {@inheritDoc}
35 | */
36 | @Override
37 | public void serialize(@NotNull final Date value,
38 | @NotNull final JsonGenerator jgen,
39 | @Nullable final SerializerProvider serializers)
40 | throws IOException
41 | {
42 | jgen.writeString(DateTimeUtils.format(value));
43 | }
44 | }
45 |
--------------------------------------------------------------------------------
/scim2-sdk-common/src/main/java/com/unboundid/scim2/common/utils/DateTimeUtils.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2019-2025 Ping Identity Corporation
3 | *
4 | * This program is free software; you can redistribute it and/or modify
5 | * it under the terms of the GNU General Public License (GPLv2 only)
6 | * or the terms of the GNU Lesser General Public License (LGPLv2.1 only)
7 | * as published by the Free Software Foundation.
8 | *
9 | * This program is distributed in the hope that it will be useful,
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 | * GNU General Public License for more details.
13 | *
14 | * You should have received a copy of the GNU General Public License
15 | * along with this program; if not, see .
16 | */
17 | package com.unboundid.scim2.common.utils;
18 |
19 | import com.unboundid.scim2.common.annotations.NotNull;
20 | import jakarta.xml.bind.DatatypeConverter;
21 | import java.util.Calendar;
22 | import java.util.Date;
23 | import java.util.TimeZone;
24 |
25 | /**
26 | * Utility methods for handling SCIM 2 DateTime values. The SCIM 2 DateTime
27 | * type is defined as a valid xsd:dateTime in RFC 7643, section 2.3.5.
28 | */
29 | public final class DateTimeUtils
30 | {
31 | @NotNull
32 | private static final TimeZone DEFAULT_TIME_ZONE = TimeZone.getTimeZone("UTC");
33 |
34 | /**
35 | * Formats a {@link Date} value as a SCIM 2 DateTime string.
36 | *
37 | * @param date A Date value.
38 | * @return The value as a SCIM 2 DateTime string.
39 | */
40 | @NotNull
41 | public static String format(@NotNull final Date date)
42 | {
43 | return format(date, DEFAULT_TIME_ZONE);
44 | }
45 |
46 | /**
47 | * Formats a {@link Date} value as a SCIM 2 DateTime string.
48 | *
49 | * @param date A Date value.
50 | * @param timeZone The time zone.
51 | * @return The value as a SCIM 2 DateTime string.
52 | */
53 | @NotNull
54 | public static String format(@NotNull final Date date,
55 | @NotNull final TimeZone timeZone)
56 | {
57 | Calendar calendar = Calendar.getInstance(timeZone);
58 | calendar.setTime(date);
59 | return format(calendar);
60 | }
61 |
62 | /**
63 | * Formats a {@link Calendar} value as a SCIM 2 DateTime string.
64 | *
65 | * @param calendar A Calendar value.
66 | * @return The value as a SCIM 2 DateTime string.
67 | */
68 | @NotNull
69 | public static String format(@NotNull final Calendar calendar)
70 | {
71 | return DatatypeConverter.printDateTime(calendar);
72 | }
73 |
74 | /**
75 | * Converts a SCIM 2 DateTime string to a {@link Calendar}.
76 | *
77 | * @param dateStr A SCIM 2 DateTime string.
78 | * @return The DateTime string as a Calendar value.
79 | * @throws IllegalArgumentException if the string cannot be parsed as an
80 | * xsd:dateTime value.
81 | */
82 | @NotNull
83 | public static Calendar parse(@NotNull final String dateStr)
84 | throws IllegalArgumentException
85 | {
86 | return DatatypeConverter.parseDateTime(dateStr);
87 | }
88 | }
89 |
--------------------------------------------------------------------------------
/scim2-sdk-common/src/main/java/com/unboundid/scim2/common/utils/GenericScimObjectDeserializer.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2015-2025 Ping Identity Corporation
3 | *
4 | * This program is free software; you can redistribute it and/or modify
5 | * it under the terms of the GNU General Public License (GPLv2 only)
6 | * or the terms of the GNU Lesser General Public License (LGPLv2.1 only)
7 | * as published by the Free Software Foundation.
8 | *
9 | * This program is distributed in the hope that it will be useful,
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 | * GNU General Public License for more details.
13 | *
14 | * You should have received a copy of the GNU General Public License
15 | * along with this program; if not, see .
16 | */
17 |
18 | package com.unboundid.scim2.common.utils;
19 |
20 | import com.fasterxml.jackson.core.JsonParser;
21 | import com.fasterxml.jackson.databind.DeserializationContext;
22 | import com.fasterxml.jackson.databind.JsonDeserializer;
23 | import com.fasterxml.jackson.databind.node.ObjectNode;
24 | import com.unboundid.scim2.common.GenericScimResource;
25 | import com.unboundid.scim2.common.annotations.NotNull;
26 | import com.unboundid.scim2.common.annotations.Nullable;
27 |
28 | import java.io.IOException;
29 |
30 | /**
31 | * Deserializer for {@link GenericScimResource}.
32 | */
33 | public class GenericScimObjectDeserializer
34 | extends JsonDeserializer
35 | {
36 | /**
37 | * {@inheritDoc}
38 | */
39 | @Override
40 | @NotNull
41 | public GenericScimResource deserialize(@NotNull final JsonParser jp,
42 | @Nullable final DeserializationContext ctxt)
43 | throws IOException
44 | {
45 | ObjectNode objectNode = JsonUtils.getObjectReader().readTree(jp);
46 | return new GenericScimResource(objectNode);
47 | }
48 | }
49 |
--------------------------------------------------------------------------------
/scim2-sdk-common/src/main/java/com/unboundid/scim2/common/utils/GenericScimObjectSerializer.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2015-2025 Ping Identity Corporation
3 | *
4 | * This program is free software; you can redistribute it and/or modify
5 | * it under the terms of the GNU General Public License (GPLv2 only)
6 | * or the terms of the GNU Lesser General Public License (LGPLv2.1 only)
7 | * as published by the Free Software Foundation.
8 | *
9 | * This program is distributed in the hope that it will be useful,
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 | * GNU General Public License for more details.
13 | *
14 | * You should have received a copy of the GNU General Public License
15 | * along with this program; if not, see .
16 | */
17 |
18 | package com.unboundid.scim2.common.utils;
19 |
20 | import com.fasterxml.jackson.core.JsonGenerator;
21 | import com.fasterxml.jackson.databind.JsonSerializer;
22 | import com.fasterxml.jackson.databind.SerializerProvider;
23 | import com.unboundid.scim2.common.GenericScimResource;
24 | import com.unboundid.scim2.common.annotations.NotNull;
25 | import com.unboundid.scim2.common.annotations.Nullable;
26 |
27 | import java.io.IOException;
28 |
29 | /**
30 | * Serializer for {@link GenericScimResource}.
31 | */
32 | public class GenericScimObjectSerializer
33 | extends JsonSerializer
34 | {
35 | /**
36 | * {@inheritDoc}
37 | */
38 | @Override
39 | public void serialize(@NotNull final GenericScimResource value,
40 | @NotNull final JsonGenerator jgen,
41 | @Nullable final SerializerProvider provider)
42 | throws IOException
43 | {
44 | JsonUtils.getObjectWriter().writeValue(jgen, value.getObjectNode());
45 | }
46 | }
47 |
--------------------------------------------------------------------------------
/scim2-sdk-common/src/main/java/com/unboundid/scim2/common/utils/JsonRefBeanSerializer.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2015-2025 Ping Identity Corporation
3 | *
4 | * This program is free software; you can redistribute it and/or modify
5 | * it under the terms of the GNU General Public License (GPLv2 only)
6 | * or the terms of the GNU Lesser General Public License (LGPLv2.1 only)
7 | * as published by the Free Software Foundation.
8 | *
9 | * This program is distributed in the hope that it will be useful,
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 | * GNU General Public License for more details.
13 | *
14 | * You should have received a copy of the GNU General Public License
15 | * along with this program; if not, see .
16 | */
17 |
18 | package com.unboundid.scim2.common.utils;
19 |
20 | import com.fasterxml.jackson.core.JsonGenerator;
21 | import com.fasterxml.jackson.databind.JsonSerializer;
22 | import com.fasterxml.jackson.databind.SerializerProvider;
23 | import com.unboundid.scim2.common.annotations.NotNull;
24 | import com.unboundid.scim2.common.types.JsonReference;
25 |
26 | import java.beans.IntrospectionException;
27 | import java.beans.PropertyDescriptor;
28 | import java.io.IOException;
29 | import java.lang.reflect.Field;
30 | import java.util.Collection;
31 |
32 | /**
33 | * Serializes classes that are beans, but the underlying structure holding
34 | * the attribute values is a JsonReference object. This will preserve those
35 | * values, so that if a value was explicitly set to null, we will know that,
36 | * but if not, we will know it was never set. During serialization, we will
37 | * serialize explicit {@code null} values, but not uninitialized values.
38 | */
39 | public class JsonRefBeanSerializer extends JsonSerializer