Package org.astrogrid.samp.web
Class SwingOriginAuthorizer
- java.lang.Object
-
- org.astrogrid.samp.web.SwingOriginAuthorizer
-
- All Implemented Interfaces:
OriginAuthorizer
class SwingOriginAuthorizer extends java.lang.Object implements OriginAuthorizer
OriginAuthorizer which uses a popup dialogue to ask the user.- Since:
- 2 Feb 2011
- Author:
- Mark Taylor
-
-
Field Summary
Fields Modifier and Type Field Description private java.awt.Componentparent_
-
Constructor Summary
Constructors Constructor Description SwingOriginAuthorizer(java.awt.Component parent)Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanauthorize(java.lang.String origin)Indicates whether a client with a given origin is permitted to access resources.booleanauthorizeAll()Indicates whether clients from arbitrary origins (including none) are permitted to access resources.protected booleangetResponse(java.lang.String[] lines)Presents some lines of text to the user and solicits a yes/no response from them.
-
-
-
Method Detail
-
authorize
public boolean authorize(java.lang.String origin)
Description copied from interface:OriginAuthorizerIndicates whether a client with a given origin is permitted to access resources.- Specified by:
authorizein interfaceOriginAuthorizer- Parameters:
origin- client Origin- Returns:
- true iff access is permitted
- See Also:
- Web Origin concept
-
authorizeAll
public boolean authorizeAll()
Description copied from interface:OriginAuthorizerIndicates whether clients from arbitrary origins (including none) are permitted to access resources.- Specified by:
authorizeAllin interfaceOriginAuthorizer- Returns:
- true iff access is permitted
-
getResponse
protected boolean getResponse(java.lang.String[] lines)
Presents some lines of text to the user and solicits a yes/no response from them. This method does not need to be called from the AWT event dispatch thread.- Parameters:
lines- lines of formatted plain text (not too many; not too long)- Returns:
- true/false for use yes/no response
-
-