Class AbstractServiceAttribute

java.lang.Object
com.sas.services.AbstractServiceAttribute
All Implemented Interfaces:
ServiceAttributeInterface, Serializable
Direct Known Subclasses:
HostAttribute, IdAttribute, IsRemotelyAccessibleAttribute, MetadataAttribute, NameValueAttribute, ServiceGroupAttribute

public class AbstractServiceAttribute extends Object implements ServiceAttributeInterface
Service attribute describing some additional criteria that may be used to distinguish services that implement the same service type(s) as specified by Java classes. Zero or more service attributes may be associated with a service that is to be accessible in the context of the Discovery service.

Each service is free to determine whether it wants to define attributes to qualify its lookup via the Discovery service. If such filtering is desired then the service implementor must define one or more classes that extend this AbstractServiceAttribute class subject to the following considerations:

  • distinguished by the implementation of the ServiceAttributeInterface interface, which is used purely as a type identifier
  • must have a default (no argument) constructor
  • no methods are allowed
  • each field of the object must be a public object reference
  • instance variables of primitive types are not permitted
  • instance variable references to object types that are static, transient, final, or not public are ignored
Since:
1.0
See Also:
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    equals(Object other)
    Determines whether the other object equals this object.
    Map<String,String>
    Gets a map, keyed by the name of the field, to its value.
    final int
    Gets a hash code for this service attribute.
    String
    Gets a summary of this attribute's fields and their values.

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait
  • Constructor Details

    • AbstractServiceAttribute

      public AbstractServiceAttribute()
  • Method Details

    • hashCode

      public final int hashCode()
      Gets a hash code for this service attribute. The hash is an XOR of all of this service's fields.
      Overrides:
      hashCode in class Object
      Returns:
      Hash code.
    • equals

      public boolean equals(Object other)
      Determines whether the other object equals this object.
      Overrides:
      equals in class Object
      Parameters:
      other - Other object.
      Returns:
      true if the objects are equivalent.
    • getFieldNameToValueMap

      public Map<String,String> getFieldNameToValueMap()
      Gets a map, keyed by the name of the field, to its value.
      Returns:
      Map keyed by the String names of a field to their values.
    • toString

      public String toString()
      Gets a summary of this attribute's fields and their values.
      Overrides:
      toString in class Object
      Returns:
      String representation of this attribute's fields and values.