01: /*
02: * Copyright 2005 Sun Microsystems, Inc. All rights reserved.
03: * PROPRIETARY/CONFIDENTIAL. Use of this product is subject to license terms.
04: */
05: package com.sun.portal.desktop.mfwk;
06:
07: import com.sun.cmm.cim.CIM_ManagedElement;
08: import com.sun.mfwk.instrum.me.CIM_ManagedElementInstrum;
09: import com.sun.mfwk.instrum.relations.MfRelationInstrum;
10: import com.sun.mfwk.instrum.server.MfManagedElementInfo;
11: import com.sun.mfwk.instrum.server.MfManagedElementServer;
12: import com.sun.mfwk.instrum.server.MfManagedElementServerException;
13: import com.sun.mfwk.instrum.server.MfRelationInfo;
14: import com.sun.mfwk.instrum.server.MfRelationType;
15:
16: public class MfwkPSRelationAdaptor {
17: private MfRelationType type;
18: private CIM_ManagedElementInstrum sourceManagedElementInstrum;
19: private MfRelationInstrum instrum;
20:
21: public MfwkPSRelationAdaptor(MfRelationType type,
22: CIM_ManagedElementInstrum sourceManagedElementInstrum) {
23: setType(type);
24: setSourceManagedElementInstrum(sourceManagedElementInstrum);
25: }
26:
27: public MfRelationType getType() {
28: return type;
29: }
30:
31: public void setType(MfRelationType type) {
32: this .type = type;
33: }
34:
35: public CIM_ManagedElementInstrum getSourceManagedElementInstrum() {
36: return sourceManagedElementInstrum;
37: }
38:
39: public void setSourceManagedElementInstrum(
40: CIM_ManagedElementInstrum sourceManagedElementInstrum) {
41: this .sourceManagedElementInstrum = sourceManagedElementInstrum;
42: }
43:
44: public MfRelationInstrum getInstrum() {
45: return instrum;
46: }
47:
48: public void setInstrum(MfRelationInstrum instrum) {
49: this .instrum = instrum;
50: }
51:
52: public void gearUp(MfManagedElementServer mfmeServer,
53: MfManagedElementInfo mfmeInfo)
54: throws MfManagedElementServerException {
55: MfRelationInfo mfrInfo;
56:
57: mfrInfo = mfmeServer.makeRelationInfo();
58: mfrInfo.setType(getType());
59: setInstrum(mfmeServer.createRelationToNewManagedElement(
60: getSourceManagedElementInstrum(), mfrInfo, mfmeInfo));
61: }
62: }
|