Search in sources :

Example 1 with KeyStoreExporter

use of com.emc.storageos.security.keystore.KeyStoreExporter in project coprhd-controller by CoprHD.

the class StorageOsPlugin method onApplicationStart.

/**
 * Called at application start (and at each reloading) Time to start stateful things.
 */
@Override
public void onApplicationStart() {
    // NOSONAR
    instance = this;
    // ("Suppressing Sonar violation of Lazy initialization of static fields should be synchronized for field instance")
    if (!isEnabled()) {
        return;
    }
    try {
        Logger.info("Connecting to Coordinator Service");
        // To using Spring profile feature
        context = new GenericXmlApplicationContext();
        context.getEnvironment().setActiveProfiles(System.getProperty("buildType"));
        context.load(getContextFiles());
        context.refresh();
        Logger.info("Connected to Coordinator Service");
        zkConnection = getBean("zkconn", ZkConnection.class);
        coordinatorClient = getBean("coordinator", CoordinatorClient.class);
        encryptionProvider = getBean("encryptionProvider", EncryptionProvider.class);
        authSvcEndPointLocator = getBean("authSvcEndpointLocator", AuthSvcEndPointLocator.class);
        Validator.setAuthSvcEndPointLocator(authSvcEndPointLocator);
        Validator.setCoordinator(coordinatorClient);
        // need reference to local-security-conf.xml to load this
        Validator.setStorageOSUserRepository(null);
        coordinatorClient.start();
        encryptionProvider.start();
        Logger.info("Started ViPR connection, version: %s", version);
        KeyStoreExporter keystoreExporter = getBean("keystoreExporter", KeyStoreExporter.class);
        keystoreExporter.export();
        // register node listener for catalog acl change
        coordinatorClient.addNodeListener(new CatalogAclListener());
        Logger.info("added CatalogAclListener");
    } catch (Exception e) {
        Logger.error(e, "Error initializing ViPR Connection");
        shutdown();
    }
}
Also used : AuthSvcEndPointLocator(com.emc.storageos.security.authentication.AuthSvcEndPointLocator) KeyStoreExporter(com.emc.storageos.security.keystore.KeyStoreExporter) CoordinatorClient(com.emc.storageos.coordinator.client.service.CoordinatorClient) CatalogAclListener(controllers.util.CatalogAclListener) EncryptionProvider(com.emc.storageos.db.client.model.EncryptionProvider) GenericXmlApplicationContext(org.springframework.context.support.GenericXmlApplicationContext) ZkConnection(com.emc.storageos.coordinator.common.impl.ZkConnection)

Example 2 with KeyStoreExporter

use of com.emc.storageos.security.keystore.KeyStoreExporter in project coprhd-controller by CoprHD.

the class KeystoreCmdHandler method exportKeystore.

/**
 * Export the ViPR keystore to local file in JKS format
 */
public void exportKeystore() throws Exception {
    KeyStoreExporter exporter = (KeyStoreExporter) ctx.getBean("keystoreExporter");
    exporter.export();
}
Also used : KeyStoreExporter(com.emc.storageos.security.keystore.KeyStoreExporter)

Aggregations

KeyStoreExporter (com.emc.storageos.security.keystore.KeyStoreExporter)2 CoordinatorClient (com.emc.storageos.coordinator.client.service.CoordinatorClient)1 ZkConnection (com.emc.storageos.coordinator.common.impl.ZkConnection)1 EncryptionProvider (com.emc.storageos.db.client.model.EncryptionProvider)1 AuthSvcEndPointLocator (com.emc.storageos.security.authentication.AuthSvcEndPointLocator)1 CatalogAclListener (controllers.util.CatalogAclListener)1 GenericXmlApplicationContext (org.springframework.context.support.GenericXmlApplicationContext)1