cascading.property

## Class AppProps

- java.lang.Object
- - cascading.property.Props
  - - cascading.property.AppProps

-     public class AppProps
      extends Props

  Class AppProps is a fluent helper for setting various application level properties that every `Flow` may or may not be required to have set. These properties are typically passed to a Flow via a `FlowConnector`.

  New property settings that may be set in Cascading 2 are application name, version, and any tags.

  See `addTag(String)` for examples of using tags to help manage an application.

  In prior releases, the FlowConnector was responsible for setting the "application jar" class or path. Those methods have been deprecated and moved to AppProps.

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static String` | `APP_FRAMEWORKS`
    `static String` | `APP_ID`
    `static String` | `APP_JAR_CLASS`
    `static String` | `APP_JAR_PATH`
    `static String` | `APP_NAME`
    `static String` | `APP_TAGS`
    `static String` | `APP_VERSION`
    `protected Set<String>` | `frameworks`
    `protected Class` | `jarClass`
    `protected String` | `jarPath`
    `protected String` | `name`
    `protected Set<String>` | `tags`
    `protected String` | `version`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `AppProps()`
    `AppProps(String name, String version)` Sets the name and version of this application.

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `static void` | `addApplicationFramework(Map<Object,Object> properties, String framework)` Adds a framework "name:version" string to the property set and to the System properties.
    `static void` | `addApplicationTag(Map<Object,Object> properties, String tag)`
    `AppProps` | `addFramework(String framework)` Method addFramework adds a new framework name to the list of frameworks used.
    `AppProps` | `addFramework(String framework, String version)` Method addFramework adds a new framework name and its version to the list of frameworks used.
    `AppProps` | `addFrameworks(String... frameworks)` Method addFrameworks adds new framework names to the list of frameworks used.
    `protected void` | `addPropertiesTo(Properties properties)`
    `AppProps` | `addTag(String tag)` Method addTag will associate a "tag" with this application.
    `AppProps` | `addTags(String... tags)` Method addTags will associate the given "tags" with this application.
    `static AppProps` | `appProps()` Creates a new AppProps instance.
    `static String` | `getApplicationFrameworks(Map<Object,Object> properties)`
    `static String` | `getApplicationID()`
    `static String` | `getApplicationID(Map<Object,Object> properties)`
    `static Class` | `getApplicationJarClass(Map<Object,Object> properties)` Method getApplicationJarClass returns the Class set by the setApplicationJarClass method.
    `static String` | `getApplicationJarPath(Map<Object,Object> properties)` Method getApplicationJarPath return the path set by the setApplicationJarPath method.
    `static String` | `getApplicationName(Map<Object,Object> properties)`
    `static String` | `getApplicationTags(Map<Object,Object> properties)`
    `static String` | `getApplicationVersion(Map<Object,Object> properties)`
    `String` | `getFrameworks()` Method getFrameworks returns a list of frameworks used to build this App.
    `String` | `getTags()`
    `static void` | `resetAppID()` Sets the static appID value to null.
    `static void` | `setApplicationID(Map<Object,Object> properties)`
    `static void` | `setApplicationJarClass(Map<Object,Object> properties, Class type)` Method setApplicationJarClass is used to set the application jar file.
    `static void` | `setApplicationJarPath(Map<Object,Object> properties, String path)` Method setApplicationJarPath is used to set the application jar file.
    `static void` | `setApplicationName(Map<Object,Object> properties, String name)`
    `static void` | `setApplicationVersion(Map<Object,Object> properties, String version)`
    `AppProps` | `setJarClass(Class jarClass)` Method setJarClass is used to set the application jar file.
    `AppProps` | `setJarPath(String jarPath)` Method setJarPath is used to set the application jar file.
    `AppProps` | `setName(String name)` Method setName sets the application name.
    `AppProps` | `setVersion(String version)` Method setVersion sets the application version.

    - ### Methods inherited from class cascading.property.Props

      `buildProperties, buildProperties, buildProperties, buildProperties, setProperties, setProperties`

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

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

- - ### Field Detail

    - #### APP_ID

          public static final String APP_ID

      See Also:
        Constant Field Values

    - #### APP_NAME

          public static final String APP_NAME

      See Also:
        Constant Field Values

    - #### APP_VERSION

          public static final String APP_VERSION

      See Also:
        Constant Field Values

    - #### APP_TAGS

          public static final String APP_TAGS

      See Also:
        Constant Field Values

    - #### APP_FRAMEWORKS

          public static final String APP_FRAMEWORKS

      See Also:
        Constant Field Values

    - #### APP_JAR_CLASS

          public static final String APP_JAR_CLASS

      See Also:
        Constant Field Values

    - #### APP_JAR_PATH

          public static final String APP_JAR_PATH

      See Also:
        Constant Field Values

    - #### name

          protected String name

    - #### version

          protected String version

    - #### tags

          protected Set<String> tags

    - #### jarClass

          protected Class jarClass

    - #### jarPath

          protected String jarPath

    - #### frameworks

          protected Set<String> frameworks

  - ### Constructor Detail

    - #### AppProps

          public AppProps()

    - #### AppProps

          public AppProps(String name,
                  String version)

      Sets the name and version of this application.
      Parameters:
        `name` - of type String
        `version` - of type String

  - ### Method Detail

    - #### appProps

          public static AppProps appProps()

      Creates a new AppProps instance.
      Returns:
        AppProps instance

    - #### setApplicationJarClass

          public static void setApplicationJarClass(Map<Object,Object> properties,
                                    Class type)

      Method setApplicationJarClass is used to set the application jar file. All cluster executed Cascading applications need to call setApplicationJarClass(java.util.Map, Class) or `setApplicationJarPath(java.util.Map, String)`, otherwise ClassNotFound exceptions are likely.
      Parameters:
        `properties` - of type Map
        `type` - of type Class

    - #### getApplicationJarClass

          public static Class getApplicationJarClass(Map<Object,Object> properties)

      Method getApplicationJarClass returns the Class set by the setApplicationJarClass method.
      Parameters:
        `properties` - of type Map
      Returns:
        Class

    - #### setApplicationJarPath

          public static void setApplicationJarPath(Map<Object,Object> properties,
                                   String path)

      Method setApplicationJarPath is used to set the application jar file. All cluster executed Cascading applications need to call `setApplicationJarClass(java.util.Map, Class)` or setApplicationJarPath(java.util.Map, String), otherwise ClassNotFound exceptions are likely.
      Parameters:
        `properties` - of type Map
        `path` - of type String

    - #### getApplicationJarPath

          public static String getApplicationJarPath(Map<Object,Object> properties)

      Method getApplicationJarPath return the path set by the setApplicationJarPath method.
      Parameters:
        `properties` - of type Map
      Returns:
        String

    - #### setApplicationID

          public static void setApplicationID(Map<Object,Object> properties)

    - #### getApplicationID

          public static String getApplicationID(Map<Object,Object> properties)

    - #### getApplicationID

          public static String getApplicationID()

    - #### resetAppID

          public static void resetAppID()

      Sets the static appID value to null. For debugging purposes.

    - #### setApplicationName

          public static void setApplicationName(Map<Object,Object> properties,
                                String name)

    - #### getApplicationName

          public static String getApplicationName(Map<Object,Object> properties)

    - #### setApplicationVersion

          public static void setApplicationVersion(Map<Object,Object> properties,
                                   String version)

    - #### getApplicationVersion

          public static String getApplicationVersion(Map<Object,Object> properties)

    - #### addApplicationTag

          public static void addApplicationTag(Map<Object,Object> properties,
                               String tag)

    - #### getApplicationTags

          public static String getApplicationTags(Map<Object,Object> properties)

    - #### addApplicationFramework

          public static void addApplicationFramework(Map<Object,Object> properties,
                                     String framework)

      Adds a framework "name:version" string to the property set and to the System properties.

      Properties may be null. Duplicates are removed.
      Parameters:
        `properties` - may be null, additionally adds to System properties
        `framework` - "name:version" String

    - #### getApplicationFrameworks

          public static String getApplicationFrameworks(Map<Object,Object> properties)

    - #### setName

          public AppProps setName(String name)

      Method setName sets the application name.

      By default the application name is derived from the jar name (values before the version in most Maven compatible jars).
      Parameters:
        `name` - type String
      Returns:
        this

    - #### setVersion

          public AppProps setVersion(String version)

      Method setVersion sets the application version.

      By default the application version is derived from the jar name (values after the name in most Maven compatible jars).
      Parameters:
        `version` - type String
      Returns:
        this

    - #### getTags

          public String getTags()

    - #### addTag

          public AppProps addTag(String tag)

      Method addTag will associate a "tag" with this application. Applications can have an unlimited number of tags.

      Tags allow applications to be searched and organized by management tools.

      Tag values are opaque, but adopting a simple convention of 'category:value' allows for complex use cases.

      Some recommendations for categories are:

      cluster: - the cluster name the application is or should be run against. A name could be logical, like QA or PROD. project: - the project name, possibly a JIRA project name this application is managed under. org: - the group, team or organization that is responsible for the application. support: - the email address of the user who should be notified of failures or issues.

      Note that tags should not contain whitespace characters, even though this is not an error, a warning will be issues.
      Parameters:
        `tag` - type String
      Returns:
        this

    - #### addTags

          public AppProps addTags(String... tags)

      Method addTags will associate the given "tags" with this application. Applications can have an unlimited number of tags.

      Tags allow applications to be searched and organized by management tools.

      Tag values are opaque, but adopting a simple convention of 'category:value' allows for complex use cases.

      Some recommendations for categories are:

      cluster: - the cluster name the application is or should be run against. A name could be logical, like QA or PROD. project: - the project name, possibly a JIRA project name this application is managed under. org: - the group, team or organization that is responsible for the application. support: - the email address of the user who should be notified of failures or issues.

      Note that tags should not contain whitespace characters, even though this is not an error, a warning will be issues.
      Parameters:
        `tags` - type String
      Returns:
        this

    - #### getFrameworks

          public String getFrameworks()

      Method getFrameworks returns a list of frameworks used to build this App.
      Returns:
        Registered frameworks

    - #### addFramework

          public AppProps addFramework(String framework)

      Method addFramework adds a new framework name to the list of frameworks used.

      Higher level tools should register themselves, and preferably with their version, for example `foo-flow-builder:1.2.3`.

      See `addFramework(String, String)`.
      Parameters:
        `framework` - A String
      Returns:
        this AppProps instance

    - #### addFramework

          public AppProps addFramework(String framework,
                              String version)

      Method addFramework adds a new framework name and its version to the list of frameworks used.

      Higher level tools should register themselves, and preferably with their version, for example `foo-flow-builder:1.2.3`.
      Parameters:
        `framework` - A String
      Returns:
        this AppProps instance

    - #### addFrameworks

          public AppProps addFrameworks(String... frameworks)

      Method addFrameworks adds new framework names to the list of frameworks used.

      Higher level tools should register themselves, and preferably with their version, for example `foo-flow-builder:1.2.3`.
      Parameters:
        `frameworks` - Strings
      Returns:
        this AppProps instance

    - #### setJarClass

          public AppProps setJarClass(Class jarClass)

      Method setJarClass is used to set the application jar file. All cluster executed Cascading applications need to call setApplicationJarClass(java.util.Map, Class) or `setApplicationJarPath(java.util.Map, String)`, otherwise ClassNotFound exceptions are likely.
      Parameters:
        `jarClass` - of type Class

    - #### setJarPath

          public AppProps setJarPath(String jarPath)

      Method setJarPath is used to set the application jar file. All cluster executed Cascading applications need to call `setJarClass(Class)` or setJarPath(java.util.Map, String), otherwise ClassNotFound exceptions are likely.
      Parameters:
        `jarPath` - of type String

    - #### addPropertiesTo

          protected void addPropertiesTo(Properties properties)

      Specified by:
        `addPropertiesTo` in class `Props`

Copyright © 2007-2015 Concurrent, Inc. All Rights Reserved.