17510631 Backport 16984138 to 11.2 - vp components must change to match RAD2 enhancements
17548766 Backport 16808665 to 11.2 - User Manager Panel can assign profiles, but not auth
--- a/components/visual-panels/ant-rules/build-common.xml Mon Oct 28 17:52:58 2013 -0700
+++ b/components/visual-panels/ant-rules/build-common.xml Wed Oct 30 16:53:48 2013 -0400
@@ -19,7 +19,7 @@
CDDL HEADER END
- Copyright (c) 2009, 2012, Oracle and/or its affiliates. All rights reserved.
+ Copyright (c) 2009, 2013, Oracle and/or its affiliates. All rights reserved.
-->
<project name="commondef">
@@ -60,44 +60,17 @@
<exec executable="/usr/bin/radadrgen">
<env key="RADADR_SCHEMA" value="/usr/share/lib/xml/rng/radadr.rng.1"/>
<env key="RADADR_XSLDIR" value="/usr/share/lib/xml/style"/>
- <env key="RADADR_JARDIR" value="${adrdir}"/>
- <arg value="-j" />
+ <arg value="-l" />
+ <arg value="java" />
+ <arg value="-s" />
+ <arg value="client" />
+ <arg value="-d" />
<arg value="${proj.gen}" />
<arg value="${ws.apis}/@{api}" />
</exec>
</sequential>
</macrodef>
- <macrodef name="generate.adropt">
- <attribute name="api" />
- <sequential>
- <exec executable="/usr/bin/radadrgen">
- <env key="RADADR_SCHEMA" value="/usr/share/lib/xml/rng/radadr.rng.1"/>
- <env key="RADADR_XSLDIR" value="/usr/share/lib/xml/style"/>
- <env key="RADADR_JARDIR" value="${adrdir}"/>
- <arg value="-N" />
- <arg value="-j" />
- <arg value="${proj.gen}" />
- <arg value="${ws.apis}/@{api}" />
- </exec>
- </sequential>
- </macrodef>
-
- <macrodef name="generate.adrimpl">
- <attribute name="api" />
- <sequential>
- <exec executable="/usr/bin/radadrgen">
- <env key="RADADR_SCHEMA" value="/usr/share/lib/xml/rng/radadr.rng.1"/>
- <env key="RADADR_XSLDIR" value="/usr/share/lib/xml/style"/>
- <env key="RADADR_JARDIR" value="${adrdir}"/>
- <arg value="-j" />
- <arg value="${proj.gen}" />
- <arg value="-i" />
- <arg value="${ws.apis}/@{api}" />
- </exec>
- </sequential>
- </macrodef>
-
<target name="generate_project" />
<target name="generate" depends="generate_project">
<mkdir dir="${proj.gen}" />
--- a/components/visual-panels/apache/src/java/vpanels/app/apache/build.xml Mon Oct 28 17:52:58 2013 -0700
+++ b/components/visual-panels/apache/src/java/vpanels/app/apache/build.xml Wed Oct 30 16:53:48 2013 -0400
@@ -19,7 +19,7 @@
CDDL HEADER END
- Copyright (c) 2009, 2012, Oracle and/or its affiliates. All rights reserved.
+ Copyright (c) 2009, 2013, Oracle and/or its affiliates. All rights reserved.
-->
<project name="vpanels-panels-apache" default="jar">
@@ -40,7 +40,6 @@
<path id="classpath.javac">
<path refid="classpath.panels" />
- <pathelement location="${abs.rad.java}/rad.jar" />
- <pathelement location="${abs.rad.java}/adr.jar" />
+ <pathelement location="${abs.rad.java}/rad.jar" />
</path>
</project>
--- a/components/visual-panels/apache/src/java/vpanels/app/apache/com/oracle/solaris/vp/panels/apache/client/swing/ApachePanelDescriptor.java Mon Oct 28 17:52:58 2013 -0700
+++ b/components/visual-panels/apache/src/java/vpanels/app/apache/com/oracle/solaris/vp/panels/apache/client/swing/ApachePanelDescriptor.java Wed Oct 30 16:53:48 2013 -0400
@@ -20,17 +20,15 @@
*/
/*
- * Copyright (c) 2009, 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2009, 2013, Oracle and/or its affiliates. All rights reserved.
*/
package com.oracle.solaris.vp.panels.apache.client.swing;
import java.io.IOException;
import java.util.*;
-import javax.management.InstanceNotFoundException;
import javax.swing.*;
import javax.swing.filechooser.FileSystemView;
-import com.oracle.solaris.adr.Stability;
import com.oracle.solaris.scf.common.ScfException;
import com.oracle.solaris.vp.panel.common.*;
import com.oracle.solaris.vp.panel.common.api.network.*;
@@ -92,7 +90,7 @@
private DefaultControl control;
private RemoteFileSystemView fsView;
- private MXBeanTracker<NetworkMXBean> networkBeanTracker;
+ private BeanTracker<Network> networkBeanTracker;
private BasicSmfMutableProperty<Boolean> customEnabledProperty =
new BooleanSmfProperty(PROPERTY_CUSTOM_ENABLED, this);
@@ -117,15 +115,14 @@
public ApachePanelDescriptor(String id, ClientContext context)
throws IOException, ScfException, InvalidScfDataException,
- MissingScfDataException, InstanceNotFoundException,
- TrackerException {
+ MissingScfDataException, TrackerException {
super(id, context, SERVICE, INSTANCE);
fsView = new RemoteFileSystemView(context);
- networkBeanTracker = new MXBeanTracker<NetworkMXBean>(
- NetworkUtil.OBJECT_NAME, NetworkMXBean.class, Stability.PRIVATE,
+ networkBeanTracker = new BeanTracker<Network>(
+ (new Network()).getName(), Network.class,
context);
vHostNamePool = new PropertyGroupNamePool(getService(),
@@ -449,7 +446,7 @@
// ApachePanelDescriptor classes
//
- public NetworkMXBean getNetworkMXBean() {
+ public Network getNetworkBean() {
return networkBeanTracker.getBean();
}
}
--- a/components/visual-panels/apache/src/java/vpanels/app/apache/com/oracle/solaris/vp/panels/apache/client/swing/ApacheUtil.java Mon Oct 28 17:52:58 2013 -0700
+++ b/components/visual-panels/apache/src/java/vpanels/app/apache/com/oracle/solaris/vp/panels/apache/client/swing/ApacheUtil.java Wed Oct 30 16:53:48 2013 -0400
@@ -20,7 +20,7 @@
*/
/*
- * Copyright (c) 2009, 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2009, 2013, Oracle and/or its affiliates. All rights reserved.
*/
package com.oracle.solaris.vp.panels.apache.client.swing;
@@ -39,7 +39,7 @@
public static String getNextAvailablePropertyName(SmfPropertyGroupInfo info,
String prefix) throws ScfException {
- ServiceMXBean service = info.getService();
+ ServiceBean service = info.getService();
String group = info.getPropertyGroupName();
List<String> names = new ArrayList<String>(
--- a/components/visual-panels/apache/src/java/vpanels/app/apache/com/oracle/solaris/vp/panels/apache/client/swing/MainControl.java Mon Oct 28 17:52:58 2013 -0700
+++ b/components/visual-panels/apache/src/java/vpanels/app/apache/com/oracle/solaris/vp/panels/apache/client/swing/MainControl.java Wed Oct 30 16:53:48 2013 -0400
@@ -20,7 +20,7 @@
*/
/*
- * Copyright (c) 2010, 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved.
*/
package com.oracle.solaris.vp.panels.apache.client.swing;
@@ -28,6 +28,7 @@
import java.awt.Component;
import java.util.List;
import javax.swing.*;
+import com.oracle.solaris.rad.client.RadPrivilegeException;
import com.oracle.solaris.scf.common.ScfException;
import com.oracle.solaris.vp.panel.common.action.*;
import com.oracle.solaris.vp.panel.common.control.*;
@@ -40,7 +41,7 @@
import com.oracle.solaris.vp.util.swing.SimpleCellRenderer;
public class MainControl extends ListSelectorControl<ApachePanelDescriptor,
- ListSelectorPanel, ManagedObject> {
+ ListSelectorPanel, ManagedObject> {
//
// Static data
@@ -149,7 +150,7 @@
SmfUtil.throwActionException(e);
throw new ActionFailedException(e);
- } catch (SecurityException e) {
+ } catch (RadPrivilegeException e) {
throw new ActionUnauthorizedException(e);
}
--- a/components/visual-panels/apache/src/java/vpanels/app/apache/com/oracle/solaris/vp/panels/apache/client/swing/MimeTypes.java Mon Oct 28 17:52:58 2013 -0700
+++ b/components/visual-panels/apache/src/java/vpanels/app/apache/com/oracle/solaris/vp/panels/apache/client/swing/MimeTypes.java Wed Oct 30 16:53:48 2013 -0400
@@ -20,7 +20,7 @@
*/
/*
- * Copyright (c) 2010, 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved.
*/
package com.oracle.solaris.vp.panels.apache.client.swing;
@@ -157,7 +157,7 @@
}
public void refresh(boolean force) throws ScfException {
- ServiceMXBean service = info.getPanelDescriptor().getService();
+ ServiceBean service = info.getPanelDescriptor().getService();
String group = info.getPropertyGroupName();
// Build list of names of MIME type properties
@@ -170,7 +170,7 @@
Collections.sort(properties);
// Remove names of properties that are pending removal on client
- for (Iterator<MimeType> i = removed.iterator(); i.hasNext();) {
+ for (Iterator<MimeType> i = removed.iterator(); i.hasNext(); ) {
MimeType mimeType = i.next();
String property = mimeType.getPropertyName();
if (properties.remove(property)) {
--- a/components/visual-panels/apache/src/java/vpanels/app/apache/com/oracle/solaris/vp/panels/apache/client/swing/Modules.java Mon Oct 28 17:52:58 2013 -0700
+++ b/components/visual-panels/apache/src/java/vpanels/app/apache/com/oracle/solaris/vp/panels/apache/client/swing/Modules.java Wed Oct 30 16:53:48 2013 -0400
@@ -20,7 +20,7 @@
*/
/*
- * Copyright (c) 2010, 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved.
*/
package com.oracle.solaris.vp.panels.apache.client.swing;
@@ -151,7 +151,7 @@
}
public void refresh(boolean force) throws ScfException {
- ServiceMXBean service = info.getPanelDescriptor().getService();
+ ServiceBean service = info.getPanelDescriptor().getService();
String group = info.getPropertyGroupName();
// Build list of names of Module properties
@@ -164,7 +164,7 @@
Collections.sort(properties);
// Remove names of properties that are pending removal on client
- for (Iterator<Module> i = removed.iterator(); i.hasNext();) {
+ for (Iterator<Module> i = removed.iterator(); i.hasNext(); ) {
Module module = i.next();
String property = module.getPropertyName();
if (properties.remove(property)) {
@@ -226,7 +226,7 @@
}
addedProperty.setValue(0);
- for (Iterator<Module> i = removed.iterator(); i.hasNext();)
+ for (Iterator<Module> i = removed.iterator(); i.hasNext(); )
{
Module module = i.next();
module.removeFromRepo();
--- a/components/visual-panels/apache/src/java/vpanels/app/apache/com/oracle/solaris/vp/panels/apache/client/swing/PropertyGroupNamePool.java Mon Oct 28 17:52:58 2013 -0700
+++ b/components/visual-panels/apache/src/java/vpanels/app/apache/com/oracle/solaris/vp/panels/apache/client/swing/PropertyGroupNamePool.java Wed Oct 30 16:53:48 2013 -0400
@@ -20,7 +20,7 @@
*/
/*
- * Copyright (c) 2009, 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2009, 2013, Oracle and/or its affiliates. All rights reserved.
*/
package com.oracle.solaris.vp.panels.apache.client.swing;
@@ -28,7 +28,7 @@
import java.util.*;
import com.oracle.solaris.scf.common.ScfException;
import com.oracle.solaris.vp.panel.common.api.smf_old.*;
-import com.oracle.solaris.vp.panel.common.smf.ServiceMXBean;
+import com.oracle.solaris.vp.panel.common.smf.ServiceBean;
public class PropertyGroupNamePool {
//
@@ -41,7 +41,7 @@
// Instance data
//
- private ServiceMXBean service;
+ private ServiceBean service;
private String prefix;
private List<Integer> existing = new LinkedList<Integer>();
private List<Integer> reserved = new LinkedList<Integer>();
@@ -51,7 +51,7 @@
// Constructors
//
- public PropertyGroupNamePool(ServiceMXBean service, String prefix)
+ public PropertyGroupNamePool(ServiceBean service, String prefix)
throws ScfException {
this.service = service;
--- a/components/visual-panels/apache/src/java/vpanels/app/apache/com/oracle/solaris/vp/panels/apache/client/swing/VirtualHost.java Mon Oct 28 17:52:58 2013 -0700
+++ b/components/visual-panels/apache/src/java/vpanels/app/apache/com/oracle/solaris/vp/panels/apache/client/swing/VirtualHost.java Wed Oct 30 16:53:48 2013 -0400
@@ -20,14 +20,14 @@
*/
/*
- * Copyright (c) 2010, 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved.
*/
package com.oracle.solaris.vp.panels.apache.client.swing;
import java.util.List;
import javax.swing.*;
-import com.oracle.solaris.rad.ObjectException;
+import com.oracle.solaris.rad.client.RadObjectException;
import com.oracle.solaris.scf.common.ScfException;
import com.oracle.solaris.vp.panel.common.model.*;
import com.oracle.solaris.vp.panel.common.smf.*;
@@ -356,7 +356,7 @@
protected void removeFromRepo() throws ScfException {
if (group != null) {
- ServiceMXBean service = getService();
+ ServiceBean service = getService();
service.deletePropertyGroup(group);
service.refresh();
parent.getVirtualHostNamePool().put(group);
@@ -468,13 +468,13 @@
try {
boolean isLocalAddress =
- parent.getNetworkMXBean().isLocalAddress(sslIP);
+ parent.getNetworkBean().isLocalAddress(sslIP);
if (!isLocalAddress) {
throw new VirtualHostSSLValidationException(getId(),
Finder.getString("vhost.ssl.error.ip.invalid", sslIP));
}
- } catch (ObjectException e) {
+ } catch (RadObjectException e) {
throw new VirtualHostSSLValidationException(getId(),
Finder.getString("vhost.ssl.error.ip.syserror", e));
}
--- a/components/visual-panels/apache/system-management-visual-panels-panel-apache-message-files.p5m Mon Oct 28 17:52:58 2013 -0700
+++ b/components/visual-panels/apache/system-management-visual-panels-panel-apache-message-files.p5m Wed Oct 30 16:53:48 2013 -0400
@@ -20,7 +20,7 @@
#
#
-# Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved.
#
set name=pkg.fmri value=pkg://$(PUBLISHER_LOCALIZABLE)/system/management/visual-panels/[email protected]$(IPS_COMPONENT_VERSION),$(BUILD_VERSION)
@@ -31,12 +31,6 @@
license ../vpanels.copyright license=Oracle
-dir path=usr
-dir path=usr/share
-dir path=usr/share/applications
-dir path=usr/share/applications/po
-dir path=usr/share/vpanels
-dir path=usr/share/vpanels/__LOCALE__
file path=usr/share/applications/po/vp-apache.pot
file path=usr/share/vpanels/__LOCALE__/com/oracle/solaris/vp/panels/apache/client/swing/resources/Resources.properties
file path=usr/share/vpanels/__LOCALE__/com/oracle/solaris/vp/panels/apache/client/swing/help/apache-vhosts-general.html
--- a/components/visual-panels/apache/system-management-visual-panels-panel-apache.p5m Mon Oct 28 17:52:58 2013 -0700
+++ b/components/visual-panels/apache/system-management-visual-panels-panel-apache.p5m Wed Oct 30 16:53:48 2013 -0400
@@ -20,7 +20,7 @@
#
#
-# Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved.
#
set name=pkg.fmri value=pkg:/system/management/visual-panels/[email protected]$(IPS_COMPONENT_VERSION),$(BUILD_VERSION)
@@ -35,20 +35,7 @@
depend fmri=pkg:/system/management/visual-panels/panel-apache/locale type=require
depend fmri=pkg:/web/server/apache-22 type=require
-dir path=etc
dir path=etc/vpanels group=sys
-dir path=lib
-dir path=lib/svc
-dir path=lib/svc/manifest
-dir path=lib/svc/manifest/network
-dir path=lib/svc/method
-dir path=usr
-dir path=usr/share
-dir path=usr/share/applications
-dir path=usr/share/vpanels
-dir path=usr/share/vpanels/app
-dir path=usr/share/vpanels/conf
-dir path=usr/share/vpanels/pixmaps
file path=etc/vpanels/httpd_conf.templ group=sys
file path=lib/svc/manifest/network/http-vpanels.xml
file path=lib/svc/method/http-vpanels mode=0555
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/components/visual-panels/core/src/apis/file.adr Wed Oct 30 16:53:48 2013 -0400
@@ -0,0 +1,68 @@
+<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
+<!--
+ Copyright (c) 2009, 2013, Oracle and/or its affiliates. All rights reserved.
+
+ CDDL HEADER START
+
+ The contents of this file are subject to the terms of the
+ Common Development and Distribution License (the "License").
+ You may not use this file except in compliance with the License.
+
+ You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ or http://www.opensolaris.org/os/licensing.
+ See the License for the specific language governing permissions
+ and limitations under the License.
+
+ When distributing Covered Code, include this CDDL HEADER in each
+ file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ If applicable, add the following below this CDDL HEADER, with the
+ fields enclosed by brackets "[]" replaced with your own identifying
+ information: Portions Copyright [yyyy] [name of copyright owner]
+
+ CDDL HEADER END
+-->
+
+<api xmlns="http://xmlns.oracle.com/radadr"
+ name="com.oracle.solaris.vp.panel.common.api.file">
+ <version major="1" minor="0" />
+
+ <struct name="FileSnapshot">
+ <field type="string" name="path" />
+ <field type="string" name="absolutePath" />
+ <field type="string" name="baseName" />
+ <field type="string" name="canonicalPath" />
+ <field type="boolean" name="absolute" />
+ <field type="boolean" name="canonical" />
+ <field type="boolean" name="exists" />
+ <field type="boolean" name="readable" />
+ <field type="boolean" name="writable" />
+ <field type="boolean" name="directory" />
+ <field type="boolean" name="file" />
+ <field type="boolean" name="hidden" />
+ <field type="time" name="lastModified" />
+ <field type="long" name="length" />
+ <field type="long" name="freeSpace" />
+ <field type="long" name="totalSpace" />
+ <field type="long" name="usableSpace" />
+ </struct>
+
+ <interface name="FileBrowser">
+ <property name="roots" access="ro">
+ <list typeref="FileSnapshot" />
+ </property>
+
+ <method name="getFile">
+ <result typeref="FileSnapshot" />
+ <error />
+ <argument type="string" name="name" />
+ </method>
+
+ <method name="getFiles">
+ <result>
+ <list typeref="FileSnapshot" />
+ </result>
+ <error />
+ <argument type="string" name="directory" />
+ </method>
+ </interface>
+</api>
--- a/components/visual-panels/core/src/apis/file.xml Mon Oct 28 17:52:58 2013 -0700
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,69 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
-<!--
- Copyright (c) 2009, 2012, Oracle and/or its affiliates. All rights reserved.
-
- CDDL HEADER START
-
- The contents of this file are subject to the terms of the
- Common Development and Distribution License (the "License").
- You may not use this file except in compliance with the License.
-
- You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
- or http://www.opensolaris.org/os/licensing.
- See the License for the specific language governing permissions
- and limitations under the License.
-
- When distributing Covered Code, include this CDDL HEADER in each
- file and include the License file at usr/src/OPENSOLARIS.LICENSE.
- If applicable, add the following below this CDDL HEADER, with the
- fields enclosed by brackets "[]" replaced with your own identifying
- information: Portions Copyright [yyyy] [name of copyright owner]
-
- CDDL HEADER END
--->
-
-<api xmlns="http://xmlns.oracle.com/radadr"
- name="com.oracle.solaris.vp.panel.common.api.file">
-
- <struct name="FileSnapshot">
- <field type="string" name="path" />
- <field type="string" name="absolutePath" />
- <field type="string" name="baseName" />
- <field type="string" name="canonicalPath" />
- <field type="boolean" name="absolute" />
- <field type="boolean" name="canonical" />
- <field type="boolean" name="exists" />
- <field type="boolean" name="readable" />
- <field type="boolean" name="writable" />
- <field type="boolean" name="directory" />
- <field type="boolean" name="file" />
- <field type="boolean" name="hidden" />
- <field type="time" name="lastModified" />
- <field type="long" name="length" />
- <field type="long" name="freeSpace" />
- <field type="long" name="totalSpace" />
- <field type="long" name="usableSpace" />
- </struct>
-
- <interface name="FileBrowser">
- <version major="1" minor="0" stability="private" />
-
- <property name="roots" access="ro">
- <list typeref="FileSnapshot" />
- </property>
-
- <method name="getFile">
- <result typeref="FileSnapshot" />
- <error />
- <argument type="string" name="name" />
- </method>
-
- <method name="getFiles">
- <result>
- <list typeref="FileSnapshot" />
- </result>
- <error />
- <argument type="string" name="directory" />
- </method>
- </interface>
-</api>
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/components/visual-panels/core/src/apis/network.adr Wed Oct 30 16:53:48 2013 -0400
@@ -0,0 +1,56 @@
+<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
+<!--
+ Copyright (c) 2009, 2013, Oracle and/or its affiliates. All rights reserved.
+
+ CDDL HEADER START
+
+ The contents of this file are subject to the terms of the
+ Common Development and Distribution License (the "License").
+ You may not use this file except in compliance with the License.
+
+ You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ or http://www.opensolaris.org/os/licensing.
+ See the License for the specific language governing permissions
+ and limitations under the License.
+
+ When distributing Covered Code, include this CDDL HEADER in each
+ file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ If applicable, add the following below this CDDL HEADER, with the
+ fields enclosed by brackets "[]" replaced with your own identifying
+ information: Portions Copyright [yyyy] [name of copyright owner]
+
+ CDDL HEADER END
+-->
+
+<api xmlns="http://xmlns.oracle.com/radadr"
+ name="com.oracle.solaris.vp.panel.common.api.network">
+ <version major="1" minor="0" />
+
+ <interface name="Network">
+ <property name="networkInterfaces" access="ro">
+ <list type="string" />
+ <error />
+ </property>
+
+ <method name="getHostNameForIP">
+ <result type="string" />
+ <error />
+ <argument type="string" name="ipaddress" />
+ </method>
+
+ <method name="hostGetIPs">
+ <result nullable="true">
+ <list type="string" />
+ </result>
+ <error />
+ <argument type="string" name="host" />
+ </method>
+
+ <method name="isLocalAddress">
+ <result type="boolean" />
+ <error />
+ <argument type="string" name="ipaddress" />
+ </method>
+ </interface>
+
+</api>
--- a/components/visual-panels/core/src/apis/network.xml Mon Oct 28 17:52:58 2013 -0700
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,57 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
-<!--
- Copyright (c) 2009, 2012, Oracle and/or its affiliates. All rights reserved.
-
- CDDL HEADER START
-
- The contents of this file are subject to the terms of the
- Common Development and Distribution License (the "License").
- You may not use this file except in compliance with the License.
-
- You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
- or http://www.opensolaris.org/os/licensing.
- See the License for the specific language governing permissions
- and limitations under the License.
-
- When distributing Covered Code, include this CDDL HEADER in each
- file and include the License file at usr/src/OPENSOLARIS.LICENSE.
- If applicable, add the following below this CDDL HEADER, with the
- fields enclosed by brackets "[]" replaced with your own identifying
- information: Portions Copyright [yyyy] [name of copyright owner]
-
- CDDL HEADER END
--->
-
-<api xmlns="http://xmlns.oracle.com/radadr"
- name="com.oracle.solaris.vp.panel.common.api.network">
-
- <interface name="Network">
- <version major="1" minor="0" stability="private" />
-
- <property name="networkInterfaces" access="ro">
- <list type="string" />
- <error />
- </property>
-
- <method name="getHostNameForIP">
- <result type="string" />
- <error />
- <argument type="string" name="ipaddress" />
- </method>
-
- <method name="hostGetIPs">
- <result nullable="true">
- <list type="string" />
- </result>
- <error />
- <argument type="string" name="host" />
- </method>
-
- <method name="isLocalAddress">
- <result type="boolean" />
- <error />
- <argument type="string" name="ipaddress" />
- </method>
- </interface>
-
-</api>
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/components/visual-panels/core/src/apis/panel.adr Wed Oct 30 16:53:48 2013 -0400
@@ -0,0 +1,64 @@
+<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
+<!--
+ Copyright (c) 2009, 2013, Oracle and/or its affiliates. All rights reserved.
+
+ CDDL HEADER START
+
+ The contents of this file are subject to the terms of the
+ Common Development and Distribution License (the "License").
+ You may not use this file except in compliance with the License.
+
+ You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ or http://www.opensolaris.org/os/licensing.
+ See the License for the specific language governing permissions
+ and limitations under the License.
+
+ When distributing Covered Code, include this CDDL HEADER in each
+ file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ If applicable, add the following below this CDDL HEADER, with the
+ fields enclosed by brackets "[]" replaced with your own identifying
+ information: Portions Copyright [yyyy] [name of copyright owner]
+
+ CDDL HEADER END
+-->
+
+<api xmlns="http://xmlns.oracle.com/radadr"
+ name="com.oracle.solaris.vp.panel.common.api.panel">
+ <version major="1" minor="0" />
+
+ <struct name="ResourceDescriptor">
+ <field type="string" name="file" />
+ <field type="string" name="hashAlgorithm" />
+ <field type="opaque" name="hash" />
+ <field type="opaque" name="token" />
+ </struct>
+
+ <struct name="CustomPanel">
+ <field type="string" name="name" />
+ <field type="string" name="locale" />
+ <field type="string" name="panelDescriptorClassName" />
+ <field name="resourceDescriptors">
+ <list typeref="ResourceDescriptor" />
+ </field>
+ </struct>
+
+ <interface name="Panel">
+ <property name="panelNames" access="ro">
+ <list type="string" />
+ <error />
+ </property>
+
+ <method name="getPanel">
+ <result typeref="CustomPanel" />
+ <error />
+ <argument type="string" name="name" />
+ <argument type="string" name="locale" nullable="true"/>
+ </method>
+
+ <method name="getResource">
+ <result type="opaque" />
+ <error />
+ <argument type="opaque" name="token" />
+ </method>
+ </interface>
+</api>
--- a/components/visual-panels/core/src/apis/panels.xml Mon Oct 28 17:52:58 2013 -0700
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,65 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
-<!--
- Copyright (c) 2009, 2012, Oracle and/or its affiliates. All rights reserved.
-
- CDDL HEADER START
-
- The contents of this file are subject to the terms of the
- Common Development and Distribution License (the "License").
- You may not use this file except in compliance with the License.
-
- You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
- or http://www.opensolaris.org/os/licensing.
- See the License for the specific language governing permissions
- and limitations under the License.
-
- When distributing Covered Code, include this CDDL HEADER in each
- file and include the License file at usr/src/OPENSOLARIS.LICENSE.
- If applicable, add the following below this CDDL HEADER, with the
- fields enclosed by brackets "[]" replaced with your own identifying
- information: Portions Copyright [yyyy] [name of copyright owner]
-
- CDDL HEADER END
--->
-
-<api xmlns="http://xmlns.oracle.com/radadr"
- name="com.oracle.solaris.vp.panel.common.api.panel">
-
- <struct name="ResourceDescriptor">
- <field type="string" name="file" />
- <field type="string" name="hashAlgorithm" />
- <field type="opaque" name="hash" />
- <field type="opaque" name="token" />
- </struct>
-
- <struct name="CustomPanel">
- <field type="string" name="name" />
- <field type="string" name="locale" />
- <field type="string" name="panelDescriptorClassName" />
- <field name="resourceDescriptors">
- <list typeref="ResourceDescriptor" />
- </field>
- </struct>
-
- <interface name="Panel">
- <version major="1" minor="0" stability="private" />
-
- <property name="panelNames" access="ro">
- <list type="string" />
- <error />
- </property>
-
- <method name="getPanel">
- <result typeref="CustomPanel" />
- <error />
- <argument type="string" name="name" />
- <argument type="string" name="locale" nullable="true"/>
- </method>
-
- <method name="getResource">
- <result type="opaque" />
- <error />
- <argument type="opaque" name="token" />
- </method>
- </interface>
-</api>
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/components/visual-panels/core/src/apis/smf_old.adr Wed Oct 30 16:53:48 2013 -0400
@@ -0,0 +1,379 @@
+<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
+<!--
+ Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved.
+
+ CDDL HEADER START
+
+ The contents of this file are subject to the terms of the
+ Common Development and Distribution License (the "License").
+ You may not use this file except in compliance with the License.
+
+ You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ or http://www.opensolaris.org/os/licensing.
+ See the License for the specific language governing permissions
+ and limitations under the License.
+
+ When distributing Covered Code, include this CDDL HEADER in each
+ file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ If applicable, add the following below this CDDL HEADER, with the
+ fields enclosed by brackets "[]" replaced with your own identifying
+ information: Portions Copyright [yyyy] [name of copyright owner]
+
+ CDDL HEADER END
+-->
+
+<api xmlns="http://xmlns.oracle.com/radadr"
+ name="com.oracle.solaris.vp.panel.common.api.smf_old">
+ <version major="1" minor="0" />
+
+ <struct name="Service">
+ <field type="string" name="fmri" />
+ <field type="name" name="objectName" />
+ <field name="instances">
+ <list type="string" />
+ </field>
+ </struct>
+
+ <enum name="SmfState">
+ <value name="NONE" />
+ <value name="UNINIT" />
+ <value name="MAINT" />
+ <value name="OFFLINE" />
+ <value name="DISABLED" />
+ <value name="ONLINE" />
+ <value name="DEGRADED" />
+ <value name="LEGACY" />
+ </enum>
+
+ <struct name="Instance">
+ <field type="string" name="fmri" />
+ <field type="name" name="objectName" />
+ <field type="time" name="STime" /> <!-- %[email protected][email protected] java -->
+ <field typeref="SmfState" name="state" />
+ </struct>
+
+ <struct name="Dependency">
+ <field type="string" name="name" />
+ <field name="target">
+ <list type="string" />
+ </field>
+ <!-- Should be enums -->
+ <field type="string" name="grouping" />
+ <field type="string" name="restartOn" />
+ </struct>
+
+ <enum name="PropertyType">
+ <value name="UNKNOWN" value="0" /> <!-- INVALID -->
+ <value name="BOOLEAN" />
+ <value name="COUNT" />
+ <value name="INTEGER" />
+ <value name="TIME" />
+ <value name="ASTRING" />
+ <value name="OPAQUE" />
+ <value name="USTRING" value="100" />
+ <value name="URI" value="200" />
+ <value name="FMRI" />
+ <value name="HOST" value="300" />
+ <value name="HOSTNAME" />
+ <value name="NET_ADDRESS_V4" />
+ <value name="NET_ADDRESS_V6" />
+ <value name="NET_ADDRESS" />
+ </enum>
+
+ <struct name="Manpage">
+ <field type="string" name="title" />
+ <field type="string" name="section" />
+ <field type="string" name="path" />
+ </struct>
+
+ <struct name="PropertyGroup">
+ <field type="string" name="name" />
+ <field type="string" name="type" />
+ </struct>
+
+ <enum name="PropertyVisibility">
+ <value name="HIDDEN" />
+ <value name="READONLY" />
+ <value name="READWRITE" />
+ </enum>
+
+ <struct name="Template">
+ <field type="string" name="name" nullable="true" />
+ <field type="string" name="description" nullable="true" />
+ <field type="string" name="units" nullable="true" />
+ <field typeref="PropertyVisibility" name="visibility" />
+ <field type="string" name="cardinality" nullable="true" />
+ <field name="separators" nullable="true" >
+ <list type="string" />
+ </field>
+ <field name="allowed" nullable="true" >
+ <list type="string" />
+ </field>
+ </struct>
+
+ <struct name="StateChange">
+ <field type="name" name="source" />
+ <field typeref="SmfState" name="state" />
+ <field typeref="SmfState" name="nextState" />
+ <field type="string" name="auxState" nullable="true" />
+ <field type="time" name="stateTime" />
+ <field type="string" name="reason" nullable="true" />
+ <field type="boolean" name="anomaly" />
+ </struct>
+
+ <enum name="SmfErrorCode">
+ <value name="NONE" value="1000" />
+ <value name="NOT_BOUND" />
+ <value name="NOT_SET" />
+ <value name="NOT_FOUND" />
+ <value name="TYPE_MISMATCH" />
+ <value name="IN_USE" />
+ <value name="CONNECTION_BROKEN" />
+ <value name="INVALID_ARGUMENT" />
+ <value name="NO_MEMORY" />
+ <value name="CONSTRAINT_VIOLATED" />
+ <value name="EXISTS" />
+ <value name="NO_SERVER" />
+ <value name="NO_RESOURCES" />
+ <value name="PERMISSION_DENIED" />
+ <value name="BACKEND_ACCESS" />
+ <value name="HANDLE_MISMATCH" />
+ <value name="HANDLE_DESTROYED" />
+ <value name="VERSION_MISMATCH" />
+ <value name="BACKEND_READONLY" />
+ <value name="DELETED" />
+ <value name="TEMPLATE_INVALID" />
+ <value name="CALLBACK_FAILED" value="1080" />
+ <value name="INTERNAL" value="1101" />
+ </enum>
+
+ <struct name="LogInfo">
+ <field type="string" name="name" />
+ <field type="integer" name="size" />
+ <field type="time" name="MTime" />
+ <field type="opaque" name="contents" />
+ </struct>
+
+ <struct name="SmfError">
+ <field typeref="SmfErrorCode" name="error" />
+ <field type="string" name="message" nullable="true" />
+ </struct>
+
+ <interface name="Aggregator">
+ <property name="services" access="ro">
+ <list typeref="Service" />
+ <error typeref="SmfError" />
+ </property>
+
+ <property name="instances" access="ro">
+ <list typeref="Instance" />
+ <error typeref="SmfError" />
+ </property>
+
+ <event typeref="StateChange" name="statechange" />
+ </interface>
+
+ <interface name="ServiceInfo">
+ <property type="string" name="fmri" access="ro">
+ <error typeref="SmfError" />
+ </property>
+
+ <property name="methodNames" access="ro">
+ <list type="string" />
+ <error typeref="SmfError" />
+ </property>
+ <property name="dependencyNames" access="ro">
+ <list type="string" />
+ <error typeref="SmfError" />
+ </property>
+
+ <method name="getDependency">
+ <result typeref="Dependency" />
+ <error typeref="SmfError" />
+ <argument type="string" name="name" />
+ </method>
+
+ <method name="getPropertyNames">
+ <result>
+ <list type="string" />
+ </result>
+ <error typeref="SmfError" />
+ <argument type="string" name="pg_name" />
+ </method>
+
+ <method name="getPropertyType">
+ <result typeref="PropertyType" />
+ <error typeref="SmfError" />
+ <argument type="string" name="pg_name" />
+ <argument type="string" name="prop_name" />
+ </method>
+
+ <method name="getPropertyValues">
+ <result>
+ <list type="string" />
+ </result>
+ <error typeref="SmfError" />
+ <argument type="string" name="pg_name" />
+ <argument type="string" name="prop_name" />
+ </method>
+
+ <method name="getSnapshotPropertyValues">
+ <result>
+ <list type="string" />
+ </result>
+ <error typeref="SmfError" />
+ <argument type="string" name="snap_name" />
+ <argument type="string" name="pg_name" />
+ <argument type="string" name="prop_name" />
+ </method>
+
+ <method name="setPropertyValues">
+ <error typeref="SmfError" />
+ <argument type="string" name="pg_name" />
+ <argument type="string" name="prop_name" />
+ <argument name="values">
+ <list type="string" />
+ </argument>
+ </method>
+
+ <method name="createPropertyGroup">
+ <error typeref="SmfError" />
+ <argument type="string" name="pg_name" />
+ <argument type="string" name="pg_type" />
+ </method>
+
+ <method name="deletePropertyGroup">
+ <error typeref="SmfError" />
+ <argument type="string" name="pg_name" />
+ </method>
+
+ <method name="createProperty">
+ <error typeref="SmfError" />
+ <argument type="string" name="pg_name" />
+ <argument type="string" name="prop_name" />
+ <argument typeref="PropertyType" name="type" />
+ </method>
+
+ <method name="deleteProperty">
+ <error typeref="SmfError" />
+ <argument type="string" name="pg_name" />
+ <argument type="string" name="prop_name" />
+ </method>
+
+ <property name="propertyGroups" access="ro">
+ <list typeref="PropertyGroup" />
+ <error typeref="SmfError" />
+ </property>
+
+ <method name="getPropertyTemplate">
+ <result typeref="Template" />
+ <error typeref="SmfError" />
+ <argument type="string" name="pg_name" />
+ <argument type="string" name="prop_name" />
+ <argument type="string" name="locale" />
+ </method>
+
+ <method name="getCommonName">
+ <result type="string" nullable="true" />
+ <error typeref="SmfError" />
+ <argument type="string" name="locale" />
+ </method>
+
+ <method name="getDescription">
+ <result type="string" nullable="true" />
+ <error typeref="SmfError" />
+ <argument type="string" name="locale" />
+ </method>
+
+ <method name="getLogInfo">
+ <result typeref="LogInfo" />
+ <error />
+ <argument type="integer" name="max_size" />
+ </method>
+
+ <property name="manpages" access="ro">
+ <list typeref="Manpage" />
+ <error typeref="SmfError" />
+ </property>
+
+ <property name="doclinks" access="ro">
+ <list type="string" />
+ <error typeref="SmfError" />
+ </property>
+
+ <method name="delete">
+ <error typeref="SmfError" />
+ </method>
+
+ <method name="clear">
+ <error typeref="SmfError" />
+ </method>
+
+ <method name="degrade">
+ <error typeref="SmfError" />
+ <argument type="boolean" name="immediate" />
+ </method>
+
+ <method name="maintain">
+ <error typeref="SmfError" />
+ <argument type="boolean" name="immediate" />
+ </method>
+
+ <method name="restart">
+ <error typeref="SmfError" />
+ </method>
+
+ <method name="refresh">
+ <error typeref="SmfError" />
+ </method>
+
+ <property type="boolean" name="persistentlyEnabled" access="rw">
+ <error typeref="SmfError" />
+ </property>
+
+ <property type="boolean" name="temporarilyEnabled" access="ro">
+ <error typeref="SmfError" />
+ </property>
+
+ <property type="boolean" name="enabled" access="ro">
+ <error typeref="SmfError" />
+ </property>
+
+ <property type="boolean" name="instance" access="ro">
+ <error typeref="SmfError" />
+ </property>
+
+ <property type="string" name="restarter" access="ro">
+ <error typeref="SmfError" />
+ </property>
+
+ <property typeref="SmfState" name="state" access="ro">
+ <error typeref="SmfError" />
+ </property>
+
+ <property typeref="SmfState" name="nextState" access="ro">
+ <error typeref="SmfError" />
+ </property>
+
+ <property type="string" name="auxiliaryState" access="ro"
+ nullable="true">
+ <error typeref="SmfError" />
+ </property>
+
+ <property type="time" name="stime" access="ro">
+ <error typeref="SmfError" />
+ </property>
+
+ <!-- Should be ulong -->
+ <property type="long" name="contractID" access="ro">
+ <error typeref="SmfError" />
+ </property>
+
+ <property type="string" name="reason" access="ro"
+ nullable="true">
+ <error typeref="SmfError" />
+ </property>
+
+ <event typeref="StateChange" name="statechange" />
+ </interface>
+</api>
--- a/components/visual-panels/core/src/apis/smf_old.xml Mon Oct 28 17:52:58 2013 -0700
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,382 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
-<!--
- Copyright (c) 2010, 2012, Oracle and/or its affiliates. All rights reserved.
-
- CDDL HEADER START
-
- The contents of this file are subject to the terms of the
- Common Development and Distribution License (the "License").
- You may not use this file except in compliance with the License.
-
- You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
- or http://www.opensolaris.org/os/licensing.
- See the License for the specific language governing permissions
- and limitations under the License.
-
- When distributing Covered Code, include this CDDL HEADER in each
- file and include the License file at usr/src/OPENSOLARIS.LICENSE.
- If applicable, add the following below this CDDL HEADER, with the
- fields enclosed by brackets "[]" replaced with your own identifying
- information: Portions Copyright [yyyy] [name of copyright owner]
-
- CDDL HEADER END
--->
-
-<api xmlns="http://xmlns.oracle.com/radadr"
- name="com.oracle.solaris.vp.panel.common.api.smf_old">
-
- <struct name="Service">
- <field type="string" name="fmri" />
- <field type="name" name="objectName" />
- <field name="instances">
- <list type="string" />
- </field>
- </struct>
-
- <enum name="SmfState">
- <value name="NONE" />
- <value name="UNINIT" />
- <value name="MAINT" />
- <value name="OFFLINE" />
- <value name="DISABLED" />
- <value name="ONLINE" />
- <value name="DEGRADED" />
- <value name="LEGACY" />
- </enum>
-
- <struct name="Instance">
- <field type="string" name="fmri" />
- <field type="name" name="objectName" />
- <field type="time" name="STime" /> <!-- %[email protected][email protected] java -->
- <field typeref="SmfState" name="state" />
- </struct>
-
- <struct name="Dependency">
- <field type="string" name="name" />
- <field name="target">
- <list type="string" />
- </field>
- <!-- Should be enums -->
- <field type="string" name="grouping" />
- <field type="string" name="restartOn" />
- </struct>
-
- <enum name="PropertyType">
- <value name="UNKNOWN" value="0" /> <!-- INVALID -->
- <value name="BOOLEAN" />
- <value name="COUNT" />
- <value name="INTEGER" />
- <value name="TIME" />
- <value name="ASTRING" />
- <value name="OPAQUE" />
- <value name="USTRING" value="100" />
- <value name="URI" value="200" />
- <value name="FMRI" />
- <value name="HOST" value="300" />
- <value name="HOSTNAME" />
- <value name="NET_ADDRESS_V4" />
- <value name="NET_ADDRESS_V6" />
- <value name="NET_ADDRESS" />
- </enum>
-
- <struct name="Manpage">
- <field type="string" name="title" />
- <field type="string" name="section" />
- <field type="string" name="path" />
- </struct>
-
- <struct name="PropertyGroup">
- <field type="string" name="name" />
- <field type="string" name="type" />
- </struct>
-
- <enum name="PropertyVisibility">
- <value name="HIDDEN" />
- <value name="READONLY" />
- <value name="READWRITE" />
- </enum>
-
- <struct name="Template">
- <field type="string" name="name" nullable="true" />
- <field type="string" name="description" nullable="true" />
- <field type="string" name="units" nullable="true" />
- <field typeref="PropertyVisibility" name="visibility" />
- <field type="string" name="cardinality" nullable="true" />
- <field name="separators" nullable="true" >
- <list type="string" />
- </field>
- <field name="allowed" nullable="true" >
- <list type="string" />
- </field>
- </struct>
-
- <struct name="StateChange">
- <field type="name" name="source" />
- <field typeref="SmfState" name="state" />
- <field typeref="SmfState" name="nextState" />
- <field type="string" name="auxState" nullable="true" />
- <field type="time" name="stateTime" />
- <field type="string" name="reason" nullable="true" />
- <field type="boolean" name="anomaly" />
- </struct>
-
- <enum name="SmfErrorCode">
- <value name="NONE" value="1000" />
- <value name="NOT_BOUND" />
- <value name="NOT_SET" />
- <value name="NOT_FOUND" />
- <value name="TYPE_MISMATCH" />
- <value name="IN_USE" />
- <value name="CONNECTION_BROKEN" />
- <value name="INVALID_ARGUMENT" />
- <value name="NO_MEMORY" />
- <value name="CONSTRAINT_VIOLATED" />
- <value name="EXISTS" />
- <value name="NO_SERVER" />
- <value name="NO_RESOURCES" />
- <value name="PERMISSION_DENIED" />
- <value name="BACKEND_ACCESS" />
- <value name="HANDLE_MISMATCH" />
- <value name="HANDLE_DESTROYED" />
- <value name="VERSION_MISMATCH" />
- <value name="BACKEND_READONLY" />
- <value name="DELETED" />
- <value name="TEMPLATE_INVALID" />
- <value name="CALLBACK_FAILED" value="1080" />
- <value name="INTERNAL" value="1101" />
- </enum>
-
- <struct name="LogInfo">
- <field type="string" name="name" />
- <field type="integer" name="size" />
- <field type="time" name="MTime" />
- <field type="opaque" name="contents" />
- </struct>
-
- <struct name="SmfError">
- <field typeref="SmfErrorCode" name="error" />
- <field type="string" name="message" nullable="true" />
- </struct>
-
- <interface name="Aggregator">
- <version major="1" minor="0" stability="private" />
-
- <property name="services" access="ro">
- <list typeref="Service" />
- <error typeref="SmfError" />
- </property>
-
- <property name="instances" access="ro">
- <list typeref="Instance" />
- <error typeref="SmfError" />
- </property>
-
- <event typeref="StateChange" name="statechange" />
- </interface>
-
- <interface name="ServiceInfo">
- <version major="1" minor="0" stability="private" />
-
- <property type="string" name="fmri" access="ro">
- <error typeref="SmfError" />
- </property>
-
- <property name="methodNames" access="ro">
- <list type="string" />
- <error typeref="SmfError" />
- </property>
- <property name="dependencyNames" access="ro">
- <list type="string" />
- <error typeref="SmfError" />
- </property>
-
- <method name="getDependency">
- <result typeref="Dependency" />
- <error typeref="SmfError" />
- <argument type="string" name="name" />
- </method>
-
- <method name="getPropertyNames">
- <result>
- <list type="string" />
- </result>
- <error typeref="SmfError" />
- <argument type="string" name="pg_name" />
- </method>
-
- <method name="getPropertyType">
- <result typeref="PropertyType" />
- <error typeref="SmfError" />
- <argument type="string" name="pg_name" />
- <argument type="string" name="prop_name" />
- </method>
-
- <method name="getPropertyValues">
- <result>
- <list type="string" />
- </result>
- <error typeref="SmfError" />
- <argument type="string" name="pg_name" />
- <argument type="string" name="prop_name" />
- </method>
-
- <method name="getSnapshotPropertyValues">
- <result>
- <list type="string" />
- </result>
- <error typeref="SmfError" />
- <argument type="string" name="snap_name" />
- <argument type="string" name="pg_name" />
- <argument type="string" name="prop_name" />
- </method>
-
- <method name="setPropertyValues">
- <error typeref="SmfError" />
- <argument type="string" name="pg_name" />
- <argument type="string" name="prop_name" />
- <argument name="values">
- <list type="string" />
- </argument>
- </method>
-
- <method name="createPropertyGroup">
- <error typeref="SmfError" />
- <argument type="string" name="pg_name" />
- <argument type="string" name="pg_type" />
- </method>
-
- <method name="deletePropertyGroup">
- <error typeref="SmfError" />
- <argument type="string" name="pg_name" />
- </method>
-
- <method name="createProperty">
- <error typeref="SmfError" />
- <argument type="string" name="pg_name" />
- <argument type="string" name="prop_name" />
- <argument typeref="PropertyType" name="type" />
- </method>
-
- <method name="deleteProperty">
- <error typeref="SmfError" />
- <argument type="string" name="pg_name" />
- <argument type="string" name="prop_name" />
- </method>
-
- <property name="propertyGroups" access="ro">
- <list typeref="PropertyGroup" />
- <error typeref="SmfError" />
- </property>
-
- <method name="getPropertyTemplate">
- <result typeref="Template" />
- <error typeref="SmfError" />
- <argument type="string" name="pg_name" />
- <argument type="string" name="prop_name" />
- <argument type="string" name="locale" />
- </method>
-
- <method name="getCommonName">
- <result type="string" nullable="true" />
- <error typeref="SmfError" />
- <argument type="string" name="locale" />
- </method>
-
- <method name="getDescription">
- <result type="string" nullable="true" />
- <error typeref="SmfError" />
- <argument type="string" name="locale" />
- </method>
-
- <method name="getLogInfo">
- <result typeref="LogInfo" />
- <error />
- <argument type="integer" name="max_size" />
- </method>
-
- <property name="manpages" access="ro">
- <list typeref="Manpage" />
- <error typeref="SmfError" />
- </property>
-
- <property name="doclinks" access="ro">
- <list type="string" />
- <error typeref="SmfError" />
- </property>
-
- <method name="delete">
- <error typeref="SmfError" />
- </method>
-
- <method name="clear">
- <error typeref="SmfError" />
- </method>
-
- <method name="degrade">
- <error typeref="SmfError" />
- <argument type="boolean" name="immediate" />
- </method>
-
- <method name="maintain">
- <error typeref="SmfError" />
- <argument type="boolean" name="immediate" />
- </method>
-
- <method name="restart">
- <error typeref="SmfError" />
- </method>
-
- <method name="refresh">
- <error typeref="SmfError" />
- </method>
-
- <property type="boolean" name="persistentlyEnabled" access="rw">
- <error typeref="SmfError" />
- </property>
-
- <property type="boolean" name="temporarilyEnabled" access="ro">
- <error typeref="SmfError" />
- </property>
-
- <property type="boolean" name="enabled" access="ro">
- <error typeref="SmfError" />
- </property>
-
- <property type="boolean" name="instance" access="ro">
- <error typeref="SmfError" />
- </property>
-
- <property type="string" name="restarter" access="ro">
- <error typeref="SmfError" />
- </property>
-
- <property typeref="SmfState" name="state" access="ro">
- <error typeref="SmfError" />
- </property>
-
- <property typeref="SmfState" name="nextState" access="ro">
- <error typeref="SmfError" />
- </property>
-
- <property type="string" name="auxiliaryState" access="ro"
- nullable="true">
- <error typeref="SmfError" />
- </property>
-
- <property type="time" name="stime" access="ro">
- <error typeref="SmfError" />
- </property>
-
- <!-- Should be ulong -->
- <property type="long" name="contractID" access="ro">
- <error typeref="SmfError" />
- </property>
-
- <property type="string" name="reason" access="ro"
- nullable="true">
- <error typeref="SmfError" />
- </property>
-
- <event typeref="StateChange" name="statechange" />
- </interface>
-</api>
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/components/visual-panels/core/src/apis/time.adr Wed Oct 30 16:53:48 2013 -0400
@@ -0,0 +1,87 @@
+<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
+<!--
+ Copyright (c) 2009, 2013, Oracle and/or its affiliates. All rights reserved.
+
+ CDDL HEADER START
+
+ The contents of this file are subject to the terms of the
+ Common Development and Distribution License (the "License").
+ You may not use this file except in compliance with the License.
+
+ You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ or http://www.opensolaris.org/os/licensing.
+ See the License for the specific language governing permissions
+ and limitations under the License.
+
+ When distributing Covered Code, include this CDDL HEADER in each
+ file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ If applicable, add the following below this CDDL HEADER, with the
+ fields enclosed by brackets "[]" replaced with your own identifying
+ information: Portions Copyright [yyyy] [name of copyright owner]
+
+ CDDL HEADER END
+-->
+
+<api xmlns="http://xmlns.oracle.com/radadr"
+ name="com.oracle.solaris.vp.panels.time">
+ <version major="1" minor="0" />
+
+ <struct name="ServerInfo">
+ <field type="string" name="server" />
+ <field type="boolean" name="enabled" />
+ </struct>
+
+ <struct name="Continent">
+ <field type="string" name="name" />
+ <field type="string" name="description" />
+ </struct>
+
+ <struct name="Country">
+ <field type="string" name="code" />
+ <field type="string" name="description" />
+ </struct>
+
+ <struct name="Coordinates">
+ <field type="integer" name="degreesE" />
+ <field type="integer" name="degreesN" />
+ <field type="integer" name="minutesE" />
+ <field type="integer" name="minutesN" />
+ <field type="integer" name="secondsE" />
+ <field type="integer" name="secondsN" />
+ </struct>
+
+ <struct name="TimeZoneInfo">
+ <field type="string" name="name" />
+ <field type="string" name="altName" nullable="true" />
+ <field type="string" name="countryCode" />
+ <field type="string" name="comments" nullable="true" />
+ <field typeref="Coordinates" name="coordinates" />
+ </struct>
+
+ <interface name="Time">
+ <!-- <property type="time" name="Time" access="rw" /> -->
+ <!-- read/write raw milliseconds for the time being -->
+ <property type="time" name="time" access="rw">
+ <error />
+ </property>
+ <property type="string" name="defaultTimeZone" access="rw">
+ <error />
+ </property>
+ <property name="ntpServers" access="rw">
+ <list typeref="ServerInfo" />
+ <error />
+ </property>
+ <property type="boolean" name="sufficientlyPrivileged"
+ access="ro"/>
+ <property name="continents" access="ro">
+ <list typeref="Continent" />
+ </property>
+ <property name="countries" access="ro">
+ <list typeref="Country" />
+ </property>
+ <property name="timeZones" access="ro">
+ <list typeref="TimeZoneInfo" />
+ </property>
+ </interface>
+
+</api>
--- a/components/visual-panels/core/src/apis/time.xml Mon Oct 28 17:52:58 2013 -0700
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,88 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
-<!--
- Copyright (c) 2009, 2012, Oracle and/or its affiliates. All rights reserved.
-
- CDDL HEADER START
-
- The contents of this file are subject to the terms of the
- Common Development and Distribution License (the "License").
- You may not use this file except in compliance with the License.
-
- You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
- or http://www.opensolaris.org/os/licensing.
- See the License for the specific language governing permissions
- and limitations under the License.
-
- When distributing Covered Code, include this CDDL HEADER in each
- file and include the License file at usr/src/OPENSOLARIS.LICENSE.
- If applicable, add the following below this CDDL HEADER, with the
- fields enclosed by brackets "[]" replaced with your own identifying
- information: Portions Copyright [yyyy] [name of copyright owner]
-
- CDDL HEADER END
--->
-
-<api xmlns="http://xmlns.oracle.com/radadr"
- name="com.oracle.solaris.vp.panels.time">
-
- <struct name="ServerInfo">
- <field type="string" name="server" />
- <field type="boolean" name="enabled" />
- </struct>
-
- <struct name="Continent">
- <field type="string" name="name" />
- <field type="string" name="description" />
- </struct>
-
- <struct name="Country">
- <field type="string" name="code" />
- <field type="string" name="description" />
- </struct>
-
- <struct name="Coordinates">
- <field type="integer" name="degreesE" />
- <field type="integer" name="degreesN" />
- <field type="integer" name="minutesE" />
- <field type="integer" name="minutesN" />
- <field type="integer" name="secondsE" />
- <field type="integer" name="secondsN" />
- </struct>
-
- <struct name="TimeZoneInfo">
- <field type="string" name="name" />
- <field type="string" name="altName" nullable="true" />
- <field type="string" name="countryCode" />
- <field type="string" name="comments" nullable="true" />
- <field typeref="Coordinates" name="coordinates" />
- </struct>
-
- <interface name="Time">
- <version major="1" minor="0" stability="private" />
-
- <!-- <property type="time" name="Time" access="rw" /> -->
- <!-- read/write raw milliseconds for the time being -->
- <property type="time" name="time" access="rw">
- <error />
- </property>
- <property type="string" name="defaultTimeZone" access="rw">
- <error />
- </property>
- <property name="ntpServers" access="rw">
- <list typeref="ServerInfo" />
- <error />
- </property>
- <property type="boolean" name="sufficientlyPrivileged"
- access="ro"/>
- <property name="continents" access="ro">
- <list typeref="Continent" />
- </property>
- <property name="countries" access="ro">
- <list typeref="Country" />
- </property>
- <property name="timeZones" access="ro">
- <list typeref="TimeZoneInfo" />
- </property>
- </interface>
-
-</api>
--- a/components/visual-panels/core/src/cmd/rad/mod/files/Makefile Mon Oct 28 17:52:58 2013 -0700
+++ b/components/visual-panels/core/src/cmd/rad/mod/files/Makefile Wed Oct 30 16:53:48 2013 -0400
@@ -20,14 +20,15 @@
#
#
-# Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved.
#
include $(SRC)/make-rules/Makefile.env
+VERS=.1
MOD_APIS=file
MOD_OBJS=mod_files.o
-MOD_LIBNAME=mod_files.so
+MOD_LIBNAME=mod_files.so$(VERS)
MOD_INSTALLDIR=$(RADDIR_MODULE)
APISDIR=../../../../apis
--- a/components/visual-panels/core/src/cmd/rad/mod/files/mod_files.c Mon Oct 28 17:52:58 2013 -0700
+++ b/components/visual-panels/core/src/cmd/rad/mod/files/mod_files.c Wed Oct 30 16:53:48 2013 -0400
@@ -20,7 +20,7 @@
*/
/*
- * Copyright (c) 2009, 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2009, 2013, Oracle and/or its affiliates. All rights reserved.
*/
/*
@@ -135,7 +135,7 @@
adr_data_t *result = adr_data_new_array(&t_array__FileSnapshot, 1);
(void) adr_array_add(result, read_file("/", NULL));
*data = adr_data_purify(result);
- return (ce_ok);
+ return (CE_OK);
}
/* ARGSUSED */
@@ -144,7 +144,7 @@
adr_data_t **ret, adr_data_t **args, int count, adr_data_t **error)
{
*ret = read_file(adr_data_to_string(args[0]), NULL);
- return (ce_ok);
+ return (CE_OK);
}
/* ARGSUSED */
@@ -158,7 +158,7 @@
adr_data_t *result;
if (d == NULL)
- return (ce_object);
+ return (CE_OBJECT);
result = adr_data_new_array(&t_array__FileSnapshot, 1);
while ((ent = readdir(d)) != NULL) {
@@ -178,23 +178,31 @@
(void) closedir(d);
*ret = adr_data_purify(result);
- return (ce_ok);
+ return (CE_OK);
}
-static rad_modinfo_t modinfo = { "files", "File Browser module" };
-
int
-_rad_init(void *handle)
+_rad_init(void)
{
- if (rad_module_register(handle, RAD_MODVERSION, &modinfo) == -1)
+ adr_name_t *aname = adr_name_vcreate(
+ MOD_DOMAIN, 1, "type", "FileBrowser");
+ conerr_t cerr = rad_cont_insert_singleton(rad_container, aname,
+ &modinfo, &interface_FileBrowser_svr);
+ adr_name_rele(aname);
+ if (cerr != CE_OK) {
+ rad_log(RL_ERROR, "(mod_files) failed to insert FileBrowser");
return (-1);
-
- if (rad_isproxy)
- return (0);
-
- (void) cont_insert_singleton(rad_container, adr_name_fromstr(
- "com.oracle.solaris.vp.panel.common.api.file:type=FileBrowser"),
- &interface_FileBrowser_svr);
+ }
return (0);
}
+
+/*
+ * _rad_fini is called by the RAD daemon when the module is unloaded. Any
+ * module finalisation is completed here.
+ */
+/*ARGSUSED*/
+void
+_rad_fini(void *unused)
+{
+}
--- a/components/visual-panels/core/src/cmd/rad/mod/network/Makefile Mon Oct 28 17:52:58 2013 -0700
+++ b/components/visual-panels/core/src/cmd/rad/mod/network/Makefile Wed Oct 30 16:53:48 2013 -0400
@@ -20,16 +20,17 @@
#
#
-# Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved.
#
include $(SRC)/make-rules/Makefile.env
LDLIBS += -lsocket -lnsl
+VERS=.1
MOD_APIS=network
MOD_OBJS=mod_network.o
-MOD_LIBNAME=mod_network.so
+MOD_LIBNAME=mod_network.so$(VERS)
MOD_INSTALLDIR=$(RADDIR_MODULE)
APISDIR=../../../../apis
--- a/components/visual-panels/core/src/cmd/rad/mod/network/mod_network.c Mon Oct 28 17:52:58 2013 -0700
+++ b/components/visual-panels/core/src/cmd/rad/mod/network/mod_network.c Wed Oct 30 16:53:48 2013 -0400
@@ -20,7 +20,7 @@
*/
/*
- * Copyright (c) 2009, 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2009, 2013, Oracle and/or its affiliates. All rights reserved.
*/
#include <sys/types.h>
@@ -75,26 +75,26 @@
adr_data_t *result;
if ((fd = socket(AF_INET, SOCK_DGRAM, 0)) == -1)
- return (ce_object);
+ return (CE_OBJECT);
do {
if (reqs != NULL)
free(reqs);
if (if_count(fd, &count) == -1)
- return (ce_object);
+ return (CE_OBJECT);
if (count == 0) {
(void) close(fd);
*data = adr_data_new_array(&adr_t_array_string, 0);
- return (ce_ok);
+ return (CE_OK);
}
count += 5;
reqsize = count * sizeof (struct lifreq);
if ((reqs = malloc(reqsize)) == NULL) {
(void) close(fd);
- return (ce_object);
+ return (CE_OBJECT);
}
ifconf.lifc_family = AF_INET;
@@ -104,7 +104,7 @@
if (ioctl(fd, SIOCGLIFCONF, &ifconf) == -1) {
(void) close(fd);
free(reqs);
- return (ce_object);
+ return (CE_OBJECT);
}
rcount = ifconf.lifc_len / sizeof (struct lifreq);
} while (rcount >= count);
@@ -125,7 +125,7 @@
free(reqs);
*data = adr_data_purify_deep(result);
- return (ce_ok);
+ return (CE_OK);
}
/* ARGSUSED */
@@ -139,21 +139,21 @@
ipaddr_t addr;
if (inet_pton(AF_INET, adr_data_to_string(args[0]), &addr) != 1)
- return (ce_object);
+ return (CE_OBJECT);
if ((he = getipnodebyaddr(&addr, sizeof (addr), AF_INET, &errnum))
== NULL) {
/* Not found? Bounce it back. */
(void) adr_data_ref(args[0]);
*ret = args[0];
- return (ce_ok);
+ return (CE_OK);
}
adr_data_t *result = adr_data_new_string(he->h_name, LT_COPY);
freehostent(he);
*ret = result;
- return (ce_ok);
+ return (CE_OK);
}
/* ARGSUSED */
@@ -167,7 +167,7 @@
if ((he = getipnodebyname(adr_data_to_string(args[0]), AF_INET,
AI_DEFAULT, &errnum)) == NULL) {
*ret = NULL;
- return (ce_object);
+ return (CE_OBJECT);
}
int n = 0;
@@ -185,7 +185,7 @@
*ret = adr_data_purify_deep(result);
freehostent(he);
- return (ce_ok);
+ return (CE_OK);
}
/* ARGSUSED */
@@ -216,7 +216,7 @@
//
// See: man -s3 socket getifaddrs
if (getifaddrs(&ifaddr) == -1) {
- return (ce_object);
+ return (CE_OBJECT);
}
/* Iterate over linked list of IP addresses */
@@ -246,23 +246,30 @@
}
}
freeifaddrs(ifaddr);
- return (ce_ok);
+ return (CE_OK);
}
-static rad_modinfo_t modinfo = { "network", "Network panel support" };
-
int
-_rad_init(void *handle)
+_rad_init(void)
{
- if (rad_module_register(handle, RAD_MODVERSION, &modinfo) == -1)
+ adr_name_t *aname = adr_name_vcreate(MOD_DOMAIN, 1, "type", "Network");
+ conerr_t cerr = rad_cont_insert_singleton(rad_container, aname,
+ &modinfo, &interface_Network_svr);
+ adr_name_rele(aname);
+ if (cerr != CE_OK) {
+ rad_log(RL_ERROR, "(mod_network) failed to insert Network");
return (-1);
-
- if (rad_isproxy)
- return (0);
-
- (void) cont_insert_singleton(rad_container, adr_name_fromstr(
- "com.oracle.solaris.vp.panel.common.api.network:type=Network"),
- &interface_Network_svr);
+ }
return (0);
}
+
+/*
+ * _rad_fini is called by the RAD daemon when the module is unloaded. Any
+ * module finalisation is completed here.
+ */
+/*ARGSUSED*/
+void
+_rad_fini(void *unused)
+{
+}
--- a/components/visual-panels/core/src/cmd/rad/mod/panels/Makefile Mon Oct 28 17:52:58 2013 -0700
+++ b/components/visual-panels/core/src/cmd/rad/mod/panels/Makefile Wed Oct 30 16:53:48 2013 -0400
@@ -20,7 +20,7 @@
#
#
-# Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved.
#
include $(SRC)/make-rules/Makefile.env
@@ -31,9 +31,10 @@
# Compensate for libxml's lint library
LINTFLAGS += -erroff=E_INCONS_ARG_DECL2
-MOD_APIS=panels
+VERS=.1
+MOD_APIS=panel
MOD_OBJS=mod_panels.o
-MOD_LIBNAME=mod_panels.so
+MOD_LIBNAME=mod_panels.so$(VERS)
MOD_INSTALLDIR=$(RADDIR_MODULE)
DTDDIR=$(ROOT)/usr/share/lib/xml/dtd
--- a/components/visual-panels/core/src/cmd/rad/mod/panels/mod_panels.c Mon Oct 28 17:52:58 2013 -0700
+++ b/components/visual-panels/core/src/cmd/rad/mod/panels/mod_panels.c Wed Oct 30 16:53:48 2013 -0400
@@ -20,7 +20,7 @@
*/
/*
- * Copyright (c) 2009, 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2009, 2013, Oracle and/or its affiliates. All rights reserved.
*/
#include <assert.h>
@@ -34,7 +34,7 @@
#include <string.h>
#include <sys/stat.h>
#include <unistd.h>
-#include "api_panels.h"
+#include "api_panel.h"
#define PANELDESCDIR "/usr/share/vpanels/conf"
@@ -63,7 +63,6 @@
*/
static xmlDtd *dtd;
-static rad_modinfo_t modinfo = { "panels", "Visual Panels module" };
/*
* Static functions
@@ -182,7 +181,7 @@
}
if (nullcnt != 3 || token[tokenlen - 1] != '\0') {
/* Bad token */
- return (ce_object);
+ return (CE_OBJECT);
}
char *locale = token;
@@ -192,7 +191,7 @@
adr_data_t *panel = read_panel(locale, pname);
if (panel == NULL) {
/* Bad panel */
- return (ce_object);
+ return (CE_OBJECT);
}
adr_data_t *resources = adr_struct_get(panel, "resourceDescriptors");
@@ -201,15 +200,15 @@
adr_data_free(panel);
if (index == -1) {
/* Bad file */
- return (ce_object);
+ return (CE_OBJECT);
}
*f = strdup(file);
if (*f == NULL) {
- return (ce_nomem);
+ return (CE_NOMEM);
}
- return (ce_ok);
+ return (CE_OK);
}
static adr_data_t *
@@ -408,21 +407,33 @@
*/
int
-_rad_init(void *handle)
+_rad_init(void)
{
- if (rad_module_register(handle, RAD_MODVERSION, &modinfo) == -1)
- return (-1);
-
dtd = xmlParseDTD(NULL,
(xmlChar *)"/usr/share/lib/xml/dtd/vpanel.dtd.1");
- adr_name_t *name = adr_name_fromstr(
- "com.oracle.solaris.vp.panel.common.api.panel:type=Panel");
- (void) cont_insert_singleton(rad_container, name, &interface_Panel_svr);
+ adr_name_t *aname = adr_name_vcreate(MOD_DOMAIN, 1, "type", "Panel");
+ conerr_t cerr = rad_cont_insert_singleton(rad_container, aname,
+ &modinfo, &interface_Panel_svr);
+ adr_name_rele(aname);
+ if (cerr != CE_OK) {
+ rad_log(RL_ERROR, "(mod_panels) failed to insert Panel");
+ return (-1);
+ }
return (0);
}
+/*
+ * _rad_fini is called by the RAD daemon when the module is unloaded. Any
+ * module finalisation is completed here.
+ */
+/*ARGSUSED*/
+void
+_rad_fini(void *unused)
+{
+}
+
/* ARGSUSED */
conerr_t
interface_Panel_invoke_getPanel(rad_instance_t *inst, adr_method_t *meth,
@@ -438,11 +449,11 @@
* Could be a memory or system error, but more likely an invalid
* name was specified.
*/
- return (ce_object);
+ return (CE_OBJECT);
}
*ret = panel;
- return (ce_ok);
+ return (CE_OK);
}
/* ARGSUSED */
@@ -452,15 +463,15 @@
{
adr_data_t *array = adr_data_new_array(&adr_t_array_string, 0);
if (array == NULL) {
- return (ce_nomem);
+ return (CE_NOMEM);
}
DIR *d;
if ((d = opendir(PANELDESCDIR)) == NULL) {
if (errno == ENOENT) {
- return (ce_ok);
+ return (CE_OK);
}
- return (ce_system);
+ return (CE_SYSTEM);
}
struct dirent *ent;
@@ -477,7 +488,7 @@
(void) closedir(d);
*data = adr_data_purify(array);
- return (*data == NULL ? ce_nomem : ce_ok);
+ return (*data == NULL ? CE_NOMEM : CE_OK);
}
/* ARGSUSED */
@@ -487,37 +498,37 @@
{
char *file;
conerr_t result = token_to_file(args[0], &file);
- if (result != ce_ok) {
+ if (result != CE_OK) {
return (result);
}
struct stat st;
if (stat(file, &st) != 0) {
free(file);
- return (ce_object);
+ return (CE_OBJECT);
}
char *buffer = malloc(st.st_size);
if (buffer == NULL) {
free(file);
- return (ce_nomem);
+ return (CE_NOMEM);
}
int fd = open(file, O_RDONLY);
free(file);
if (fd == -1) {
free(buffer);
- return (ce_priv);
+ return (CE_PRIV);
}
if (read(fd, buffer, st.st_size) != st.st_size) {
(void) close(fd);
free(buffer);
- return (ce_system);
+ return (CE_SYSTEM);
}
(void) close(fd);
*ret = adr_data_new_opaque(buffer, st.st_size, LT_FREE);
- return (*ret == NULL ? ce_nomem : ce_ok);
+ return (*ret == NULL ? CE_NOMEM : CE_OK);
}
--- a/components/visual-panels/core/src/cmd/rad/mod/smf_old/Makefile Mon Oct 28 17:52:58 2013 -0700
+++ b/components/visual-panels/core/src/cmd/rad/mod/smf_old/Makefile Wed Oct 30 16:53:48 2013 -0400
@@ -20,15 +20,17 @@
#
#
-# Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved.
#
include $(SRC)/make-rules/Makefile.env
LDLIBS += -lscf
+
+VERS=.1
MOD_APIS=smf_old
-MOD_OBJS=mod_smf.o propvec.o
-MOD_LIBNAME=mod_smf_old.so
+MOD_OBJS=mod_smf.o propvec.o /usr/lib/libcmdutils.so.1
+MOD_LIBNAME=mod_smf_old.so$(VERS)
MOD_INSTALLDIR=$(RADDIR_MODULE)
APISDIR=../../../../apis
--- a/components/visual-panels/core/src/cmd/rad/mod/smf_old/mod_smf.c Mon Oct 28 17:52:58 2013 -0700
+++ b/components/visual-panels/core/src/cmd/rad/mod/smf_old/mod_smf.c Wed Oct 30 16:53:48 2013 -0400
@@ -20,7 +20,7 @@
*/
/*
- * Copyright (c) 2010, 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved.
*/
#include <sys/list.h>
@@ -47,9 +47,6 @@
static int service_count = 0;
static int instance_count = 0;
-static const char *aggregator_pattern =
- "com.oracle.solaris.vp.panel.common.api.smf_old:type=Aggregator";
-
typedef struct servinst {
char *sname; /* Service name */
char *iname; /* Instance name */
@@ -84,14 +81,14 @@
adr_data_new_string(scf_strerror(code), LT_CONST));
*error = adr_data_purify(e);
}
- return (ce_object);
+ return (CE_OBJECT);
}
static conerr_t
simple_scf(adr_data_t **error, int result)
{
if (result == 0)
- return (ce_ok);
+ return (CE_OK);
return (error_scf(error, scf_error()));
}
@@ -128,7 +125,7 @@
boolean_t(*fp)(const char **, const char *), const char **set,
adr_data_t **error)
{
- conerr_t err = ce_ok;
+ conerr_t err = CE_OK;
scf_handle_t *scfhandle = handle_create();
scf_service_t *service = scf_service_create(scfhandle);
scf_instance_t *instance = scf_instance_create(scfhandle);
@@ -203,9 +200,9 @@
interface_ServiceInfo_read_fmri(rad_instance_t *inst, adr_attribute_t *attr,
adr_data_t **data, adr_data_t **error)
{
- servinst_t *si = instance_getdata(inst);
+ servinst_t *si = rad_instance_getdata(inst);
*data = adr_data_new_string(si->fmri, LT_COPY);
- return (ce_ok);
+ return (CE_OK);
}
/* ARGSUSED */
@@ -214,8 +211,8 @@
adr_attribute_t *attr, adr_data_t **data, adr_data_t **error)
{
const char *pgtypes[] = { SCF_GROUP_METHOD, NULL };
- return (getpgs(instance_getdata(inst), data, B_TRUE, strinset, pgtypes,
- error));
+ return (getpgs(rad_instance_getdata(inst), data, B_TRUE,
+ strinset, pgtypes, error));
}
/* ARGSUSED */
@@ -224,8 +221,8 @@
adr_attribute_t *attr, adr_data_t **data, adr_data_t **error)
{
const char *pgtypes[] = { SCF_GROUP_DEPENDENCY, NULL };
- return (getpgs(instance_getdata(inst), data, B_TRUE, strinset, pgtypes,
- error));
+ return (getpgs(rad_instance_getdata(inst), data, B_TRUE,
+ strinset, pgtypes, error));
}
/* ARGSUSED */
@@ -233,8 +230,8 @@
interface_ServiceInfo_read_propertyGroups(rad_instance_t *inst,
adr_attribute_t *attr, adr_data_t **data, adr_data_t **error)
{
- return (getpgs(instance_getdata(inst), data, B_FALSE, strnotinset,
- framework_pgtypes, error));
+ return (getpgs(rad_instance_getdata(inst), data, B_FALSE,
+ strnotinset, framework_pgtypes, error));
}
/* ARGSUSED */
@@ -242,7 +239,7 @@
interface_ServiceInfo_read_manpages(rad_instance_t *inst, adr_attribute_t *attr,
adr_data_t **data, adr_data_t **error)
{
- servinst_t *si = instance_getdata(inst);
+ servinst_t *si = rad_instance_getdata(inst);
char *title, *section, *path;
rad_propvec_t *badprop;
rad_propvec_t evec[] = {
@@ -260,7 +257,7 @@
adr_data_t *pgs;
conerr_t err = getpgs(si, &pgs, B_TRUE, strinset, pgtypes, error);
- if (err != ce_ok)
+ if (err != CE_OK)
return (err);
adr_data_t *result = adr_data_new_array(&t_array__Manpage, 5);
for (int i = 0; i < adr_array_size(pgs); i++) {
@@ -286,7 +283,7 @@
adr_data_free(pgs);
*data = result;
- return (ce_ok);
+ return (CE_OK);
}
/* ARGSUSED */
@@ -294,7 +291,7 @@
interface_ServiceInfo_read_doclinks(rad_instance_t *inst, adr_attribute_t *attr,
adr_data_t **data, adr_data_t **error)
{
- servinst_t *si = instance_getdata(inst);
+ servinst_t *si = rad_instance_getdata(inst);
char *uri;
rad_propvec_t *badprop;
rad_propvec_t evec[] = {
@@ -309,7 +306,7 @@
adr_data_t *pgs;
conerr_t err = getpgs(si, &pgs, B_TRUE, strinset, pgtypes, error);
- if (err != ce_ok)
+ if (err != CE_OK)
return (err);
adr_data_t *result = adr_data_new_array(&adr_t_array_string, 5);
for (int i = 0; i < adr_array_size(pgs); i++) {
@@ -329,7 +326,7 @@
adr_data_free(pgs);
*data = result;
- return (ce_ok);
+ return (CE_OK);
}
/* ARGSUSED */
@@ -337,7 +334,7 @@
interface_ServiceInfo_read_persistentlyEnabled(rad_instance_t *inst,
adr_attribute_t *attr, adr_data_t **data, adr_data_t **error)
{
- servinst_t *si = instance_getdata(inst);
+ servinst_t *si = rad_instance_getdata(inst);
if (!si->instance)
return (error_scf(error, SCF_ERROR_INVALID_ARGUMENT));
@@ -355,7 +352,7 @@
rad_clean_propvec(evec);
*data = adr_data_new_boolean(enabled);
- return (ce_ok);
+ return (CE_OK);
}
/* ARGSUSED */
@@ -363,7 +360,7 @@
interface_ServiceInfo_read_temporarilyEnabled(rad_instance_t *inst,
adr_attribute_t *attr, adr_data_t **data, adr_data_t **error)
{
- servinst_t *si = instance_getdata(inst);
+ servinst_t *si = rad_instance_getdata(inst);
if (!si->instance)
return (error_scf(error, SCF_ERROR_INVALID_ARGUMENT));
@@ -381,7 +378,7 @@
rad_clean_propvec(evec);
*data = adr_data_new_boolean(enabled);
- return (ce_ok);
+ return (CE_OK);
}
/* ARGSUSED */
@@ -401,9 +398,9 @@
interface_ServiceInfo_read_instance(rad_instance_t *inst, adr_attribute_t *attr,
adr_data_t **data, adr_data_t **error)
{
- servinst_t *si = instance_getdata(inst);
+ servinst_t *si = rad_instance_getdata(inst);
*data = adr_data_new_boolean(si->instance);
- return (ce_ok);
+ return (CE_OK);
}
/* ARGSUSED */
@@ -411,7 +408,7 @@
interface_ServiceInfo_read_restarter(rad_instance_t *inst,
adr_attribute_t *attr, adr_data_t **data, adr_data_t **error)
{
- servinst_t *si = instance_getdata(inst);
+ servinst_t *si = rad_instance_getdata(inst);
if (!si->instance)
return (error_scf(error, SCF_ERROR_INVALID_ARGUMENT));
@@ -431,7 +428,7 @@
"system/svc/restarter", "default");
}
- return (*data != NULL ? ce_ok : ce_system);
+ return (*data != NULL ? CE_OK : CE_SYSTEM);
}
static adr_data_t *
@@ -453,7 +450,7 @@
interface_ServiceInfo_read_state(rad_instance_t *inst, adr_attribute_t *attr,
adr_data_t **data, adr_data_t **error)
{
- servinst_t *si = instance_getdata(inst);
+ servinst_t *si = rad_instance_getdata(inst);
if (!si->instance)
return (error_scf(error, SCF_ERROR_INVALID_ARGUMENT));
@@ -463,7 +460,7 @@
*data = state2enum(state);
free(state);
- return (*data != NULL ? ce_ok : ce_system);
+ return (*data != NULL ? CE_OK : CE_SYSTEM);
}
/* ARGSUSED */
@@ -471,7 +468,7 @@
interface_ServiceInfo_read_nextState(rad_instance_t *inst,
adr_attribute_t *attr, adr_data_t **data, adr_data_t **error)
{
- servinst_t *si = instance_getdata(inst);
+ servinst_t *si = rad_instance_getdata(inst);
if (!si->instance)
return (error_scf(error, SCF_ERROR_INVALID_ARGUMENT));
@@ -489,7 +486,7 @@
*data = state2enum(state);
rad_clean_propvec(evec);
- return (*data != NULL ? ce_ok : ce_system);
+ return (*data != NULL ? CE_OK : CE_SYSTEM);
}
/* ARGSUSED */
@@ -497,7 +494,7 @@
interface_ServiceInfo_read_auxiliaryState(rad_instance_t *inst,
adr_attribute_t *attr, adr_data_t **data, adr_data_t **error)
{
- servinst_t *si = instance_getdata(inst);
+ servinst_t *si = rad_instance_getdata(inst);
if (!si->instance)
return (error_scf(error, SCF_ERROR_INVALID_ARGUMENT));
@@ -513,7 +510,7 @@
if (scferr != 0) {
if (scferr == SCF_ERROR_NOT_FOUND) {
*data = NULL;
- return (ce_ok);
+ return (CE_OK);
}
return (error_scf(error, scferr));
}
@@ -521,7 +518,7 @@
*data = adr_data_new_string(aux, LT_COPY);
rad_clean_propvec(evec);
- return (*data != NULL ? ce_ok : ce_system);
+ return (*data != NULL ? CE_OK : CE_SYSTEM);
}
/* ARGSUSED */
@@ -529,7 +526,7 @@
interface_ServiceInfo_read_stime(rad_instance_t *inst, adr_attribute_t *attr,
adr_data_t **data, adr_data_t **error)
{
- servinst_t *si = instance_getdata(inst);
+ servinst_t *si = rad_instance_getdata(inst);
if (!si->instance)
return (error_scf(error, SCF_ERROR_INVALID_ARGUMENT));
@@ -549,7 +546,7 @@
*data = adr_data_new_time(time.t_seconds, time.t_ns);
- return (*data != NULL ? ce_ok : ce_system);
+ return (*data != NULL ? CE_OK : CE_SYSTEM);
}
/* ARGSUSED */
@@ -557,7 +554,7 @@
interface_ServiceInfo_read_contractID(rad_instance_t *inst,
adr_attribute_t *attr, adr_data_t **data, adr_data_t **error)
{
- servinst_t *si = instance_getdata(inst);
+ servinst_t *si = rad_instance_getdata(inst);
if (!si->instance)
return (error_scf(error, SCF_ERROR_INVALID_ARGUMENT));
@@ -576,7 +573,7 @@
*data = adr_data_new_long(count);
- return (*data != NULL ? ce_ok : ce_system);
+ return (*data != NULL ? CE_OK : CE_SYSTEM);
}
/* ARGSUSED */
@@ -584,11 +581,11 @@
interface_ServiceInfo_read_reason(rad_instance_t *inst, adr_attribute_t *attr,
adr_data_t **data, adr_data_t **error)
{
- servinst_t *si = instance_getdata(inst);
+ servinst_t *si = rad_instance_getdata(inst);
if (!si->instance)
return (error_scf(error, SCF_ERROR_INVALID_ARGUMENT));
*data = NULL;
- return (ce_ok);
+ return (CE_OK);
}
/* ARGSUSED */
@@ -596,7 +593,7 @@
interface_ServiceInfo_write_persistentlyEnabled(rad_instance_t *inst,
adr_attribute_t *attr, adr_data_t *data, adr_data_t **error)
{
- servinst_t *si = instance_getdata(inst);
+ servinst_t *si = rad_instance_getdata(inst);
boolean_t enable = adr_data_to_boolean(data);
if (!si->instance)
return (error_scf(error, SCF_ERROR_INVALID_ARGUMENT));
@@ -609,7 +606,7 @@
get_pg(scf_handle_t *scfhandle, scf_propertygroup_t *pg, servinst_t *si,
const char *snapname, const char *pgname, adr_data_t **error)
{
- conerr_t err = ce_ok;
+ conerr_t err = CE_OK;
scf_service_t *service = scf_service_create(scfhandle);
scf_instance_t *instance = scf_instance_create(scfhandle);
scf_snapshot_t *snap = scf_snapshot_create(scfhandle);
@@ -661,9 +658,9 @@
adr_method_t *meth, adr_data_t **ret, adr_data_t **args, int count,
adr_data_t **error)
{
- conerr_t err = ce_ok;
+ conerr_t err = CE_OK;
const char *pgname = adr_data_to_string(args[0]);
- servinst_t *si = instance_getdata(inst);
+ servinst_t *si = rad_instance_getdata(inst);
char type[1000];
char grouping[1000];
char restarton[1000];
@@ -680,7 +677,7 @@
goto out;
}
if ((err = get_pg(scfhandle, pg, si, "running", pgname, error))
- != ce_ok)
+ != CE_OK)
goto out;
if (scf_pg_get_type(pg, type, sizeof (type)) == 0) {
@@ -742,9 +739,9 @@
adr_method_t *meth, adr_data_t **ret, adr_data_t **args, int count,
adr_data_t **error)
{
- conerr_t err = ce_ok;
+ conerr_t err = CE_OK;
const char *pgname = adr_data_to_string(args[0]);
- servinst_t *si = instance_getdata(inst);
+ servinst_t *si = rad_instance_getdata(inst);
scf_handle_t *scfhandle = handle_create();
scf_iter_t *iter = scf_iter_create(scfhandle);
@@ -757,7 +754,7 @@
}
if ((err = get_pg(scfhandle, pg, si, "running", pgname, error))
- != ce_ok)
+ != CE_OK)
goto out;
adr_data_t *result = adr_data_new_array(&adr_t_array_string, 5);
@@ -787,8 +784,8 @@
{
const char *pgname = adr_data_to_string(args[0]);
const char *propname = adr_data_to_string(args[1]);
- conerr_t err = ce_ok;
- servinst_t *si = instance_getdata(inst);
+ conerr_t err = CE_OK;
+ servinst_t *si = rad_instance_getdata(inst);
scf_handle_t *scfhandle = handle_create();
scf_propertygroup_t *pg = scf_pg_create(scfhandle);
@@ -800,7 +797,7 @@
goto out;
}
if ((err = get_pg(scfhandle, pg, si, "running", pgname, error))
- != ce_ok)
+ != CE_OK)
goto out;
if (scf_pg_get_property(pg, propname, prop) != 0 ||
@@ -828,11 +825,11 @@
adr_method_t *meth, adr_data_t **ret, adr_data_t **args, int count,
adr_data_t **error)
{
- conerr_t err = ce_ok;
+ conerr_t err = CE_OK;
const char *pgname = adr_data_to_string(args[0]);
const char *propname = adr_data_to_string(args[1]);
- servinst_t *si = instance_getdata(inst);
+ servinst_t *si = rad_instance_getdata(inst);
scf_handle_t *scfhandle = handle_create();
scf_service_t *service = scf_service_create(scfhandle);
@@ -892,12 +889,12 @@
adr_method_t *meth, adr_data_t **ret, adr_data_t **args, int count,
adr_data_t **error)
{
- conerr_t err = ce_ok;
+ conerr_t err = CE_OK;
const char *snapname = adr_data_to_string(args[0]);
const char *pgname = adr_data_to_string(args[1]);
const char *propname = adr_data_to_string(args[2]);
- servinst_t *si = instance_getdata(inst);
+ servinst_t *si = rad_instance_getdata(inst);
if (!si->instance)
return (error_scf(error, SCF_ERROR_INVALID_ARGUMENT));
@@ -916,7 +913,7 @@
}
if ((err = get_pg(scfhandle, pg, si, "running", pgname, error))
- != ce_ok)
+ != CE_OK)
goto out;
if (scf_pg_get_property(pg, propname, prop) != 0) {
err = error_scf(error, scf_error());
@@ -948,12 +945,12 @@
adr_method_t *meth, adr_data_t **ret, adr_data_t **args, int count,
adr_data_t **error)
{
- conerr_t err = ce_ok;
+ conerr_t err = CE_OK;
const char *pgname = adr_data_to_string(args[0]);
const char *propname = adr_data_to_string(args[1]);
adr_data_t *values = args[2];
- servinst_t *si = instance_getdata(inst);
+ servinst_t *si = rad_instance_getdata(inst);
scf_handle_t *scfhandle = handle_create();
scf_service_t *service = scf_service_create(scfhandle);
@@ -1063,11 +1060,11 @@
adr_method_t *meth, adr_data_t **ret, adr_data_t **args, int count,
adr_data_t **error)
{
- conerr_t err = ce_ok;
+ conerr_t err = CE_OK;
const char *pgname = adr_data_to_string(args[0]);
const char *pgtype = adr_data_to_string(args[1]);
- servinst_t *si = instance_getdata(inst);
+ servinst_t *si = rad_instance_getdata(inst);
scf_handle_t *scfhandle = handle_create();
scf_service_t *service = scf_service_create(scfhandle);
@@ -1115,10 +1112,10 @@
adr_method_t *meth, adr_data_t **ret, adr_data_t **args, int count,
adr_data_t **error)
{
- conerr_t err = ce_ok;
+ conerr_t err = CE_OK;
const char *pgname = adr_data_to_string(args[0]);
- servinst_t *si = instance_getdata(inst);
+ servinst_t *si = rad_instance_getdata(inst);
scf_handle_t *scfhandle = handle_create();
scf_service_t *service = scf_service_create(scfhandle);
@@ -1172,13 +1169,13 @@
adr_method_t *meth, adr_data_t **ret, adr_data_t **args, int count,
adr_data_t **error)
{
- conerr_t err = ce_ok;
+ conerr_t err = CE_OK;
const char *pgname = adr_data_to_string(args[0]);
const char *propname = adr_data_to_string(args[1]);
scf_type_t type = adr_enum_tovalue(args[2]);
int sret;
- servinst_t *si = instance_getdata(inst);
+ servinst_t *si = rad_instance_getdata(inst);
scf_handle_t *scfhandle = handle_create();
scf_service_t *service = scf_service_create(scfhandle);
@@ -1254,12 +1251,12 @@
adr_method_t *meth, adr_data_t **ret, adr_data_t **args, int count,
adr_data_t **error)
{
- conerr_t err = ce_ok;
+ conerr_t err = CE_OK;
const char *pgname = adr_data_to_string(args[0]);
const char *propname = adr_data_to_string(args[1]);
int sret;
- servinst_t *si = instance_getdata(inst);
+ servinst_t *si = rad_instance_getdata(inst);
scf_handle_t *scfhandle = handle_create();
scf_service_t *service = scf_service_create(scfhandle);
@@ -1332,12 +1329,12 @@
adr_method_t *meth, adr_data_t **ret, adr_data_t **args, int count,
adr_data_t **error)
{
- conerr_t err = ce_ok;
+ conerr_t err = CE_OK;
const char *pgname = adr_data_to_string(args[0]);
const char *propname = adr_data_to_string(args[1]);
const char *locale = adr_data_to_string(args[2]);
- servinst_t *si = instance_getdata(inst);
+ servinst_t *si = rad_instance_getdata(inst);
scf_handle_t *scfhandle = handle_create();
scf_pg_tmpl_t *pgtmpl = scf_tmpl_pg_create(scfhandle);
scf_prop_tmpl_t *proptmpl = scf_tmpl_prop_create(scfhandle);
@@ -1435,14 +1432,14 @@
if (scferr != 0) {
if (error != NULL && scferr == SCF_ERROR_NOT_FOUND) {
*ret = NULL;
- return (ce_ok);
+ return (CE_OK);
}
return (error_scf(error, scferr));
}
*ret = adr_data_new_string(str, LT_COPY);
rad_clean_propvec(evec);
- return (ce_ok);
+ return (CE_OK);
}
/* ARGSUSED */
@@ -1452,11 +1449,11 @@
adr_data_t **error)
{
const char *locale = adr_data_to_string(args[0]);
- servinst_t *si = instance_getdata(inst);
+ servinst_t *si = rad_instance_getdata(inst);
if (get_localedprop(si, locale, SCF_PG_TM_COMMON_NAME, ret, NULL)
- == ce_ok)
- return (ce_ok);
+ == CE_OK)
+ return (CE_OK);
return (get_localedprop(si, "C", SCF_PG_TM_COMMON_NAME, ret, error));
}
@@ -1467,11 +1464,11 @@
adr_data_t **error)
{
const char *locale = adr_data_to_string(args[0]);
- servinst_t *si = instance_getdata(inst);
+ servinst_t *si = rad_instance_getdata(inst);
if (get_localedprop(si, locale, SCF_PG_TM_DESCRIPTION, ret, NULL)
- == ce_ok)
- return (ce_ok);
+ == CE_OK)
+ return (CE_OK);
return (get_localedprop(si, "C", SCF_PG_TM_DESCRIPTION, ret, error));
}
@@ -1481,9 +1478,9 @@
adr_method_t *meth, adr_data_t **ret, adr_data_t **args, int count,
adr_data_t **error)
{
- servinst_t *si = instance_getdata(inst);
+ servinst_t *si = rad_instance_getdata(inst);
if (!si->instance)
- return (ce_object);
+ return (CE_OBJECT);
char *logname = NULL;
rad_propvec_t evec[] = {
@@ -1495,12 +1492,12 @@
int errval = rad_read_propvec(si->fmri, SCF_PG_RESTARTER, B_FALSE,
evec, &badprop);
if (errval != 0)
- return (ce_object);
+ return (CE_OBJECT);
struct stat st;
if (stat(logname, &st) != 0) {
free(logname);
- return (ce_object);
+ return (CE_OBJECT);
}
int max_size = adr_data_to_integer(args[0]);
@@ -1510,21 +1507,21 @@
char *buffer = malloc(bsize);
if (buffer == NULL) {
free(logname);
- return (ce_nomem);
+ return (CE_NOMEM);
}
int fd;
if ((fd = open(logname, O_RDONLY)) == -1) {
free(buffer);
free(logname);
- return (ce_priv);
+ return (CE_PRIV);
}
if (pread(fd, buffer, bsize, st.st_size - bsize) != bsize) {
(void) close(fd);
free(buffer);
free(logname);
- return (ce_system);
+ return (CE_SYSTEM);
}
(void) close(fd);
@@ -1537,9 +1534,9 @@
adr_data_new_opaque(buffer, bsize, LT_FREE));
if ((*ret = adr_data_purify(result)) == NULL)
- return (ce_object);
+ return (CE_OBJECT);
- return (ce_ok);
+ return (CE_OK);
}
/* ARGSUSED */
@@ -1547,8 +1544,8 @@
interface_ServiceInfo_invoke_delete(rad_instance_t *inst, adr_method_t *meth,
adr_data_t **ret, adr_data_t **args, int count, adr_data_t **error)
{
- conerr_t err = ce_ok;
- servinst_t *si = instance_getdata(inst);
+ conerr_t err = CE_OK;
+ servinst_t *si = rad_instance_getdata(inst);
scf_handle_t *scfhandle = handle_create();
scf_service_t *service = scf_service_create(scfhandle);
@@ -1583,7 +1580,7 @@
interface_ServiceInfo_invoke_clear(rad_instance_t *inst, adr_method_t *meth,
adr_data_t **ret, adr_data_t **args, int count, adr_data_t **error)
{
- servinst_t *si = instance_getdata(inst);
+ servinst_t *si = rad_instance_getdata(inst);
if (!si->instance)
return (error_scf(error, SCF_ERROR_INVALID_ARGUMENT));
@@ -1595,7 +1592,7 @@
interface_ServiceInfo_invoke_degrade(rad_instance_t *inst, adr_method_t *meth,
adr_data_t **ret, adr_data_t **args, int count, adr_data_t **error)
{
- servinst_t *si = instance_getdata(inst);
+ servinst_t *si = rad_instance_getdata(inst);
if (!si->instance)
return (error_scf(error, SCF_ERROR_INVALID_ARGUMENT));
@@ -1608,7 +1605,7 @@
interface_ServiceInfo_invoke_maintain(rad_instance_t *inst, adr_method_t *meth,
adr_data_t **ret, adr_data_t **args, int count, adr_data_t **error)
{
- servinst_t *si = instance_getdata(inst);
+ servinst_t *si = rad_instance_getdata(inst);
if (!si->instance)
return (error_scf(error, SCF_ERROR_INVALID_ARGUMENT));
@@ -1621,7 +1618,7 @@
interface_ServiceInfo_invoke_restart(rad_instance_t *inst, adr_method_t *meth,
adr_data_t **ret, adr_data_t **args, int count, adr_data_t **error)
{
- servinst_t *si = instance_getdata(inst);
+ servinst_t *si = rad_instance_getdata(inst);
if (!si->instance)
return (error_scf(error, SCF_ERROR_INVALID_ARGUMENT));
@@ -1633,7 +1630,7 @@
interface_ServiceInfo_invoke_refresh(rad_instance_t *inst, adr_method_t *meth,
adr_data_t **ret, adr_data_t **args, int count, adr_data_t **error)
{
- servinst_t *si = instance_getdata(inst);
+ servinst_t *si = rad_instance_getdata(inst);
if (!si->instance)
return (error_scf(error, SCF_ERROR_INVALID_ARGUMENT));
@@ -1663,7 +1660,7 @@
adr_struct_set(service, "fmri",
adr_data_new_string(si->fmri, LT_COPY));
adr_struct_set(service, "objectName",
- instance_getname(si->inst));
+ rad_instance_getname(si->inst));
adr_struct_set(service, "instances", insts);
(void) adr_array_add(result, service);
}
@@ -1674,7 +1671,7 @@
adr_data_free(result);
rad_mutex_exit(&service_lock);
- return (*data != NULL ? ce_ok : ce_object);
+ return (*data != NULL ? CE_OK : CE_OBJECT);
}
/* ARGSUSED */
@@ -1682,7 +1679,7 @@
interface_Aggregator_read_instances(rad_instance_t *inst, adr_attribute_t *attr,
adr_data_t **data, adr_data_t **error)
{
- conerr_t err = ce_ok;
+ conerr_t err = CE_OK;
scf_handle_t *scfhandle = handle_create();
scf_service_t *service = scf_service_create(scfhandle);
@@ -1736,7 +1733,8 @@
adr_data_t *inst = adr_data_new_struct(&t__Instance);
adr_struct_set(inst, "fmri",
adr_data_new_string(si->fmri, LT_COPY));
- adr_struct_set(inst, "objectName", instance_getname(si->inst));
+ adr_struct_set(inst, "objectName",
+ rad_instance_getname(si->inst));
adr_struct_set(inst, "STime", adr_data_new_time(seconds, ns));
adr_struct_set(inst, "state", state2enum(statestr));
if (!adr_data_verify(inst, NULL, B_TRUE))
@@ -1746,7 +1744,7 @@
}
if ((*data = adr_data_purify(result)) == NULL)
- err = ce_object;
+ err = CE_OBJECT;
rad_mutex_exit(&service_lock);
out:
scf_value_destroy(val);
@@ -1776,7 +1774,7 @@
_scf_notify_add_pgtype(scfhandle, SCF_GROUP_FRAMEWORK) != 0)
goto out;
- rad_thread_ack(arg, rm_ok);
+ rad_thread_ack(arg, RM_OK);
while ((ret = _scf_notify_wait(pg, fmri, 5)) >= 0) {
rad_log(RL_DEBUG, "received SMF event");
@@ -1820,7 +1818,8 @@
&reason, NULL);
adr_data_t *event = adr_data_new_struct(&t__StateChange);
- adr_struct_set(event, "source", instance_getname(si->inst));
+ adr_struct_set(event, "source",
+ rad_instance_getname(si->inst));
adr_struct_set(event, "state", state);
adr_struct_set(event, "nextState", nstate);
adr_struct_set(event, "stateTime", stime);
@@ -1830,9 +1829,9 @@
if (adr_data_verify(event, NULL, B_FALSE)) {
rad_log(RL_DEBUG, "sending SMF event");
if (agg_inst != NULL)
- instance_notify(agg_inst, "statechange",
+ rad_instance_notify(agg_inst, "statechange",
0, adr_data_ref(event));
- instance_notify(si->inst, "statechange", 0, event);
+ rad_instance_notify(si->inst, "statechange", 0, event);
} else {
rad_log(RL_DEBUG, "failed to send SMF event");
adr_data_free(event);
@@ -1852,7 +1851,7 @@
rad_log(RL_ERROR, "exiting SMF event loop");
- return (rm_system);
+ return (RM_SYSTEM);
}
static servinst_t *
@@ -1866,20 +1865,19 @@
/* LINTED */
if (si->instance = inst) {
(void) asprintf(&si->fmri, "svc:/%s:%s", sname, iname);
- objname = adr_name_vcreate(
- "com.oracle.solaris.vp.panel.common.api.smf_old", 3,
- "type", "service", "service", sname, "instance", iname);
+ objname = adr_name_vcreate(MOD_DOMAIN, 3,
+ "type", "ServiceInfo", "service", sname, "instance", iname);
} else {
list_create(&si->instances, sizeof (servinst_t),
offsetof(servinst_t, snode));
(void) asprintf(&si->fmri, "svc:/%s", sname);
- objname = adr_name_vcreate(
- "com.oracle.solaris.vp.panel.common.api.smf_old", 2,
- "type", "service", "service", sname);
+ objname = adr_name_vcreate(MOD_DOMAIN, 2,
+ "type", "ServiceInfo", "service", sname);
}
- si->inst = instance_create(objname, &interface_ServiceInfo_svr,
- si, NULL);
- (void) cont_insert(rad_container, si->inst, INST_ID_PICK);
+
+ si->inst = rad_instance_create(objname, &modinfo,
+ &interface_ServiceInfo_svr, si, NULL);
+ (void) rad_cont_insert(rad_container, si->inst, INST_ID_PICK);
if (inst) {
list_insert_tail(&instance_list, si);
@@ -1893,16 +1891,11 @@
return (si);
}
-static rad_modinfo_t modinfo = { "smf_old", "Legacy SMF module" };
-
int
-_rad_init(void *handle)
+_rad_init(void)
{
- if (rad_module_register(handle, RAD_MODVERSION, &modinfo) == -1)
- return (-1);
-
- if (rad_isproxy)
- return (0);
+ adr_name_t *aname;
+ conerr_t cerr;
list_create(&service_list, sizeof (servinst_t),
offsetof(servinst_t, node));
@@ -1939,12 +1932,26 @@
scf_scope_destroy(scope);
scf_handle_destroy(scfhandle);
- agg_inst = instance_create(adr_name_fromstr(aggregator_pattern),
- &interface_Aggregator_svr, NULL, NULL);
- if (agg_inst != NULL)
- (void) cont_insert(rad_container, agg_inst, INST_ID_PICK);
+ aname = adr_name_vcreate(MOD_DOMAIN, 1, "type", "Aggregator");
+ cerr = rad_cont_insert_singleton(rad_container, aname,
+ &modinfo, &interface_Aggregator_svr);
+ adr_name_rele(aname);
+ if (cerr != CE_OK) {
+ rad_log(RL_ERROR, "(mod_smf) failed to insert Aggregator");
+ return (-1);
+ }
- if (rad_thread_create(notify_thread, NULL) != rm_ok)
+ if (rad_thread_create(notify_thread, NULL) != RM_OK)
rad_log(RL_ERROR, "failed to start SMF listener");
return (0);
}
+
+/*
+ * _rad_fini is called by the RAD daemon when the module is unloaded. Any
+ * module finalisation is completed here.
+ */
+/*ARGSUSED*/
+void
+_rad_fini(void *unused)
+{
+}
--- a/components/visual-panels/core/src/java/smf-old/build.xml Mon Oct 28 17:52:58 2013 -0700
+++ b/components/visual-panels/core/src/java/smf-old/build.xml Wed Oct 30 16:53:48 2013 -0400
@@ -19,7 +19,7 @@
CDDL HEADER END
- Copyright (c) 2009, 2012, Oracle and/or its affiliates. All rights reserved.
+ Copyright (c) 2009, 2013, Oracle and/or its affiliates. All rights reserved.
-->
<project name="smf-old" default="jar">
@@ -29,7 +29,7 @@
<target name="build_project" depends="javadoc" />
<target name="generate_project">
- <generate.adr api="smf_old.xml" />
+ <generate.adr api="smf_old.adr" />
</target>
<target name="install_project" depends="javadoc">
@@ -37,7 +37,6 @@
</target>
<path id="classpath.javac">
- <pathelement location="${abs.rad.java}/adr.jar" />
<pathelement location="${abs.rad.java}/rad.jar" />
</path>
</project>
--- a/components/visual-panels/core/src/java/smf-old/com/oracle/solaris/scf/common/FMRI.java Mon Oct 28 17:52:58 2013 -0700
+++ b/components/visual-panels/core/src/java/smf-old/com/oracle/solaris/scf/common/FMRI.java Wed Oct 30 16:53:48 2013 -0400
@@ -20,7 +20,7 @@
*/
/*
- * Copyright (c) 2009, 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2009, 2013, Oracle and/or its affiliates. All rights reserved.
*/
package com.oracle.solaris.scf.common;
@@ -30,13 +30,12 @@
import java.beans.ConstructorProperties;
import java.util.Map;
import java.util.EnumMap;
-import javax.management.openmbean.*;
/**
* A basic FMRI class. Probably should be named "SmfFMRI", as
* legacy-run services aren't an SCF concept.
*/
-public class FMRI implements Comparable<FMRI>, CompositeDataView
+public class FMRI implements Comparable<FMRI>
{
/*
* Static data
@@ -323,27 +322,6 @@
"svcType", "scope", "name", "service", "instance", "propertyGroup",
"property" };
- /*
- * Manually convert the FMRI to its automatically-determined
- * CompositeType. This conversion is normally performed by the
- * MXBean implementation, but the automatic conversion uses our
- * accessors to inspect the object. Performing the conversion
- * manually permits us to circumvent the run-time checking
- * performed by our accessors (or to put it differently, permits
- * us to leave the run-time checking in place).
- */
- public CompositeData toCompositeData(CompositeType ct)
- {
- Object[] itemValues = new Object[] { scheme_.name(),
- svctype_.name(), scope_, name_, service_, instance_, pg_,
- property_ };
- try {
- return (new CompositeDataSupport(ct, itemNames,
- itemValues));
- } catch (OpenDataException ex) {
- throw (new RuntimeException(ex));
- }
- }
// Comparable methods
--- a/components/visual-panels/core/src/java/smf-old/com/oracle/solaris/scf/common/ScfException.java Mon Oct 28 17:52:58 2013 -0700
+++ b/components/visual-panels/core/src/java/smf-old/com/oracle/solaris/scf/common/ScfException.java Wed Oct 30 16:53:48 2013 -0400
@@ -20,12 +20,12 @@
*/
/*
- * Copyright (c) 2009, 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2009, 2013, Oracle and/or its affiliates. All rights reserved.
*/
package com.oracle.solaris.scf.common;
-import com.oracle.solaris.rad.ObjectException;
+import com.oracle.solaris.rad.client.RadObjectException;
import com.oracle.solaris.vp.panel.common.api.smf_old.SmfError;
import com.oracle.solaris.vp.panel.common.api.smf_old.SmfErrorCode;
@@ -40,10 +40,10 @@
private SmfErrorCode error_ = null;
private String msg_ = "";
- public ScfException(ObjectException e)
+ public ScfException(RadObjectException e)
{
super(e);
- SmfError se = e.getPayload(SmfError.class);
+ SmfError se = (SmfError)e.getPayload();
if (se != null) {
error_ = se.getError();
msg_ = se.getMessage();
--- a/components/visual-panels/core/src/java/util/build.xml Mon Oct 28 17:52:58 2013 -0700
+++ b/components/visual-panels/core/src/java/util/build.xml Wed Oct 30 16:53:48 2013 -0400
@@ -19,7 +19,7 @@
CDDL HEADER END
- Copyright (c) 2009, 2012, Oracle and/or its affiliates. All rights reserved.
+ Copyright (c) 2009, 2013, Oracle and/or its affiliates. All rights reserved.
-->
<project name="vpanels-util" default="jar">
@@ -34,5 +34,6 @@
<path id="classpath.javac">
<fileset refid="proj.extlibs" />
+ <pathelement location="${abs.rad.java}/rad.jar" />
</path>
</project>
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/components/visual-panels/core/src/java/util/com/oracle/solaris/vp/util/misc/converter/ADRUintStringConverter.java Wed Oct 30 16:53:48 2013 -0400
@@ -0,0 +1,63 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
+ */
+
+package com.oracle.solaris.vp.util.misc.converter;
+
+import com.oracle.solaris.rad.client.ADRUinteger;
+
+public class ADRUintStringConverter extends StringConverter<ADRUinteger> {
+ //
+ // Static data
+ //
+
+ public static final ADRUintStringConverter INSTANCE =
+ new ADRUintStringConverter();
+
+ //
+ // Converter methods
+ //
+
+ /**
+ * Converts the given {@code String} to a {@code ADRUinteger}.
+ *
+ * @param s
+ * the {@code String} to convert
+ *
+ * @return {@code null} if {@code s} is {@code null},
+ * a {@code ADRUinteger} otherwise
+ *
+ * @exception NumberFormatException
+ * if the given {@code String} could not be converted to a
+ * {@code ADRUinteger}
+ */
+ @Override
+ public ADRUinteger convert(String s) {
+ if (s == null) {
+ return null;
+ }
+
+ return new ADRUinteger(Long.parseLong(s));
+ }
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/components/visual-panels/core/src/java/util/com/oracle/solaris/vp/util/misc/property/ADRUintProperty.java Wed Oct 30 16:53:48 2013 -0400
@@ -0,0 +1,43 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
+ */
+
+package com.oracle.solaris.vp.util.misc.property;
+
+import com.oracle.solaris.rad.client.ADRUinteger;
+import com.oracle.solaris.vp.util.misc.converter.ADRUintStringConverter;
+
+public class ADRUintProperty extends BasicMutableProperty<ADRUinteger> {
+ //
+ // Constructors
+ //
+
+ public ADRUintProperty() {
+ this(null);
+ }
+
+ public ADRUintProperty(String name) {
+ super(name, ADRUintStringConverter.INSTANCE);
+ }
+}
--- a/components/visual-panels/core/src/java/util/com/oracle/solaris/vp/util/swing/property/PasswordFieldPropertySynchronizer.java Mon Oct 28 17:52:58 2013 -0700
+++ b/components/visual-panels/core/src/java/util/com/oracle/solaris/vp/util/swing/property/PasswordFieldPropertySynchronizer.java Wed Oct 30 16:53:48 2013 -0400
@@ -20,7 +20,7 @@
*/
/*
- * Copyright (c) 2009, 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2009, 2013, Oracle and/or its affiliates. All rights reserved.
*/
package com.oracle.solaris.vp.util.swing.property;
@@ -36,7 +36,7 @@
* automatically be reflected in the other.
*/
public class PasswordFieldPropertySynchronizer
- extends PropertySynchronizer<char[], JPasswordField> {
+ extends PropertySynchronizer<String, JPasswordField> {
//
// Instance data
@@ -54,7 +54,7 @@
// Constructors
//
- public PasswordFieldPropertySynchronizer(MutableProperty<char[]> property,
+ public PasswordFieldPropertySynchronizer(MutableProperty<String> property,
JPasswordField field, boolean initFromProp) {
super(property, field, initFromProp);
@@ -65,7 +65,7 @@
* Constructs a {@code PasswordFieldPropertySynchronizer} with initial
* synchronization from the property to the {@code JPasswordField}.
*/
- public PasswordFieldPropertySynchronizer(MutableProperty<char[]> property,
+ public PasswordFieldPropertySynchronizer(MutableProperty<String> property,
JPasswordField field) {
this(property, field, true);
@@ -82,12 +82,12 @@
}
@Override
- public char[] getValue() {
- return getObject().getPassword();
+ public String getValue() {
+ return new String(getObject().getPassword());
}
@Override
- public void setValue(char[] value) {
+ public void setValue(String value) {
String text = value == null ? "" : new String(value);
getObject().setText(text);
}
--- a/components/visual-panels/core/src/java/vpanels/app/browser/build.xml Mon Oct 28 17:52:58 2013 -0700
+++ b/components/visual-panels/core/src/java/vpanels/app/browser/build.xml Wed Oct 30 16:53:48 2013 -0400
@@ -19,7 +19,7 @@
CDDL HEADER END
- Copyright (c) 2009, 2012, Oracle and/or its affiliates. All rights reserved.
+ Copyright (c) 2009, 2013, Oracle and/or its affiliates. All rights reserved.
-->
<project name="vpanels-panels-browser" default="jar">
@@ -34,7 +34,6 @@
<path id="classpath.javac">
<path refid="classpath.panels" />
- <pathelement location="${abs.rad.java}/rad.jar" />
- <pathelement location="${abs.rad.java}/adr.jar" />
+ <pathelement location="${abs.rad.java}/rad.jar" />
</path>
</project>
--- a/components/visual-panels/core/src/java/vpanels/app/browser/com/oracle/solaris/vp/panels/browser/client/swing/BrowserPanelDescriptor.java Mon Oct 28 17:52:58 2013 -0700
+++ b/components/visual-panels/core/src/java/vpanels/app/browser/com/oracle/solaris/vp/panels/browser/client/swing/BrowserPanelDescriptor.java Wed Oct 30 16:53:48 2013 -0400
@@ -20,7 +20,7 @@
*/
/*
- * Copyright (c) 2010, 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved.
*/
package com.oracle.solaris.vp.panels.browser.client.swing;
@@ -28,7 +28,7 @@
import java.beans.*;
import java.util.*;
import java.util.logging.Level;
-import com.oracle.solaris.rad.ObjectException;
+import com.oracle.solaris.rad.client.RadObjectException;
import com.oracle.solaris.vp.panel.common.*;
import com.oracle.solaris.vp.panel.common.api.panel.*;
import com.oracle.solaris.vp.panel.common.control.*;
@@ -52,7 +52,7 @@
private DefaultControl topControl;
private Map<String, PanelManagedObject> panels_ =
new HashMap<String, PanelManagedObject>();
- private PanelMXBeanTracker panelBeanTracker;
+ private PanelBeanTracker panelBeanTracker;
private PropertyChangeListener beanListener =
new PropertyChangeListener() {
@@ -74,9 +74,9 @@
super(id, context);
- panelBeanTracker = new PanelMXBeanTracker(getClientContext());
+ panelBeanTracker = new PanelBeanTracker(getClientContext());
panelBeanTracker.addPropertyChangeListener(
- MXBeanTracker.PROPERTY_BEAN, beanListener);
+ BeanTracker.PROPERTY_BEAN, beanListener);
beanChanged();
@@ -112,7 +112,7 @@
}
private void beanChanged() {
- PanelMXBean bean = panelBeanTracker.getBean();
+ Panel bean = panelBeanTracker.getBean();
panels_.clear();
clearChildren();
@@ -123,12 +123,12 @@
try {
CustomPanel custom = bean.getPanel(name, null);
panels_.put(name, new PanelManagedObject(custom));
- } catch (ObjectException e) {
+ } catch (RadObjectException e) {
getLog().log(Level.SEVERE,
"could not load panel: " + name, e);
}
}
- } catch (ObjectException e) {
+ } catch (RadObjectException e) {
getLog().log(Level.SEVERE, "could not get panel names", e);
}
}
--- a/components/visual-panels/core/src/java/vpanels/client/build.xml Mon Oct 28 17:52:58 2013 -0700
+++ b/components/visual-panels/core/src/java/vpanels/client/build.xml Wed Oct 30 16:53:48 2013 -0400
@@ -19,7 +19,7 @@
CDDL HEADER END
- Copyright (c) 2009, 2012, Oracle and/or its affiliates. All rights reserved.
+ Copyright (c) 2009, 2013, Oracle and/or its affiliates. All rights reserved.
-->
<project name="vpanels-client" default="jar">
@@ -61,9 +61,9 @@
<fileset refid="proj.extlibs" />
<pathelement location="${proj.vpanel}/vpanels-panel.jar" />
<pathelement location="${proj.util}/vpanels-util.jar" />
- <pathelement location="${abs.rad.java}/adr.jar" />
<pathelement location="${abs.rad.java}/rad.jar" />
- <pathelement location="${abs.rad.java}/afunix.jar" />
+ <pathelement location="${abs.rad.java}/pam.jar" />
+ <pathelement location="${abs.rad.java}/zonesbridge.jar" />
</path>
<path id="classpath.jar">
--- a/components/visual-panels/core/src/java/vpanels/client/com/oracle/solaris/vp/client/common/ConnectionManager.java Mon Oct 28 17:52:58 2013 -0700
+++ b/components/visual-panels/core/src/java/vpanels/client/com/oracle/solaris/vp/client/common/ConnectionManager.java Wed Oct 30 16:53:48 2013 -0400
@@ -20,7 +20,7 @@
*/
/*
- * Copyright (c) 2010, 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved.
*/
package com.oracle.solaris.vp.client.common;
@@ -28,8 +28,6 @@
import java.awt.*;
import java.util.*;
import java.util.List;
-import javax.management.*;
-import javax.management.remote.JMXConnectionNotification;
import javax.swing.tree.*;
import javax.swing.WindowConstants;
import com.oracle.solaris.vp.panel.common.*;
@@ -203,15 +201,6 @@
// Static data
//
- private static NotificationFilter nFilter =
- new NotificationFilter() {
- @Override
- public boolean isNotificationEnabled(Notification notification) {
- return notification.getType().equals(
- JMXConnectionNotification.FAILED);
- }
- };
-
//
// Instance data
//
@@ -224,19 +213,6 @@
private Map<Object, DependencyTreeNode> nodeMap =
new HashMap<Object, DependencyTreeNode>();
- private NotificationListener nListener =
- new NotificationListener() {
- @Override
- public void handleNotification(Notification notification,
- Object handback) {
-
- if (nFilter.isNotificationEnabled(notification)) {
- ConnectionTreeNode node = (ConnectionTreeNode)handback;
- fireConnectionFailed(node);
- }
- }
- };
-
private ConnectionListListeners listeners =
new ConnectionListListeners();
@@ -313,9 +289,6 @@
node = new ConnectionTreeNode(info);
- info.getConnector().addConnectionNotificationListener(
- nListener, nFilter, node);
-
parent.add(node);
fireAddEvent(info);
parent = node;
@@ -514,11 +487,6 @@
if (node instanceof ConnectionTreeNode) {
ConnectionInfo info = ((ConnectionTreeNode)node).getUserObject();
- try {
- info.getConnector().removeConnectionNotificationListener(
- nListener);
- } catch (ListenerNotFoundException ignore) {
- }
}
DependencyTreeNode<?> parent = (DependencyTreeNode)node.getParent();
--- a/components/visual-panels/core/src/java/vpanels/client/com/oracle/solaris/vp/client/common/PanelResourceManager.java Mon Oct 28 17:52:58 2013 -0700
+++ b/components/visual-panels/core/src/java/vpanels/client/com/oracle/solaris/vp/client/common/PanelResourceManager.java Wed Oct 30 16:53:48 2013 -0400
@@ -20,7 +20,7 @@
*/
/*
- * Copyright (c) 2010, 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved.
*/
package com.oracle.solaris.vp.client.common;
@@ -29,7 +29,6 @@
import java.net.*;
import java.security.*;
import java.util.*;
-import com.oracle.solaris.rad.jmx.IncompatibleVersionException;
import com.oracle.solaris.vp.panel.common.*;
import com.oracle.solaris.vp.panel.common.action.ActionAbortedException;
import com.oracle.solaris.vp.panel.common.api.panel.*;
@@ -83,8 +82,8 @@
List<URL> urls = new ArrayList<URL>();
boolean isLocal = NetUtil.isLocalAddress(info.getHost());
- PanelMXBeanTracker tracker = null;
- PanelMXBean bean = null;
+ PanelBeanTracker tracker = null;
+ Panel bean = null;
// Download each resource
for (ResourceDescriptor descriptor : panel.getResourceDescriptors()) {
@@ -212,31 +211,19 @@
// Private methods
//
- private PanelMXBeanTracker createTracker(ConnectionInfo info)
+ private PanelBeanTracker createTracker(ConnectionInfo info)
throws PanelResourceException {
- PanelMXBeanTracker tracker;
+ PanelBeanTracker tracker;
try {
- tracker = new PanelMXBeanTracker();
+ tracker = new PanelBeanTracker();
tracker.setConnectionInfo(info);
} catch (TrackerException e) {
Throwable cause = e.getCause();
- String message;
-
- if (cause instanceof IncompatibleVersionException) {
- IncompatibleVersionException ive =
- (IncompatibleVersionException)cause;
-
- message = Finder.getString("proxy.error.version",
- ive.getClientVersion(), ive.getServerVersion(),
- ive.getInterfaceClass().getSimpleName());
- } else {
- message = Finder.getString("download.error.general",
- info.getHost());
- }
-
+ String message = Finder.getString("download.error.general",
+ info.getHost());
throw new PanelResourceException(message, cause);
}
--- a/components/visual-panels/core/src/java/vpanels/client/com/oracle/solaris/vp/client/common/RadLoginManager.java Mon Oct 28 17:52:58 2013 -0700
+++ b/components/visual-panels/core/src/java/vpanels/client/com/oracle/solaris/vp/client/common/RadLoginManager.java Wed Oct 30 16:53:48 2013 -0400
@@ -20,7 +20,7 @@
*/
/*
- * Copyright (c) 2010, 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved.
*/
package com.oracle.solaris.vp.client.common;
@@ -32,17 +32,16 @@
import java.security.cert.Certificate;
import java.util.*;
import java.util.logging.*;
-import javax.management.*;
-import javax.management.remote.*;
+import java.net.InetAddress;
import javax.swing.JOptionPane;
-import com.oracle.solaris.adr.Stability;
-import com.oracle.solaris.rad.*;
-import com.oracle.solaris.rad.jmx.*;
+import com.oracle.solaris.rad.client.ProxyInterface;
+import com.oracle.solaris.rad.client.RadObjectException;
+import com.oracle.solaris.rad.connect.Connection;
import com.oracle.solaris.rad.pam.*;
+import com.oracle.solaris.rad.transports.RadTrustManager;
import com.oracle.solaris.rad.zonesbridge.*;
import com.oracle.solaris.vp.panel.common.*;
import com.oracle.solaris.vp.panel.common.action.*;
-import com.oracle.solaris.vp.panel.common.api.panel.MBeanUtil;
import com.oracle.solaris.vp.util.misc.*;
import com.oracle.solaris.vp.util.misc.finder.Finder;
@@ -82,8 +81,8 @@
}
public abstract Block initiate(LoginRequest request,
- AuthenticationMXBean auth) throws ActionAbortedException,
- ObjectException;
+ Authentication auth) throws ActionAbortedException,
+ RadObjectException;
public abstract void prompt(LoginRequest request,
List<LoginProperty> properties, boolean isFirst)
@@ -93,8 +92,8 @@
private class UserPrompter extends AuthPrompter {
@Override
public Block initiate(LoginRequest request,
- AuthenticationMXBean auth) throws ActionAbortedException,
- ObjectException {
+ Authentication auth) throws ActionAbortedException,
+ RadObjectException {
setLoginStatus(request, Finder.getString("login.status.login",
request.getUser().getValue()));
@@ -121,8 +120,8 @@
private class RolePrompter extends AuthPrompter {
@Override
public Block initiate(LoginRequest request,
- AuthenticationMXBean auth) throws ActionAbortedException,
- ObjectException {
+ Authentication auth) throws ActionAbortedException,
+ RadObjectException {
setLoginStatus(request, Finder.getString("login.status.assume",
request.getRole().getValue()));
@@ -148,8 +147,8 @@
private class ZoneUserPrompter extends AuthPrompter {
@Override
public Block initiate(LoginRequest request,
- AuthenticationMXBean auth) throws ActionAbortedException,
- ObjectException {
+ Authentication auth) throws ActionAbortedException,
+ RadObjectException {
return auth.login(Locale.getDefault().getLanguage(),
request.getZoneUser().getValue());
@@ -173,8 +172,8 @@
private class ZoneRolePrompter extends AuthPrompter {
@Override
public Block initiate(LoginRequest request,
- AuthenticationMXBean auth) throws ActionAbortedException,
- ObjectException {
+ Authentication auth) throws ActionAbortedException,
+ RadObjectException {
return auth.assume(Locale.getDefault().getLanguage(),
request.getZoneRole().getValue());
@@ -384,7 +383,6 @@
case 1:
gatherRoleData(request, data);
step++;
-
case 2:
doZone = request.getZonePrompt().getValue();
if (doZone != null && doZone) {
@@ -645,7 +643,7 @@
@SuppressWarnings({"fallthrough"})
private boolean authConverse(LoginRequest request,
- AuthenticationMXBean auth, AuthPrompter prompter)
+ Authentication auth, AuthPrompter prompter)
throws ActionAbortedException, ActionRegressedException {
List<DialogMessage> messages = request.getMessages();
@@ -710,24 +708,22 @@
messages.clear();
}
- List<char[]> response = new LinkedList<char[]>();
+ List<String> response = new LinkedList<String>();
for (LoginProperty property : properties) {
Object value = property.getValue();
if (value != null) {
response.add(value instanceof char[] ?
- (char[])value : ((String)value).toCharArray());
+ new String((char[])value) : (String)value);
}
}
-
answer = auth.submit(response);
// clear out passwords
- for (char[] res : response) {
- Arrays.fill(res, (char)0);
- res = null;
+ for (String s : response) {
+ s = null;
}
}
}
- } catch (ObjectException e) {
+ } catch (RadObjectException e) {
messages.add(new DialogMessage(
Finder.getString("login.err.io",
request.getHost().getValue()),
@@ -736,31 +732,17 @@
}
}
- private <T> T createMXBeanProxy(LoginRequest request, ConnectionInfo info,
- Class<T> ifaceClass, Stability s, String domain, String name)
+ private <T> T createProxy(LoginRequest request, ConnectionInfo info,
+ Class<T> ifaceClass, String domain, String name)
throws ActionFailedException {
- MBeanServerConnection mbsc = getMBeanServerConnection(request, info);
- if (mbsc == null) {
- return null;
- }
-
- ObjectName oName = MBeanUtil.makeObjectName(domain, name);
-
try {
- return ifaceClass.cast(RadJMX.newMXBeanProxy(mbsc, oName,
- ifaceClass, s));
- } catch (IncompatibleVersionException e) {
+ ProxyInterface proxy = (ProxyInterface) ifaceClass.newInstance();
+ return info.getConnection().getObject(proxy);
+ } catch (RadObjectException e) {
List<DialogMessage> messages = request.getMessages();
messages.add(new DialogMessage(Finder.getString(
- "proxy.error.version", e.getClientVersion(),
- e.getServerVersion(), ifaceClass.getSimpleName()),
- JOptionPane.ERROR_MESSAGE));
- requestFailed(request);
- } catch (JMException e) {
- List<DialogMessage> messages = request.getMessages();
- messages.add(new DialogMessage(Finder.getString(
- "proxy.error.general", oName),
+ "proxy.error.general", ifaceClass.getSimpleName()),
JOptionPane.ERROR_MESSAGE));
requestFailed(request);
} catch (IOException e) {
@@ -769,20 +751,25 @@
"proxy.error.io", ifaceClass.getSimpleName()),
JOptionPane.ERROR_MESSAGE));
requestFailed(request);
+ } catch (Exception e) {
+ List<DialogMessage> messages = request.getMessages();
+ messages.add(new DialogMessage(Finder.getString(
+ "proxy.error.general", ifaceClass.getSimpleName()),
+ JOptionPane.ERROR_MESSAGE));
+ requestFailed(request);
}
return null;
}
- private AuthenticationMXBean createAuthBean(LoginRequest request,
+ private Authentication createAuthBean(LoginRequest request,
ConnectionInfo info) throws ActionFailedException {
- return createMXBeanProxy(request, info, AuthenticationMXBean.class,
- Stability.PRIVATE, "com.oracle.solaris.rad.pam", "Authentication");
+ return createProxy(request, info, Authentication.class,
+ "com.oracle.solaris.rad.pam", "Authentication");
}
- private JMXConnector createConnector(String host)
- throws KeyStoreException, NoSuchAlgorithmException,
- CertificateException, MalformedURLException, IOException,
- ActionAbortedException {
+ private Connection createConnector(String host)
+ throws KeyStoreException, ActionAbortedException, CertificateException,
+ UnknownHostException, NoSuchAlgorithmException, IOException {
if (NetUtil.isLocalAddress(host)) {
String[] paths = {
@@ -791,43 +778,43 @@
};
for (String path : paths) {
- JMXServiceURL url = null;
try {
- url = new JMXServiceURL(RadConnector.PROTOCOL_UNIX, "", 0,
- path);
- return JMXConnectorFactory.connect(url);
+ return Connection.connectUnix(new File(path));
} catch (IOException e) {
// Not necessarily an error
Logger.getLogger(getClass().getName()).log(Level.CONFIG,
- "unable to utilize local AF_UNIX connector: " +
- (url == null ? path : url), e);
+ "unable to utilize local AF_UNIX connection: " +
+ path, e);
}
}
}
+ InetAddress addr = InetAddress.getByName(host);
+
File truststore = getTrustStoreFile();
if (!truststore.exists()) {
createTrustStore(truststore);
}
- Map<String, Object> env = new HashMap<String, Object>();
- env.put(RadConnector.KEY_TLS_TRUSTSTORE,
- truststore.getAbsolutePath());
- env.put(RadConnector.KEY_TLS_TRUSTPASS,
- getTrustStorePassword());
+ String tsloc = truststore.getAbsolutePath();
+ String tspass = getTrustStorePassword();
+ if (tsloc == null || tspass == null)
+ throw new IOException("Must supply truststore and password");
+ RadTrustManager mtm = new RadTrustManager();
- JMXServiceURL url = new JMXServiceURL(
- RadConnector.PROTOCOL_TLS, host, 0);
+ KeyStore ks;
- // Throws MalformedURLException
- JMXConnector connector = JMXConnectorFactory.newJMXConnector(url, null);
+ try {
+ ks = KeyStore.getInstance("JKS");
+ ks.load(new FileInputStream(tsloc), tspass.toCharArray());
+ } catch (Exception e) {
+ throw new IOException(e);
+ }
+ Connection conn = null;
for (;;) {
- RadTrustManager mtm = new RadTrustManager();
- env.put(RadConnector.KEY_TLS_RADMANAGER, mtm);
-
try {
- connector.connect(env);
+ conn = Connection.connectTLS(addr, host, ks, mtm);
break;
} catch (IOException e) {
X509Certificate[] chain = mtm.getBadChain();
@@ -840,14 +827,13 @@
}
}
}
-
- return connector;
+ return conn;
}
- private JMXConnector createConnector(LoginRequest request)
+ private Connection createConnector(LoginRequest request)
throws ActionAbortedException {
- JMXConnector connector = null;
+ Connection connector = null;
LoginProperty<String> host = request.getHost();
String hostVal = host.getValue();
List<DialogMessage> messages = request.getMessages();
@@ -859,29 +845,17 @@
connector = createConnector(hostVal);
success = true;
-
- // Thrown by JMXConnector.connect
} catch (UnknownHostException e) {
messages.add(new DialogMessage(Finder.getString(
"login.err.host.unknown", hostVal), JOptionPane.ERROR_MESSAGE));
-
- // Thrown by JMXConnector.connect
- } catch (ConnectException e) {
- messages.add(new DialogMessage(Finder.getString(
- "login.err.host.refused", hostVal), JOptionPane.ERROR_MESSAGE));
-
- // Thrown by JMXConnector.connect
} catch (SecurityException e) {
messages.add(new DialogMessage(Finder.getString(
"login.err.security", hostVal),
JOptionPane.ERROR_MESSAGE));
-
- // Thrown by createTrustStore
} catch (KeyStoreException e) {
messages.add(new DialogMessage(Finder.getString(
"login.err.keystore", e.getMessage()),
JOptionPane.ERROR_MESSAGE));
-
// Thrown by createTrustStore
} catch (NoSuchAlgorithmException e) {
messages.add(new DialogMessage(Finder.getString(
@@ -894,13 +868,7 @@
"login.err.nocerts", hostVal),
JOptionPane.ERROR_MESSAGE));
- // Thrown by new JMXServiceURL
- } catch (MalformedURLException e) {
- messages.add(new DialogMessage(Finder.getString(
- "login.err.url.invalid"),
- JOptionPane.ERROR_MESSAGE));
-
- // Thrown by JMXConnector.connect et al
+ // Thrown by RAD java client
} catch (IOException e) {
messages.add(new DialogMessage(Finder.getString(
"login.err.io", hostVal),
@@ -915,22 +883,26 @@
return connector;
}
- private IOMXBean createZonesBridgeBean(LoginRequest request,
+ private IO createZonesBridgeBean(LoginRequest request,
ConnectionInfo info) throws ActionFailedException {
- return createMXBeanProxy(request, info, IOMXBean.class,
- Stability.PRIVATE, "com.oracle.solaris.rad.zonesbridge", "IO");
+ return createProxy(request, info, IO.class,
+ "com.oracle.solaris.rad.zonesbridge", "IO");
}
- private UtilMXBean createZonesUtilBean(LoginRequest request,
+
+ private Util createZonesUtilBean(LoginRequest request,
ConnectionInfo info) throws ActionFailedException {
- return createMXBeanProxy(request, info, UtilMXBean.class,
- Stability.PRIVATE, "com.oracle.solaris.rad.zonesbridge", "Util");
+ return createProxy(request, info, Util.class,
+ "com.oracle.solaris.rad.zonesbridge", "Util");
}
- private JMXConnector createZoneConnector(LoginRequest request,
- IOMXBean bean) {
+
+ private Connection createZoneConnector(LoginRequest request,
+ IO bean) throws ActionAbortedException {
- JMXConnector connector = null;
+ Connection conn = null;
+ LoginProperty<String> host = request.getHost();
+ String hostVal = host.getValue();
LoginProperty<String> zone = request.getZone();
String zoneVal = zone.getValue();
String zoneUserVal = request.getZoneUser().getValue();
@@ -938,28 +910,29 @@
boolean success = false;
try {
- JMXServiceURL url = new JMXServiceURL(
- RadConnector.PROTOCOL_ZONESBRIDGE, zoneVal, 0,
- "/" + zoneUserVal);
-
- Map<String, Object> env = new HashMap<String, Object>();
- env.put(RadConnector.KEY_ZONESBRIDGE_MXBEAN, bean);
-
- connector = JMXConnectorFactory.connect(url, env);
+ Connection rc = createConnector(hostVal);
+ conn = Connection.connectZone(rc, zoneVal, zoneUserVal, null);
success = true;
-
- // Thrown by JMXConnector.connect
} catch (SecurityException e) {
messages.add(new DialogMessage(Finder.getString(
"login.err.zone.security", zoneVal, zoneUserVal),
JOptionPane.ERROR_MESSAGE));
-
- // Thrown by new JMXServiceURL
- } catch (MalformedURLException e) {
+ } catch (KeyStoreException e) {
+ messages.add(new DialogMessage(Finder.getString(
+ "login.err.keystore", e.getMessage()),
+ JOptionPane.ERROR_MESSAGE));
+ // Thrown by createTrustStore
+ } catch (NoSuchAlgorithmException e) {
messages.add(new DialogMessage(Finder.getString(
- "login.err.url.invalid"), JOptionPane.ERROR_MESSAGE));
+ "login.err.keystore", e.getMessage()),
+ JOptionPane.ERROR_MESSAGE));
- // Thrown by JMXConnector.connect et al
+ // Thrown by getDaemonCertificateChain
+ } catch (CertificateException e) {
+ messages.add(new DialogMessage(Finder.getString(
+ "login.err.nocerts", hostVal),
+ JOptionPane.ERROR_MESSAGE));
+
} catch (IOException e) {
messages.add(new DialogMessage(Finder.getString(
"login.err.io", zoneVal), JOptionPane.ERROR_MESSAGE));
@@ -969,8 +942,7 @@
zone.setErrored(true);
}
}
-
- return connector;
+ return conn;
}
private void gatherHostAndUserData(LoginRequest request, LoginData data)
@@ -1044,13 +1016,13 @@
}
// Create connection, append to messages on error
- JMXConnector connector = createConnector(request);
- if (connector != null) {
+ Connection connection = createConnector(request);
+ if (connection != null) {
ConnectionInfo info = new ConnectionInfo(hostVal, userVal, null,
- connector);
+ connection);
// Get/create auth bean, append to messages on error
- AuthenticationMXBean auth = createAuthBean(request, info);
+ Authentication auth = createAuthBean(request, info);
if (auth != null) {
setLoginStatus(request,
Finder.getString("login.status.user"));
@@ -1109,7 +1081,7 @@
String zoneUserVal = zoneUser.getValue();
// Get/create auth bean, append to messages on error
- AuthenticationMXBean userAuth = createAuthBean(request, data.peek(0));
+ Authentication userAuth = createAuthBean(request, data.peek(0));
if (userAuth == null) {
// Not likely, but handle it anyway
requestFailed(request);
@@ -1174,16 +1146,16 @@
byte[] token = userAuth.createToken();
// Create connection, append to messages on error
- JMXConnector connector = createConnector(request);
+ Connection connector = createConnector(request);
if (connector != null) {
ConnectionInfo info = new ConnectionInfo(hostVal, userVal,
roleVal, connector);
// Create auth bean, append to messages on error
- AuthenticationMXBean roleAuth = createAuthBean(request,
+ Authentication roleAuth = createAuthBean(request,
info);
if (roleAuth != null) {
- roleAuth.redeemToken(userVal, token);
+ roleAuth.redeemToken(userVal, token);
AuthPrompter prompter = new RolePrompter();
do {
@@ -1211,7 +1183,7 @@
}
// Thrown by createToken/redeemToken
- } catch (ObjectException e) {
+ } catch (RadObjectException e) {
messages.add(new DialogMessage(Finder.getString(
"login.err.io", hostVal), JOptionPane.ERROR_MESSAGE));
@@ -1225,8 +1197,8 @@
throws ActionAbortedException, ActionFailedException,
ActionRegressedException {
- IOMXBean zcon = createZonesBridgeBean(request, data.peek(0));
- UtilMXBean zutil = createZonesUtilBean(request, data.peek(0));
+ IO zcon = createZonesBridgeBean(request, data.peek(0));
+ Util zutil = createZonesUtilBean(request, data.peek(0));
if (zcon == null || zutil == null) {
requestFailed(request);
}
@@ -1238,7 +1210,7 @@
List<String> zones = null;
try {
zones = zutil.getZones(ZoneState.RUNNING);
- } catch (ObjectException e) {
+ } catch (RadObjectException e) {
messages.add(new DialogMessage(Finder.getString(
"login.err.io", request.getHost().getValue()),
JOptionPane.ERROR_MESSAGE));
@@ -1304,7 +1276,7 @@
return;
}
- JMXConnector connector = createZoneConnector(request, zcon);
+ Connection connector = createZoneConnector(request, zcon);
if (connector != null) {
ConnectionInfo info = new ConnectionInfo(
request.getHost().getValue(), request.getUser().getValue(),
@@ -1312,7 +1284,7 @@
connector);
// Get/create auth bean, append to messages on error
- AuthenticationMXBean auth = createAuthBean(request, info);
+ Authentication auth = createAuthBean(request, info);
if (auth != null) {
if (zoneUserVal.equals(auth.getuser())) {
data.push(info, acknowledged);
@@ -1371,7 +1343,7 @@
String zoneUserVal = zoneUser.getValue();
// Get/create auth bean, append to messages on error
- AuthenticationMXBean userAuth = createAuthBean(request, data.peek(0));
+ Authentication userAuth = createAuthBean(request, data.peek(0));
if (userAuth == null) {
// Not likely, but handle it anyway
requestFailed(request);
@@ -1389,7 +1361,7 @@
isRoleValid(request, roles, true);
}
- IOMXBean zcon = null;
+ IO zcon = null;
// Loop until no role is chosen, or chosen role is authenticated
while (true) {
@@ -1446,16 +1418,16 @@
}
// Create connection, append to messages on error
- JMXConnector connector = createZoneConnector(request, zcon);
+ Connection connector = createZoneConnector(request, zcon);
if (connector != null) {
ConnectionInfo info = new ConnectionInfo(hostVal, userVal,
roleVal, zoneVal, zoneUserVal, zoneRoleVal, connector);
// Create auth bean, append to messages on error
- AuthenticationMXBean roleAuth = createAuthBean(request,
+ Authentication roleAuth = createAuthBean(request,
info);
if (roleAuth != null) {
- roleAuth.redeemToken(userVal, token);
+ roleAuth.redeemToken(userVal, token);
AuthPrompter prompter = new ZoneRolePrompter();
do {
@@ -1484,7 +1456,7 @@
}
// Thrown by createToken/redeemToken
- } catch (ObjectException e) {
+ } catch (RadObjectException e) {
messages.add(new DialogMessage(Finder.getString(
"login.err.io", hostVal), JOptionPane.ERROR_MESSAGE));
@@ -1494,20 +1466,6 @@
}
}
- private MBeanServerConnection getMBeanServerConnection(LoginRequest request,
- ConnectionInfo info) {
-
- try {
- return info.getConnector().getMBeanServerConnection();
- } catch (IOException e) {
- request.getMessages().add(new DialogMessage(
- Finder.getString("login.err.io",
- request.getHost().getValue()),
- JOptionPane.ERROR_MESSAGE));
- }
- return null;
- }
-
private <T> boolean inSet(LoginProperty<T> property, List<T> valid,
String resource, LoginRequest request) {
--- a/components/visual-panels/core/src/java/vpanels/client/com/oracle/solaris/vp/client/common/resources/Resources.properties Mon Oct 28 17:52:58 2013 -0700
+++ b/components/visual-panels/core/src/java/vpanels/client/com/oracle/solaris/vp/client/common/resources/Resources.properties Wed Oct 30 16:53:48 2013 -0400
@@ -20,7 +20,7 @@
#
#
-# Copyright (c) 2010, 2012, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved.
#
# Parameters (all messages in this block):
@@ -68,6 +68,5 @@
panelload.error.class.notfound = class not found: {0}
panelload.error.class.cantinstantiate = unable to instantiate class: {0}
-proxy.error.version = The client version ({0}) of the "{2}" interface is not compatible with the server version ({1}) of the interface. Upgrade to matching versions of the interface.
-proxy.error.general = An error occurred while getting the MBean information for {0}.
-proxy.error.io = An error occurred while contacting the MBean server to create the {0} proxy.
+proxy.error.general = An error occurred while getting the proxy interface for {0}.
+proxy.error.io = An error occurred while contacting the server to create the {0} proxy.
--- a/components/visual-panels/core/src/java/vpanels/client/com/oracle/solaris/vp/client/swing/App.java Mon Oct 28 17:52:58 2013 -0700
+++ b/components/visual-panels/core/src/java/vpanels/client/com/oracle/solaris/vp/client/swing/App.java Wed Oct 30 16:53:48 2013 -0400
@@ -20,7 +20,7 @@
*/
/*
- * Copyright (c) 2009, 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2009, 2013, Oracle and/or its affiliates. All rights reserved.
*/
package com.oracle.solaris.vp.client.swing;
@@ -29,7 +29,7 @@
import java.net.*;
import java.util.*;
import java.util.logging.*;
-import com.oracle.solaris.afunix.*;
+import com.oracle.solaris.rad.transports.*;
import com.oracle.solaris.vp.client.common.*;
import com.oracle.solaris.vp.panel.common.*;
import com.oracle.solaris.vp.panel.common.action.*;
--- a/components/visual-panels/core/src/java/vpanels/client/com/oracle/solaris/vp/client/swing/AppRootControl.java Mon Oct 28 17:52:58 2013 -0700
+++ b/components/visual-panels/core/src/java/vpanels/client/com/oracle/solaris/vp/client/swing/AppRootControl.java Wed Oct 30 16:53:48 2013 -0400
@@ -20,7 +20,7 @@
*/
/*
- * Copyright (c) 2009, 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2009, 2013, Oracle and/or its affiliates. All rights reserved.
*/
package com.oracle.solaris.vp.client.swing;
@@ -30,8 +30,7 @@
import java.util.Map;
import java.util.logging.Level;
import javax.help.HelpSet;
-import com.oracle.solaris.rad.ObjectException;
-import com.oracle.solaris.rad.jmx.IncompatibleVersionException;
+import com.oracle.solaris.rad.client.RadObjectException;
import com.oracle.solaris.vp.client.common.*;
import com.oracle.solaris.vp.panel.common.*;
import com.oracle.solaris.vp.panel.common.action.ActionAbortedException;
@@ -55,7 +54,7 @@
private PanelDescriptorFactory factory;
private HelpSet helpSet;
- private PanelMXBeanTracker panelBeanTracker;
+ private PanelBeanTracker panelBeanTracker;
//
// Constructors
@@ -114,7 +113,7 @@
showError(e.getMessage(), e.getCause());
// Assume invalid panel name
- } catch (ObjectException e) {
+ } catch (RadObjectException e) {
}
}
@@ -129,20 +128,13 @@
super.start(navigator, parameters);
try {
- panelBeanTracker = new PanelMXBeanTracker(getClientContext());
+ panelBeanTracker = new PanelBeanTracker(getClientContext());
} catch (TrackerException e) {
String message = null;
Throwable cause = e.getCause();
- if (cause instanceof IncompatibleVersionException) {
- IncompatibleVersionException ive =
- (IncompatibleVersionException)cause;
-
- message = Finder.getString("panelproxy.error.version",
- ive.getClientVersion(), ive.getServerVersion(),
- ive.getInterfaceClass().getSimpleName());
- } else if (cause instanceof IOException) {
+ if (cause instanceof IOException) {
message = Finder.getString("panelproxy.error.io");
} else {
message = Finder.getString("panelproxy.error.general");
--- a/components/visual-panels/core/src/java/vpanels/client/com/oracle/solaris/vp/client/swing/resources/Resources.properties Mon Oct 28 17:52:58 2013 -0700
+++ b/components/visual-panels/core/src/java/vpanels/client/com/oracle/solaris/vp/client/swing/resources/Resources.properties Wed Oct 30 16:53:48 2013 -0400
@@ -20,7 +20,7 @@
#
#
-# Copyright (c) 2010, 2012, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved.
#
init.error.security.io = unable to read panel security policy, refusing to continue
@@ -91,7 +91,6 @@
panelproxy.error.io = An error occurred while contacting the server.
panelproxy.error.general = An error occurred while creating the system proxy.
-panelproxy.error.version = The client version ({0}) of the "{2}" interface is not compatible with the server version ({1}) of the interface. Upgrade to matching versions of the interface.
certificate.message = The authenticity of {0} cannot be established. Do you want to trust this host?
certificate.view.x509 =\
<table>\
--- a/components/visual-panels/core/src/java/vpanels/java.policy.in Mon Oct 28 17:52:58 2013 -0700
+++ b/components/visual-panels/core/src/java/vpanels/java.policy.in Wed Oct 30 16:53:48 2013 -0400
@@ -20,7 +20,7 @@
//
//
-// Copyright (c) 2009, 2012, Oracle and/or its affiliates. All rights reserved.
+// Copyright (c) 2009, 2013, Oracle and/or its affiliates. All rights reserved.
//
//
@@ -42,6 +42,10 @@
permission java.security.AllPermission;
};
+grant codeBase "file:<VP_DIR>/app/*" {
+ permission java.security.AllPermission;
+};
+
// Workaround for 7066948 - remove when fixed
grant codeBase "file:/usr/jdk/packages/-" {
permission java.security.AllPermission;
--- a/components/visual-panels/core/src/java/vpanels/panel/build.xml Mon Oct 28 17:52:58 2013 -0700
+++ b/components/visual-panels/core/src/java/vpanels/panel/build.xml Wed Oct 30 16:53:48 2013 -0400
@@ -19,7 +19,7 @@
CDDL HEADER END
- Copyright (c) 2009, 2012, Oracle and/or its affiliates. All rights reserved.
+ Copyright (c) 2009, 2013, Oracle and/or its affiliates. All rights reserved.
-->
<project name="vpanels-panel" default="jar">
@@ -29,10 +29,10 @@
<target name="build_project" depends="javadoc" />
<target name="generate_project">
- <generate.adrimpl api="time.xml" />
- <generate.adrimpl api="network.xml" />
- <generate.adr api="panels.xml" />
- <generate.adr api="file.xml" />
+ <generate.adr api="time.adr" />
+ <generate.adr api="network.adr" />
+ <generate.adr api="panel.adr" />
+ <generate.adr api="file.adr" />
<generate.struct />
</target>
@@ -46,6 +46,5 @@
<pathelement location="${proj.util}/vpanels-util.jar" />
<pathelement location="${proj.smf-old}/smf-old.jar" />
<pathelement location="${abs.rad.java}/rad.jar" />
- <pathelement location="${abs.rad.java}/adr.jar" />
</path>
</project>
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/components/visual-panels/core/src/java/vpanels/panel/com/oracle/solaris/vp/panel/common/BeanTracker.java Wed Oct 30 16:53:48 2013 -0400
@@ -0,0 +1,178 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved.
+ */
+
+package com.oracle.solaris.vp.panel.common;
+
+import java.beans.PropertyChangeEvent;
+import java.io.IOException;
+import java.util.logging.*;
+import com.oracle.solaris.rad.client.ADRName;
+import com.oracle.solaris.rad.client.RadException;
+import com.oracle.solaris.rad.connect.Connection;
+import com.oracle.solaris.vp.util.misc.ObjectUtil;
+import com.oracle.solaris.vp.util.misc.event.PropertyChangeListeners;
+
+/**
+ * The {@code BeanTracker} is a {@link ConnectionTracker} that automatically
+ * creates and re-creates an {@link #getBean Bean} after changes in the {@link
+ * #setServerConnection ServerConnection} or {@link #setObjectName
+ * ObjectName}.
+ * </p>
+ * A property change notification is sent out when the tracked {@code Bean}
+ * changes.
+ */
+public class BeanTracker<T> extends ConnectionTracker {
+ //
+ // Static data
+ //
+
+ /**
+ * The name of the property that changes with {@link #setBean}.
+ */
+ public static final String PROPERTY_BEAN = "bean";
+
+ //
+ // Instance data
+ //
+
+ private Class<T> clazz;
+ private T bean;
+
+ //
+ // Constructors
+ //
+
+ public BeanTracker(ADRName aName, Class<T> clazz)
+ {
+ super(aName);
+ try {
+ setClass(clazz);
+
+ // Impossible because ServerConnection not yet set
+ } catch (TrackerException impossible) {
+ }
+ }
+
+ public BeanTracker(ADRName aName, Class<T> clazz,
+ ClientContext context) throws TrackerException {
+
+ this(aName, clazz);
+ setClientContext(context);
+ }
+
+ //
+ // ConnectionTracker methods
+ //
+
+ @Override
+ public void setServerConnection(Connection conn)
+ throws TrackerException {
+
+ if (getServerConnection() != conn) {
+ super.setServerConnection(conn);
+ setBean();
+ }
+ }
+
+ @Override
+ public void setObjectName(ADRName aName)
+ throws TrackerException {
+
+ if (!ObjectUtil.equals(getObjectName(), aName)) {
+ super.setObjectName(aName);
+ setBean();
+ }
+ }
+
+ //
+ // BeanTracker methods
+ //
+
+ protected T createBean() throws RadException, IOException {
+
+ T bean = null;
+ Connection conn = getServerConnection();
+ ADRName aname = getObjectName();
+ if (conn != null && aname != null && clazz != null) {
+ bean = conn.getObject(aname);
+ }
+
+ return bean;
+ }
+
+ public T getBean() {
+ return bean;
+ }
+
+ public Class<T> getBeanClass() {
+ return clazz;
+ }
+
+ public void setBean(T bean) {
+ if (this.bean != bean) {
+ PropertyChangeEvent e = new PropertyChangeEvent(
+ this, PROPERTY_BEAN, this.bean, bean);
+ this.bean = bean;
+ getPropertyChangeListeners().propertyChange(e);
+ }
+ }
+
+ //
+ // Private methods
+ //
+
+ private void setClass(Class<T> clazz)
+ throws TrackerException {
+
+ this.clazz = clazz;
+ setBean();
+ }
+
+ private void setBean() throws TrackerException {
+ T bean = null;
+ String message = null;
+ Throwable cause = null;
+
+ try {
+ bean = createBean();
+ } catch (RadException e) {
+ cause = e;
+ message = "Error getting object information for: "
+ + getObjectName();
+ } catch (IOException e) {
+ cause = e;
+ message = "Error contacting server while "
+ + "creating proxy for: " + clazz.getSimpleName();
+ }
+
+ setBean(bean);
+
+ if (cause != null) {
+ Logger.getLogger(getClass().getName()).log(
+ Level.SEVERE, message, cause);
+ throw new TrackerException(cause);
+ }
+ }
+}
--- a/components/visual-panels/core/src/java/vpanels/panel/com/oracle/solaris/vp/panel/common/ConnectionInfo.java Mon Oct 28 17:52:58 2013 -0700
+++ b/components/visual-panels/core/src/java/vpanels/panel/com/oracle/solaris/vp/panel/common/ConnectionInfo.java Wed Oct 30 16:53:48 2013 -0400
@@ -20,17 +20,17 @@
*/
/*
- * Copyright (c) 2010, 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved.
*/
package com.oracle.solaris.vp.panel.common;
import java.net.*;
-import javax.management.remote.JMXConnector;
+import com.oracle.solaris.rad.connect.Connection;
import com.oracle.solaris.vp.util.misc.*;
/**
- * The {@code ConnectionInfo} class encapsulate an open {@code JMXConnector} and
+ * The {@code ConnectionInfo} class encapsulate an open {@code Connection} and
* some of its attributes.
*/
public class ConnectionInfo implements LoginInfo {
@@ -44,7 +44,7 @@
private String zone;
private String zoneUser;
private String zoneRole;
- private JMXConnector connector;
+ private Connection connection;
private InetAddress[] addrs;
private Boolean isLocalAddress;
@@ -53,7 +53,7 @@
//
public ConnectionInfo(String host, String user, String role,
- String zone, String zoneUser, String zoneRole, JMXConnector connector) {
+ String zone, String zoneUser, String zoneRole, Connection connection) {
this.host = host;
this.user = user;
@@ -61,13 +61,13 @@
this.zone = zone;
this.zoneUser = zoneUser;
this.zoneRole = zoneRole;
- this.connector = connector;
+ this.connection = connection;
}
public ConnectionInfo(String host, String user, String role,
- JMXConnector connector) {
+ Connection connection) {
- this(host, user, role, null, null, null, connector);
+ this(host, user, role, null, null, null, connection);
}
//
@@ -127,7 +127,7 @@
@Override
public void finalize() throws Throwable {
- IOUtil.closeIgnore(connector);
+ IOUtil.closeIgnore(connection);
super.finalize();
}
@@ -145,8 +145,8 @@
// ConnectionInfo methods
//
- public JMXConnector getConnector() {
- return connector;
+ public Connection getConnection() {
+ return connection;
}
public synchronized InetAddress[] getInetAddresses() {
--- a/components/visual-panels/core/src/java/vpanels/panel/com/oracle/solaris/vp/panel/common/ConnectionTracker.java Mon Oct 28 17:52:58 2013 -0700
+++ b/components/visual-panels/core/src/java/vpanels/panel/com/oracle/solaris/vp/panel/common/ConnectionTracker.java Wed Oct 30 16:53:48 2013 -0400
@@ -20,7 +20,7 @@
*/
/*
- * Copyright (c) 2010, 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved.
*/
package com.oracle.solaris.vp.panel.common;
@@ -29,7 +29,8 @@
import java.io.IOException;
import java.util.*;
import java.util.logging.*;
-import javax.management.*;
+import com.oracle.solaris.rad.client.ADRName;
+import com.oracle.solaris.rad.connect.Connection;
import com.oracle.solaris.vp.util.misc.ObjectUtil;
import com.oracle.solaris.vp.util.misc.event.PropertyChangeListeners;
@@ -41,12 +42,12 @@
* automatically removed/added when the tracked {@code ClientContext}
* fails/changes.
* </p>
- * {@code NotificationListener}s that depend on an {@code MBeanServerConnection}
+ * {@code NotificationListener}s that depend on a {@code Connection}
* are automatically removed/added when the tracked {@code
- * MBeanServerConnection} or {@code ObjectName} changes.
+ * Connection} or {@code ObjectName} changes.
* </p>
* Property change notifications are sent out when the tracked {@code
- * ClientContext}, {@code ConnectionInfo}, {@code MBeanServerConnection}, or
+ * ClientContext}, {@code ConnectionInfo}, {@code Connection}, or
* {@code ObjectName} changes.
*/
public class ConnectionTracker implements ConnectionListener {
@@ -56,18 +57,15 @@
private abstract class NotifyParams<O> {
private O listener;
- private NotificationFilter filter;
private Object handback;
//
// Constructors
//
- public NotifyParams(O listener, NotificationFilter filter,
- Object handback) {
+ public NotifyParams(O listener, Object handback) {
this.listener = listener;
- this.filter = filter;
this.handback = handback;
}
@@ -79,11 +77,9 @@
return ObjectUtil.equals(this.listener, listener);
}
- public boolean equals(Object listener, NotificationFilter filter,
- Object handback) {
+ public boolean equals(Object listener, Object handback) {
return ObjectUtil.equals(this.listener, listener) &&
- ObjectUtil.equals(this.filter, filter) &&
ObjectUtil.equals(this.handback, handback);
}
@@ -91,91 +87,36 @@
return listener;
}
- public NotificationFilter getFilter() {
- return filter;
- }
-
public Object getHandback() {
return handback;
}
public abstract void add()
- throws InstanceNotFoundException, IOException;
+ throws IOException;
public abstract void remove()
- throws InstanceNotFoundException, IOException;
+ throws IOException;
}
- private class ListenerNotifyParams
- extends NotifyParams<NotificationListener> {
+ private class ObjectNameNotifyParams extends NotifyParams<ADRName> {
//
// Constructors
//
- public ListenerNotifyParams(NotificationListener listener,
- NotificationFilter filter, Object handback) {
- super(listener, filter, handback);
- }
-
- //
- // ListenerNotifyParams methods
- //
-
- @Override
- public void add() throws InstanceNotFoundException, IOException {
- if (mbsc != null && oName != null) {
- mbsc.addNotificationListener(oName, getListener(), getFilter(),
- getHandback());
- }
+ public ObjectNameNotifyParams(ADRName listener,
+ Object handback) {
+ super(listener, handback);
}
-
- @Override
- public void remove() throws InstanceNotFoundException,
- IOException {
-
- if (mbsc != null && oName != null) {
- try {
- mbsc.removeNotificationListener(oName, getListener(),
- getFilter(), getHandback());
- } catch (ListenerNotFoundException ignore) {
- }
- }
- }
- }
-
- private class ObjectNameNotifyParams extends NotifyParams<ObjectName> {
- //
- // Constructors
- //
-
- public ObjectNameNotifyParams(ObjectName listener,
- NotificationFilter filter, Object handback) {
- super(listener, filter, handback);
- }
-
//
// ObjectNameNotifyParams methods
//
@Override
- public void add() throws InstanceNotFoundException, IOException {
- if (mbsc != null && oName != null) {
- mbsc.addNotificationListener(oName, getListener(), getFilter(),
- getHandback());
- }
+ public void add() throws IOException {
}
@Override
- public void remove() throws InstanceNotFoundException,
- IOException {
-
- if (mbsc != null && oName != null) {
- try {
- mbsc.removeNotificationListener(oName, getListener(),
- getFilter(), getHandback());
- } catch (ListenerNotFoundException ignore) {
- }
- }
+ public void remove() throws IOException {
}
}
@@ -195,9 +136,9 @@
/**
* The name of the property that changes with {@link
- * #setMBeanServerConnection}.
+ * #setServerConnection}.
*/
- public static final String PROPERTY_MBSC = "mbsc";
+ public static final String PROPERTY_SCONN = "sconn";
/**
* The name of the property that changes with {@link #setObjectName}.
@@ -210,8 +151,8 @@
private ClientContext context;
private ConnectionInfo info;
- private MBeanServerConnection mbsc;
- private ObjectName oName;
+ private Connection conn;
+ private ADRName aname;
private PropertyChangeListeners pListeners = new PropertyChangeListeners();
private List<NotifyParams> nListeners = new LinkedList<NotifyParams>();
@@ -219,19 +160,19 @@
// Constructors
//
- public ConnectionTracker(ObjectName oName) {
+ public ConnectionTracker(ADRName aname) {
try {
- setObjectName(oName);
+ setObjectName(aname);
// Impossible because no NotificationListeners have been added yet
} catch (TrackerException impossible) {
}
}
- public ConnectionTracker(ObjectName oName, ClientContext context)
+ public ConnectionTracker(ADRName aname, ClientContext context)
throws TrackerException {
- this(oName);
+ this(aname);
setClientContext(context);
}
@@ -263,23 +204,10 @@
// ConnectionTracker methods
//
- public void addNotificationListener(NotificationListener listener,
- NotificationFilter filter, Object handback)
- throws InstanceNotFoundException, IOException {
-
- NotifyParams params = new ListenerNotifyParams(listener, filter,
- handback);
+ public void addNotificationListener(ADRName listener, Object handback)
+ throws IOException {
- params.add();
- nListeners.add(params);
- }
-
- public void addNotificationListener(ObjectName listener,
- NotificationFilter filter, Object handback)
- throws InstanceNotFoundException, IOException {
-
- NotifyParams params = new ObjectNameNotifyParams(listener, filter,
- handback);
+ NotifyParams params = new ObjectNameNotifyParams(listener, handback);
params.add();
nListeners.add(params);
@@ -319,22 +247,22 @@
return info;
}
- public MBeanServerConnection getMBeanServerConnection() {
- return mbsc;
+ public Connection getServerConnection() {
+ return conn;
}
- public ObjectName getObjectName() {
- return oName;
+ public ADRName getObjectName() {
+ return aname;
}
protected PropertyChangeListeners getPropertyChangeListeners() {
return pListeners;
}
- public void removeNotificationListener(NotificationListener listener)
- throws InstanceNotFoundException, IOException {
+ public void removeNotificationListener(ADRName listener)
+ throws IOException {
- for (Iterator<NotifyParams> i = nListeners.iterator(); i.hasNext();) {
+ for (Iterator<NotifyParams> i = nListeners.iterator(); i.hasNext(); ) {
NotifyParams params = i.next();
if (params.equals(listener)) {
params.remove();
@@ -343,39 +271,13 @@
}
}
- public void removeNotificationListener(NotificationListener listener,
- NotificationFilter filter, Object handback)
- throws InstanceNotFoundException, IOException {
-
- for (Iterator<NotifyParams> i = nListeners.iterator(); i.hasNext();) {
- NotifyParams params = i.next();
- if (params.equals(listener, filter, handback)) {
- params.remove();
- i.remove();
- return;
- }
- }
- }
-
- public void removeNotificationListener(ObjectName listener)
- throws InstanceNotFoundException, IOException {
+ public void removeNotificationListener(ADRName name, ADRName listener,
+ Object handback)
+ throws IOException {
- for (Iterator<NotifyParams> i = nListeners.iterator(); i.hasNext();) {
+ for (Iterator<NotifyParams> i = nListeners.iterator(); i.hasNext(); ) {
NotifyParams params = i.next();
- if (params.equals(listener)) {
- params.remove();
- i.remove();
- }
- }
- }
-
- public void removeNotificationListener(ObjectName name, ObjectName listener,
- NotificationFilter filter, Object handback)
- throws InstanceNotFoundException, IOException {
-
- for (Iterator<NotifyParams> i = nListeners.iterator(); i.hasNext();) {
- NotifyParams params = i.next();
- if (params.equals(listener, filter, handback)) {
+ if (params.equals(listener, handback)) {
params.remove();
i.remove();
return;
@@ -422,7 +324,7 @@
/**
* Sets the {@code ConnectionInfo}, then calls {@link
- * #setMBeanServerConnection}.
+ * #setServerConnection}.
*
* @exception TrackerException
* if an error occurred during initialization
@@ -436,30 +338,26 @@
this.info = info;
pListeners.propertyChange(e);
- try {
- setMBeanServerConnection(info == null ? null :
- info.getConnector().getMBeanServerConnection());
- } catch (IOException ex) {
- throw new TrackerException(ex);
- }
+ setServerConnection(info == null ? null :
+ info.getConnection());
}
}
/**
- * Sets the {@code MBeanServerConnection}.
+ * Sets the {@code ServerConnection}.
*
* @exception TrackerException
* if an error occurred during initialization
*/
- public void setMBeanServerConnection(MBeanServerConnection mbsc)
+ public void setServerConnection(Connection conn)
throws TrackerException {
- if (this.mbsc != mbsc) {
+ if (this.conn != conn) {
removeNotificationListeners();
PropertyChangeEvent e = new PropertyChangeEvent(
- this, PROPERTY_MBSC, this.mbsc, mbsc);
- this.mbsc = mbsc;
+ this, PROPERTY_SCONN, this.conn, conn);
+ this.conn = conn;
pListeners.propertyChange(e);
addNotificationListeners();
@@ -472,15 +370,15 @@
* @exception TrackerException
* if an error occurred during initialization
*/
- public void setObjectName(ObjectName oName)
+ public void setObjectName(ADRName aname)
throws TrackerException {
- if (!ObjectUtil.equals(this.oName, oName)) {
+ if (!ObjectUtil.equals(this.aname, aname)) {
removeNotificationListeners();
PropertyChangeEvent e = new PropertyChangeEvent(
- this, PROPERTY_OBJECTNAME, this.oName, oName);
- this.oName = oName;
+ this, PROPERTY_OBJECTNAME, this.aname, aname);
+ this.aname = aname;
pListeners.propertyChange(e);
addNotificationListeners();
@@ -494,12 +392,10 @@
private void addNotificationListeners()
throws TrackerException {
- if (mbsc != null && oName != null) {
+ if (conn != null && aname != null) {
for (NotifyParams params : nListeners) {
try {
params.add();
- } catch (InstanceNotFoundException e) {
- throw new TrackerException(e);
} catch (IOException e) {
throw new TrackerException(e);
}
@@ -508,7 +404,7 @@
}
private void removeNotificationListeners() {
- if (mbsc != null && oName != null) {
+ if (conn != null && aname != null) {
for (NotifyParams params : nListeners) {
try {
params.remove();
--- a/components/visual-panels/core/src/java/vpanels/panel/com/oracle/solaris/vp/panel/common/MXBeanTracker.java Mon Oct 28 17:52:58 2013 -0700
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,192 +0,0 @@
-/*
- * CDDL HEADER START
- *
- * The contents of this file are subject to the terms of the
- * Common Development and Distribution License (the "License").
- * You may not use this file except in compliance with the License.
- *
- * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
- * or http://www.opensolaris.org/os/licensing.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- *
- * When distributing Covered Code, include this CDDL HEADER in each
- * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
- * If applicable, add the following below this CDDL HEADER, with the
- * fields enclosed by brackets "[]" replaced with your own identifying
- * information: Portions Copyright [yyyy] [name of copyright owner]
- *
- * CDDL HEADER END
- */
-
-/*
- * Copyright (c) 2010, 2012, Oracle and/or its affiliates. All rights reserved.
- */
-
-package com.oracle.solaris.vp.panel.common;
-
-import java.beans.PropertyChangeEvent;
-import java.io.IOException;
-import java.util.logging.*;
-import javax.management.*;
-import com.oracle.solaris.adr.Stability;
-import com.oracle.solaris.rad.jmx.*;
-import com.oracle.solaris.vp.util.misc.ObjectUtil;
-import com.oracle.solaris.vp.util.misc.event.PropertyChangeListeners;
-
-/**
- * The {@code MXBeanTracker} is a {@link ConnectionTracker} that automatically
- * creates and re-creates an {@link #getBean MXBean} after changes in the {@link
- * #setMBeanServerConnection MBeanServerConnection} or {@link #setObjectName
- * ObjectName}.
- * </p>
- * A property change notification is sent out when the tracked {@code MXBean}
- * changes.
- */
-public class MXBeanTracker<T> extends ConnectionTracker {
- //
- // Static data
- //
-
- /**
- * The name of the property that changes with {@link #setBean}.
- */
- public static final String PROPERTY_BEAN = "bean";
-
- //
- // Instance data
- //
-
- private Class<T> clazz;
- private T bean;
- private Stability stability;
-
- //
- // Constructors
- //
-
- public MXBeanTracker(ObjectName oName, Class<T> clazz, Stability stability)
- {
- super(oName);
- try {
- setClass(clazz, stability);
-
- // Impossible because mbsc not yet set
- } catch (TrackerException impossible) {
- }
- }
-
- public MXBeanTracker(ObjectName oName, Class<T> clazz, Stability stability,
- ClientContext context) throws TrackerException {
-
- this(oName, clazz, stability);
- setClientContext(context);
- }
-
- //
- // ConnectionTracker methods
- //
-
- @Override
- public void setMBeanServerConnection(MBeanServerConnection mbsc)
- throws TrackerException {
-
- if (getMBeanServerConnection() != mbsc) {
- super.setMBeanServerConnection(mbsc);
- setBean();
- }
- }
-
- @Override
- public void setObjectName(ObjectName oName)
- throws TrackerException {
-
- if (!ObjectUtil.equals(getObjectName(), oName)) {
- super.setObjectName(oName);
- setBean();
- }
- }
-
- //
- // MXBeanTracker methods
- //
-
- protected T createBean() throws JMException,
- IncompatibleVersionException, IOException {
-
- T bean = null;
- MBeanServerConnection mbsc = getMBeanServerConnection();
- ObjectName oName = getObjectName();
- if (mbsc != null && oName != null && clazz != null && stability != null)
- {
- bean = RadJMX.newMXBeanProxy(mbsc, oName, clazz, stability);
- }
-
- return bean;
- }
-
- public T getBean() {
- return bean;
- }
-
- public Class<T> getBeanClass() {
- return clazz;
- }
-
- public Stability getStability() {
- return stability;
- }
-
- public void setBean(T bean) {
- if (this.bean != bean) {
- PropertyChangeEvent e = new PropertyChangeEvent(
- this, PROPERTY_BEAN, this.bean, bean);
- this.bean = bean;
- getPropertyChangeListeners().propertyChange(e);
- }
- }
-
- //
- // Private methods
- //
-
- private void setClass(Class<T> clazz, Stability stability)
- throws TrackerException {
-
- this.clazz = clazz;
- this.stability = stability;
- setBean();
- }
-
- private void setBean() throws TrackerException {
- T bean = null;
- String message = null;
- Throwable cause = null;
-
- try {
- bean = createBean();
-
- } catch (IncompatibleVersionException e) {
- cause = e;
- message = "Incompatible client and server versions for: "
- + clazz.getSimpleName();
-
- } catch (JMException e) {
- cause = e;
- message = "Error getting MBean information for: " + getObjectName();
-
- } catch (IOException e) {
- cause = e;
- message = "Error contacting MBean server while "
- + "creating proxy for: " + clazz.getSimpleName();
- }
-
- setBean(bean);
-
- if (cause != null) {
- Logger.getLogger(getClass().getName()).log(
- Level.SEVERE, message, cause);
- throw new TrackerException(cause);
- }
- }
-}
--- a/components/visual-panels/core/src/java/vpanels/panel/com/oracle/solaris/vp/panel/common/api/file/FileBrowserUtil.java Mon Oct 28 17:52:58 2013 -0700
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,39 +0,0 @@
-/*
- * CDDL HEADER START
- *
- * The contents of this file are subject to the terms of the
- * Common Development and Distribution License (the "License").
- * You may not use this file except in compliance with the License.
- *
- * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
- * or http://www.opensolaris.org/os/licensing.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- *
- * When distributing Covered Code, include this CDDL HEADER in each
- * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
- * If applicable, add the following below this CDDL HEADER, with the
- * fields enclosed by brackets "[]" replaced with your own identifying
- * information: Portions Copyright [yyyy] [name of copyright owner]
- *
- * CDDL HEADER END
- */
-
-/*
- * Copyright (c) 2009, 2012, Oracle and/or its affiliates. All rights reserved.
- */
-
-package com.oracle.solaris.vp.panel.common.api.file;
-
-import javax.management.ObjectName;
-import com.oracle.solaris.vp.panel.common.api.panel.MBeanUtil;
-
-public class FileBrowserUtil {
- //
- // Static data
- //
-
- private static final String DOMAIN = MBeanUtil.VP_DOMAIN + ".file";
- public static final ObjectName OBJECT_NAME =
- MBeanUtil.makeObjectName(DOMAIN, "FileBrowser");
-}
--- a/components/visual-panels/core/src/java/vpanels/panel/com/oracle/solaris/vp/panel/common/api/file/RemoteFile.java Mon Oct 28 17:52:58 2013 -0700
+++ b/components/visual-panels/core/src/java/vpanels/panel/com/oracle/solaris/vp/panel/common/api/file/RemoteFile.java Wed Oct 30 16:53:48 2013 -0400
@@ -20,14 +20,14 @@
*/
/*
- * Copyright (c) 2009, 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2009, 2013, Oracle and/or its affiliates. All rights reserved.
*/
package com.oracle.solaris.vp.panel.common.api.file;
import java.io.*;
import java.util.List;
-import com.oracle.solaris.rad.ObjectException;
+import com.oracle.solaris.rad.client.RadObjectException;
@SuppressWarnings({"serial"})
public class RemoteFile extends File {
@@ -35,14 +35,14 @@
// Instance data
//
- private FileBrowserMXBean browser;
+ private FileBrowser browser;
private FileSnapshot snapshot;
//
// Constructors
//
- public RemoteFile(FileBrowserMXBean browser, FileSnapshot snapshot) {
+ public RemoteFile(FileBrowser browser, FileSnapshot snapshot) {
super(snapshot.getPath());
this.browser = browser;
this.snapshot = snapshot;
@@ -108,7 +108,7 @@
String path = snapshot.getCanonicalPath();
try {
return new RemoteFile(browser, browser.getFile(path));
- } catch (ObjectException e) {
+ } catch (RadObjectException e) {
throw new IOException(e);
}
}
@@ -136,7 +136,7 @@
try {
return parent == null ? null :
new RemoteFile(browser, browser.getFile(parent));
- } catch (ObjectException e) {
+ } catch (RadObjectException e) {
/* Not correct, but our choices are limited */
return null;
}
@@ -193,7 +193,7 @@
names[i++] = ss.getBaseName();
return names;
- } catch (ObjectException e) {
+ } catch (RadObjectException e) {
return null;
}
}
@@ -203,7 +203,7 @@
try {
List<FileSnapshot> snapshots = browser.getFiles(getAbsolutePath());
return toFiles(snapshots);
- } catch (ObjectException e) {
+ } catch (RadObjectException e) {
return null;
}
}
@@ -278,7 +278,7 @@
// RemoteFile methods
//
- public FileBrowserMXBean getBrowser() {
+ public FileBrowser getBrowser() {
return browser;
}
@@ -295,7 +295,7 @@
//
public static RemoteFile[] toFiles(
- FileBrowserMXBean browser, List<FileSnapshot> snapshots) {
+ FileBrowser browser, List<FileSnapshot> snapshots) {
RemoteFile[] files = new RemoteFile[snapshots.size()];
--- a/components/visual-panels/core/src/java/vpanels/panel/com/oracle/solaris/vp/panel/common/api/file/RemoteFileSystemView.java Mon Oct 28 17:52:58 2013 -0700
+++ b/components/visual-panels/core/src/java/vpanels/panel/com/oracle/solaris/vp/panel/common/api/file/RemoteFileSystemView.java Wed Oct 30 16:53:48 2013 -0400
@@ -20,7 +20,7 @@
*/
/*
- * Copyright (c) 2009, 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2009, 2013, Oracle and/or its affiliates. All rights reserved.
*/
package com.oracle.solaris.vp.panel.common.api.file;
@@ -30,8 +30,7 @@
import java.util.*;
import javax.swing.*;
import javax.swing.filechooser.FileSystemView;
-import com.oracle.solaris.adr.Stability;
-import com.oracle.solaris.rad.ObjectException;
+import com.oracle.solaris.rad.client.RadObjectException;
import com.oracle.solaris.vp.panel.common.*;
import com.oracle.solaris.vp.util.misc.IOUtil;
@@ -40,7 +39,7 @@
// Instance data
//
- private MXBeanTracker<FileBrowserMXBean> tracker;
+ private BeanTracker<FileBrowser> tracker;
//
// Constructors
@@ -49,9 +48,8 @@
public RemoteFileSystemView(ClientContext context)
throws TrackerException {
- tracker = new MXBeanTracker<FileBrowserMXBean>(
- FileBrowserUtil.OBJECT_NAME, FileBrowserMXBean.class,
- Stability.PRIVATE, context);
+ tracker = new BeanTracker<FileBrowser>(
+ (new FileBrowser()).getName(), FileBrowser.class, context);
}
//
@@ -69,11 +67,11 @@
@Override
public RemoteFile createFileObject(String path) {
try {
- FileBrowserMXBean browser = tracker.getBean();
+ FileBrowser browser = tracker.getBean();
FileSnapshot snap = browser.getFile(path);
return snap != null ?
new RemoteFile(browser, browser.getFile(path)) : null;
- } catch (ObjectException ex) {
+ } catch (RadObjectException ex) {
return null;
}
}
@@ -107,18 +105,18 @@
public RemoteFile[] getFiles(File dir, boolean useFileHiding) {
List<RemoteFile> files = new ArrayList<RemoteFile>();
- FileBrowserMXBean browser = tracker.getBean();
+ FileBrowser browser = tracker.getBean();
List<FileSnapshot> snapshots;
try {
snapshots = browser.getFiles(dir.getAbsolutePath());
- } catch (ObjectException e) {
+ } catch (RadObjectException e) {
return (new RemoteFile[0]);
} catch (java.lang.reflect.UndeclaredThrowableException e) {
/*
* Our caller, BasicDirectoryModel, may interrupt us at
* any time. This can cause exceptions to be thrown.
* In our case, our transport may throw an exception
- * which is mapped by the MBean proxy to a
+ * which is mapped by the proxy to a
* UndeclaredThrowableException.
*
* Unfortunately, the FileSystemView interface doesn't
@@ -152,7 +150,7 @@
}
public RemoteFile[] getRoots() {
- FileBrowserMXBean browser = tracker.getBean();
+ FileBrowser browser = tracker.getBean();
List<FileSnapshot> snapshots = browser.getroots();
return RemoteFile.toFiles(browser, snapshots);
}
--- a/components/visual-panels/core/src/java/vpanels/panel/com/oracle/solaris/vp/panel/common/api/network/NetworkUtil.java Mon Oct 28 17:52:58 2013 -0700
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,39 +0,0 @@
-/*
- * CDDL HEADER START
- *
- * The contents of this file are subject to the terms of the
- * Common Development and Distribution License (the "License").
- * You may not use this file except in compliance with the License.
- *
- * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
- * or http://www.opensolaris.org/os/licensing.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- *
- * When distributing Covered Code, include this CDDL HEADER in each
- * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
- * If applicable, add the following below this CDDL HEADER, with the
- * fields enclosed by brackets "[]" replaced with your own identifying
- * information: Portions Copyright [yyyy] [name of copyright owner]
- *
- * CDDL HEADER END
- */
-
-/*
- * Copyright (c) 2009, 2012, Oracle and/or its affiliates. All rights reserved.
- */
-
-package com.oracle.solaris.vp.panel.common.api.network;
-
-import javax.management.ObjectName;
-import com.oracle.solaris.vp.panel.common.api.panel.MBeanUtil;
-
-public class NetworkUtil {
- //
- // Static data
- //
-
- private static final String DOMAIN = MBeanUtil.VP_DOMAIN + ".network";
- public static final ObjectName OBJECT_NAME =
- MBeanUtil.makeObjectName(DOMAIN, "Network");
-}
--- a/components/visual-panels/core/src/java/vpanels/panel/com/oracle/solaris/vp/panel/common/api/panel/MBeanUtil.java Mon Oct 28 17:52:58 2013 -0700
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,64 +0,0 @@
-/*
- * CDDL HEADER START
- *
- * The contents of this file are subject to the terms of the
- * Common Development and Distribution License (the "License").
- * You may not use this file except in compliance with the License.
- *
- * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
- * or http://www.opensolaris.org/os/licensing.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- *
- * When distributing Covered Code, include this CDDL HEADER in each
- * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
- * If applicable, add the following below this CDDL HEADER, with the
- * fields enclosed by brackets "[]" replaced with your own identifying
- * information: Portions Copyright [yyyy] [name of copyright owner]
- *
- * CDDL HEADER END
- */
-
-/*
- * Copyright (c) 2009, 2012, Oracle and/or its affiliates. All rights reserved.
- */
-
-package com.oracle.solaris.vp.panel.common.api.panel;
-
-import javax.management.ObjectName;
-
-public class MBeanUtil
-{
- /**
- * The root domain of all VP-provided MBeans.
- *
- * Because internally a domain-based dispatch mechanism is used, no
- * two modules may deliver MBeans in the same subdomain.
- */
- public static final String VP_DOMAIN =
- "com.oracle.solaris.vp.panel.common.api";
-
- /**
- * The root domain of all VP panel-provided MBeans.
- *
- * Because internally a domain-based dispatch mechanism is used, no
- * two modules may deliver MBeans in the same subdomain.
- */
- public static final String VP_PANEL_DOMAIN =
- "com.oracle.solaris.vp.panels";
-
- /**
- * Creates an {@code ObjectName} in {@code domain} of "type"
- * {@code name}.
- */
- public static ObjectName makeObjectName(String domain, String name)
- {
- ObjectName result = null;
- try {
- result = ObjectName.getInstance(domain, "type", name);
- } catch (Exception e) {
- /* shouldn't happen */
- }
- return (result);
- }
-}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/components/visual-panels/core/src/java/vpanels/panel/com/oracle/solaris/vp/panel/common/api/panel/PanelBeanTracker.java Wed Oct 30 16:53:48 2013 -0400
@@ -0,0 +1,46 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright (c) 2009, 2013, Oracle and/or its affiliates. All rights reserved.
+ */
+
+package com.oracle.solaris.vp.panel.common.api.panel;
+
+import com.oracle.solaris.rad.client.ADRName;
+import com.oracle.solaris.vp.panel.common.*;
+
+public class PanelBeanTracker extends BeanTracker<Panel> {
+ //
+ // Constructors
+ //
+
+ public PanelBeanTracker() {
+ super(new Panel().getName(), Panel.class);
+ }
+
+ public PanelBeanTracker(ClientContext context)
+ throws TrackerException {
+
+ this();
+ setClientContext(context);
+ }
+}
--- a/components/visual-panels/core/src/java/vpanels/panel/com/oracle/solaris/vp/panel/common/api/panel/PanelMXBeanTracker.java Mon Oct 28 17:52:58 2013 -0700
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,55 +0,0 @@
-/*
- * CDDL HEADER START
- *
- * The contents of this file are subject to the terms of the
- * Common Development and Distribution License (the "License").
- * You may not use this file except in compliance with the License.
- *
- * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
- * or http://www.opensolaris.org/os/licensing.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- *
- * When distributing Covered Code, include this CDDL HEADER in each
- * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
- * If applicable, add the following below this CDDL HEADER, with the
- * fields enclosed by brackets "[]" replaced with your own identifying
- * information: Portions Copyright [yyyy] [name of copyright owner]
- *
- * CDDL HEADER END
- */
-
-/*
- * Copyright (c) 2009, 2012, Oracle and/or its affiliates. All rights reserved.
- */
-
-package com.oracle.solaris.vp.panel.common.api.panel;
-
-import javax.management.ObjectName;
-import com.oracle.solaris.adr.Stability;
-import com.oracle.solaris.vp.panel.common.*;
-
-public class PanelMXBeanTracker extends MXBeanTracker<PanelMXBean> {
- //
- // Static data
- //
-
- private static final String DOMAIN = MBeanUtil.VP_DOMAIN + ".panel";
- public static final ObjectName OBJECT_NAME =
- MBeanUtil.makeObjectName(DOMAIN, "Panel");
-
- //
- // Constructors
- //
-
- public PanelMXBeanTracker() {
- super(OBJECT_NAME, PanelMXBean.class, Stability.PRIVATE);
- }
-
- public PanelMXBeanTracker(ClientContext context)
- throws TrackerException {
-
- this();
- setClientContext(context);
- }
-}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/components/visual-panels/core/src/java/vpanels/panel/com/oracle/solaris/vp/panel/common/api/time/HasTimeBean.java Wed Oct 30 16:53:48 2013 -0400
@@ -0,0 +1,32 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright (c) 2009, 2013, Oracle and/or its affiliates. All rights reserved.
+ */
+
+package com.oracle.solaris.vp.panel.common.api.time;
+
+import com.oracle.solaris.vp.panels.time.*;
+
+public interface HasTimeBean {
+ Time getTimeBean();
+}
--- a/components/visual-panels/core/src/java/vpanels/panel/com/oracle/solaris/vp/panel/common/api/time/HasTimeMXBean.java Mon Oct 28 17:52:58 2013 -0700
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,32 +0,0 @@
-/*
- * CDDL HEADER START
- *
- * The contents of this file are subject to the terms of the
- * Common Development and Distribution License (the "License").
- * You may not use this file except in compliance with the License.
- *
- * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
- * or http://www.opensolaris.org/os/licensing.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- *
- * When distributing Covered Code, include this CDDL HEADER in each
- * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
- * If applicable, add the following below this CDDL HEADER, with the
- * fields enclosed by brackets "[]" replaced with your own identifying
- * information: Portions Copyright [yyyy] [name of copyright owner]
- *
- * CDDL HEADER END
- */
-
-/*
- * Copyright (c) 2009, 2012, Oracle and/or its affiliates. All rights reserved.
- */
-
-package com.oracle.solaris.vp.panel.common.api.time;
-
-import com.oracle.solaris.vp.panels.time.*;
-
-public interface HasTimeMXBean {
- TimeMXBean getTimeMXBean();
-}
--- a/components/visual-panels/core/src/java/vpanels/panel/com/oracle/solaris/vp/panel/common/smf/AggregatedRefreshService.java Mon Oct 28 17:52:58 2013 -0700
+++ b/components/visual-panels/core/src/java/vpanels/panel/com/oracle/solaris/vp/panel/common/smf/AggregatedRefreshService.java Wed Oct 30 16:53:48 2013 -0400
@@ -20,7 +20,7 @@
*/
/*
- * Copyright (c) 2009, 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2009, 2013, Oracle and/or its affiliates. All rights reserved.
*/
package com.oracle.solaris.vp.panel.common.smf;
@@ -32,14 +32,14 @@
/**
* The {@code AggregatedRefreshService} class is a wrapper around another {@link
- * ServiceMXBean} that aggregates calls to {@link #refresh} to minimize the
+ * ServiceBean} that aggregates calls to {@link #refresh} to minimize the
* churn in the SMF repository and the risk of incomplete data. Use of this
* class should generally follow this pattern:
* <br/>
* 1. Prevent refreshes of the wrapped service by calling {@link #pause}.
* <br/>
* 2. Use this class with one or more classes that operate on a {@link
- * ServiceMXBean} (like {@link BasicSmfMutableProperty}). These classes may
+ * ServiceBean} (like {@link BasicSmfMutableProperty}). These classes may
* call {@link #refresh} repeatedly.
* <br/>
* 3. Flush the pending refresh requests with {@link #unpause}.
@@ -47,12 +47,12 @@
* Users of this class must take care to invoke step 3 even if step 2 results in
* an exception.
*/
-public class AggregatedRefreshService implements ServiceMXBean {
+public class AggregatedRefreshService implements ServiceBean {
//
// Instance data
//
- private ServiceMXBean service;
+ private ServiceBean service;
private boolean paused;
private boolean refreshNeeded;
private Boolean instance = null;
@@ -64,12 +64,12 @@
public AggregatedRefreshService() {
}
- public AggregatedRefreshService(ServiceMXBean service) {
+ public AggregatedRefreshService(ServiceBean service) {
setService(service);
}
//
- // ServiceMXBean methods
+ // ServiceBean methods
//
@Override
@@ -280,7 +280,7 @@
return refreshNeeded;
}
- public ServiceMXBean getService() {
+ public ServiceBean getService() {
return service;
}
@@ -288,7 +288,7 @@
* Calls refresh on the service if not paused and a refresh is needed.
*
* @exception ScfException
- * thrown by {@link ServiceMXBean#refresh}
+ * thrown by {@link ServiceBean#refresh}
*/
public synchronized void refreshConditional() throws ScfException {
if (!paused && refreshNeeded) {
@@ -311,7 +311,7 @@
}
/**
- * Sets the underlying {@link ServiceMXBean} for this {@code
+ * Sets the underlying {@link ServiceBean} for this {@code
* AggregatedRefreshService}.
*
* @param force
@@ -323,7 +323,7 @@
* if this {@code AggregatedRefreshService} is {@link #pause
* paused} or {@link #getRefreshNeeded needs a refresh}
*/
- public synchronized void setService(ServiceMXBean service, boolean force) {
+ public synchronized void setService(ServiceBean service, boolean force) {
if (this.service != service) {
if (paused && !force) {
throw new IllegalStateException(
@@ -345,7 +345,7 @@
/**
* Calls {@link #setService setService}{@code (service, true)}.
*/
- public void setService(ServiceMXBean service) {
+ public void setService(ServiceBean service) {
setService(service, true);
}
}
--- a/components/visual-panels/core/src/java/vpanels/panel/com/oracle/solaris/vp/panel/common/smf/BasicSmfMutableProperty.java Mon Oct 28 17:52:58 2013 -0700
+++ b/components/visual-panels/core/src/java/vpanels/panel/com/oracle/solaris/vp/panel/common/smf/BasicSmfMutableProperty.java Wed Oct 30 16:53:48 2013 -0400
@@ -20,7 +20,7 @@
*/
/*
- * Copyright (c) 2009, 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2009, 2013, Oracle and/or its affiliates. All rights reserved.
*/
package com.oracle.solaris.vp.panel.common.smf;
@@ -188,7 +188,7 @@
for (T v : values)
array.add(converter.revert(v));
- ServiceMXBean service = info.getService();
+ ServiceBean service = info.getService();
String group = info.getPropertyGroupName();
String name = getSmfPropertyName();
@@ -304,7 +304,7 @@
}
public void removeFromRepo() throws ScfException {
- ServiceMXBean service = info.getService();
+ ServiceBean service = info.getService();
String group = info.getPropertyGroupName();
String name = getSmfPropertyName();
--- a/components/visual-panels/core/src/java/vpanels/panel/com/oracle/solaris/vp/panel/common/smf/HasService.java Mon Oct 28 17:52:58 2013 -0700
+++ b/components/visual-panels/core/src/java/vpanels/panel/com/oracle/solaris/vp/panel/common/smf/HasService.java Wed Oct 30 16:53:48 2013 -0400
@@ -20,7 +20,7 @@
*/
/*
- * Copyright (c) 2009, 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2009, 2013, Oracle and/or its affiliates. All rights reserved.
*/
package com.oracle.solaris.vp.panel.common.smf;
@@ -29,5 +29,5 @@
/**
* Gets the service.
*/
- ServiceMXBean getService();
+ ServiceBean getService();
}
--- a/components/visual-panels/core/src/java/vpanels/panel/com/oracle/solaris/vp/panel/common/smf/InstanceManagedObject.java Mon Oct 28 17:52:58 2013 -0700
+++ b/components/visual-panels/core/src/java/vpanels/panel/com/oracle/solaris/vp/panel/common/smf/InstanceManagedObject.java Wed Oct 30 16:53:48 2013 -0400
@@ -20,7 +20,7 @@
*/
/*
- * Copyright (c) 2009, 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2009, 2013, Oracle and/or its affiliates. All rights reserved.
*/
package com.oracle.solaris.vp.panel.common.smf;
@@ -133,7 +133,7 @@
}
public void setEnabled(boolean enable) throws ScfException {
- ServiceMXBean bean = getService();
+ ServiceBean bean = getService();
if (bean != null) {
bean.setPersistentlyEnabled(enable);
}
--- a/components/visual-panels/core/src/java/vpanels/panel/com/oracle/solaris/vp/panel/common/smf/PropertyGroupManagedObject.java Mon Oct 28 17:52:58 2013 -0700
+++ b/components/visual-panels/core/src/java/vpanels/panel/com/oracle/solaris/vp/panel/common/smf/PropertyGroupManagedObject.java Wed Oct 30 16:53:48 2013 -0400
@@ -20,7 +20,7 @@
*/
/*
- * Copyright (c) 2009, 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2009, 2013, Oracle and/or its affiliates. All rights reserved.
*/
package com.oracle.solaris.vp.panel.common.smf;
@@ -153,7 +153,7 @@
public void refresh(boolean force) throws ScfException {
ServiceTracker tracker = parent.getServiceTracker();
- ServiceMXBean service = tracker.getService();
+ ServiceBean service = tracker.getService();
if (service == null) {
return;
}
@@ -226,7 +226,7 @@
// Static methods
//
- private static Template getPropertyTemplate(ServiceMXBean service,
+ private static Template getPropertyTemplate(ServiceBean service,
String pgName, String pName, String locale) throws ScfException {
Template templ = null;
--- a/components/visual-panels/core/src/java/vpanels/panel/com/oracle/solaris/vp/panel/common/smf/PropertyGroupsManagedObject.java Mon Oct 28 17:52:58 2013 -0700
+++ b/components/visual-panels/core/src/java/vpanels/panel/com/oracle/solaris/vp/panel/common/smf/PropertyGroupsManagedObject.java Wed Oct 30 16:53:48 2013 -0400
@@ -20,7 +20,7 @@
*/
/*
- * Copyright (c) 2009, 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2009, 2013, Oracle and/or its affiliates. All rights reserved.
*/
package com.oracle.solaris.vp.panel.common.smf;
@@ -129,7 +129,7 @@
}
public void refresh(boolean force) throws ScfException {
- ServiceMXBean service = tracker.getService();
+ ServiceBean service = tracker.getService();
if (service == null) {
return;
}
--- a/components/visual-panels/core/src/java/vpanels/panel/com/oracle/solaris/vp/panel/common/smf/RepoManagedObject.java Mon Oct 28 17:52:58 2013 -0700
+++ b/components/visual-panels/core/src/java/vpanels/panel/com/oracle/solaris/vp/panel/common/smf/RepoManagedObject.java Wed Oct 30 16:53:48 2013 -0400
@@ -20,7 +20,7 @@
*/
/*
- * Copyright (c) 2010, 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved.
*/
package com.oracle.solaris.vp.panel.common.smf;
@@ -29,12 +29,9 @@
import java.io.IOException;
import java.util.*;
import java.util.logging.*;
-import javax.management.*;
-import com.oracle.solaris.adr.Stability;
-import com.oracle.solaris.rad.ObjectException;
-import com.oracle.solaris.rad.jmx.RadNotification;
+import com.oracle.solaris.rad.client.ADRName;
+import com.oracle.solaris.rad.client.RadObjectException;
import com.oracle.solaris.vp.panel.common.*;
-import com.oracle.solaris.vp.panel.common.api.panel.MBeanUtil;
import com.oracle.solaris.vp.panel.common.api.file.*;
import com.oracle.solaris.vp.panel.common.api.smf_old.*;
import com.oracle.solaris.vp.panel.common.model.*;
@@ -43,36 +40,16 @@
extends AbstractManagedObject<InstanceManagedObject> {
//
- // Static data
- //
-
- private static final String DOMAIN = MBeanUtil.VP_DOMAIN + ".smf_old";
- private static final ObjectName oName =
- MBeanUtil.makeObjectName(DOMAIN, "Aggregator");
-
- //
// Instance data
//
private Set<Service> services;
private Set<Instance> instances;
- private Map<ObjectName, SmfManagedObject> objects;
+ private Map<ADRName, SmfManagedObject> objects;
private AbstractManagedObject<ServiceManagedObject> serviceMo;
- private MXBeanTracker<AggregatorMXBean> beanTracker;
- private MXBeanTracker<FileBrowserMXBean> filebeanTracker;
-
- private NotificationListener stateListener =
- new NotificationListener() {
- @Override
- public void handleNotification(Notification notification,
- Object handback) {
-
- StateChange sc = ((RadNotification)notification).getPayload(
- StateChange.class);
- stateChanged(sc);
- }
- };
+ private BeanTracker<Aggregator> beanTracker;
+ private BeanTracker<FileBrowser> filebeanTracker;
private PropertyChangeListener beanListener =
new PropertyChangeListener() {
@@ -87,22 +64,18 @@
//
public RepoManagedObject(String id, ClientContext context)
- throws InstanceNotFoundException, IOException, TrackerException {
+ throws IOException, TrackerException {
super(id);
- beanTracker = new MXBeanTracker<AggregatorMXBean>(
- oName, AggregatorMXBean.class, Stability.PRIVATE, context);
-
- beanTracker.addNotificationListener(stateListener,
- SmfUtil.NOTIFY_FILTER_STATE_CHANGE, null);
+ beanTracker = new BeanTracker<Aggregator>(
+ (new Aggregator()).getName(), Aggregator.class, context);
beanTracker.addPropertyChangeListener(
- MXBeanTracker.PROPERTY_BEAN, beanListener);
+ BeanTracker.PROPERTY_BEAN, beanListener);
- filebeanTracker = new MXBeanTracker<FileBrowserMXBean>(
- FileBrowserUtil.OBJECT_NAME, FileBrowserMXBean.class,
- Stability.PRIVATE, context);
+ filebeanTracker = new BeanTracker<FileBrowser>(
+ (new FileBrowser()).getName(), FileBrowser.class, context);
objects = Collections.emptyMap();
serviceMo = new AbstractManagedObject<ServiceManagedObject>() {};
@@ -129,19 +102,12 @@
//
public boolean hasInstance(String service) {
- ObjectName pattern;
-
- try {
- pattern = ServiceUtil.getServiceObjectName(service, "*");
- } catch (MalformedObjectNameException ex) {
- return false;
+ String pattern = ServiceUtil.getServiceObjectName(service, ".*").
+ toString();
+ for (Instance instance : instances) {
+ if (instance.getObjectName().toString().matches(pattern))
+ return true;
}
-
- for (Instance instance : instances)
- if (pattern.apply(instance.getObjectName())) {
- return true;
- }
-
return false;
}
@@ -174,7 +140,7 @@
public boolean fileExists(String filename) {
try {
return filebeanTracker.getBean().getFile(filename).isExists();
- } catch (ObjectException e) {
+ } catch (RadObjectException e) {
}
return false;
}
@@ -187,12 +153,12 @@
services = Collections.emptySet();
instances = Collections.emptySet();
- AggregatorMXBean bean = beanTracker.getBean();
+ Aggregator bean = beanTracker.getBean();
if (bean != null) {
try {
services = new HashSet<Service>(bean.getservices());
instances = new HashSet<Instance>(bean.getinstances());
- } catch (ObjectException e) {
+ } catch (RadObjectException e) {
Logger.getLogger(getClass().getName()).log(Level.SEVERE,
"could not retrieve smf services/instances", e);
}
@@ -208,13 +174,13 @@
clearChildren();
serviceMo.clearChildren();
- Map<ObjectName, SmfManagedObject> oldObjects = objects;
- objects = new HashMap<ObjectName, SmfManagedObject>(objects);
+ Map<ADRName, SmfManagedObject> oldObjects = objects;
+ objects = new HashMap<ADRName, SmfManagedObject>(objects);
for (Service svc : services) {
- ObjectName oName = svc.getObjectName();
+ ADRName name = svc.getObjectName();
ServiceManagedObject smo =
- (ServiceManagedObject)oldObjects.get(oName);
+ (ServiceManagedObject)oldObjects.get(name);
if (smo == null) {
try {
smo = new ServiceManagedObject(this,
@@ -223,19 +189,19 @@
smo = null;
}
} else {
- oldObjects.remove(oName);
+ oldObjects.remove(name);
}
if (smo != null) {
- objects.put(oName, smo);
+ objects.put(name, smo);
serviceMo.addChildren(smo);
}
}
for (Instance inst : instances) {
- ObjectName oName = inst.getObjectName();
+ ADRName name = inst.getObjectName();
InstanceManagedObject imo =
- (InstanceManagedObject)oldObjects.get(oName);
+ (InstanceManagedObject)oldObjects.get(name);
if (imo == null) {
try {
imo = new InstanceManagedObject(
@@ -244,11 +210,11 @@
imo = null;
}
} else {
- oldObjects.remove(oName);
+ oldObjects.remove(name);
}
if (imo != null) {
- objects.put(oName, imo);
+ objects.put(name, imo);
addChildren(imo);
}
}
@@ -259,12 +225,4 @@
smo.dispose();
}
}
-
- private void stateChanged(StateChange sc) {
- SmfManagedObject smo = objects.get(sc.getSource());
- if (smo != null && smo instanceof InstanceManagedObject) {
- InstanceManagedObject imo = (InstanceManagedObject)smo;
- imo.handleStateChange(sc);
- }
- }
}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/components/visual-panels/core/src/java/vpanels/panel/com/oracle/solaris/vp/panel/common/smf/ServiceBean.java Wed Oct 30 16:53:48 2013 -0400
@@ -0,0 +1,287 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright (c) 2009, 2013, Oracle and/or its affiliates. All rights reserved.
+ */
+
+package com.oracle.solaris.vp.panel.common.smf;
+
+import java.math.BigInteger;
+import java.util.*;
+import com.oracle.solaris.scf.common.ScfException;
+import com.oracle.solaris.vp.panel.common.api.smf_old.*;
+
+/**
+ * An SMF service (and instance) Bean interface
+ *
+ * (This isn't actually an Bean interface, it's a wrapper around the
+ * real one.)
+ */
+public interface ServiceBean
+{
+ /**
+ * Get the FMRI.
+ */
+ String getFmri() throws ScfException;
+
+ /**
+ * Get method names.
+ */
+ List<String> getMethodNames() throws ScfException;
+
+ /**
+ * Get dependency names.
+ */
+ List<String> getDependencyNames() throws ScfException;
+
+ /**
+ * Get dependency properties.
+ *
+ * @param name dependency name
+ */
+ Dependency getDependency(String name) throws ScfException;
+
+ /**
+ * Get property names in a property group.
+ *
+ * @param name property group name
+ */
+ List<String> getPropertyNames(String name) throws ScfException;
+
+ /**
+ * Get type of a property.
+ *
+ * @param pg_name property group name
+ * @param prop_name property name
+ */
+ PropertyType getPropertyType(String pg_name, String prop_name)
+ throws ScfException;
+
+ /**
+ * Get values of a property.
+ *
+ * @param pg_name property group name
+ * @param prop_name property name
+ */
+ List<String> getPropertyValues(String pg_name, String prop_name)
+ throws ScfException;
+
+ /**
+ * Get values of a property in a snapshot.
+ *
+ * @param snap_name snapshot name
+ * @param pg_name property group name
+ * @param prop_name property name
+ */
+ List<String> getSnapshotPropertyValues(String snap_name, String pg_name,
+ String prop_name) throws ScfException;
+
+ /**
+ * Set the current values of a property.
+ *
+ * @param pg_name property group name
+ * @param prop_name property name
+ * @param values values
+ */
+ void setPropertyValues(String pg_name, String prop_name,
+ List<String> values) throws ScfException;
+
+ /**
+ * Create property group.
+ *
+ * @param pg_name property group name
+ * @param prop_name property type
+ */
+ void createPropertyGroup(String pg_name, String prop_name)
+ throws ScfException;
+
+ /**
+ * Delete named property group.
+ *
+ * @param pg_name property group name
+ */
+ void deletePropertyGroup(String pg_name)
+ throws ScfException;
+
+ /**
+ * Create property.
+ *
+ * @param pg_name property group name
+ * @param prop_name property name
+ * @param type property type
+ */
+ void createProperty(String pg_name, String prop_name,
+ PropertyType type) throws ScfException;
+
+ /**
+ * Delete named property.
+ *
+ * @param pg_name property group name
+ * @param prop_name property name
+ */
+ void deleteProperty(String pg_name, String prop_name)
+ throws ScfException;
+
+ /**
+ * Get property group names.
+ */
+ List<PropertyGroup> getPropertyGroups() throws ScfException;
+
+ /**
+ * Get template information for a property.
+ *
+ * @param pg_name property group name
+ * @param prop_name property name
+ * @param locale locale name
+ */
+ Template getPropertyTemplate(String pg_name, String prop_name,
+ String locale) throws ScfException;
+
+ /**
+ * Get the common name of a service.
+ *
+ * @param locale locale name
+ */
+ String getCommonName(String locale) throws ScfException;
+
+ /**
+ * Get the description of a service.
+ *
+ * @param locale locale name
+ */
+ String getDescription(String locale) throws ScfException;
+
+ /**
+ * Get the contents of the log file for this service instance.
+ *
+ * @param max_size
+ * the maximum size of the returned array (populated
+ * from the end of the log file), or -1 to return the
+ * entire file
+ */
+ LogInfo getLogInfo(int max_size) throws ScfException;
+
+ /**
+ * Get manual pages.
+ */
+ List<Manpage> getManpages() throws ScfException;
+
+ /**
+ * Get documentation links.
+ */
+ List<String> getDoclinks() throws ScfException;
+
+ /**
+ * Put into maintenance.
+ *
+ * @param immediate do immediately
+ */
+ void maintain(boolean immediate) throws ScfException;
+
+ /**
+ * Clear maintenance.
+ */
+ void clear() throws ScfException;
+
+ /**
+ * Put into degraded state.
+ *
+ * @param immediate do immediately
+ */
+ void degrade(boolean immediate) throws ScfException;
+
+ /**
+ * Restart the service.
+ */
+ void restart() throws ScfException;
+
+ /**
+ * Refresh the service.
+ */
+ void refresh() throws ScfException;
+
+ /*
+ * "Attributes"
+ */
+
+ /**
+ * Service should run on next boot.
+ */
+ boolean isPersistentlyEnabled() throws ScfException;
+
+ /**
+ * Service should run on next boot.
+ *
+ * @param enabled service should run on next boot
+ */
+ void setPersistentlyEnabled(boolean enabled) throws ScfException;
+
+ /**
+ * Service should run until next boot.
+ */
+ boolean isTemporarilyEnabled() throws ScfException;
+
+ /**
+ * Service should run.
+ */
+ boolean isEnabled() throws ScfException;
+
+ /**
+ * Whether Service is an instance.
+ */
+ boolean isInstance() throws ScfException;
+
+ /**
+ * Restarter of service.
+ */
+ String getRestarter() throws ScfException;
+
+ /**
+ * Current state of service.
+ */
+ SmfState getState() throws ScfException;
+
+ /**
+ * Next state of service.
+ */
+ SmfState getNextState() throws ScfException;
+
+ /**
+ * Time of last state transition.
+ */
+ Date getSTime() throws ScfException;
+
+ /**
+ * Process contract of main processes.
+ */
+ BigInteger getContractID() throws ScfException;
+
+ /**
+ * Extra state information.
+ */
+ String getAuxiliaryState() throws ScfException;
+
+ /**
+ * Reason for state.
+ */
+ String getReason() throws ScfException;
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/components/visual-panels/core/src/java/vpanels/panel/com/oracle/solaris/vp/panel/common/smf/ServiceBeanAdaptor.java Wed Oct 30 16:53:48 2013 -0400
@@ -0,0 +1,384 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright (c) 2009, 2013, Oracle and/or its affiliates. All rights reserved.
+ */
+
+package com.oracle.solaris.vp.panel.common.smf;
+
+import java.math.BigInteger;
+import java.util.*;
+import com.oracle.solaris.rad.client.RadObjectException;
+import com.oracle.solaris.scf.common.ScfException;
+import com.oracle.solaris.vp.panel.common.api.smf_old.*;
+
+/**
+ * ServiceBeanAdaptor wraps a ServiceInfoBean and provides an
+ * old-style ServiceBean interface. Because the use of the
+ * ServiceBean interface and the ScfExceptions is so widespread,
+ * it is simpler to make the bridge from ObjectExceptions here
+ * rather than at the site of each use.
+ * <br/>
+ * For classloading reasons this mapping can never be completely
+ * automatic. It might prove fruitful to create an generic wrapper
+ * using {@code Proxy}, though.
+ */
+public class ServiceBeanAdaptor implements ServiceBean {
+
+ ServiceInfo sibean_;
+
+ public ServiceBeanAdaptor(ServiceInfo sibean) {
+ sibean_ = sibean;
+ }
+
+ public String getFmri() throws ScfException {
+ try {
+ return sibean_.getfmri();
+ } catch (RadObjectException e) {
+ throw new ScfException(e);
+ }
+ }
+
+ public List<String> getMethodNames() throws ScfException {
+ try {
+ return sibean_.getmethodNames();
+ } catch (RadObjectException e) {
+ throw new ScfException(e);
+ }
+ }
+
+ public List<String> getDependencyNames() throws ScfException {
+ try {
+ return sibean_.getdependencyNames();
+ } catch (RadObjectException e) {
+ throw new ScfException(e);
+ }
+ }
+
+ @Override
+ public Dependency getDependency(String name) throws ScfException {
+ try {
+ return sibean_.getDependency(name);
+ } catch (RadObjectException e) {
+ throw new ScfException(e);
+ }
+ }
+
+ @Override
+ public List<String> getPropertyNames(String pg_name) throws ScfException {
+ try {
+ return sibean_.getPropertyNames(pg_name);
+ } catch (RadObjectException e) {
+ throw new ScfException(e);
+ }
+ }
+
+ @Override
+ public PropertyType getPropertyType(String pg_name, String prop_name)
+ throws ScfException {
+
+ try {
+ return sibean_.getPropertyType(pg_name, prop_name);
+ } catch (RadObjectException e) {
+ throw new ScfException(e);
+ }
+ }
+
+ @Override
+ public List<String> getPropertyValues(String pg_name, String prop_name)
+ throws ScfException {
+
+ try {
+ return sibean_.getPropertyValues(pg_name, prop_name);
+ } catch (RadObjectException e) {
+ throw new ScfException(e);
+ }
+ }
+
+ @Override
+ public List<String> getSnapshotPropertyValues(String snap_name,
+ String pg_name, String prop_name) throws ScfException {
+
+ try {
+ return sibean_.getSnapshotPropertyValues(snap_name, pg_name,
+ prop_name);
+ } catch (RadObjectException e) {
+ throw new ScfException(e);
+ }
+ }
+
+ @Override
+ public void setPropertyValues(String pg_name, String prop_name,
+ List<String> values) throws ScfException {
+
+ try {
+ sibean_.setPropertyValues(pg_name, prop_name, values);
+ } catch (RadObjectException e) {
+ throw new ScfException(e);
+ }
+ }
+
+ @Override
+ public void createPropertyGroup(String pg_name, String pg_type)
+ throws ScfException {
+
+ try {
+ sibean_.createPropertyGroup(pg_name, pg_type);
+ } catch (RadObjectException e) {
+ throw new ScfException(e);
+ }
+ }
+
+ @Override
+ public void deletePropertyGroup(String pg_name) throws ScfException {
+ try {
+ sibean_.deletePropertyGroup(pg_name);
+ } catch (RadObjectException e) {
+ throw new ScfException(e);
+ }
+ }
+
+ @Override
+ public void createProperty(String pg_name, String prop_name,
+ PropertyType type) throws ScfException {
+
+ try {
+ sibean_.createProperty(pg_name, prop_name, type);
+ } catch (RadObjectException e) {
+ throw new ScfException(e);
+ }
+ }
+
+ @Override
+ public void deleteProperty(String pg_name, String prop_name)
+ throws ScfException {
+
+ try {
+ sibean_.deleteProperty(pg_name, prop_name);
+ } catch (RadObjectException e) {
+ throw new ScfException(e);
+ }
+ }
+
+ public List<PropertyGroup> getPropertyGroups() throws ScfException {
+ try {
+ return sibean_.getpropertyGroups();
+ } catch (RadObjectException e) {
+ throw new ScfException(e);
+ }
+ }
+
+ @Override
+ public Template getPropertyTemplate(String pg_name, String prop_name,
+ String locale) throws ScfException {
+
+ try {
+ return sibean_.getPropertyTemplate(pg_name, prop_name, locale);
+ } catch (RadObjectException e) {
+ throw new ScfException(e);
+ }
+ }
+
+ @Override
+ public String getCommonName(String locale) throws ScfException {
+ try {
+ return sibean_.getCommonName(locale);
+ } catch (RadObjectException e) {
+ throw new ScfException(e);
+ }
+ }
+
+ @Override
+ public String getDescription(String locale) throws ScfException {
+ try {
+ return sibean_.getDescription(locale);
+ } catch (RadObjectException e) {
+ throw new ScfException(e);
+ }
+ }
+
+ @Override
+ public LogInfo getLogInfo(int max_size) throws ScfException {
+ try {
+ return sibean_.getLogInfo(max_size);
+ } catch (RadObjectException e) {
+ throw new ScfException(e);
+ }
+ }
+
+ public List<Manpage> getManpages() throws ScfException {
+ try {
+ return sibean_.getmanpages();
+ } catch (RadObjectException e) {
+ throw new ScfException(e);
+ }
+ }
+
+ public List<String> getDoclinks() throws ScfException {
+ try {
+ return sibean_.getdoclinks();
+ } catch (RadObjectException e) {
+ throw new ScfException(e);
+ }
+ }
+
+ @Override
+ public void maintain(boolean immediate) throws ScfException {
+ try {
+ sibean_.maintain(immediate);
+ } catch (RadObjectException e) {
+ throw new ScfException(e);
+ }
+ }
+
+ @Override
+ public void clear() throws ScfException {
+ try {
+ sibean_.clear();
+ } catch (RadObjectException e) {
+ throw new ScfException(e);
+ }
+ }
+
+ @Override
+ public void degrade(boolean immediate) throws ScfException {
+ try {
+ sibean_.degrade(immediate);
+ } catch (RadObjectException e) {
+ throw new ScfException(e);
+ }
+ }
+
+ @Override
+ public void restart() throws ScfException {
+ try {
+ sibean_.restart();
+ } catch (RadObjectException e) {
+ throw new ScfException(e);
+ }
+ }
+
+ @Override
+ public void refresh() throws ScfException {
+ try {
+ sibean_.refresh();
+ } catch (RadObjectException e) {
+ throw new ScfException(e);
+ }
+ }
+
+ public boolean isPersistentlyEnabled() throws ScfException {
+ try {
+ return sibean_.ispersistentlyEnabled();
+ } catch (RadObjectException e) {
+ throw new ScfException(e);
+ }
+ }
+
+ public void setPersistentlyEnabled(boolean enabled) throws ScfException {
+ try {
+ sibean_.setpersistentlyEnabled(enabled);
+ } catch (RadObjectException e) {
+ throw new ScfException(e);
+ }
+ }
+
+ public boolean isTemporarilyEnabled() throws ScfException {
+ try {
+ return sibean_.istemporarilyEnabled();
+ } catch (RadObjectException e) {
+ throw new ScfException(e);
+ }
+ }
+
+ public boolean isEnabled() throws ScfException {
+ try {
+ return sibean_.isenabled();
+ } catch (RadObjectException e) {
+ throw new ScfException(e);
+ }
+ }
+
+ public boolean isInstance() throws ScfException {
+ try {
+ return sibean_.isinstance();
+ } catch (RadObjectException e) {
+ throw new ScfException(e);
+ }
+ }
+
+ public String getRestarter() throws ScfException {
+ try {
+ return sibean_.getrestarter();
+ } catch (RadObjectException e) {
+ throw new ScfException(e);
+ }
+ }
+
+ public SmfState getState() throws ScfException {
+ try {
+ return sibean_.getstate();
+ } catch (RadObjectException e) {
+ throw new ScfException(e);
+ }
+ }
+
+ public SmfState getNextState() throws ScfException {
+ try {
+ return sibean_.getnextState();
+ } catch (RadObjectException e) {
+ throw new ScfException(e);
+ }
+ }
+
+ public Date getSTime() throws ScfException {
+ try {
+ return sibean_.getstime();
+ } catch (RadObjectException e) {
+ throw new ScfException(e);
+ }
+ }
+
+ public BigInteger getContractID() throws ScfException {
+ try {
+ return BigInteger.valueOf(sibean_.getcontractID());
+ } catch (RadObjectException e) {
+ throw new ScfException(e);
+ }
+ }
+
+ public String getAuxiliaryState() throws ScfException {
+ try {
+ return sibean_.getauxiliaryState();
+ } catch (RadObjectException e) {
+ throw new ScfException(e);
+ }
+ }
+
+ public String getReason() throws ScfException {
+ try {
+ return sibean_.getreason();
+ } catch (RadObjectException e) {
+ throw new ScfException(e);
+ }
+ }
+}
--- a/components/visual-panels/core/src/java/vpanels/panel/com/oracle/solaris/vp/panel/common/smf/ServiceMXBean.java Mon Oct 28 17:52:58 2013 -0700
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,287 +0,0 @@
-/*
- * CDDL HEADER START
- *
- * The contents of this file are subject to the terms of the
- * Common Development and Distribution License (the "License").
- * You may not use this file except in compliance with the License.
- *
- * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
- * or http://www.opensolaris.org/os/licensing.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- *
- * When distributing Covered Code, include this CDDL HEADER in each
- * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
- * If applicable, add the following below this CDDL HEADER, with the
- * fields enclosed by brackets "[]" replaced with your own identifying
- * information: Portions Copyright [yyyy] [name of copyright owner]
- *
- * CDDL HEADER END
- */
-
-/*
- * Copyright (c) 2009, 2012, Oracle and/or its affiliates. All rights reserved.
- */
-
-package com.oracle.solaris.vp.panel.common.smf;
-
-import java.math.BigInteger;
-import java.util.*;
-import com.oracle.solaris.scf.common.ScfException;
-import com.oracle.solaris.vp.panel.common.api.smf_old.*;
-
-/**
- * An SMF service (and instance) MXBean interface
- *
- * (This isn't actually an MXBean interface, it's a wrapper around the
- * real one.)
- */
-public interface ServiceMXBean
-{
- /**
- * Get the FMRI.
- */
- String getFmri() throws ScfException;
-
- /**
- * Get method names.
- */
- List<String> getMethodNames() throws ScfException;
-
- /**
- * Get dependency names.
- */
- List<String> getDependencyNames() throws ScfException;
-
- /**
- * Get dependency properties.
- *
- * @param name dependency name
- */
- Dependency getDependency(String name) throws ScfException;
-
- /**
- * Get property names in a property group.
- *
- * @param name property group name
- */
- List<String> getPropertyNames(String name) throws ScfException;
-
- /**
- * Get type of a property.
- *
- * @param pg_name property group name
- * @param prop_name property name
- */
- PropertyType getPropertyType(String pg_name, String prop_name)
- throws ScfException;
-
- /**
- * Get values of a property.
- *
- * @param pg_name property group name
- * @param prop_name property name
- */
- List<String> getPropertyValues(String pg_name, String prop_name)
- throws ScfException;
-
- /**
- * Get values of a property in a snapshot.
- *
- * @param snap_name snapshot name
- * @param pg_name property group name
- * @param prop_name property name
- */
- List<String> getSnapshotPropertyValues(String snap_name, String pg_name,
- String prop_name) throws ScfException;
-
- /**
- * Set the current values of a property.
- *
- * @param pg_name property group name
- * @param prop_name property name
- * @param values values
- */
- void setPropertyValues(String pg_name, String prop_name,
- List<String> values) throws ScfException;
-
- /**
- * Create property group.
- *
- * @param pg_name property group name
- * @param prop_name property type
- */
- void createPropertyGroup(String pg_name, String prop_name)
- throws ScfException;
-
- /**
- * Delete named property group.
- *
- * @param pg_name property group name
- */
- void deletePropertyGroup(String pg_name)
- throws ScfException;
-
- /**
- * Create property.
- *
- * @param pg_name property group name
- * @param prop_name property name
- * @param type property type
- */
- void createProperty(String pg_name, String prop_name,
- PropertyType type) throws ScfException;
-
- /**
- * Delete named property.
- *
- * @param pg_name property group name
- * @param prop_name property name
- */
- void deleteProperty(String pg_name, String prop_name)
- throws ScfException;
-
- /**
- * Get property group names.
- */
- List<PropertyGroup> getPropertyGroups() throws ScfException;
-
- /**
- * Get template information for a property.
- *
- * @param pg_name property group name
- * @param prop_name property name
- * @param locale locale name
- */
- Template getPropertyTemplate(String pg_name, String prop_name,
- String locale) throws ScfException;
-
- /**
- * Get the common name of a service.
- *
- * @param locale locale name
- */
- String getCommonName(String locale) throws ScfException;
-
- /**
- * Get the description of a service.
- *
- * @param locale locale name
- */
- String getDescription(String locale) throws ScfException;
-
- /**
- * Get the contents of the log file for this service instance.
- *
- * @param max_size
- * the maximum size of the returned array (populated
- * from the end of the log file), or -1 to return the
- * entire file
- */
- LogInfo getLogInfo(int max_size) throws ScfException;
-
- /**
- * Get manual pages.
- */
- List<Manpage> getManpages() throws ScfException;
-
- /**
- * Get documentation links.
- */
- List<String> getDoclinks() throws ScfException;
-
- /**
- * Put into maintenance.
- *
- * @param immediate do immediately
- */
- void maintain(boolean immediate) throws ScfException;
-
- /**
- * Clear maintenance.
- */
- void clear() throws ScfException;
-
- /**
- * Put into degraded state.
- *
- * @param immediate do immediately
- */
- void degrade(boolean immediate) throws ScfException;
-
- /**
- * Restart the service.
- */
- void restart() throws ScfException;
-
- /**
- * Refresh the service.
- */
- void refresh() throws ScfException;
-
- /*
- * "Attributes"
- */
-
- /**
- * Service should run on next boot.
- */
- boolean isPersistentlyEnabled() throws ScfException;
-
- /**
- * Service should run on next boot.
- *
- * @param enabled service should run on next boot
- */
- void setPersistentlyEnabled(boolean enabled) throws ScfException;
-
- /**
- * Service should run until next boot.
- */
- boolean isTemporarilyEnabled() throws ScfException;
-
- /**
- * Service should run.
- */
- boolean isEnabled() throws ScfException;
-
- /**
- * Whether Service is an instance.
- */
- boolean isInstance() throws ScfException;
-
- /**
- * Restarter of service.
- */
- String getRestarter() throws ScfException;
-
- /**
- * Current state of service.
- */
- SmfState getState() throws ScfException;
-
- /**
- * Next state of service.
- */
- SmfState getNextState() throws ScfException;
-
- /**
- * Time of last state transition.
- */
- Date getSTime() throws ScfException;
-
- /**
- * Process contract of main processes.
- */
- BigInteger getContractID() throws ScfException;
-
- /**
- * Extra state information.
- */
- String getAuxiliaryState() throws ScfException;
-
- /**
- * Reason for state.
- */
- String getReason() throws ScfException;
-}
--- a/components/visual-panels/core/src/java/vpanels/panel/com/oracle/solaris/vp/panel/common/smf/ServiceMXBeanAdaptor.java Mon Oct 28 17:52:58 2013 -0700
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,384 +0,0 @@
-/*
- * CDDL HEADER START
- *
- * The contents of this file are subject to the terms of the
- * Common Development and Distribution License (the "License").
- * You may not use this file except in compliance with the License.
- *
- * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
- * or http://www.opensolaris.org/os/licensing.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- *
- * When distributing Covered Code, include this CDDL HEADER in each
- * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
- * If applicable, add the following below this CDDL HEADER, with the
- * fields enclosed by brackets "[]" replaced with your own identifying
- * information: Portions Copyright [yyyy] [name of copyright owner]
- *
- * CDDL HEADER END
- */
-
-/*
- * Copyright (c) 2009, 2012, Oracle and/or its affiliates. All rights reserved.
- */
-
-package com.oracle.solaris.vp.panel.common.smf;
-
-import java.math.BigInteger;
-import java.util.*;
-import com.oracle.solaris.rad.ObjectException;
-import com.oracle.solaris.scf.common.ScfException;
-import com.oracle.solaris.vp.panel.common.api.smf_old.*;
-
-/**
- * ServiceMXBeanAdaptor wraps a ServiceInfoMXBean and provides an
- * old-style ServiceMXBean interface. Because the use of the
- * ServiceMXBean interface and the ScfExceptions is so widespread,
- * it is simpler to make the bridge from ObjectExceptions here
- * rather than at the site of each use.
- * <br/>
- * For classloading reasons this mapping can never be completely
- * automatic. It might prove fruitful to create an generic wrapper
- * using {@code Proxy}, though.
- */
-public class ServiceMXBeanAdaptor implements ServiceMXBean {
-
- ServiceInfoMXBean sibean_;
-
- public ServiceMXBeanAdaptor(ServiceInfoMXBean sibean) {
- sibean_ = sibean;
- }
-
- public String getFmri() throws ScfException {
- try {
- return sibean_.getfmri();
- } catch (ObjectException e) {
- throw new ScfException(e);
- }
- }
-
- public List<String> getMethodNames() throws ScfException {
- try {
- return sibean_.getmethodNames();
- } catch (ObjectException e) {
- throw new ScfException(e);
- }
- }
-
- public List<String> getDependencyNames() throws ScfException {
- try {
- return sibean_.getdependencyNames();
- } catch (ObjectException e) {
- throw new ScfException(e);
- }
- }
-
- @Override
- public Dependency getDependency(String name) throws ScfException {
- try {
- return sibean_.getDependency(name);
- } catch (ObjectException e) {
- throw new ScfException(e);
- }
- }
-
- @Override
- public List<String> getPropertyNames(String pg_name) throws ScfException {
- try {
- return sibean_.getPropertyNames(pg_name);
- } catch (ObjectException e) {
- throw new ScfException(e);
- }
- }
-
- @Override
- public PropertyType getPropertyType(String pg_name, String prop_name)
- throws ScfException {
-
- try {
- return sibean_.getPropertyType(pg_name, prop_name);
- } catch (ObjectException e) {
- throw new ScfException(e);
- }
- }
-
- @Override
- public List<String> getPropertyValues(String pg_name, String prop_name)
- throws ScfException {
-
- try {
- return sibean_.getPropertyValues(pg_name, prop_name);
- } catch (ObjectException e) {
- throw new ScfException(e);
- }
- }
-
- @Override
- public List<String> getSnapshotPropertyValues(String snap_name,
- String pg_name, String prop_name) throws ScfException {
-
- try {
- return sibean_.getSnapshotPropertyValues(snap_name, pg_name,
- prop_name);
- } catch (ObjectException e) {
- throw new ScfException(e);
- }
- }
-
- @Override
- public void setPropertyValues(String pg_name, String prop_name,
- List<String> values) throws ScfException {
-
- try {
- sibean_.setPropertyValues(pg_name, prop_name, values);
- } catch (ObjectException e) {
- throw new ScfException(e);
- }
- }
-
- @Override
- public void createPropertyGroup(String pg_name, String pg_type)
- throws ScfException {
-
- try {
- sibean_.createPropertyGroup(pg_name, pg_type);
- } catch (ObjectException e) {
- throw new ScfException(e);
- }
- }
-
- @Override
- public void deletePropertyGroup(String pg_name) throws ScfException {
- try {
- sibean_.deletePropertyGroup(pg_name);
- } catch (ObjectException e) {
- throw new ScfException(e);
- }
- }
-
- @Override
- public void createProperty(String pg_name, String prop_name,
- PropertyType type) throws ScfException {
-
- try {
- sibean_.createProperty(pg_name, prop_name, type);
- } catch (ObjectException e) {
- throw new ScfException(e);
- }
- }
-
- @Override
- public void deleteProperty(String pg_name, String prop_name)
- throws ScfException {
-
- try {
- sibean_.deleteProperty(pg_name, prop_name);
- } catch (ObjectException e) {
- throw new ScfException(e);
- }
- }
-
- public List<PropertyGroup> getPropertyGroups() throws ScfException {
- try {
- return sibean_.getpropertyGroups();
- } catch (ObjectException e) {
- throw new ScfException(e);
- }
- }
-
- @Override
- public Template getPropertyTemplate(String pg_name, String prop_name,
- String locale) throws ScfException {
-
- try {
- return sibean_.getPropertyTemplate(pg_name, prop_name, locale);
- } catch (ObjectException e) {
- throw new ScfException(e);
- }
- }
-
- @Override
- public String getCommonName(String locale) throws ScfException {
- try {
- return sibean_.getCommonName(locale);
- } catch (ObjectException e) {
- throw new ScfException(e);
- }
- }
-
- @Override
- public String getDescription(String locale) throws ScfException {
- try {
- return sibean_.getDescription(locale);
- } catch (ObjectException e) {
- throw new ScfException(e);
- }
- }
-
- @Override
- public LogInfo getLogInfo(int max_size) throws ScfException {
- try {
- return sibean_.getLogInfo(max_size);
- } catch (ObjectException e) {
- throw new ScfException(e);
- }
- }
-
- public List<Manpage> getManpages() throws ScfException {
- try {
- return sibean_.getmanpages();
- } catch (ObjectException e) {
- throw new ScfException(e);
- }
- }
-
- public List<String> getDoclinks() throws ScfException {
- try {
- return sibean_.getdoclinks();
- } catch (ObjectException e) {
- throw new ScfException(e);
- }
- }
-
- @Override
- public void maintain(boolean immediate) throws ScfException {
- try {
- sibean_.maintain(immediate);
- } catch (ObjectException e) {
- throw new ScfException(e);
- }
- }
-
- @Override
- public void clear() throws ScfException {
- try {
- sibean_.clear();
- } catch (ObjectException e) {
- throw new ScfException(e);
- }
- }
-
- @Override
- public void degrade(boolean immediate) throws ScfException {
- try {
- sibean_.degrade(immediate);
- } catch (ObjectException e) {
- throw new ScfException(e);
- }
- }
-
- @Override
- public void restart() throws ScfException {
- try {
- sibean_.restart();
- } catch (ObjectException e) {
- throw new ScfException(e);
- }
- }
-
- @Override
- public void refresh() throws ScfException {
- try {
- sibean_.refresh();
- } catch (ObjectException e) {
- throw new ScfException(e);
- }
- }
-
- public boolean isPersistentlyEnabled() throws ScfException {
- try {
- return sibean_.ispersistentlyEnabled();
- } catch (ObjectException e) {
- throw new ScfException(e);
- }
- }
-
- public void setPersistentlyEnabled(boolean enabled) throws ScfException {
- try {
- sibean_.setpersistentlyEnabled(enabled);
- } catch (ObjectException e) {
- throw new ScfException(e);
- }
- }
-
- public boolean isTemporarilyEnabled() throws ScfException {
- try {
- return sibean_.istemporarilyEnabled();
- } catch (ObjectException e) {
- throw new ScfException(e);
- }
- }
-
- public boolean isEnabled() throws ScfException {
- try {
- return sibean_.isenabled();
- } catch (ObjectException e) {
- throw new ScfException(e);
- }
- }
-
- public boolean isInstance() throws ScfException {
- try {
- return sibean_.isinstance();
- } catch (ObjectException e) {
- throw new ScfException(e);
- }
- }
-
- public String getRestarter() throws ScfException {
- try {
- return sibean_.getrestarter();
- } catch (ObjectException e) {
- throw new ScfException(e);
- }
- }
-
- public SmfState getState() throws ScfException {
- try {
- return sibean_.getstate();
- } catch (ObjectException e) {
- throw new ScfException(e);
- }
- }
-
- public SmfState getNextState() throws ScfException {
- try {
- return sibean_.getnextState();
- } catch (ObjectException e) {
- throw new ScfException(e);
- }
- }
-
- public Date getSTime() throws ScfException {
- try {
- return sibean_.getstime();
- } catch (ObjectException e) {
- throw new ScfException(e);
- }
- }
-
- public BigInteger getContractID() throws ScfException {
- try {
- return BigInteger.valueOf(sibean_.getcontractID());
- } catch (ObjectException e) {
- throw new ScfException(e);
- }
- }
-
- public String getAuxiliaryState() throws ScfException {
- try {
- return sibean_.getauxiliaryState();
- } catch (ObjectException e) {
- throw new ScfException(e);
- }
- }
-
- public String getReason() throws ScfException {
- try {
- return sibean_.getreason();
- } catch (ObjectException e) {
- throw new ScfException(e);
- }
- }
-}
--- a/components/visual-panels/core/src/java/vpanels/panel/com/oracle/solaris/vp/panel/common/smf/ServicePanelDescriptor.java Mon Oct 28 17:52:58 2013 -0700
+++ b/components/visual-panels/core/src/java/vpanels/panel/com/oracle/solaris/vp/panel/common/smf/ServicePanelDescriptor.java Wed Oct 30 16:53:48 2013 -0400
@@ -20,7 +20,7 @@
*/
/*
- * Copyright (c) 2009, 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2009, 2013, Oracle and/or its affiliates. All rights reserved.
*/
package com.oracle.solaris.vp.panel.common.smf;
@@ -29,8 +29,6 @@
import java.io.IOException;
import java.util.Locale;
import java.util.logging.Level;
-import javax.management.*;
-import com.oracle.solaris.rad.jmx.RadNotification;
import com.oracle.solaris.scf.common.ScfException;
import com.oracle.solaris.vp.panel.common.*;
import com.oracle.solaris.vp.panel.common.api.smf_old.*;
@@ -68,39 +66,13 @@
}
};
- /**
- * Handles changes to this {@code ServicePanelDescriptor}'s service.
- * This implementation listens only for {@code StateChangeNotification}s and
- * fires a {@code PropertyChangeEvent} to registered {@code
- * PropertyChangeEvent}s. Subclasses with {@code ManagedObject} children
- * may wish to override/extend this implementation.
- */
- private NotificationListener notifyListener =
- new NotificationListener() {
- @Override
- public void handleNotification(Notification n, Object h) {
- StateChange sc = ((RadNotification)n).getPayload(
- StateChange.class);
-
- firePropertyChange(PROPERTY_STATE, null, sc.getState());
- setStatus();
- setStatusText();
- try {
- refresh(false);
- } catch (Exception e) {
- getLog().log(Level.SEVERE, Finder.getString(
- "error.repository.read"), e);
- }
- }
- };
-
//
// Constructors
//
public ServicePanelDescriptor(String id, ClientContext context,
String serviceName, String instanceName) throws IOException,
- InstanceNotFoundException, TrackerException {
+ TrackerException {
super(id, context);
@@ -108,8 +80,6 @@
this.instanceName = instanceName;
tracker = new ServiceTracker(serviceName, instanceName, context);
- tracker.addNotificationListener(notifyListener,
- SmfUtil.NOTIFY_FILTER_STATE_CHANGE, null);
tracker.addPropertyChangeListener(ServiceTracker.PROPERTY_SERVICE,
serviceListener);
@@ -215,7 +185,7 @@
protected ManagedObjectStatus getCalculatedStatus() {
ManagedObjectStatus status = super.getCalculatedStatus();
- ServiceMXBean service = getService();
+ ServiceBean service = getService();
if (service != null) {
ManagedObjectStatus sStatus = null;
@@ -238,7 +208,7 @@
protected String getCalculatedStatusText() {
SmfState state = null;
SmfState nextState = null;
- ServiceMXBean service = getService();
+ ServiceBean service = getService();
try {
state = service.getState();
--- a/components/visual-panels/core/src/java/vpanels/panel/com/oracle/solaris/vp/panel/common/smf/ServiceTracker.java Mon Oct 28 17:52:58 2013 -0700
+++ b/components/visual-panels/core/src/java/vpanels/panel/com/oracle/solaris/vp/panel/common/smf/ServiceTracker.java Wed Oct 30 16:53:48 2013 -0400
@@ -20,24 +20,23 @@
*/
/*
- * Copyright (c) 2010, 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved.
*/
package com.oracle.solaris.vp.panel.common.smf;
import java.beans.PropertyChangeEvent;
-import javax.management.ObjectName;
-import com.oracle.solaris.adr.Stability;
-import com.oracle.solaris.vp.panel.common.api.smf_old.ServiceInfoMXBean;
+import com.oracle.solaris.rad.client.ADRName;
+import com.oracle.solaris.vp.panel.common.api.smf_old.ServiceInfo;
import com.oracle.solaris.vp.panel.common.*;
/**
- * The {@code ServiceTracker} is a {@link MXBeanTracker} that automatically
+ * The {@code ServiceTracker} is a {@link BeanTracker} that automatically
* creates and re-creates an {@link #getService AggregatedRefreshService}, which
- * wraps a {@link ServiceMXBeanAdaptor}, which wraps a {@link
- * ServiceInfoMXBean}.
+ * wraps a {@link ServiceBeanAdaptor}, which wraps a {@link
+ * ServiceInfo}.
*/
-public class ServiceTracker extends MXBeanTracker<ServiceInfoMXBean>
+public class ServiceTracker extends BeanTracker<ServiceInfo>
implements HasService {
//
@@ -59,16 +58,16 @@
// Constructors
//
- public ServiceTracker(ObjectName oName, ClientContext context)
+ public ServiceTracker(ADRName oName, ClientContext context)
throws TrackerException {
- super(oName, ServiceInfoMXBean.class, Stability.PRIVATE, context);
+ super(oName, ServiceInfo.class, context);
}
public ServiceTracker(String serviceName, String instanceName,
ClientContext context) throws TrackerException {
- this(ServiceUtil.toObjectName(serviceName, instanceName), context);
+ this(ServiceUtil.toADRName(serviceName, instanceName), context);
}
//
@@ -81,11 +80,11 @@
}
//
- // MXBeanTracker methods
+ // BeanTracker methods
//
@Override
- public void setBean(ServiceInfoMXBean bean) {
+ public void setBean(ServiceInfo bean) {
if (getBean() != bean) {
super.setBean(bean);
setService();
@@ -99,7 +98,7 @@
public void setObjectName(String serviceName, String instanceName)
throws TrackerException {
- ObjectName oName = ServiceUtil.toObjectName(serviceName, instanceName);
+ ADRName oName = ServiceUtil.toADRName(serviceName, instanceName);
setObjectName(oName);
}
@@ -117,7 +116,7 @@
//
private void setService() {
- setService(new AggregatedRefreshService(new ServiceMXBeanAdaptor(
+ setService(new AggregatedRefreshService(new ServiceBeanAdaptor(
getBean())));
}
}
--- a/components/visual-panels/core/src/java/vpanels/panel/com/oracle/solaris/vp/panel/common/smf/ServiceUtil.java Mon Oct 28 17:52:58 2013 -0700
+++ b/components/visual-panels/core/src/java/vpanels/panel/com/oracle/solaris/vp/panel/common/smf/ServiceUtil.java Wed Oct 30 16:53:48 2013 -0400
@@ -20,16 +20,16 @@
*/
/*
- * Copyright (c) 2010, 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved.
*/
package com.oracle.solaris.vp.panel.common.smf;
import java.text.DateFormat;
import java.util.*;
-import javax.management.*;
+import com.oracle.solaris.rad.client.ADRName;
import com.oracle.solaris.scf.common.FMRI;
-import com.oracle.solaris.vp.panel.common.api.panel.MBeanUtil;
+import com.oracle.solaris.vp.panel.common.api.smf_old.ServiceInfo;
import com.oracle.solaris.vp.panel.common.api.smf_old.SmfState;
import com.oracle.solaris.vp.panel.common.model.ManagedObjectStatus;
import com.oracle.solaris.vp.util.misc.finder.Finder;
@@ -40,74 +40,84 @@
//
public static final String SERVICE_DOMAIN =
- MBeanUtil.VP_DOMAIN + ".smf_old";
+ "com.oracle.solaris.vp.panel.common.api.smf_old";
//
// Static methods
//
- public static ObjectName getServiceObjectName(
- String service, String instance) throws MalformedObjectNameException {
+ public static ADRName getServiceObjectName(
+ String service, String instance) {
- /*
- * We don't use ObjectName.quote() because we can be called to
- * construct a pattern, and no valid FMRI characters require quoting
- * in a quoted ObjectName values.
- */
- String namestr = String.format("%s:type=service,service=\"%s\"",
+ String namestr = String.format("%s:type=ServiceInfo,service=%s",
SERVICE_DOMAIN, service);
if (instance != null)
- namestr = String.format("%s,instance=\"%s\"", namestr, instance);
+ namestr = String.format("%s,instance=%s", namestr, instance);
- return (new ObjectName(namestr));
+ return (new ADRName(namestr));
}
- public static ObjectName toObjectName(String service, String instance)
- {
+ public static ADRName toADRName(String service, String instance) {
try {
return (getServiceObjectName(service, instance));
- } catch (MalformedObjectNameException e) {
+ } catch (Exception e) {
throw (new IllegalArgumentException(e));
}
}
- public static ObjectName toObjectName(FMRI fmri)
- {
+ public static ADRName toADRName(FMRI fmri) {
switch (fmri.getSvcType()) {
case INSTANCE:
- return (toObjectName(fmri.getService(), fmri.getInstance()));
+ return (toADRName(fmri.getService(), fmri.getInstance()));
case SERVICE:
- return (toObjectName(fmri.getService(), null));
+ return (toADRName(fmri.getService(), null));
default:
return (null);
}
}
- public static String toFMRI(ObjectName on)
- {
- String service = ObjectName.unquote(on.getKeyProperty("service"));
- String instance = ObjectName.unquote(on.getKeyProperty("instance"));
+ public static String toFMRI(ADRName an) {
+
+ String name = an.toString();
+ String[] pieces = name.split(":", 2);
+ String[] kvpairs = pieces[1].split(",");
+ String domain = pieces[0];
- if (!on.getDomain().equals(SERVICE_DOMAIN) || service == null)
- throw (new IllegalArgumentException("Not an SMF ObjectName"));
+ Map<String, String> kvs = new HashMap<String, String>();
+ for (String s : kvpairs) {
+ String[] kv = s.split("=");
+ kvs.put(kv[0], kv[1]);
+ }
- service = service.replace('+', ',');
- if (instance != null)
- instance = instance.replace('+', ',');
+ String service = kvs.get("service");
+ String instance = kvs.get("instance");
+ if (!domain.equals(SERVICE_DOMAIN) || service == null)
+ throw new IllegalArgumentException("Not an SMF Object name");
return ("svc:/" + (instance == null ?
service : service + ":" + instance));
}
- public static String toService(ObjectName on)
- {
- try {
- String service = on.getKeyProperty("service");
- if (on.getDomain().equals(SERVICE_DOMAIN) && service != null)
- return ObjectName.unquote(service);
- } catch (IllegalArgumentException e) {
+ public static String toService(ADRName an) {
+
+ String name = an.toString();
+ String[] pieces = name.split(":", 2);
+ String[] kvpairs = pieces[1].split(",");
+ String domain = pieces[0];
+ String service = null;
+
+ for (int i = 0; i < kvpairs.length; i++) {
+ if (kvpairs[i].startsWith("service=")) {
+ String[] kv = kvpairs[i].split("=");
+ service = kv[1];
+ break;
+ }
}
- throw new IllegalArgumentException("Not an SMF ObjectName");
+
+ if (domain.equals(SERVICE_DOMAIN) && service != null)
+ return service;
+ else
+ throw new IllegalArgumentException("Not an SMF Object name");
}
public static ManagedObjectStatus getPanelStatus(SmfState state) {
--- a/components/visual-panels/core/src/java/vpanels/panel/com/oracle/solaris/vp/panel/common/smf/SimpleHasService.java Mon Oct 28 17:52:58 2013 -0700
+++ b/components/visual-panels/core/src/java/vpanels/panel/com/oracle/solaris/vp/panel/common/smf/SimpleHasService.java Wed Oct 30 16:53:48 2013 -0400
@@ -20,7 +20,7 @@
*/
/*
- * Copyright (c) 2009, 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2009, 2013, Oracle and/or its affiliates. All rights reserved.
*/
package com.oracle.solaris.vp.panel.common.smf;
@@ -30,13 +30,13 @@
// Instance data
//
- private ServiceMXBean service;
+ private ServiceBean service;
//
// Constructors
//
- public SimpleHasService(ServiceMXBean service) {
+ public SimpleHasService(ServiceBean service) {
this.service = service;
}
@@ -45,7 +45,7 @@
//
@Override
- public ServiceMXBean getService() {
+ public ServiceBean getService() {
return service;
}
}
--- a/components/visual-panels/core/src/java/vpanels/panel/com/oracle/solaris/vp/panel/common/smf/SimpleSmfPropertyGroupInfo.java Mon Oct 28 17:52:58 2013 -0700
+++ b/components/visual-panels/core/src/java/vpanels/panel/com/oracle/solaris/vp/panel/common/smf/SimpleSmfPropertyGroupInfo.java Wed Oct 30 16:53:48 2013 -0400
@@ -20,7 +20,7 @@
*/
/*
- * Copyright (c) 2009, 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2009, 2013, Oracle and/or its affiliates. All rights reserved.
*/
package com.oracle.solaris.vp.panel.common.smf;
@@ -44,7 +44,7 @@
this.group = group;
}
- public SimpleSmfPropertyGroupInfo(ServiceMXBean service, String group) {
+ public SimpleSmfPropertyGroupInfo(ServiceBean service, String group) {
this(new SimpleHasService(service), group);
}
@@ -53,7 +53,7 @@
//
@Override
- public ServiceMXBean getService() {
+ public ServiceBean getService() {
return info.getService();
}
--- a/components/visual-panels/core/src/java/vpanels/panel/com/oracle/solaris/vp/panel/common/smf/SimpleSmfPropertyInfo.java Mon Oct 28 17:52:58 2013 -0700
+++ b/components/visual-panels/core/src/java/vpanels/panel/com/oracle/solaris/vp/panel/common/smf/SimpleSmfPropertyInfo.java Wed Oct 30 16:53:48 2013 -0400
@@ -20,7 +20,7 @@
*/
/*
- * Copyright (c) 2009, 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2009, 2013, Oracle and/or its affiliates. All rights reserved.
*/
package com.oracle.solaris.vp.panel.common.smf;
@@ -49,7 +49,7 @@
this(new SimpleSmfPropertyGroupInfo(info, group), name);
}
- public SimpleSmfPropertyInfo(ServiceMXBean service, String group,
+ public SimpleSmfPropertyInfo(ServiceBean service, String group,
String name) {
this(new SimpleHasService(service), group, name);
}
@@ -59,7 +59,7 @@
//
@Override
- public ServiceMXBean getService() {
+ public ServiceBean getService() {
return info.getService();
}
--- a/components/visual-panels/core/src/java/vpanels/panel/com/oracle/solaris/vp/panel/common/smf/SmfEnabledProperty.java Mon Oct 28 17:52:58 2013 -0700
+++ b/components/visual-panels/core/src/java/vpanels/panel/com/oracle/solaris/vp/panel/common/smf/SmfEnabledProperty.java Wed Oct 30 16:53:48 2013 -0400
@@ -20,7 +20,7 @@
*/
/*
- * Copyright (c) 2009, 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2009, 2013, Oracle and/or its affiliates. All rights reserved.
*/
package com.oracle.solaris.vp.panel.common.smf;
@@ -97,7 +97,7 @@
@Override
public void setRepoValue(Boolean value) throws ScfException {
- ServiceMXBean service = info.getService();
+ ServiceBean service = info.getService();
service.setPersistentlyEnabled(value);
}
--- a/components/visual-panels/core/src/java/vpanels/panel/com/oracle/solaris/vp/panel/common/smf/SmfManagedObject.java Mon Oct 28 17:52:58 2013 -0700
+++ b/components/visual-panels/core/src/java/vpanels/panel/com/oracle/solaris/vp/panel/common/smf/SmfManagedObject.java Wed Oct 30 16:53:48 2013 -0400
@@ -20,7 +20,7 @@
*/
/*
- * Copyright (c) 2010, 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved.
*/
package com.oracle.solaris.vp.panel.common.smf;
@@ -28,8 +28,8 @@
import java.net.URISyntaxException;
import java.util.*;
import java.util.logging.*;
-import javax.management.ObjectName;
import javax.swing.*;
+import com.oracle.solaris.rad.client.ADRName;
import com.oracle.solaris.scf.common.*;
import com.oracle.solaris.vp.panel.common.*;
import com.oracle.solaris.vp.panel.common.api.smf_old.Dependency;
@@ -58,7 +58,7 @@
//
private ServiceTracker tracker;
- private ObjectName on;
+ private ADRName an;
private FMRI fmri;
private String name;
private String desc;
@@ -70,17 +70,17 @@
// Constructors
//
- public SmfManagedObject(ClientContext context, String fmri, ObjectName on)
+ public SmfManagedObject(ClientContext context, String fmri, ADRName an)
throws TrackerException {
- tracker = new ServiceTracker(on, context);
+ tracker = new ServiceTracker(an, context);
try {
this.fmri = new FMRI(fmri);
} catch (URISyntaxException e) {
this.fmri = null;
}
- this.on = on;
- serviceName = ServiceUtil.toService(on);
+ this.an = an;
+ serviceName = ServiceUtil.toService(an);
}
//
@@ -206,7 +206,7 @@
try {
dependencies = new HashMap<String, Dependency>();
- ServiceMXBean service = getService();
+ ServiceBean service = getService();
List<String> deps = service.getDependencyNames();
for (String dep : deps) {
dependencies.put(dep, service.getDependency(dep));
@@ -218,7 +218,7 @@
}
}
- public ObjectName getObjectName() {
- return on;
+ public ADRName getObjectName() {
+ return an;
}
}
--- a/components/visual-panels/core/src/java/vpanels/panel/com/oracle/solaris/vp/panel/common/smf/SmfUtil.java Mon Oct 28 17:52:58 2013 -0700
+++ b/components/visual-panels/core/src/java/vpanels/panel/com/oracle/solaris/vp/panel/common/smf/SmfUtil.java Wed Oct 30 16:53:48 2013 -0400
@@ -20,13 +20,11 @@
*/
/*
- * Copyright (c) 2009, 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2009, 2013, Oracle and/or its affiliates. All rights reserved.
*/
package com.oracle.solaris.vp.panel.common.smf;
-import javax.management.*;
-import com.oracle.solaris.rad.jmx.RadNotification;
import com.oracle.solaris.scf.common.ScfException;
import com.oracle.solaris.vp.panel.common.action.*;
import com.oracle.solaris.vp.panel.common.api.smf_old.*;
@@ -37,16 +35,6 @@
// Static data
//
- public static final NotificationFilter NOTIFY_FILTER_STATE_CHANGE =
- new NotificationFilter() {
- @Override
- public boolean isNotificationEnabled(Notification n) {
- return n instanceof RadNotification &&
- n.getType().equals("statechange") &&
- ((RadNotification)n).getPayload(StateChange.class) != null;
- }
- };
-
//
// Static methods
//
--- a/components/visual-panels/core/src/java/vpanels/panel/com/oracle/solaris/vp/panel/swing/control/WindowControl.java Mon Oct 28 17:52:58 2013 -0700
+++ b/components/visual-panels/core/src/java/vpanels/panel/com/oracle/solaris/vp/panel/swing/control/WindowControl.java Wed Oct 30 16:53:48 2013 -0400
@@ -20,7 +20,7 @@
*/
/*
- * Copyright (c) 2010, 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved.
*/
package com.oracle.solaris.vp.panel.swing.control;
@@ -252,11 +252,8 @@
ConnectionInfo info = getPanelDescriptor().
getClientContext().getConnectionInfo();
- try {
- // Test connection.
- info.getConnector().
- getMBeanServerConnection();
- } catch (IOException e) {
+ // Test connection - check if there is a connection
+ if (info == null || !(info.getConnection().isOpen())) {
// Show indicator for broken connection.
connListener.connectionFailed(
new ConnectionEvent(this, info));
--- a/components/visual-panels/core/src/java/vpanels/panel/com/oracle/solaris/vp/panel/swing/smf/ClearServiceAction.java Mon Oct 28 17:52:58 2013 -0700
+++ b/components/visual-panels/core/src/java/vpanels/panel/com/oracle/solaris/vp/panel/swing/smf/ClearServiceAction.java Wed Oct 30 16:53:48 2013 -0400
@@ -20,12 +20,13 @@
*/
/*
- * Copyright (c) 2010, 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved.
*/
package com.oracle.solaris.vp.panel.swing.smf;
import java.util.List;
+import com.oracle.solaris.rad.client.RadPrivilegeException;
import com.oracle.solaris.scf.common.ScfException;
import com.oracle.solaris.vp.panel.common.action.*;
import com.oracle.solaris.vp.panel.common.smf.*;
@@ -82,7 +83,7 @@
inst.getService().clear();
} catch (ScfException e) {
SmfUtil.throwActionException(e);
- } catch (SecurityException e) {
+ } catch (RadPrivilegeException e) {
throw new ActionUnauthorizedException(e);
}
}
--- a/components/visual-panels/core/src/java/vpanels/panel/com/oracle/solaris/vp/panel/swing/smf/EnableServiceAction.java Mon Oct 28 17:52:58 2013 -0700
+++ b/components/visual-panels/core/src/java/vpanels/panel/com/oracle/solaris/vp/panel/swing/smf/EnableServiceAction.java Wed Oct 30 16:53:48 2013 -0400
@@ -20,12 +20,13 @@
*/
/*
- * Copyright (c) 2009, 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2009, 2013, Oracle and/or its affiliates. All rights reserved.
*/
package com.oracle.solaris.vp.panel.swing.smf;
import java.util.List;
+import com.oracle.solaris.rad.client.RadPrivilegeException;
import com.oracle.solaris.scf.common.ScfException;
import com.oracle.solaris.vp.panel.common.action.*;
import com.oracle.solaris.vp.panel.common.smf.*;
@@ -80,7 +81,7 @@
inst.setEnabled(enable);
} catch (ScfException e) {
SmfUtil.throwActionException(e);
- } catch (SecurityException e) {
+ } catch (RadPrivilegeException e) {
throw new ActionUnauthorizedException(e);
}
}
--- a/components/visual-panels/core/src/java/vpanels/panel/com/oracle/solaris/vp/panel/swing/smf/SmfLogControl.java Mon Oct 28 17:52:58 2013 -0700
+++ b/components/visual-panels/core/src/java/vpanels/panel/com/oracle/solaris/vp/panel/swing/smf/SmfLogControl.java Wed Oct 30 16:53:48 2013 -0400
@@ -20,7 +20,7 @@
*/
/*
- * Copyright (c) 2009, 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2009, 2013, Oracle and/or its affiliates. All rights reserved.
*/
package com.oracle.solaris.vp.panel.swing.smf;
@@ -28,7 +28,6 @@
import java.awt.Component;
import java.io.IOException;
import java.util.logging.*;
-import javax.management.InstanceNotFoundException;
import com.oracle.solaris.vp.panel.common.model.PanelDescriptor;
import com.oracle.solaris.vp.panel.common.smf.*;
import com.oracle.solaris.vp.panel.swing.control.SettingsControl;
@@ -87,8 +86,6 @@
try {
getComponent().init(tracker);
- } catch (InstanceNotFoundException e) {
- t = e;
} catch (IOException e) {
t = e;
}
--- a/components/visual-panels/core/src/java/vpanels/panel/com/oracle/solaris/vp/panel/swing/smf/SmfLogPanel.java Mon Oct 28 17:52:58 2013 -0700
+++ b/components/visual-panels/core/src/java/vpanels/panel/com/oracle/solaris/vp/panel/swing/smf/SmfLogPanel.java Wed Oct 30 16:53:48 2013 -0400
@@ -20,7 +20,7 @@
*/
/*
- * Copyright (c) 2009, 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2009, 2013, Oracle and/or its affiliates. All rights reserved.
*/
package com.oracle.solaris.vp.panel.swing.smf;
@@ -28,9 +28,7 @@
import java.awt.*;
import java.beans.*;
import java.io.IOException;
-import javax.management.*;
import javax.swing.*;
-import com.oracle.solaris.rad.jmx.RadNotification;
import com.oracle.solaris.scf.common.ScfException;
import com.oracle.solaris.vp.panel.common.api.smf_old.*;
import com.oracle.solaris.vp.panel.common.smf.*;
@@ -54,17 +52,6 @@
}
};
- private NotificationListener notifyListener =
- new NotificationListener() {
- @Override
- public void handleNotification(Notification n, Object h) {
- final StateChange sc =
- ((RadNotification)n).getPayload(StateChange.class);
-
- updateContentOnEventThread();
- }
- };
-
//
// Constructors
//
@@ -97,14 +84,12 @@
//
public void init(ServiceTracker tracker)
- throws InstanceNotFoundException, IOException {
+ throws IOException {
if (this.tracker != tracker) {
if (this.tracker != null) {
this.tracker.removePropertyChangeListener(
ServiceTracker.PROPERTY_SERVICE, serviceListener);
- this.tracker.removeNotificationListener(notifyListener,
- SmfUtil.NOTIFY_FILTER_STATE_CHANGE, null);
}
this.tracker = tracker;
@@ -112,8 +97,6 @@
if (tracker != null) {
tracker.addPropertyChangeListener(
ServiceTracker.PROPERTY_SERVICE, serviceListener);
- tracker.addNotificationListener(notifyListener,
- SmfUtil.NOTIFY_FILTER_STATE_CHANGE, null);
}
updateContentOnEventThread();
@@ -126,7 +109,7 @@
private void updateContent() {
String content = null;
- ServiceMXBean service = tracker == null ? null : tracker.getService();
+ ServiceBean service = tracker == null ? null : tracker.getService();
if (tracker != null) {
try {
@@ -140,7 +123,7 @@
}
content = Finder.getString(resource, info.getName(), content);
} catch (ScfException e) {
- content = Finder.getString("service.log.error.jmx");
+ content = Finder.getString("service.log.error");
}
}
--- a/components/visual-panels/core/src/java/vpanels/panel/com/oracle/solaris/vp/panel/swing/smf/SmfStatusControl.java Mon Oct 28 17:52:58 2013 -0700
+++ b/components/visual-panels/core/src/java/vpanels/panel/com/oracle/solaris/vp/panel/swing/smf/SmfStatusControl.java Wed Oct 30 16:53:48 2013 -0400
@@ -20,7 +20,7 @@
*/
/*
- * Copyright (c) 2009, 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2009, 2013, Oracle and/or its affiliates. All rights reserved.
*/
package com.oracle.solaris.vp.panel.swing.smf;
@@ -28,7 +28,6 @@
import java.awt.Component;
import java.io.IOException;
import java.util.logging.*;
-import javax.management.InstanceNotFoundException;
import com.oracle.solaris.vp.panel.common.model.PanelDescriptor;
import com.oracle.solaris.vp.panel.common.smf.*;
import com.oracle.solaris.vp.panel.swing.control.SettingsControl;
@@ -89,8 +88,6 @@
try {
getComponent().init(tracker);
- } catch (InstanceNotFoundException e) {
- t = e;
} catch (IOException e) {
t = e;
}
--- a/components/visual-panels/core/src/java/vpanels/panel/com/oracle/solaris/vp/panel/swing/smf/SmfStatusPanel.java Mon Oct 28 17:52:58 2013 -0700
+++ b/components/visual-panels/core/src/java/vpanels/panel/com/oracle/solaris/vp/panel/swing/smf/SmfStatusPanel.java Wed Oct 30 16:53:48 2013 -0400
@@ -20,7 +20,7 @@
*/
/*
- * Copyright (c) 2009, 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2009, 2013, Oracle and/or its affiliates. All rights reserved.
*/
package com.oracle.solaris.vp.panel.swing.smf;
@@ -31,9 +31,7 @@
import java.io.IOException;
import java.util.*;
import java.util.logging.*;
-import javax.management.*;
import javax.swing.*;
-import com.oracle.solaris.rad.jmx.RadNotification;
import com.oracle.solaris.scf.common.ScfException;
import com.oracle.solaris.vp.panel.common.api.smf_old.*;
import com.oracle.solaris.vp.panel.common.smf.*;
@@ -101,25 +99,6 @@
}
};
- private NotificationListener notifyListener =
- new NotificationListener() {
- @Override
- public void handleNotification(Notification n, Object h) {
- final StateChange sc =
- ((RadNotification)n).getPayload(StateChange.class);
-
- EventQueue.invokeLater(
- new Runnable() {
- @Override
- public void run() {
- setServiceState(sc.getState(),
- sc.getNextState(), sc.getAuxState(),
- sc.getStateTime());
- }
- });
- }
- };
-
//
// Constructors
//
@@ -221,14 +200,12 @@
}
public void init(ServiceTracker tracker)
- throws InstanceNotFoundException, IOException {
+ throws IOException {
if (this.tracker != tracker) {
if (this.tracker != null) {
this.tracker.removePropertyChangeListener(
ServiceTracker.PROPERTY_SERVICE, serviceListener);
- this.tracker.removeNotificationListener(notifyListener,
- SmfUtil.NOTIFY_FILTER_STATE_CHANGE, null);
}
this.tracker = tracker;
@@ -236,8 +213,6 @@
if (tracker != null) {
tracker.addPropertyChangeListener(
ServiceTracker.PROPERTY_SERVICE, serviceListener);
- tracker.addNotificationListener(notifyListener,
- SmfUtil.NOTIFY_FILTER_STATE_CHANGE, null);
}
serviceChanged();
@@ -406,7 +381,7 @@
}
private void serviceChanged() {
- ServiceMXBean service = tracker == null ? null : tracker.getService();
+ ServiceBean service = tracker == null ? null : tracker.getService();
Logger log = Logger.getLogger(getClass().getPackage().getName());
--- a/components/visual-panels/core/src/java/vpanels/panel/com/oracle/solaris/vp/panel/swing/smf/resources/Resources.properties Mon Oct 28 17:52:58 2013 -0700
+++ b/components/visual-panels/core/src/java/vpanels/panel/com/oracle/solaris/vp/panel/swing/smf/resources/Resources.properties Wed Oct 30 16:53:48 2013 -0400
@@ -20,7 +20,7 @@
#
#
-# Copyright (c) 2010, 2012, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved.
#
service.action.clear = Clear
@@ -62,7 +62,7 @@
error.scf.permission = @forward:com.oracle.solaris.vp.panel.common.action:error.server.permission
error.scf.general = unexpected error accessing SMF repository
-error.jmx.general = unexpected error communicating with JMX host
+error.server.general = unexpected error communicating with server
service.properties.name = Properties
service.properties.property.label = {0}:
@@ -73,6 +73,6 @@
service.dependencies.name = Dependencies
service.log.name = Log
-service.log.error.jmx = Unable to retrieve a log file for this service.
+service.log.error = Unable to retrieve a log file for this service.
service.log.contents = {0}\n\n{1}
service.log.contents.truncated = {0} (truncated)\n\n...{1}
--- a/components/visual-panels/core/src/java/vpanels/panel/com/oracle/solaris/vp/panel/swing/timezone/TimeZoneModel.java Mon Oct 28 17:52:58 2013 -0700
+++ b/components/visual-panels/core/src/java/vpanels/panel/com/oracle/solaris/vp/panel/swing/timezone/TimeZoneModel.java Wed Oct 30 16:53:48 2013 -0400
@@ -20,18 +20,19 @@
*/
/*
- * Copyright (c) 2009, 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2009, 2013, Oracle and/or its affiliates. All rights reserved.
*/
package com.oracle.solaris.vp.panel.swing.timezone;
-import com.oracle.solaris.rad.ObjectException;
+import com.oracle.solaris.rad.client.RadObjectException;
+import com.oracle.solaris.rad.client.RadPrivilegeException;
import com.oracle.solaris.vp.panel.common.action.*;
-import com.oracle.solaris.vp.panel.common.api.time.HasTimeMXBean;
+import com.oracle.solaris.vp.panel.common.api.time.HasTimeBean;
import com.oracle.solaris.vp.panel.common.model.AbstractModel;
import com.oracle.solaris.vp.util.misc.finder.Finder;
-public class TimeZoneModel extends AbstractModel<HasTimeMXBean> {
+public class TimeZoneModel extends AbstractModel<HasTimeBean> {
//
// Instance data
//
@@ -43,7 +44,7 @@
// Constructors
//
- public TimeZoneModel(HasTimeMXBean descriptor) {
+ public TimeZoneModel(HasTimeBean descriptor) {
super(descriptor);
}
@@ -67,8 +68,8 @@
public void load() {
try {
- setTimeZone(getSource().getTimeMXBean().getdefaultTimeZone());
- } catch (ObjectException e) {
+ setTimeZone(getSource().getTimeBean().getdefaultTimeZone());
+ } catch (RadObjectException e) {
setTimeZone("UTC");
}
}
@@ -80,12 +81,12 @@
validate();
try {
- getSource().getTimeMXBean().setdefaultTimeZone(timeZone);
+ getSource().getTimeBean().setdefaultTimeZone(timeZone);
- } catch (SecurityException e) {
+ } catch (RadPrivilegeException e) {
throw new ActionUnauthorizedException(e);
- } catch (ObjectException e) {
+ } catch (RadObjectException e) {
throw new ActionFailedException(Finder.getString(
"timezone.error.syserror"), e);
}
--- a/components/visual-panels/core/src/java/vpanels/panel/com/oracle/solaris/vp/panel/swing/timezone/TimeZonePanel.java Mon Oct 28 17:52:58 2013 -0700
+++ b/components/visual-panels/core/src/java/vpanels/panel/com/oracle/solaris/vp/panel/swing/timezone/TimeZonePanel.java Wed Oct 30 16:53:48 2013 -0400
@@ -20,7 +20,7 @@
*/
/*
- * Copyright (c) 2010, 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved.
*/
package com.oracle.solaris.vp.panel.swing.timezone;
@@ -280,7 +280,7 @@
// Constructors
//
- public TimeZonePanel(TimeMXBean bean, final SimpleTimeModel model) {
+ public TimeZonePanel(Time bean, final SimpleTimeModel model) {
getHelpField().setText(Finder.getString("timezone.desc"));
@@ -290,7 +290,7 @@
constraint.setGap(0);
/*
- * Read metadata from MBean. Ideally would be read from the model.
+ * Read metadata from Time bean. Ideally would be read from the model.
*/
List<TimeZoneInfo> infoSet = bean.gettimeZones();
List<Continent> continents = bean.getcontinents();
--- a/components/visual-panels/core/src/java/vpanels/vp.in Mon Oct 28 17:52:58 2013 -0700