org.licas.service.model

## Class AddressInfo

- java.lang.Object
- - org.licas.service.model.AddressInfo

-     public class AddressInfo
      extends java.lang.Object

  This class stores information for a single service address, including passwords. It is not used by the calling mechanism inherently, but might be useful for a service wishing to store related addresses, such as the messenger service.
  Author:
    Kieran Greer

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `java.lang.String` | `description` Arbitrary description for the address
    `java.lang.String` | `imagePath` Optional file path for an image to display
    `java.lang.String` | `serverPassword` Password to access the server
    `java.lang.String` | `serverURL` URL address of the server the service runs on
    `java.lang.String` | `serviceAdminKey` Admin key to access the service
    `java.lang.String` | `serviceID` Unique service ID
    `java.lang.String` | `servicePassword` Password to access the service

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `AddressInfo()` Create a new instance of AddressInfo

  - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `static java.lang.String` | `idFromKey(java.lang.String serviceKey)` Parse the service key to retrieve the service id only.
    `boolean` | `isComplete()` Return true if the entry is complete.
    `org.licas_xml.abs.Element` | `serverAddress()` Construct and return the base server address as an XML-based description, including the server ip address and default `Const`.`HTTPSERVER` name.
    `org.licas_xml.abs.Element` | `serviceAddress()` Construct and return the service address as an XML-based description, including the server ip address.
    `java.lang.String` | `serviceKey()` Construct and return the service key value that should be a unique URI across servers.
    `static java.lang.String` | `serviceKey(java.lang.String thisServerURL, java.lang.String thisServiceID)` Construct and return the service key value that should be a unique URI across servers.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Field Detail

    - #### serviceID

          public java.lang.String serviceID

      Unique service ID

    - #### servicePassword

          public java.lang.String servicePassword

      Password to access the service

    - #### serviceAdminKey

          public java.lang.String serviceAdminKey

      Admin key to access the service

    - #### serverURL

          public java.lang.String serverURL

      URL address of the server the service runs on

    - #### serverPassword

          public java.lang.String serverPassword

      Password to access the server

    - #### imagePath

          public java.lang.String imagePath

      Optional file path for an image to display

    - #### description

          public java.lang.String description

      Arbitrary description for the address

  - ### Constructor Detail

    - #### AddressInfo

          public AddressInfo()

      Create a new instance of AddressInfo

  - ### Method Detail

    - #### isComplete

          public boolean isComplete()

      Return true if the entry is complete.
      Returns:
        true if there are no null values.

    - #### serviceKey

          public java.lang.String serviceKey()
                                      throws java.lang.Exception

      Construct and return the service key value that should be a unique URI across servers. It contains the full service handle (ip address plus service ID) as a string.
      Returns:
        the service key value, to be used as a unique identifier.
      Throws:
        `java.lang.Exception` - any error.

    - #### serviceAddress

          public org.licas_xml.abs.Element serviceAddress()

      Construct and return the service address as an XML-based description, including the server ip address.
      Returns:
        the service address as constructed by `Handle`.

    - #### serverAddress

          public org.licas_xml.abs.Element serverAddress()

      Construct and return the base server address as an XML-based description, including the server ip address and default `Const`.`HTTPSERVER` name.
      Returns:
        the server address as constructed by `Handle`.

    - #### idFromKey

          public static java.lang.String idFromKey(java.lang.String serviceKey)
                                            throws java.lang.Exception

      Parse the service key to retrieve the service id only.
      Parameters:
        `serviceKey` - the full URI service key, as constructed by `serviceKey()`.
      Returns:
        the service id value only.
      Throws:
        `java.lang.Exception` - any error.

    - #### serviceKey

          public static java.lang.String serviceKey(java.lang.String thisServerURL,
                                                    java.lang.String thisServiceID)
                                             throws java.lang.Exception

      Construct and return the service key value that should be a unique URI across servers. It contains the full service handle (ip address plus service ID) as a string.
      Parameters:
        `thisServerURL` - the server url address to use `(http://ip/port)`.
        `thisServiceID` - the service uuid.
      Returns:
        the service key value, to be used as a unique identifier.
      Throws:
        `java.lang.Exception` - any error.