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: * @(#)ServiceUnitInfoImpl.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 com.sun.jbi.ServiceUnitState;
033:
034: /**
035: * This interface provides information on Service Units.
036: * @author Sun Microsystems, Inc.
037: */
038: public class ServiceUnitInfoImpl implements com.sun.jbi.ServiceUnitInfo {
039:
040: private ServiceUnitState mServiceUnitState;
041: private String mServiceUnitName;
042: private String mServiceAssemblyName;
043: private String mTargetComponent;
044: private String mFilePath;
045:
046: /**
047: * Determine if the supplied Object is equal to this one.
048: * @param object - the Object to be compared with this one.
049: * @return true if the supplied Object is equal to this one.
050: */
051: public boolean equals(Object object) {
052: return (object.hashCode() == this .hashCode());
053: }
054:
055: /**
056: * Get the name of the Service Unit.
057: * @return the name of the Service Unit.
058: */
059: public String getName() {
060: return mServiceUnitName;
061: }
062:
063: public void setName(String name) {
064: mServiceUnitName = name;
065: }
066:
067: /**
068: * Get the name of the Service Assembly containing this Service Unit.
069: * @return the name of the Service Assembly.
070: */
071: public String getServiceAssemblyName() {
072: return mServiceAssemblyName;
073: }
074:
075: public void setServiceAssemblyName(String name) {
076: mServiceAssemblyName = name;
077: }
078:
079: /**
080: * Get the state of the Service Unit.
081: * @return current state.
082: */
083: public ServiceUnitState getState() {
084: return mServiceUnitState;
085: }
086:
087: public void setState(ServiceUnitState state) {
088: mServiceUnitState = state;
089: }
090:
091: /**
092: * Get the state of the Service Unit as a string.
093: * @return current state, as one of the values: "shutdown", "stopped",
094: * "started".
095: */
096: public String getStateAsString() {
097: return mServiceUnitState.toString();
098: }
099:
100: /**
101: * Get the Service Units target component
102: *
103: * @return the target component name
104: */
105: public String getTargetComponent() {
106: return mTargetComponent;
107: }
108:
109: /**
110: * Set the Service Units target component
111: *
112: * @param compName - the target component name
113: */
114: public void setTargetComponent(String compName) {
115: mTargetComponent = compName;
116: }
117:
118: /**
119: * Get the path to the Service Unit archive.
120: * @return the file path.
121: */
122: public String getFilePath() {
123: return mFilePath;
124: }
125:
126: /**
127: * @param filePath - the path to the ServiceUnit archive
128: */
129: public void setFilePath(String filePath) {
130: mFilePath = filePath;
131: }
132: }
|