001: /*
002: * BEGIN_HEADER - DO NOT EDIT
003: *
004: * The contents of this file are subject to the terms
005: * of the Common Development and Distribution License
006: * (the "License"). You may not use this file except
007: * in compliance with the License.
008: *
009: * You can obtain a copy of the license at
010: * https://open-esb.dev.java.net/public/CDDLv1.0.html.
011: * See the License for the specific language governing
012: * permissions and limitations under the License.
013: *
014: * When distributing Covered Code, include this CDDL
015: * HEADER in each file and include the License file at
016: * https://open-esb.dev.java.net/public/CDDLv1.0.html.
017: * If applicable add the following below this CDDL HEADER,
018: * with the fields enclosed by brackets "[]" replaced with
019: * your own identifying information: Portions Copyright
020: * [year] [name of copyright owner]
021: */
022:
023: /*
024: * @(#)ServiceAssemblyInfoImpl.java
025: * Copyright 2004-2007 Sun Microsystems, Inc. All Rights Reserved.
026: *
027: * END_HEADER - DO NOT EDIT
028: */
029: package com.sun.jbi.management.registry.data;
030:
031: import java.util.List;
032: import java.util.ArrayList;
033: import com.sun.jbi.ServiceAssemblyState;
034: import com.sun.jbi.ServiceUnitInfo;
035:
036: /**
037: * This interface provides information on Service Assemblys.
038: *
039: * @author Sun Microsystems, Inc.
040: */
041: public class ServiceAssemblyInfoImpl implements
042: com.sun.jbi.ServiceAssemblyInfo {
043:
044: private String mName;
045: private String mDescription;
046: private ServiceAssemblyState mServiceAssemblyState;
047: private List<ServiceUnitInfo> mServiceUnitList;
048: private long mTimestamp;
049:
050: /**
051: * Determine if the supplied Object is equal to this one.
052: * @param object - the Object to be compared with this one.
053: * @return true if the supplied Object is equal to this one.
054: */
055: public boolean equals(Object object) {
056: return (object.hashCode() == this .hashCode());
057: }
058:
059: /**
060: * Get a hash code for this ServiceAssemblyInfo.
061: * @return the hash code for the object.
062: */
063: public int hashCode() {
064: return 0;
065: }
066:
067: /**
068: * Get the name of the Service Assembly.
069: * @return the name of the Service Assembly.
070: */
071: public String getName() {
072: return mName;
073: }
074:
075: public void setName(String name) {
076: mName = name;
077: }
078:
079: /**
080: * Get the timestamp associated with archive.
081: * @return the timestamp of the archive.
082: */
083: public long getTimestamp() {
084: return (mTimestamp);
085: }
086:
087: public void setTimestamp(long timestamp) {
088: mTimestamp = timestamp;
089: }
090:
091: public String getDescription() {
092: return mDescription;
093: }
094:
095: public void setDescription(String descr) {
096: mDescription = descr;
097: }
098:
099: /**
100: * Get a List<ServiceUnitInfo> of all service units in this service assembly
101: * @return the Service Unit Info List.
102: */
103: public List<ServiceUnitInfo> getServiceUnitList() {
104: if (mServiceUnitList == null) {
105: mServiceUnitList = new ArrayList();
106: }
107: return mServiceUnitList;
108: }
109:
110: public void setServiceUnitList(List<ServiceUnitInfo> suList) {
111: mServiceUnitList = suList;
112: }
113:
114: /**
115: * Get the state of the Service Assembly.
116: * @return current state, one of {SHUTDOWN, STOPPED, STARTED, UNKNOWN}
117: */
118: public ServiceAssemblyState getStatus() {
119: return mServiceAssemblyState;
120: }
121:
122: public void setStatus(ServiceAssemblyState state) {
123: mServiceAssemblyState = state;
124: }
125: }
|