com.sun.grid.jgdi.util.shell.editor

## Class GEObjectEditor

- java.lang.Object
- - com.sun.grid.jgdi.util.shell.editor.GEObjectEditor

-     public class GEObjectEditor
      extends java.lang.Object

  GEObject editor is a class for editing any GEObject based on text. This text will be parsed. If it's format is valid atrributes that were provided will be updated based on the values next to the attribute. Less coding when creating a new GeObject: `ClusterQueue geObj = new ClusterQueue(true); GEObjectEditor.updateObjectWithText(jgdi, geObj, "name test\n acl user1 user2\n xacl user3"); or GEObjectEditor.updateObjectWithText(geObj, "name test\n acl user1 user2\n xacl user3"); jgdi.addClusterQueue(geObj);` Only difference between these methods is that whenJGDI reference is passed attributes are checked if they are known to Grid Engine and their structure is more advaced, they are retrived. Such as can have ... While when not passing JGDI reference, new Objects are created with default values. This can lead to unexpected behaviour when you try to update already existing object or even create a new one. RECOMMENDED IS TO USE `updateObjectWithText(JGDI jgdi, GEObject obj, String text)` method. Modifying existing GEObjects: `ClusterQueue geObj = jgdi.getClusterQueue("test"); GEObjectEditor.updateObjectWithText(jgdi, geObj, "xacl user4"); jgdi.updateClusterQueue(geObj);`

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `GEObjectEditor()`

  - ### Method Summary

    All Methods Static Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `static java.lang.String` | `getAllPropertiesAsText(GEObject obj)` Retrives all properties known to JGDI for specified GEObject as text.
    `static java.lang.String` | `getConfigurablePropertiesAsText(GEObject obj)` Retrives configurable properties for specified GEObject as text.
    `static java.lang.String` | `getPropertiesAsText(GEObject obj, int propScope)`
    `static java.lang.String` | `getPropertyAsText(GEObject obj, int propScope, java.lang.String propName)`
    `static java.lang.String` | `getReadOnlyPropertiesAsText(GEObject obj)` Retrives read-only properties for specified GEObject as text.
    `static void` | `main(java.lang.String[] args)`
    `static <T extends GEObject> T` | `updateObjectWithText(JGDI jgdi, T obj, java.lang.String text)` Updates GEObject based on the text.
    `static <T extends GEObject> T` | `updateObjectWithText(T obj, java.lang.String text)` Updates GEObject based on the text.

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

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

- - ### Constructor Detail

    - #### GEObjectEditor

          public GEObjectEditor()

  - ### Method Detail

    - #### updateObjectWithText

          public static <T extends GEObject> T updateObjectWithText(T obj,
                                                                    java.lang.String text)

      Updates GEObject based on the text. Text is parsed and if correct, object is updated. Creates new objects where necessary, based on values provided in text, therefore it is recommended to use method `updateObjectWithText(JGDI jgdi, GEObject obj, String text)` that retrieves these objects from Grid Engine instead.

    - #### updateObjectWithText

          public static <T extends GEObject> T updateObjectWithText(JGDI jgdi,
                                                                    T obj,
                                                                    java.lang.String text)

      Updates GEObject based on the text. Text is parsed and if correct, object is updated. Retrives objects from Grid Engine where necessary. Recommended method.

    - #### getAllPropertiesAsText

          public static java.lang.String getAllPropertiesAsText(GEObject obj)

      Retrives all properties known to JGDI for specified GEObject as text. Each property on one line.

    - #### getConfigurablePropertiesAsText

          public static java.lang.String getConfigurablePropertiesAsText(GEObject obj)

      Retrives configurable properties for specified GEObject as text. Each property on one line.

    - #### getReadOnlyPropertiesAsText

          public static java.lang.String getReadOnlyPropertiesAsText(GEObject obj)

      Retrives read-only properties for specified GEObject as text. Each property on one line.

    - #### getPropertiesAsText

          public static java.lang.String getPropertiesAsText(GEObject obj,
                                                             int propScope)

    - #### getPropertyAsText

          public static java.lang.String getPropertyAsText(GEObject obj,
                                                           int propScope,
                                                           java.lang.String propName)
                                                    throws JGDIException

      Throws:
        `JGDIException`

    - #### main

          public static void main(java.lang.String[] args)

Copyright © 2007 Sun Microsystems, Inc. All rights reserved.