1 /** 2 * 3 * Copyright 2004 The Apache Software Foundation 4 * 5 * Licensed under the Apache License, Version 2.0 (the "License"); 6 * you may not use this file except in compliance with the License. 7 * You may obtain a copy of the License at 8 * 9 * http://www.apache.org/licenses/LICENSE-2.0 10 * 11 * Unless required by applicable law or agreed to in writing, software 12 * distributed under the License is distributed on an "AS IS" BASIS, 13 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 * See the License for the specific language governing permissions and 15 * limitations under the License. 16 */ 17 package org.apache.geronimo.kernel.config; 18 19 import java.io.Serializable; 20 import java.io.File; 21 import java.util.LinkedHashSet; 22 import java.util.Set; 23 24 import org.apache.geronimo.gbean.AbstractName; 25 import org.apache.geronimo.kernel.management.State; 26 import org.apache.geronimo.kernel.repository.Artifact; 27 28 /** 29 * 30 * 31 * @version $Rev: 398278 $ $Date: 2006-04-29 20:44:14 -0700 (Sat, 29 Apr 2006) $ 32 */ 33 public class ConfigurationInfo implements Serializable { 34 private static final long serialVersionUID = -16555213664245560L; 35 private final AbstractName storeName; 36 private final Artifact configID; 37 private final ConfigurationModuleType type; 38 private final long created; 39 private final File inPlaceLocation; 40 private final Set ownedConfigurations = new LinkedHashSet(); 41 private final Set childConfigurations = new LinkedHashSet(); 42 private final State state; 43 private final Artifact parentID; 44 45 public ConfigurationInfo(AbstractName storeName, Artifact configID, ConfigurationModuleType type, long created, Set ownedConfigurations, Set childConfigurations, File inPlaceLocation) { 46 this(storeName, configID, type, created, ownedConfigurations, childConfigurations, inPlaceLocation, null, null); 47 } 48 49 public ConfigurationInfo(AbstractName storeName, Artifact configID, ConfigurationModuleType type, long created, Set ownedConfigurations, Set childConfigurations, File inPlaceLocation, State state) { 50 this(storeName, configID, type, created, ownedConfigurations, childConfigurations, inPlaceLocation, state, null); 51 } 52 53 public ConfigurationInfo(AbstractName storeName, Artifact configID, ConfigurationModuleType type, long created, Set ownedConfigurations, Set childConfigurations, File inPlaceLocation, State state, Artifact parentID) { 54 this.storeName = storeName; 55 this.configID = configID; 56 this.type = type; 57 this.created = created; 58 this.inPlaceLocation = inPlaceLocation; 59 if (ownedConfigurations != null) { 60 this.ownedConfigurations.addAll(ownedConfigurations); 61 } 62 if (childConfigurations != null) { 63 this.childConfigurations.addAll(childConfigurations); 64 } 65 this.state = state; 66 this.parentID = parentID; 67 } 68 69 public AbstractName getStoreName() { 70 return storeName; 71 } 72 73 public Artifact getConfigID() { 74 return configID; 75 } 76 77 public ConfigurationModuleType getType() { 78 return type; 79 } 80 81 public long getCreated() { 82 return created; 83 } 84 85 public File getInPlaceLocation() { 86 return inPlaceLocation; 87 } 88 89 public Set getOwnedConfigurations() { 90 return ownedConfigurations; 91 } 92 93 public Set getChildConfigurations() { 94 return childConfigurations; 95 } 96 97 public State getState() { 98 return state; 99 } 100 101 public Artifact getParentID() { 102 return parentID; 103 } 104 }