001package org.apache.archiva.redback.keys.memory; 002 003/* 004 * Licensed to the Apache Software Foundation (ASF) under one 005 * or more contributor license agreements. See the NOTICE file 006 * distributed with this work for additional information 007 * regarding copyright ownership. The ASF licenses this file 008 * to you under the Apache License, Version 2.0 (the 009 * "License"); you may not use this file except in compliance 010 * with the License. You may obtain a copy of the License at 011 * 012 * http://www.apache.org/licenses/LICENSE-2.0 013 * 014 * Unless required by applicable law or agreed to in writing, 015 * software distributed under the License is distributed on an 016 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 017 * KIND, either express or implied. See the License for the 018 * specific language governing permissions and limitations 019 * under the License. 020 */ 021 022import org.apache.archiva.redback.keys.AuthenticationKey; 023 024import java.util.Date; 025 026/** 027 * MemoryAuthenticationKey 028 * 029 * @author <a href="mailto:joakim@erdfelt.com">Joakim Erdfelt</a> 030 * 031 */ 032public class MemoryAuthenticationKey 033 implements AuthenticationKey 034{ 035 private String key; 036 037 private String forPrincipal; 038 039 private String purpose; 040 041 private Date dateCreated; 042 043 private Date dateExpires; 044 045 public Date getDateCreated() 046 { 047 return dateCreated; 048 } 049 050 public Date getDateExpires() 051 { 052 return dateExpires; 053 } 054 055 public String getForPrincipal() 056 { 057 return forPrincipal; 058 } 059 060 public String getKey() 061 { 062 return key; 063 } 064 065 public String getPurpose() 066 { 067 return purpose; 068 } 069 070 public void setDateCreated( Date dateCreated ) 071 { 072 this.dateCreated = dateCreated; 073 } 074 075 public void setDateExpires( Date dateExpires ) 076 { 077 this.dateExpires = dateExpires; 078 } 079 080 public void setForPrincipal( String forPrincipal ) 081 { 082 this.forPrincipal = forPrincipal; 083 } 084 085 public void setKey( String key ) 086 { 087 this.key = key; 088 } 089 090 public void setPurpose( String purpose ) 091 { 092 this.purpose = purpose; 093 } 094 095 public String toString() 096 { 097 StringBuilder sb = new StringBuilder(); 098 099 sb.append( "MemoryAuthenticationKey[" ); 100 sb.append( "key=" ).append( key ); 101 sb.append( ",forPrincipal=" ).append( forPrincipal ); 102 sb.append( ",purpose=" ).append( purpose ); 103 sb.append( ",dateCreated=" ).append( dateCreated ); 104 sb.append( ",dateExpired=" ).append( dateExpires ); 105 sb.append( ']' ); 106 107 return sb.toString(); 108 } 109}