001/*
002 * Copyright 2011 The Kuali Foundation.
003 * 
004 * Licensed under the Educational Community License, Version 2.0 (the "License");
005 * you may not use this file except in compliance with the License.
006 * You may obtain a copy of the License at
007 * 
008 * http://www.opensource.org/licenses/ecl2.php
009 * 
010 * Unless required by applicable law or agreed to in writing, software
011 * distributed under the License is distributed on an "AS IS" BASIS,
012 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
013 * See the License for the specific language governing permissions and
014 * limitations under the License.
015 */
016package org.kuali.ole.docstore.model.xmlpojo.ingest;
017
018import java.util.ArrayList;
019import java.util.HashSet;
020import java.util.List;
021import java.util.Set;
022
023/**
024 * Created by IntelliJ IDEA.
025 * User: pvsubrah
026 * Date: 9/7/11
027 * Time: 1:18 PM
028 * To change this template use File | Settings | File Templates.
029 */
030public class Request {
031
032    public static Set<String> validOperationSet = getValidOperationSet();
033
034    public enum Operation {
035        ingest, bulkIngest, checkIn, checkOut, delete, deleteVerify, deleteWithLinkedDocs, bind, unbind, transfer,
036        transferInstances, transferItems
037    }
038
039    private List<RequestDocument> requestDocuments = new ArrayList<RequestDocument>();
040    private String user;
041    private String operation;
042
043    public String getUser() {
044        return user;
045    }
046
047    public void setUser(String user) {
048        this.user = user;
049    }
050
051    public String getOperation() {
052        return operation;
053    }
054
055    public void setOperation(String operation) {
056        this.operation = operation;
057    }
058
059    public List<RequestDocument> getRequestDocuments() {
060        return requestDocuments;
061    }
062
063    public void setRequestDocuments(List<RequestDocument> requestDocuments) {
064        this.requestDocuments = requestDocuments;
065    }
066
067    private static Set<String> getValidOperationSet() {
068        validOperationSet = new HashSet<String>();
069        validOperationSet.add(Request.Operation.ingest.toString());
070        validOperationSet.add(Request.Operation.bulkIngest.toString());
071        validOperationSet.add(Request.Operation.checkIn.toString());
072        validOperationSet.add(Request.Operation.checkOut.toString());
073        validOperationSet.add(Request.Operation.delete.toString());
074        validOperationSet.add(Operation.deleteVerify.toString());
075        validOperationSet.add(Request.Operation.deleteWithLinkedDocs.toString());
076        validOperationSet.add(Request.Operation.bind.toString());
077        validOperationSet.add(Request.Operation.unbind.toString());
078        validOperationSet.add(Request.Operation.transfer.toString());
079        validOperationSet.add(Request.Operation.transferInstances.toString());
080        validOperationSet.add(Request.Operation.transferItems.toString());
081        return validOperationSet;
082    }
083}