2222import com .ibm .websphere .security .auth .InvalidTokenException ;
2323import com .ibm .websphere .security .auth .TokenExpiredException ;
2424import com .ibm .websphere .security .auth .ValidationFailedException ;
25+ import com .ibm .ws .kernel .productinfo .ProductInfo ;
2526import com .ibm .ws .security .token .TokenManager ;
2627import com .ibm .ws .security .token .internal .ValidationResultImpl ;
2728import com .ibm .wsspi .kernel .service .utils .AtomicServiceReference ;
@@ -41,6 +42,22 @@ public class WSSecurityPropagationHelper {
4142 private static final AtomicServiceReference <TokenManager > tokenManagerRef = new AtomicServiceReference <TokenManager >("tokenManager" );
4243 private final static WebSphereRuntimePermission VALIDATE_TOKEN = new WebSphereRuntimePermission ("validateLTPAToken" );
4344
45+ // Flag tells us if the message for a call to a beta method has been issued
46+ private static boolean issuedBetaMessage = false ;
47+
48+ private static void betaFenceCheck () throws UnsupportedOperationException {
49+ // Not running beta edition, throw exception
50+ if (!ProductInfo .getBetaEdition ()) {
51+ throw new UnsupportedOperationException ("This method is beta and is not available." );
52+ } else {
53+ // Running beta exception, issue message if we haven't already issued one for this class
54+ if (!issuedBetaMessage ) {
55+ Tr .info (tc , "BETA: A beta method has been invoked for the class WSSecurityPropagationHelper for the first time." );
56+ issuedBetaMessage = !issuedBetaMessage ;
57+ }
58+ }
59+ }
60+
4461 /**
4562 * <p>
4663 * This method validates an LTPA token and will return a ValidationResult object.
@@ -55,7 +72,9 @@ public class WSSecurityPropagationHelper {
5572 * @return ValidationResult
5673 * @exception ValidationFailedException
5774 **/
75+ @ Deprecated
5876 public static ValidationResult validateToken (byte [] token ) throws ValidationFailedException {
77+ betaFenceCheck ();
5978 ValidationResult validationResult = null ;
6079 java .lang .SecurityManager sm = System .getSecurityManager ();
6180 if (sm != null ) {
0 commit comments