001    /*
002     * Copyright 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 java.util.ArrayList;
021    import java.util.List;
022    
023    
024    
025    /**
026     * This class implements the bulk operation handler to process bulk operation
027     * responses in the SCIM client. This handler accumulates all the operation
028     * responses in memory.
029     */
030    public class BulkContentResponseHandler extends BulkContentHandler
031    {
032      private final List<BulkOperation> operations = new ArrayList<BulkOperation>();
033    
034      /**
035       * {@inheritDoc}
036       */
037      public boolean handleOperation(final int opIndex,
038                                     final BulkOperation bulkOperation)
039          throws SCIMException
040      {
041        operations.add(bulkOperation);
042        return true;
043      }
044    
045    
046    
047      /**
048       * Retrieve the list of operation responses.
049       *
050       * @return  The list of operation responses.
051       */
052      public List<BulkOperation> getOperations()
053      {
054        return operations;
055      }
056    }