View Javadoc

1   /*
2    * Copyright 2008 University Corporation for Advanced Internet Development, Inc.
3    *
4    * Licensed under the Apache License, Version 2.0 (the "License");
5    * you may not use this file except in compliance with the License.
6    * You may obtain a copy of the License at
7    *
8    * http://www.apache.org/licenses/LICENSE-2.0
9    *
10   * Unless required by applicable law or agreed to in writing, software
11   * distributed under the License is distributed on an "AS IS" BASIS,
12   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13   * See the License for the specific language governing permissions and
14   * limitations under the License.
15   */
16  
17  package org.opensaml.util.storage;
18  
19  import java.io.Serializable;
20  
21  import org.joda.time.DateTime;
22  
23  /** Replay cache storage service entry. */
24  public class ReplayCacheEntry extends AbstractExpiringObject implements Serializable {
25  
26      /** Serial version UID. */
27      private static final long serialVersionUID = 1066201734851002196L;
28  
29      /** ID of the message that may not be replayed. */
30      private String messageId;
31  
32      /**
33       * Constructor.
34       * 
35       * @param id ID of the message that may not be replayed
36       * @param expiration time when this entry expires
37       */
38      public ReplayCacheEntry(String id, DateTime expiration) {
39          super(expiration);
40          messageId = id;
41      }
42  
43      /**
44       * Gets the ID of the message that may not be replayed.
45       * 
46       * @return ID of the message that may not be replayed
47       */
48      public String getMessageId() {
49          return messageId;
50      }
51  }