Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
import org.wso2.carbon.governance.api.util.GovernanceUtils;

Registry governanceRegistry = GovernanceUtils.getGovernanceUserRegistry(rootRegistry, username); //rootRegistry refers to an instance of RemoteRegistry or WSRegistryServiceClient

For optimum performance at the client-side, it is also useful to enable client-side caching.

Code Block
import org.wso2.carbon.governance.api.cache.ArtifactCacheManager;

ArtifactCacheManager.enableClientCache();

As a specific example, Governance Registry can be obtained via Remote Registry as shown below. See also Accessing Registry Remotely through API.

...