View Javadoc
1   /*
2    * Licensed to the Apache Software Foundation (ASF) under one
3    * or more contributor license agreements.  See the NOTICE file
4    * distributed with this work for additional information
5    * regarding copyright ownership. The ASF licenses this file
6    * to you under the Apache License, Version 2.0 (the
7    * "License"); you may not use this file except in compliance
8    * with the License. You may obtain a copy of the License at
9    * 
10   *      http://www.apache.org/licenses/LICENSE-2.0
11   * 
12   * Unless required by applicable law or agreed to in writing, software
13   * distributed under the License is distributed on an "AS IS" BASIS,
14   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15   * See the License for the specific language governing permissions and
16   * limitations under the License.
17   */
18  package com.sun.jini.landlord;
19  
20  /**
21   * Provided for backward compatibility, migrate to new name space.
22   * 
23   * Allows later clients to access earlier service versions.
24   */
25  @Deprecated
26  public interface Landlord extends org.apache.river.landlord.Landlord {
27      
28      /**
29       * Note that for security reasons, the public api of this class has
30       * changed in the new org.apache.river.landlord name space.
31       * 
32       * Public mutable fields are a playground for gadget attacks, which is also
33       * why this class also doesn't implement {@link org.apache.river.api.io.AtomicSerial AtomicSerial}
34       */
35      public class RenewResults extends org.apache.river.landlord.Landlord.RenewResults {
36          static final long serialVersionUID = 2L; 
37    
38          /** 
39          * For each cookie passed to {@link Landlord#renewAll renewAll}, 
40          * <code>granted[i]</code> is the granted lease time, or -1 if the 
41          * renewal for that lease generated an exception.  If there was 
42          * an exception, the exception is held in <code>denied</code>. 
43          * 
44          * @see #denied 
45          * @serial 
46          */ 
47          public long[] granted; 
48  
49          /** 
50          * The <code>i</code><sup><i>th</i></sup> -1 in <code>granted</code> 
51          * was denied because of <code>denied[i]</code>.  If nothing was  
52          * denied, this field is <code>null</code>. 
53          * 
54          * @serial 
55          */ 
56          public Exception[] denied; 
57  
58          public RenewResults(long[] granted) {
59              this(granted, null);
60          }
61          
62          public RenewResults(long[] granted, Exception[] denied) {
63              super(granted, denied);
64              this.granted = granted;
65              this.denied = denied;
66          }
67  	
68  	@Override
69  	public long getGranted(int i){
70  	    return granted[i];
71  	}	
72  	
73  	@Override
74  	public Exception getDenied(int i){
75  	    if (denied == null) return null;
76  	    return denied[i];
77  	}
78          
79      }
80  }