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.Component
parent_
-
Constructor Summary
Constructors Constructor Description SwingOriginAuthorizer(java.awt.Component parent)
Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
authorize(java.lang.String origin)
Indicates whether a client with a given origin is permitted to access resources.boolean
authorizeAll()
Indicates whether clients from arbitrary origins (including none) are permitted to access resources.protected boolean
getResponse(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:OriginAuthorizer
Indicates whether a client with a given origin is permitted to access resources.- Specified by:
authorize
in interfaceOriginAuthorizer
- Parameters:
origin
- client Origin- Returns:
- true iff access is permitted
- See Also:
- Web Origin concept
-
authorizeAll
public boolean authorizeAll()
Description copied from interface:OriginAuthorizer
Indicates whether clients from arbitrary origins (including none) are permitted to access resources.- Specified by:
authorizeAll
in 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
-
-