Class ServiceDescriptor

java.lang.Object
chemaxon.marvin.services.ServiceDescriptor
Direct Known Subclasses:
HTTPServiceDescriptor, JsonServiceDescriptor, LocalServiceDescriptor, SoapServiceDescriptor, XMLRPCServiceDescriptor

@PublicApi public abstract class ServiceDescriptor extends Object
Descriptor class for marvin services
Since:
5.6
  • Field Details

  • Constructor Details

    • ServiceDescriptor

      protected ServiceDescriptor()
      Subclasses must have public argless constructor.
  • Method Details

    • setProperty

      public void setProperty(String key, String value)
      Sets a descriptor property
      Parameters:
      key - the property key
      value - the property value
    • getProperty

      public String getProperty(String key)
      Returns a descriptor property
      Parameters:
      key - the property key
      Returns:
      the property value or null
    • getPropertyKeys

      public String[] getPropertyKeys()
      Returns the array of property keys
      Returns:
      the array of property keys
    • getName

      public String getName()
      Returns the name of the service
      Returns:
      the name of the service
    • setName

      public void setName(String name)
      Sets the name of the service
      Parameters:
      name - the new service name
    • getAlias

      public String getAlias()
      Returns the service alias. Aliases may be used to call services in a user friendly way by parsing user input.
      Returns:
      the service alias or null if no alias set
    • setAlias

      public void setAlias(String alias)
      Sets the service alias. Aliases may be used to call services in a user friendly way by parsing user input.
      Parameters:
      alias - the new alias
    • getURL

      public String getURL()
      Returns the service URL
      Returns:
      the service URL
    • setURL

      public void setURL(String url)
      Sets the service URL
      Parameters:
      url - the service URL
    • getMethodName

      public String getMethodName()
      Returns the method name to call
      Returns:
      the method name to call
    • setMethodName

      public void setMethodName(String methodName)
      Sets the method name to call
      Parameters:
      methodName - the method name
    • getPropertyChangeSupport

      public PropertyChangeSupport getPropertyChangeSupport()
      Returns the property change support for this object
      Returns:
      the property change support for this object
    • getArguments

      public List<ServiceArgument<?>> getArguments()
      Returns an unmodifiable list of the argument types
      Returns:
      an unmodifiable list of the argument types
    • getArgumentCount

      public int getArgumentCount()
      Returns the number of arguments
      Returns:
      the number of arguments
    • getArgument

      public ServiceArgument<?> getArgument(int index)
      Returns the type of the specified argument
      Parameters:
      index - the index of the argument
      Returns:
      the type of index-th argument
    • addArgument

      public void addArgument(ServiceArgument<?> argument)
      Adds a new argument to the end of the argument list
      Parameters:
      argument - the argument
    • setArgument

      public void setArgument(int index, ServiceArgument<?> argument)
      Replaces the argument at specified index with specified argument
      Parameters:
      index - the index of argument to replace
      argument - the new argument
    • removeArgument

      public ServiceArgument<?> removeArgument(int index)
      Removes the specified argument from the argument list
      Parameters:
      index - the index of argument to remove
      Returns:
      the removed argument type
    • getIcon

      public Icon getIcon()
      Returns the icon of service descriptor or null if no icon
      Returns:
      the icon of service descriptor or null if no icon
    • setDescription

      public void setDescription(String description)
      Sets the description (tooltip) of service descriptor
      Parameters:
      description - the new description
    • getDescription

      public String getDescription()
      Returns the description (tooltip) of service descriptor
      Returns:
      the description (tooltip) of service descriptor
    • getSimpleName

      public String getSimpleName()
      Returns the simple name of the service type
      Returns:
      the simple name of the service type
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • isAvailable

      public boolean isAvailable()
      Returns true if service is available. Default implementation returns true
      Returns:
      true if service is available
    • getServiceHandler

      public ServiceHandler<? extends ServiceDescriptor> getServiceHandler()
      Returns the default service handler instance for this descriptor. The returned handler is capable to perform service call on the service described by this descriptor
      Returns:
      a service handler instance for this descriptor
    • createServiceHandler

      public abstract ServiceHandler<? extends ServiceDescriptor> createServiceHandler()
      Creates a new service handler for this descriptor. The returned handler is capable to perform service call on the service described by this descriptor
      Returns:
      a service handler instance for this descriptor