01: /*
02: * $Id: PropertyCallback.java,v 1.4 2007/01/08 09:28:57 ashutoshshahi Exp $
03: */
04:
05: /*
06: * The contents of this file are subject to the terms
07: * of the Common Development and Distribution License
08: * (the License). You may not use this file except in
09: * compliance with the License.
10: *
11: * You can obtain a copy of the license at
12: * https://glassfish.dev.java.net/public/CDDLv1.0.html.
13: * See the License for the specific language governing
14: * permissions and limitations under the License.
15: *
16: * When distributing Covered Code, include this CDDL
17: * Header Notice in each file and include the License file
18: * at https://glassfish.dev.java.net/public/CDDLv1.0.html.
19: * If applicable, add the following below the CDDL Header,
20: * with the fields enclosed by brackets [] replaced by
21: * you own identifying information:
22: * "Portions Copyrighted [year] [name of copyright owner]"
23: *
24: * Copyright 2006 Sun Microsystems Inc. All Rights Reserved
25: */
26:
27: package com.sun.xml.wss.impl.callback;
28:
29: import javax.security.auth.callback.Callback;
30:
31: /**
32: * This callback is an optional callback that can be handled by an
33: * implementation of CallbackHandler to specify the values of properties
34: * configurable with XWS-Security runtime. The properties are:
35: *
36: * <ul><li>MAX_CLOCK_SKEW : The assumed maximum skew (milliseconds) between the local times of any two systems </li>
37: * <li>TIMESTAMP_FRESHNESS_LIMIT : The period (milliseconds) for which a Timestamp is considered fresh </li>
38: * <li>MAX_NONCE_AGE : The length of time (milliseconds) a previously received Nonce value will be stored </li></ul>
39: * @deprecated This callback is no longer supported by the XWS-Security runtime, use the XWS-Security configuration
40: * file to set the above property values instead.
41: */
42: public class PropertyCallback extends XWSSCallback implements Callback {
43:
44: public static final long MAX_NONCE_AGE = 900000;
45: public static final long MAX_CLOCK_SKEW = 60000;
46: public static final long TIMESTAMP_FRESHNESS_LIMIT = 300000;
47:
48: long maxSkew = MAX_CLOCK_SKEW;
49: long freshnessLimit = TIMESTAMP_FRESHNESS_LIMIT;
50: long maxNonceAge = MAX_NONCE_AGE;
51:
52: /**
53: *@param skew the assumed maximum skew (milliseconds) between the local times of any two systems
54: */
55: public void setMaxClockSkew(long skew) {
56: this .maxSkew = skew;
57: }
58:
59: /**
60: *@return the maximum clock skew
61: */
62: public long getMaxClockSkew() {
63: return maxSkew;
64: }
65:
66: /**
67: *@param freshnessLimit the period (milliseconds) for which a Timestamp is considered fresh
68: */
69: public void setTimestampFreshnessLimit(long freshnessLimit) {
70: this .freshnessLimit = freshnessLimit;
71: }
72:
73: /**
74: *@return the Timestamp Freshness Limit
75: */
76: public long getTimestampFreshnessLimit() {
77: return freshnessLimit;
78: }
79:
80: /**
81: *@param maxNonceAge The length of time (milliseconds) a previously received Nonce value
82: *will be stored
83: * Implementation Note: The actual time for which any Nonce will be stored can be greater
84: * than maxNonceAge. In some cases when the implementation is unable to determine a receiver
85: * side policy ahead of processing the Message, the maxNonceAge value used will be a default
86: * value of 30 mins.
87: */
88: public void setMaxNonceAge(long maxNonceAge) {
89: this .maxNonceAge = maxNonceAge;
90: }
91:
92: /**
93: *@return the Maximum Nonce Age value
94: */
95: public long getMaxNonceAge() {
96: return this.maxNonceAge;
97: }
98:
99: }
|