private CredentialStore getCredentialStore(CredentialStoreType credentialStoreType) {
    if (CredentialStoreType.PERSISTED == credentialStoreType) {
      return persistedCredentialStore;
    } else if (CredentialStoreType.TEMPORARY == credentialStoreType) {
      return temporaryCredentialStore;
    } else {
      throw new IllegalArgumentException("Invalid or unexpected credential store type specified");
    }
  }
Gets either the persisted or temporary CredentialStore as requested

@param credentialStoreType a CredentialStoreType indicating which credential store facility to use
@return a CredentialStore implementation
ambari-server/src/main/java/org/apache/ambari/server/security/encryption/CredentialStoreServiceImpl.java