Skip to content
This repository has been archived by the owner on Jul 11, 2022. It is now read-only.

Commit

Permalink
[BZ 1234991] add support for fetching storage cluster settings from r…
Browse files Browse the repository at this point in the history
…emote API

Cluster settings that are exposed in the UI, including replication factor, can
now be fetched from a remote Java client such as the CLI.
  • Loading branch information
John Sanda committed Nov 20, 2015
1 parent ce430d3 commit ce28825
Show file tree
Hide file tree
Showing 5 changed files with 41 additions and 4 deletions.
Expand Up @@ -50,6 +50,7 @@
import org.rhq.enterprise.server.resource.group.definition.GroupDefinitionManagerRemote;
import org.rhq.enterprise.server.resource.metadata.PluginManagerRemote;
import org.rhq.enterprise.server.search.SavedSearchManagerRemote;
import org.rhq.enterprise.server.storage.StorageClusterSettingsManagerRemote;
import org.rhq.enterprise.server.support.SupportManagerRemote;
import org.rhq.enterprise.server.sync.SynchronizationManagerRemote;
import org.rhq.enterprise.server.system.SystemManagerRemote;
Expand Down Expand Up @@ -105,7 +106,9 @@ public enum RhqManager {
SystemManager(SystemManagerRemote.class, "${SystemManager}"), //
RemoteInstallManager(RemoteInstallManagerRemote.class, "${RemoteInstallManager}"), //
TagManager(TagManagerRemote.class, "${TagManager}"), //
SynchronizationManager(SynchronizationManagerRemote.class, "${SynchronizationManager}");
SynchronizationManager(SynchronizationManagerRemote.class, "${SynchronizationManager}"),

StorageClusterSettingsManager(StorageClusterSettingsManagerRemote.class, "${StorageClusterSettingsManager}");

private Class<?> remote;
private String localInterfaceClassName;
Expand Down
Expand Up @@ -28,6 +28,7 @@
import org.rhq.enterprise.server.resource.group.ResourceGroupManagerRemote;
import org.rhq.enterprise.server.resource.group.definition.GroupDefinitionManagerRemote;
import org.rhq.enterprise.server.search.SavedSearchManagerRemote;
import org.rhq.enterprise.server.storage.StorageClusterSettingsManagerRemote;
import org.rhq.enterprise.server.support.SupportManagerRemote;
import org.rhq.enterprise.server.sync.SynchronizationManagerRemote;
import org.rhq.enterprise.server.system.SystemManagerRemote;
Expand Down Expand Up @@ -65,6 +66,7 @@ public enum RhqManagers {
ResourceTypeManager(ResourceTypeManagerRemote.class, "${ResourceTypeManager}"), //
RoleManager(RoleManagerRemote.class, "${RoleManager}"), //
SavedSearchManager(SavedSearchManagerRemote.class, "${SavedSearchManager}"), //
StorageClusterSettingsManager(StorageClusterSettingsManagerRemote.class, "${StorageClusterSettingsManager}"), //
StorageNodeManager(StorageNodeManagerRemote.class, "${StorageNodeManager}"), //
SubjectManager(SubjectManagerRemote.class, "${SubjectManager}"), //
SupportManager(SupportManagerRemote.class, "${SupportManager}"), //
Expand Down
Expand Up @@ -18,7 +18,8 @@
* @author John Sanda
*/
@Stateless
public class StorageClusterSettingsManagerBean implements StorageClusterSettingsManagerLocal {
public class StorageClusterSettingsManagerBean implements StorageClusterSettingsManagerLocal,
StorageClusterSettingsManagerRemote {

private static final String UPDATE_PASSWORD_QUERY = "ALTER USER '%s' WITH PASSWORD '%s'";

Expand Down
Expand Up @@ -9,8 +9,7 @@
* @author John Sanda
*/
@Local
public interface StorageClusterSettingsManagerLocal {
StorageClusterSettings getClusterSettings(Subject subject);
public interface StorageClusterSettingsManagerLocal extends StorageClusterSettingsManagerRemote {

void setClusterSettings(Subject subject, StorageClusterSettings clusterSettings);
}
@@ -0,0 +1,32 @@
/*
* Copyright 2015 Red Hat, Inc. and/or its affiliates
* and other contributors as indicated by the @author tags.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.rhq.enterprise.server.storage;

import javax.ejb.Remote;

import org.rhq.core.domain.auth.Subject;
import org.rhq.core.domain.cloud.StorageClusterSettings;

/**
* @author jsanda
*/
@Remote
public interface StorageClusterSettingsManagerRemote {

StorageClusterSettings getClusterSettings(Subject subject);

}

0 comments on commit ce28825

Please sign in to comment.