Class EntitlementListener


  • public final class EntitlementListener
    extends Object
    Listener for receiving entitlements related changes.
    • Constructor Detail

      • EntitlementListener

        public EntitlementListener​(String url,
                                   String application,
                                   Collection<String> resourceNames)
                            throws EntitlementException
        Constructor.
        Parameters:
        url - URL of which notification will be sent to.
        application - Application name.
        resourceNames - Notification will be send to url if privilege for resources matches with the elements in resourceNames. Wildcard and sub resource matching apply too.
        Throws:
        EntitlementException - if url or resourceNames is null.
      • EntitlementListener

        public EntitlementListener​(URL url,
                                   String application,
                                   Collection<String> resourceNames)
                            throws EntitlementException
        Constructor.
        Parameters:
        url - URL of which notification will be sent to.
        application - Application name.
        resourceNames - Notification will be send to url if privilege for resources matches with the elements in resourceNames. Wildcard and sub resource matching apply too.
        Throws:
        EntitlementException - if url or resourceNames is null.
    • Method Detail

      • toJSON

        public org.json.JSONObject toJSON()
                                   throws org.json.JSONException
        Throws:
        org.json.JSONException
      • getMapAppToRes

        public Map<String,​Set<String>> getMapAppToRes()
        Returns map of application name to resource names.
        Returns:
        map of application name to resource names.
      • getUrl

        public URL getUrl()
        Returns notification URL.
        Returns:
        notification URL.
      • combine

        public boolean combine​(EntitlementListener l)
        Combines other listener. Returns true if combination is possible.
        Parameters:
        l - listener.
        Returns:
        true if combination is done.
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class Object