001/*
002 * Copyright 2011-2013 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/**
028 * This class represents a SCIM Delete Resource request delete a single
029 * resource.
030 */
031public final class DeleteResourceRequest extends SCIMRequest
032{
033  /**
034   * The target resource ID.
035   */
036  private final String resourceID;
037
038
039
040  /**
041   * Create a new SCIM Delete Resource request from the provided information.
042   *
043   * @param baseURL              The base URL for the SCIM service.
044   * @param authenticatedUserID  The authenticated user name or {@code null} if
045   *                             the request is not authenticated.
046   * @param resourceDescriptor   The ResourceDescriptor associated with this
047   *                             request.
048   * @param resourceID    The target resource ID.
049   */
050  public DeleteResourceRequest(final URI baseURL,
051                               final String authenticatedUserID,
052                               final ResourceDescriptor resourceDescriptor,
053                               final String resourceID)
054  {
055    super(baseURL, authenticatedUserID, resourceDescriptor);
056    this.resourceID          = resourceID;
057  }
058
059
060
061  /**
062   * Create a new SCIM Delete Resource request from the provided information.
063   *
064   * @param baseURL              The base URL for the SCIM service.
065   * @param authenticatedUserID  The authenticated user name or {@code null} if
066   *                             the request is not authenticated.
067   * @param resourceDescriptor   The ResourceDescriptor associated with this
068   *                             request.
069   * @param resourceID           The target resource ID.
070   * @param httpServletRequest   The HTTP servlet request associated with this
071   *                             request or {@code null} if this request is not
072   *                             initiated by a servlet.
073   */
074  public DeleteResourceRequest(final URI baseURL,
075                               final String authenticatedUserID,
076                               final ResourceDescriptor resourceDescriptor,
077                               final String resourceID,
078                               final HttpServletRequest httpServletRequest)
079  {
080    super(baseURL, authenticatedUserID, resourceDescriptor, httpServletRequest);
081    this.resourceID          = resourceID;
082  }
083
084
085  /**
086   * Get the requested resource ID.
087   *
088   * @return  The requested resource ID.
089   */
090  public String getResourceID()
091  {
092    return resourceID;
093  }
094}