Class 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.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • parent_

        private final java.awt.Component parent_
    • Constructor Detail

      • SwingOriginAuthorizer

        public SwingOriginAuthorizer​(java.awt.Component parent)
        Constructor.
        Parameters:
        parent - parent component
    • 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 interface OriginAuthorizer
        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 interface OriginAuthorizer
        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