001/** 002 * Copyright 2015 DuraSpace, Inc. 003 * 004 * Licensed under the Apache 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.apache.org/licenses/LICENSE-2.0 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.fcrepo.oai.http; 017 018/** 019 * A representation of a OAI compliant resumption token. 020 * 021 * @author Frank Asseg 022 */ 023public class ResumptionToken { 024 025 private final String verb; 026 027 private final String from; 028 029 private final String until; 030 031 private final int offset; 032 033 private final String set; 034 035 private final String metadataPrefix; 036 037 /** 038 * Create a new resumption token with the given OAI parameters 039 * 040 * @param verb the OAI verb 041 * @param metadataPrefix the OAI metadata prefix 042 * @param from the first date constraint value 043 * @param until the secod date constraint value 044 * @param offset indicates the current cursor position for list operations 045 * @param set the name of the OAI set 046 */ 047 public ResumptionToken(final String verb, final String metadataPrefix, final String from, final String until, 048 final int offset, final String set) { 049 this.verb = verb; 050 this.from = from; 051 this.metadataPrefix = metadataPrefix; 052 this.until = until; 053 this.offset = offset; 054 this.set = set; 055 } 056 057 /** 058 * Gets metadata prefix. 059 * 060 * @return the metadata prefix 061 */ 062 public String getMetadataPrefix() { 063 return metadataPrefix; 064 } 065 066 /** 067 * Gets offset. 068 * 069 * @return the offset 070 */ 071 public int getOffset() { 072 return offset; 073 } 074 075 /** 076 * Gets verb. 077 * 078 * @return the verb 079 */ 080 public String getVerb() { 081 return verb; 082 } 083 084 /** 085 * Gets from. 086 * 087 * @return the from 088 */ 089 public String getFrom() { 090 return from; 091 } 092 093 /** 094 * Gets until. 095 * 096 * @return the until 097 */ 098 public String getUntil() { 099 return until; 100 } 101 102 /** 103 * Gets set. 104 * 105 * @return the set 106 */ 107 public String getSet() { 108 return set; 109 } 110}