001    /**
002     *  Licensed to the Apache Software Foundation (ASF) under one or more
003     *  contributor license agreements.  See the NOTICE file distributed with
004     *  this work for additional information regarding copyright ownership.
005     *  The ASF licenses this file to You under the Apache License, Version 2.0
006     *  (the "License"); you may not use this file except in compliance with
007     *  the License.  You may obtain a copy of the License at
008     *
009     *     http://www.apache.org/licenses/LICENSE-2.0
010     *
011     *  Unless required by applicable law or agreed to in writing, software
012     *  distributed under the License is distributed on an "AS IS" BASIS,
013     *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
014     *  See the License for the specific language governing permissions and
015     *  limitations under the License.
016     */
017    package org.apache.geronimo.kernel.config;
018    
019    import java.io.Serializable;
020    import java.io.File;
021    import java.util.LinkedHashSet;
022    import java.util.Set;
023    
024    import org.apache.geronimo.gbean.AbstractName;
025    import org.apache.geronimo.kernel.management.State;
026    import org.apache.geronimo.kernel.repository.Artifact;
027    
028    /**
029     * 
030     * 
031     * @version $Rev: 706640 $ $Date: 2008-10-21 14:44:05 +0000 (Tue, 21 Oct 2008) $
032     */
033    public class ConfigurationInfo implements Serializable {
034        private static final long serialVersionUID = -16555213664245560L;
035        private final AbstractName storeName;
036        private final Artifact configID;
037        private final ConfigurationModuleType type;
038        private final long created;
039        private final File inPlaceLocation;
040        private final Set ownedConfigurations = new LinkedHashSet();
041        private final Set childConfigurations = new LinkedHashSet();
042        private final State state;
043        private final Artifact parentID;
044    
045        public ConfigurationInfo(AbstractName storeName, Artifact configID, ConfigurationModuleType type, long created, Set ownedConfigurations, Set childConfigurations, File inPlaceLocation) {
046            this(storeName, configID, type, created, ownedConfigurations, childConfigurations, inPlaceLocation, null, null);
047        }
048    
049        public ConfigurationInfo(AbstractName storeName, Artifact configID, ConfigurationModuleType type, long created, Set ownedConfigurations, Set childConfigurations, File inPlaceLocation, State state) {
050            this(storeName, configID, type, created, ownedConfigurations, childConfigurations, inPlaceLocation, state, null);
051        }
052    
053        public ConfigurationInfo(AbstractName storeName, Artifact configID, ConfigurationModuleType type, long created, Set ownedConfigurations, Set childConfigurations, File inPlaceLocation, State state, Artifact parentID) {
054            this.storeName = storeName;
055            this.configID = configID;
056            this.type = type;
057            this.created = created;
058            this.inPlaceLocation = inPlaceLocation;
059            if (ownedConfigurations != null) {
060                this.ownedConfigurations.addAll(ownedConfigurations);
061            }
062            if (childConfigurations != null) {
063                this.childConfigurations.addAll(childConfigurations);
064            }
065            this.state = state;
066            this.parentID = parentID;
067        }
068    
069        public AbstractName getStoreName() {
070            return storeName;
071        }
072    
073        public Artifact getConfigID() {
074            return configID;
075        }
076    
077        public ConfigurationModuleType getType() {
078            return type;
079        }
080    
081        public long getCreated() {
082            return created;
083        }
084    
085        public File getInPlaceLocation() {
086            return inPlaceLocation;
087        }
088    
089        public Set getOwnedConfigurations() {
090            return ownedConfigurations;
091        }
092    
093        public Set getChildConfigurations() {
094            return childConfigurations;
095        }
096    
097        public State getState() {
098            return state;
099        }
100    
101        public Artifact getParentID() {
102            return parentID;
103        }
104    }