Uploaded image for project: 'Tools (JBoss Tools)'
  1. Tools (JBoss Tools)
  2. JBIDE-10261

Remove (internal) information duplication in the OpenShift client library

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Obsolete
    • Icon: Major Major
    • 3.3.0.Beta3
    • 3.3.0.M4
    • openshift
    • None

      Rework on the OpenShift client library to avoid duplicate and potentially out-of-sync layers of Objects on the client side, while still being able to lazyly load the data from OpenShift when they are queried:

      Code sample :

      public String getRhlogin() throws OpenShiftException {
        if (rhlogin == null) {
          refresh();
        }
        return rhlogin;
      }
       
      public void refresh() throws OpenShiftException {
        UserInfo userInfo = service.getUserInfo(this);
        this.uuid = userInfo.getUuid();
        this.namespace = userInfo.getNamespace();
        this.rhcDomain = userInfo.getRhcDomain();
        this.sshKey = userInfo.getSshPublicKey();
        this.domain = new Domain(
          this.namespace
          , this.rhcDomain
          , this
          , service);
        this.applications = null;
      }
      
      

      Idem for the list of applications, perhaps using a custom ApplicationList (extends List<Application>) instance which would maintain an internal state value (initialized : boolean), and that would be able to call the OpenShift service when necessary (a bit in the Hibernate way of managing lazy containers)

            adietish@redhat.com André Dietisheim
            xcoulon@redhat.com Xavier Coulon
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved: