Class SetHostAuthorizations

java.lang.Object
com.uc4.communication.requests.XMLRequest
com.uc4.communication.requests.SetHostAuthorizations

public class SetHostAuthorizations extends XMLRequest
Sets the authorizations of one or many hosts in one request.
  • Constructor Details

    • SetHostAuthorizations

      public SetHostAuthorizations(String hostnameFilter, int client, boolean read, boolean write, boolean execute)
      Sets the specified authorizations for all hosts that match the filter.
      Parameters:
      hostnameFilter - Name of the host, can include the wildcards * and ?
      client - UC4 client
      read - true if read access should be permitted
      write - true if write access should be permitted
      execute - true if execute access should be permitted
  • Method Details

    • createRequest

      protected void createRequest(com.uc4.util.XMLDocument doc, Element request, ConnectionAttributes sessionInfo)
      Description copied from class: XMLRequest
      Creates the XML Document for the request. This method is used internally.
      Specified by:
      createRequest in class XMLRequest
      Parameters:
      doc - Document, used to create new Elements
      request - Request Element - classes append information to this request element
      sessionInfo - Information about the session
    • handleContent

      protected void handleContent(com.uc4.util.XMLDocument doc, ConnectionAttributes session)
      Description copied from class: XMLRequest
      Sub classes extract the values from the XML document and provide public getter methods.
      Overrides:
      handleContent in class XMLRequest
      Parameters:
      doc - XML Document
      session - Info about the user session
    • getUpdateCount

      public int getUpdateCount()
      Returns:
      Number of successfully modified hosts
    • getFailedCount

      public int getFailedCount()
      Returns:
      Number of hosts that where not changed
    • changedIterator

      Returns an Iterator that can be used to read a list of successful modified host names.
      Returns:
      Iterator over SetHostAuthorizations.ModificationStatus
    • failedIterator

      Returns an Iterator that can be used to read a list of host names that where not modified. Each returned instance of SetHostAuthorizations.ModificationStatus contains a getMessage() method that returns the reason for failure.
      Returns:
      Iterator over SetHostAuthorizations.ModificationStatus
    • getSrc

      protected String getSrc()
      Description copied from class: XMLRequest
      Returns the request source. This method is used internally.
      Specified by:
      getSrc in class XMLRequest
      Returns:
      Source
    • isAllowedInClientZero

      protected boolean isAllowedInClientZero()
      Description copied from class: XMLRequest
      This method is used internally. Tests if this XMLRequest is allowed in client 0. The default implementation returns false, subclasses may override.
      Overrides:
      isAllowedInClientZero in class XMLRequest
      Returns:
      true if this request is allowed in client 0, false otherwise