
package org.hawkular.agent.monitor.extension;

import java.util.Arrays;
import java.util.Collection;
import java.util.List;

import org.jboss.as.controller.AttributeDefinition;
import org.jboss.as.controller.PathElement;
import org.jboss.as.controller.PersistentResourceDefinition;
import org.jboss.as.controller.registry.OperationEntry.Flag;

public class PlatformDefinition extends PersistentResourceDefinition {

    public static final PlatformDefinition INSTANCE = new PlatformDefinition();

    static final String PLATFORM = "platform";

    private PlatformDefinition() {
        super(PathElement.pathElement(PLATFORM, "default"),
                SubsystemExtension.getResourceDescriptionResolver(PLATFORM),
                PlatformAdd.INSTANCE,
                PlatformRemove.INSTANCE,
                Flag.RESTART_RESOURCE_SERVICES,
                Flag.RESTART_RESOURCE_SERVICES);
    }

    @Override
    public Collection<AttributeDefinition> getAttributes() {
        return Arrays.asList(PlatformAttributes.ATTRIBUTES);
    }

    @Override
    protected List<? extends PersistentResourceDefinition> getChildren() {
        return Arrays.asList(FileStoresDefinition.INSTANCE, MemoryDefinition.INSTANCE, ProcessorsDefinition.INSTANCE,
                PowerSourcesDefinition.INSTANCE);
    }
}
