Class CadfResource.Builder

  • Enclosing class:
    CadfResource

    public static class CadfResource.Builder
    extends java.lang.Object
    Builder for immutable CadfResource objects
    • Constructor Detail

      • Builder

        public Builder​(java.lang.String id,
                       ResourceType typeURI)
        Creates an instance of the CadfResource builder.
        Parameters:
        id - - String. Resource identifier.
        typeURI - - CadfEvent.ResourceType. Resource classification in the CADF taxonomy.
        See Also:
        ResourceType
    • Method Detail

      • id

        public CadfResource.Builder id​(java.lang.String id)
        Set the optional local name for the resource (not necessarily unique)
        Parameters:
        name -
        Returns:
        Builder
      • name

        public CadfResource.Builder name​(java.lang.String name)
        Set the optional local name for the resource (not necessarily unique)
        Parameters:
        name -
        Returns:
        Builder
      • host

        public CadfResource.Builder host​(java.lang.String host)
        Set the optional information about the (network) host of the resource
        Parameters:
        host -
        Returns:
        Builder
      • domain

        public CadfResource.Builder domain​(java.lang.String domain)
        Set the optional name of the domain that qualifies the name of the resource (e.g., a path name, a container name, etc.).
        Parameters:
        domain -
        Returns:
        Builder
      • credential

        public CadfResource.Builder credential​(CadfCredential cred)
        Set the optional optional security credentials associated with the resource’s identity.
        Parameters:
        cred -
        Returns:
        Builder
      • geolocationId

        public CadfResource.Builder geolocationId​(java.lang.String geolocId)
        This optional property identifies a CADF Geolocation by reference and whose definition exists outside the event record itself (e.g., within the same CADF Log or Report level). Note: This property can be used instead of the "geolocation" property to reference a valid CADF Geolocation definition, which is already defined outside the resource itself, by its identifier (e.g., a CADF Geolocation already defined at the CADF Log or Report level that also contains the CADF Resource definition). This property is required if the geolocation property is not used.
        Parameters:
        geolocId -
        Returns:
        Builder
      • geolocation

        public CadfResource.Builder geolocation​(CadfGeolocation geoloc)
        Set the property describing the geographic location of the resource using a CADF Geolocation data type. This property is required if the geolocationId property is not used.
        Parameters:
        geoloc -
        Returns:
        Builder
      • attachments

        public CadfResource.Builder attachments​(CadfAttachment[] attachments)
        An optional array of additional data containing information about the reporter or any action it performed that affected the CADF Event Record contents.
      • attachments

        public CadfResource.Builder attachments​(java.util.ArrayList<CadfAttachment> attachments)
        An optional array of additional data containing information about the reporter or any action it performed that affected the CADF Event Record contents.
      • addresses

        public CadfResource.Builder addresses​(java.util.ArrayList<CadfEndpoint> addresses)
        An optional ArrayList of descriptive addresses (including URLs) of the resource
      • build

        public CadfResource build()
        Build an immutable ReporterStep instance.
        Returns:
        ReporterStep
        Throws:
        java.lang.IllegalStateException - when the properties do not meet the specification.