001/* 002 * Copyright 2011-2016 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 018package com.unboundid.scim.sdk; 019 020import com.unboundid.scim.schema.ResourceDescriptor; 021 022import javax.servlet.http.HttpServletRequest; 023import java.net.URI; 024 025 026/** 027 * This class represents a SCIM Delete Resource request delete a single 028 * resource. 029 */ 030public final class DeleteResourceRequest extends SCIMRequest 031{ 032 /** 033 * The target resource ID. 034 */ 035 private final String resourceID; 036 037 038 /** 039 * Create a new SCIM Delete Resource request from the provided information. 040 * 041 * @param baseURL The base URL for the SCIM service. 042 * @param authenticatedUserID The authenticated user name or {@code null} if 043 * the request is not authenticated. 044 * @param resourceDescriptor The ResourceDescriptor associated with this 045 * request. 046 * @param resourceID The target resource ID. 047 */ 048 public DeleteResourceRequest(final URI baseURL, 049 final String authenticatedUserID, 050 final ResourceDescriptor resourceDescriptor, 051 final String resourceID) 052 { 053 super(baseURL, authenticatedUserID, resourceDescriptor); 054 this.resourceID = resourceID; 055 } 056 057 058 059 /** 060 * Create a new SCIM Delete Resource request from the provided information. 061 * 062 * @param baseURL The base URL for the SCIM service. 063 * @param authenticatedUserID The authenticated user name or {@code null} if 064 * the request is not authenticated. 065 * @param resourceDescriptor The ResourceDescriptor associated with this 066 * request. 067 * @param resourceID The target resource ID. 068 * @param httpServletRequest The HTTP servlet request associated with this 069 * request or {@code null} if this request is not 070 * initiated by a servlet. 071 */ 072 public DeleteResourceRequest(final URI baseURL, 073 final String authenticatedUserID, 074 final ResourceDescriptor resourceDescriptor, 075 final String resourceID, 076 final HttpServletRequest httpServletRequest) 077 { 078 super(baseURL, authenticatedUserID, resourceDescriptor, httpServletRequest); 079 this.resourceID = resourceID; 080 } 081 082 083 084 /** 085 * Create a new SCIM Delete Resource request from the provided information. 086 * 087 * @param baseURL The base URL for the SCIM service. 088 * @param authenticatedUserID The authenticated user name or {@code null} if 089 * the request is not authenticated. 090 * @param resourceDescriptor The ResourceDescriptor associated with this 091 * request. 092 * @param resourceID The target resource ID. 093 * @param httpServletRequest The HTTP servlet request associated with this 094 * request or {@code null} if this request is not 095 * initiated by a servlet. 096 * @param ifMatchHeaderValue The If-Match header value. 097 * @param ifNoneMatchHeaderValue The If-None-Match header value. 098 */ 099 public DeleteResourceRequest(final URI baseURL, 100 final String authenticatedUserID, 101 final ResourceDescriptor resourceDescriptor, 102 final String resourceID, 103 final HttpServletRequest httpServletRequest, 104 final String ifMatchHeaderValue, 105 final String ifNoneMatchHeaderValue) 106 { 107 super(baseURL, authenticatedUserID, resourceDescriptor, httpServletRequest, 108 ifMatchHeaderValue, ifNoneMatchHeaderValue); 109 this.resourceID = resourceID; 110 } 111 112 113 /** 114 * Get the requested resource ID. 115 * 116 * @return The requested resource ID. 117 */ 118 public String getResourceID() 119 { 120 return resourceID; 121 } 122}