@Test(expected = AmbariException.class) public void testFailToReinitialize_Persisted() throws Exception { credentialStoreService.initializePersistedCredentialStore(null, null); }
public synchronized void initializePersistedCredentialStore(File credentialStoreLocation, MasterKeyService masterKeyService) throws AmbariException { if (isInitialized(CredentialStoreType.PERSISTED)) { throw new AmbariException("This persisted CredentialStore has already been initialized"); } persistedCredentialStore = new FileBasedCredentialStore(credentialStoreLocation); persistedCredentialStore.setMasterKeyService(masterKeyService); }
CredentialStoreServiceImpl implements CredentialStoreService { public synchronized void initializePersistedCredentialStore(File credentialStoreLocation, MasterKeyService masterKeyService) throws AmbariException { if (isInitialized(CredentialStoreType.PERSISTED)) { throw new AmbariException("This persisted CredentialStore has already been initialized"); } persistedCredentialStore = new FileBasedCredentialStore(credentialStoreLocation); persistedCredentialStore.setMasterKeyService(masterKeyService); } }
CredentialStoreServiceImpl implements CredentialStoreService { public synchronized void initializePersistedCredentialStore(File credentialStoreLocation, MasterKeyService masterKeyService) throws AmbariException { if (isInitialized(CredentialStoreType.PERSISTED)) { throw new AmbariException("This persisted CredentialStore has already been initialized"); } persistedCredentialStore = new FileBasedCredentialStore(credentialStoreLocation); persistedCredentialStore.setMasterKeyService(masterKeyService); } @Inject  CredentialStoreServiceImpl(Configuration configuration, SecurePasswordHelper securePasswordHelper); }
CredentialStoreServiceImpl implements CredentialStoreService { public synchronized void initializePersistedCredentialStore(File credentialStoreLocation, MasterKeyService masterKeyService) throws AmbariException { if (isInitialized(CredentialStoreType.PERSISTED)) { throw new AmbariException("This persisted CredentialStore has already been initialized"); } persistedCredentialStore = new FileBasedCredentialStore(credentialStoreLocation); persistedCredentialStore.setMasterKeyService(masterKeyService); } @Inject  CredentialStoreServiceImpl(Configuration configuration, SecurePasswordHelper securePasswordHelper); synchronized void initializeTemporaryCredentialStore(long retentionDuration, TimeUnit units, boolean activelyPurge); synchronized void initializePersistedCredentialStore(File credentialStoreLocation, MasterKeyService masterKeyService); @Override void setCredential(String clusterName, String alias, Credential credential, CredentialStoreType credentialStoreType); @Override Credential getCredential(String clusterName, String alias); @Override Credential getCredential(String clusterName, String alias, CredentialStoreType credentialStoreType); @Override void removeCredential(String clusterName, String alias); @Override void removeCredential(String clusterName, String alias, CredentialStoreType credentialStoreType); @Override boolean containsCredential(String clusterName, String alias); @Override boolean containsCredential(String clusterName, String alias, CredentialStoreType credentialStoreType); @Override CredentialStoreType getCredentialStoreType(String clusterName, String alias); @Override Map<String, CredentialStoreType> listCredentials(String clusterName); @Override synchronized boolean isInitialized(); @Override synchronized boolean isInitialized(CredentialStoreType credentialStoreType); static String canonicalizeAlias(String clusterName, String alias); static String decanonicalizeAlias(String clusterName, String canonicaizedAlias); }
CredentialStoreServiceImpl implements CredentialStoreService { public synchronized void initializePersistedCredentialStore(File credentialStoreLocation, MasterKeyService masterKeyService) throws AmbariException { if (isInitialized(CredentialStoreType.PERSISTED)) { throw new AmbariException("This persisted CredentialStore has already been initialized"); } persistedCredentialStore = new FileBasedCredentialStore(credentialStoreLocation); persistedCredentialStore.setMasterKeyService(masterKeyService); } @Inject  CredentialStoreServiceImpl(Configuration configuration, SecurePasswordHelper securePasswordHelper); synchronized void initializeTemporaryCredentialStore(long retentionDuration, TimeUnit units, boolean activelyPurge); synchronized void initializePersistedCredentialStore(File credentialStoreLocation, MasterKeyService masterKeyService); @Override void setCredential(String clusterName, String alias, Credential credential, CredentialStoreType credentialStoreType); @Override Credential getCredential(String clusterName, String alias); @Override Credential getCredential(String clusterName, String alias, CredentialStoreType credentialStoreType); @Override void removeCredential(String clusterName, String alias); @Override void removeCredential(String clusterName, String alias, CredentialStoreType credentialStoreType); @Override boolean containsCredential(String clusterName, String alias); @Override boolean containsCredential(String clusterName, String alias, CredentialStoreType credentialStoreType); @Override CredentialStoreType getCredentialStoreType(String clusterName, String alias); @Override Map<String, CredentialStoreType> listCredentials(String clusterName); @Override synchronized boolean isInitialized(); @Override synchronized boolean isInitialized(CredentialStoreType credentialStoreType); static String canonicalizeAlias(String clusterName, String alias); static String decanonicalizeAlias(String clusterName, String canonicaizedAlias);  }