Implementing the Instagram client

With our new module created, we need to create three specific items to fulfill the contract provided by the Sunago API module. We need SocialMediaPreferencesController, SocialMediaClient, and SocialMediaItem.

Our SocialMediaPreferencesController instance is InstagramPreferencesController. It has the same getTab() method required by the interface, which is as follows:

    public Tab getTab() { 
      if (tab == null) { 
        tab = new Tab(); 
        tab.setText("Instagram"); 
        tab.setContent(getNode()); 
      } 
 
      return tab; 
    } 
 
    private Node getNode() { 
      Node node = instagram.isAuthenticated() 
        ? buildConfigurationUI() : buildConnectUI(); 
      return node; 
    } 

To save time and space, for this example, we've left the Instagram implementation much more ...

Get Java 9: Building Robust Modular Applications now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.