|
| 1 | +package com.barista.logincontext; |
| 2 | + |
| 3 | +import liquidjava.specification.StateSet; |
| 4 | +import liquidjava.specification.StateRefinement; |
| 5 | + |
| 6 | +import javax.security.auth.Subject; |
| 7 | +import javax.security.auth.callback.CallbackHandler; |
| 8 | +import javax.security.auth.login.Configuration; |
| 9 | + |
| 10 | +import liquidjava.specification.ExternalRefinementsFor; |
| 11 | + |
| 12 | +@StateSet({"created", "loggedIn", "authenticated", "loggedOut"}) |
| 13 | +@ExternalRefinementsFor("javax.security.auth.login.LoginContext") |
| 14 | +public interface LoginContextRefinements { |
| 15 | + |
| 16 | + @StateRefinement(to="created(this)") |
| 17 | + public void LoginContext(String name); |
| 18 | + |
| 19 | + @StateRefinement(to="created(this)") |
| 20 | + public void LoginContext(String name, CallbackHandler callbackHandler); |
| 21 | + |
| 22 | + @StateRefinement(to="created(this)") |
| 23 | + public void LoginContext(String name, Subject subject); |
| 24 | + |
| 25 | + @StateRefinement(to="created(this)") |
| 26 | + public void LoginContext(String name, Subject subject, CallbackHandler callbackHandler); |
| 27 | + |
| 28 | + @StateRefinement(to="created(this)") |
| 29 | + public void LoginContext(String name, Subject subject, CallbackHandler callbackHandler, Configuration config); |
| 30 | + |
| 31 | + @StateRefinement(from="created(this) || loggedOut(this)", to="loggedIn(this)") |
| 32 | + public void login(); |
| 33 | + |
| 34 | + @StateRefinement(from="authenticated(this) || loggedIn(this)", to="loggedOut(this)") |
| 35 | + public void logout(); |
| 36 | + |
| 37 | + @StateRefinement(from="authenticated(this)", to="authenticated(this)") |
| 38 | + public Subject getSubject(); |
| 39 | +} |
0 commit comments