001 /*
002 * Copyright 2011-2012 UnboundID Corp.
003 *
004 * This program is free software; you can redistribute it and/or modify
005 * it under the terms of the GNU General Public License (GPLv2 only)
006 * or the terms of the GNU Lesser General Public License (LGPLv2.1 only)
007 * as published by the Free Software Foundation.
008 *
009 * This program is distributed in the hope that it will be useful,
010 * but WITHOUT ANY WARRANTY; without even the implied warranty of
011 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
012 * GNU General Public License for more details.
013 *
014 * You should have received a copy of the GNU General Public License
015 * along with this program; if not, see <http://www.gnu.org/licenses>.
016 */
017
018 package com.unboundid.scim.sdk;
019
020 import com.unboundid.scim.schema.ResourceDescriptor;
021
022 import java.net.URI;
023
024
025
026 /**
027 * This class is the base class for all SCIM requests.
028 */
029 public abstract class SCIMRequest
030 {
031 /**
032 * The base URL for the SCIM service.
033 */
034 private final URI baseURL;
035
036 /**
037 * The authenticated user ID or {@code null} if the request is not
038 * authenticated.
039 */
040 private final String authenticatedUserID;
041
042 /**
043 * The ResourceDescriptor associated with this request.
044 */
045 private final ResourceDescriptor resourceDescriptor;
046
047
048
049 /**
050 * Create a new SCIM request from the provided information.
051 *
052 * @param baseURL The base URL for the SCIM service.
053 * @param authenticatedUserID The authenticated user name or {@code null} if
054 * the request is not authenticated.
055 * @param resourceDescriptor The ResourceDescriptor associated with this
056 * request.
057 */
058 public SCIMRequest(final URI baseURL, final String authenticatedUserID,
059 final ResourceDescriptor resourceDescriptor)
060 {
061 this.baseURL = baseURL;
062 this.authenticatedUserID = authenticatedUserID;
063 this.resourceDescriptor = resourceDescriptor;
064 }
065
066
067
068 /**
069 * Retrieve the base URL for the SCIM service.
070 *
071 * @return The base URL for the SCIM service.
072 */
073 public URI getBaseURL()
074 {
075 return baseURL;
076 }
077
078
079
080 /**
081 * Get the authenticated user ID.
082 *
083 * @return The authenticated user ID or {@code null} if the request is
084 * not authenticated.
085 */
086 public String getAuthenticatedUserID()
087 {
088 return authenticatedUserID;
089 }
090
091
092
093 /**
094 * Get ResourceDescriptor associated with this request.
095 *
096 * @return The ResourceDescriptor associated with this request.
097 */
098 public ResourceDescriptor getResourceDescriptor() {
099 return resourceDescriptor;
100 }
101 }