org.apache.brooklyn.entity.brooklynnode.BrooklynCluster Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of brooklyn-software-base Show documentation
Show all versions of brooklyn-software-base Show documentation
Base classes for Brooklyn software process entities
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you 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.apache.brooklyn.entity.brooklynnode;
import java.util.Map;
import org.apache.brooklyn.api.effector.Effector;
import org.apache.brooklyn.api.entity.EntitySpec;
import org.apache.brooklyn.api.entity.ImplementedBy;
import org.apache.brooklyn.api.sensor.AttributeSensor;
import org.apache.brooklyn.config.ConfigKey;
import org.apache.brooklyn.core.config.ConfigKeys;
import org.apache.brooklyn.core.effector.Effectors;
import org.apache.brooklyn.core.sensor.Sensors;
import org.apache.brooklyn.entity.brooklynnode.effector.BrooklynNodeUpgradeEffectorBody;
import org.apache.brooklyn.entity.group.DynamicCluster;
@ImplementedBy(BrooklynClusterImpl.class)
public interface BrooklynCluster extends DynamicCluster {
ConfigKey> MEMBER_SPEC = ConfigKeys.newConfigKeyWithDefault(DynamicCluster.MEMBER_SPEC,
EntitySpec.create(BrooklynNode.class));
AttributeSensor MASTER_NODE = Sensors.newSensor(
BrooklynNode.class, "brooklyncluster.master", "Pointer to the child node with MASTER state in the cluster");
interface SelectMasterEffector {
ConfigKey NEW_MASTER_ID = ConfigKeys.newStringConfigKey(
"brooklyncluster.new_master_id", "The ID of the node to become master", null);
Effector SELECT_MASTER = Effectors.effector(Void.class, "selectMaster")
.description("Select a new master in the cluster")
.parameter(NEW_MASTER_ID)
.buildAbstract();
}
Effector SELECT_MASTER = SelectMasterEffector.SELECT_MASTER;
interface UpgradeClusterEffector {
ConfigKey DOWNLOAD_URL = BrooklynNode.DOWNLOAD_URL.getConfigKey();
ConfigKey