Class RdapSearchActionBase

    • Field Summary

      Fields 
      Modifier and Type Field Description
      protected java.util.Optional<java.lang.String> cursorString  
    • Method Summary

      All Methods Instance Methods Abstract Methods Concrete Methods 
      Modifier and Type Method Description
      protected void decodeCursorToken()
      Decodes the cursor token passed in the HTTP request.
      protected java.lang.String encodeCursorToken​(java.lang.String nextCursorString)
      Returns an encoded cursor token to pass back in the RDAP JSON link strings.
      protected <T extends EppResource>
      google.registry.rdap.RdapResultSet<T>
      filterResourcesByVisibility​(java.util.List<T> queryResult, int querySizeLimit)  
      protected java.util.Optional<java.lang.String> getDesiredRegistrar()
      Returns the registrar on which results should be filtered, or absent().
      google.registry.rdap.RdapSearchResults.BaseSearchResponse getJsonObjectForResource​(java.lang.String pathSearchString, boolean isHeadRequest)  
      protected java.lang.String getRequestUrlWithExtraParameter​(java.lang.String parameterName, java.lang.String parameterValue)
      Returns the original request URL, but with the specified parameter added or overridden.
      protected java.lang.String getRequestUrlWithExtraParameter​(java.lang.String parameterName, java.util.List<java.lang.String> parameterValues)
      Returns the original request URL, but with the specified parameter added or overridden.
      abstract google.registry.rdap.RdapSearchResults.BaseSearchResponse getSearchResponse​(boolean isHeadRequest)  
      protected boolean shouldBeVisible​(EppResource eppResource)
      Returns true if the EPP resource should be visible.
      protected boolean shouldBeVisible​(Registrar registrar)
      Returns true if the EPP resource should be visible.
      protected boolean shouldBeVisible​(java.util.Optional<? extends EppResource> eppResource)  
      • Methods inherited from class java.lang.Object

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

      • cursorString

        protected java.util.Optional<java.lang.String> cursorString
    • Method Detail

      • getJsonObjectForResource

        public final google.registry.rdap.RdapSearchResults.BaseSearchResponse getJsonObjectForResource​(java.lang.String pathSearchString,
                                                                                                        boolean isHeadRequest)
      • getSearchResponse

        public abstract google.registry.rdap.RdapSearchResults.BaseSearchResponse getSearchResponse​(boolean isHeadRequest)
      • decodeCursorToken

        protected void decodeCursorToken()
        Decodes the cursor token passed in the HTTP request.

        The cursor token is just the Base 64 encoded value of the last data item returned. To fetch the next page, the code can just decode the cursor, and return only data whose value is greater than the cursor value.

      • encodeCursorToken

        protected java.lang.String encodeCursorToken​(java.lang.String nextCursorString)
        Returns an encoded cursor token to pass back in the RDAP JSON link strings.
      • getRequestUrlWithExtraParameter

        protected java.lang.String getRequestUrlWithExtraParameter​(java.lang.String parameterName,
                                                                   java.lang.String parameterValue)
        Returns the original request URL, but with the specified parameter added or overridden.
      • getDesiredRegistrar

        protected java.util.Optional<java.lang.String> getDesiredRegistrar()
        Returns the registrar on which results should be filtered, or absent().
      • shouldBeVisible

        protected boolean shouldBeVisible​(java.util.Optional<? extends EppResource> eppResource)
      • shouldBeVisible

        protected boolean shouldBeVisible​(EppResource eppResource)
        Returns true if the EPP resource should be visible.

        This is true iff: 1. The resource is not deleted, or the request wants to see deleted items, and is authorized to do so, and: 2. The request did not specify a registrar to filter on, or the registrar matches.

      • shouldBeVisible

        protected boolean shouldBeVisible​(Registrar registrar)
        Returns true if the EPP resource should be visible.

        This is true iff: 1. The resource is not deleted, or the request wants to see deleted items, and is authorized to do so, and: 2. The request did not specify a registrar to filter on, or the registrar matches.

      • filterResourcesByVisibility

        protected <T extends EppResource> google.registry.rdap.RdapResultSet<T> filterResourcesByVisibility​(java.util.List<T> queryResult,
                                                                                                            int querySizeLimit)
      • getRequestUrlWithExtraParameter

        protected java.lang.String getRequestUrlWithExtraParameter​(java.lang.String parameterName,
                                                                   java.util.List<java.lang.String> parameterValues)
        Returns the original request URL, but with the specified parameter added or overridden.

        This version handles a list of parameter values, all associated with the same name.

        Example: If the original parameters were "a=w&a=x&b=y&c=z", and this method is called with parameterName = "b" and parameterValues of "p" and "q", the result will be "a=w&a=x&c=z&b=p&b=q". The new values of parameter "b" replace the old ones.