001: /**
002: * Copyright 2004-2005 jManage.org
003: *
004: * Licensed under the Apache License, Version 2.0 (the "License");
005: * you may not use this file except in compliance with the License.
006: * You may obtain a copy of the License at
007: *
008: * http://www.apache.org/licenses/LICENSE-2.0
009: *
010: * Unless required by applicable law or agreed to in writing, software
011: * distributed under the License is distributed on an "AS IS" BASIS,
012: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
013: * See the License for the specific language governing permissions and
014: * limitations under the License.
015: */package org.jmanage.core.management;
016:
017: import java.util.Set;
018: import java.util.List;
019: import java.io.IOException;
020:
021: /**
022: * This interface is the abstraction between different MBeanServer
023: * implementations and jmanage application. jManage application talks to
024: * different MBeanServers via this connection.
025: * <p>
026: * We may be able to leverage this abstraction to talk to applications
027: * which support some other management protocol (like SNMP) than JMX.
028: *
029: * date: Aug 12, 2004
030: * @author Rakesh Kalra
031: */
032: public interface ServerConnection {
033:
034: /**
035: * Queries the management objects based on the given object name, containing
036: * the search criteria.
037: *
038: * @param objectName
039: * @return
040: */
041: public Set queryNames(ObjectName objectName);
042:
043: /**
044: * Invokes the given "operationName" on the object identified by
045: * "objectName".
046: *
047: * @param objectName
048: * @param operationName
049: * @param params
050: * @param signature
051: * @return
052: */
053: public Object invoke(ObjectName objectName, String operationName,
054: Object[] params, String[] signature);
055:
056: /**
057: * Returns the information about the given objectName.
058: *
059: * @param objectName
060: * @return
061: */
062: public ObjectInfo getObjectInfo(ObjectName objectName);
063:
064: /**
065: * Gets the value for a single attribute.
066: *
067: * @param objectName
068: * @param attributeName
069: * @return attribute value
070: */
071: public Object getAttribute(ObjectName objectName,
072: String attributeName);
073:
074: /**
075: * Returns a list of ObjectAttribute objects containing attribute names
076: * and values for the given attributeNames
077: *
078: * @param objectName
079: * @param attributeNames
080: * @return
081: */
082: public List getAttributes(ObjectName objectName,
083: String[] attributeNames);
084:
085: /**
086: * Saves the attribute values.
087: *
088: * @param objectName
089: * @param attributeList list of ObjectAttribute objects
090: */
091: public List setAttributes(ObjectName objectName, List attributeList);
092:
093: public void addNotificationListener(ObjectName objectName,
094: ObjectNotificationListener listener,
095: ObjectNotificationFilter filter, Object handback);
096:
097: public void removeNotificationListener(ObjectName objectName,
098: ObjectNotificationListener listener,
099: ObjectNotificationFilter filter, Object handback);
100:
101: public void createMBean(String className, ObjectName name,
102: Object[] params, String[] signature);
103:
104: public void unregisterMBean(ObjectName objectName);
105:
106: /**
107: *
108: * @param objectName
109: * @return an object of type javax.management.ObjectName
110: */
111: public Object buildObjectName(String objectName);
112:
113: /**
114: * checks if this connection is open
115: * @return true if this connection is open
116: */
117: public boolean isOpen();
118:
119: /**
120: * Closes the connection to the server
121: */
122: public void close() throws IOException;
123: }
|