*** This class provides Binary Compatibility only, not Source Compatibility ***

Class AttributeMap

java.lang.Object
java.rmi.server.RemoteObject
java.rmi.server.RemoteServer
java.rmi.server.UnicastRemoteObject
com.sas.services.util.AttributeMap
All Implemented Interfaces:
AttributeMapInterface, Serializable, Remote

@SASScope("ALL") @BinaryCompatibilityOnly public class AttributeMap extends UnicastRemoteObject implements AttributeMapInterface
Represents the name/value pairs. A name/value can be specified as a name, a name and a value, or a name and multiple values.

Name/value pairs are used by the Publish services to provide user or application control information describing the result package or entry. Name/values can be associated with a result package, or with individual entries within the result package.

Since:
1.0
See Also:
  • Field Summary

    Fields inherited from class java.rmi.server.RemoteObject

    ref
  • Constructor Summary

    Constructors
    Constructor
    Description
    Constructor.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    addAttribute(String name, String value)
    Add a value to existing name/value pair.
    static boolean
    applyFilter(String filter, AttributeMapInterface attr)
    Apply a filter string to the specified name/value pairs to determine if there is a match.
    static String
    buildValue(String[] values)
    Takes the values of a name/value pair, and builds the appropriate value String.
    String
    getAttribute(String name)
    Get the value for the specified name.
    String[]
    getAttributes(String name)
    Get all the values for the specified name.
    String[]
    Returns an array of all the names.
    parseNameValuePairs(AttributeMapInterface attrMap, String nameValuePairs)
    Parses a name/value pairs string.
    parseValues(AttributeMapInterface attrMap, String name, String values)
    Parses a name/value pairs string.
    void
    setAttribute(String name, String value)
    Set the name/value pair.

    Methods inherited from class java.rmi.server.UnicastRemoteObject

    clone, exportObject, exportObject, exportObject, exportObject, exportObject, unexportObject

    Methods inherited from class java.rmi.server.RemoteServer

    getClientHost, getLog, setLog

    Methods inherited from class java.rmi.server.RemoteObject

    equals, getRef, hashCode, toString, toStub

    Methods inherited from class java.lang.Object

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

    • AttributeMap

      public AttributeMap() throws RemoteException
      Constructor.
      Throws:
      RemoteException - if unable to export a remote object to the RMI system.
  • Method Details

    • getAttribute

      public String getAttribute(String name) throws RemoteException
      Get the value for the specified name. If there are multiple values for this name, it returns the first name that was added.

      Specified by:
      getAttribute in interface AttributeMapInterface
      Parameters:
      name - The name portion of the name/value pair.
      Returns:
      String The value.
      Throws:
      RemoteException - If a network anomaly is encountered.
    • getAttributes

      public String[] getAttributes(String name) throws RemoteException
      Get all the values for the specified name. If no values exist for this name, an empty array is returned.

      Specified by:
      getAttributes in interface AttributeMapInterface
      Parameters:
      name - The name portion of the name/value pair.
      Returns:
      String[] An array of all values for the specified name.
      Throws:
      RemoteException - If a network anomaly is encountered.
    • setAttribute

      public void setAttribute(String name, String value) throws RemoteException, IllegalArgumentException
      Set the name/value pair. Any existing value(s) will be cleared in favor of the new value.

      Specified by:
      setAttribute in interface AttributeMapInterface
      Parameters:
      name - The name portion of the name/value pair.
      value - The value portion of the name/value pair. If this value is null, any existing value(s) are removed for the name/value pair.
      Throws:
      IllegalArgumentException - If a null or blank name is specified.
      RemoteException - If a network anomaly is encountered.
    • addAttribute

      public void addAttribute(String name, String value) throws RemoteException, IllegalArgumentException
      Add a value to existing name/value pair. This value is appended to the set of any existing values for the specified name. If this name does not already exist, the behavior is the same as setAttribute(String, String). The order is preserved between addAttribute and getAttributes(String).

      Specified by:
      addAttribute in interface AttributeMapInterface
      Parameters:
      name - The name portion of the name/value pair.
      value - The value portion of the name/value pair.
      Throws:
      IllegalArgumentException - If a null or blank name is specified.
      RemoteException - If a network anomaly is encountered.
    • listAttributeNames

      public String[] listAttributeNames() throws RemoteException
      Returns an array of all the names.

      Specified by:
      listAttributeNames in interface AttributeMapInterface
      Returns:
      Set An array of all the names.
      Throws:
      RemoteException - If a network anomaly is encountered.
    • parseNameValuePairs

      public static AttributeMapInterface parseNameValuePairs(AttributeMapInterface attrMap, String nameValuePairs) throws ParseException
      Parses a name/value pairs string. The parsed name/values are returned in a AttributeMapInterface object.

      Parameters:
      attrMap - The AttributeMapInterface to continue to build with the parsed name/value pairs. This may be null. If null, a new attribute map will be created and returned. If not null, the existing map will be updated and returned.
      nameValuePairs - The name/value string to parse.
      Returns:
      AttributeMapInterface The name/value pairs attribute map.
      Throws:
      ParseException - If an error occurs during parsing.
    • parseValues

      public static AttributeMapInterface parseValues(AttributeMapInterface attrMap, String name, String values) throws ParseException
      Parses a name/value pairs string. The parsed name/values are returned in a AttributeMapInterface object.

      Parameters:
      attrMap - The AttributeMapInterface to continue to build with the parsed name/value pairs. This may be null. If null, a new attribute map will be created and returned. If not null, the existing map will be updated and returned.
      name - The name to parse.
      values - Values to be parsed.
      Returns:
      Map of attributes.
      Throws:
      ParseException - If an error occurs during parsing.
    • buildValue

      public static String buildValue(String[] values) throws ParseException
      Takes the values of a name/value pair, and builds the appropriate value String. Single values that contain spaces will quoted. For example, "single value with spaces". The constructed String will contain the quotes. Multi-valued name/value specifications will be surrounded in parenthesis, and values will be comma-separated. For example, (value1, "value 2", value3, ...valueN).

      Parameters:
      values - The array of values for this name/value specification
      Returns:
      String The constructed values string. This may be null.
      Throws:
      ParseException - If an error is encountered building the value string.
    • applyFilter

      public static boolean applyFilter(String filter, AttributeMapInterface attr) throws ParseException
      Apply a filter string to the specified name/value pairs to determine if there is a match.

      Parameters:
      filter - Filter to be applied.
      attr - Map of attributes.
      Returns:
      boolean Returns true if the name/value filter matches the name/value pair specification; otherwise if there is not match, false is returned.
      Throws:
      ParseException - If an error occurs parsing the name/value filter.