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/panel-apache-message-files@$(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/panel-apache@$(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" /> <!-- %!@$!@ 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" /> <!-- %!@$!@ 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
+++ b/components/visual-panels/core/src/java/vpanels/vp.in Wed Oct 30 16:53:48 2013 -0400
@@ -21,14 +21,24 @@
#
#
-# Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2011, 2013, Oracle and/or its affiliates. All rights reserved.
#
{
- echo <RAD_JAVA_DIR>/adr.jar
echo <RAD_JAVA_DIR>/rad.jar
- echo <RAD_JAVA_DIR>/afunix.jar
+ echo <RAD_JAVA_DIR>/pam.jar
+ echo <RAD_JAVA_DIR>/config.jar
+ echo <RAD_JAVA_DIR>/container.jar
+ echo <RAD_JAVA_DIR>/control.jar
+ echo <RAD_JAVA_DIR>/errors.jar
+ echo <RAD_JAVA_DIR>/kstat.jar
+ echo <RAD_JAVA_DIR>/modules.jar
+ echo <RAD_JAVA_DIR>/usermgr.jar
+ echo <RAD_JAVA_DIR>/zonemgr.jar
+ echo <RAD_JAVA_DIR>/zonesbridge.jar
+ /usr/bin/gfind '<VP_DIR>/app' \
+ -mindepth 1 -maxdepth 1 -type f -iname '*.jar'
/usr/bin/gfind '<VP_DIR>' \
-mindepth 1 -maxdepth 1 -type f -iname '*.jar'
/usr/bin/gfind '<VP_LOCALE>' \
--- a/components/visual-panels/core/system-management-visual-panels-core-message-files.p5m Mon Oct 28 17:52:58 2013 -0700
+++ b/components/visual-panels/core/system-management-visual-panels-core-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/core-message-files@$(IPS_COMPONENT_VERSION),$(BUILD_VERSION)
@@ -31,10 +31,6 @@
license ../vpanels.copyright license=Oracle
-dir path=usr
-dir path=usr/share
-dir path=usr/share/vpanels
-dir path=usr/share/vpanels/__LOCALE__
file path=usr/share/vpanels/__LOCALE__/com/oracle/solaris/vp/client/swing/help/toc.xml
file path=usr/share/vpanels/__LOCALE__/com/oracle/solaris/vp/client/swing/help/map.jhm
file path=usr/share/vpanels/__LOCALE__/com/oracle/solaris/vp/client/swing/help/app.hs
--- a/components/visual-panels/core/system-management-visual-panels-core.p5m Mon Oct 28 17:52:58 2013 -0700
+++ b/components/visual-panels/core/system-management-visual-panels-core.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.
#
<transform file path=usr.*/man/.+ -> default mangler.man.stability committed>
@@ -64,27 +64,16 @@
depend fmri=pkg:/system/management/visual-panels-core/locale type=require
-dir path=usr
-dir path=usr/bin
-dir path=usr/lib
-dir path=usr/lib/rad
-dir path=usr/lib/rad/module
-dir path=usr/share
-dir path=usr/share/lib
-dir path=usr/share/lib/xml group=sys
-dir path=usr/share/lib/xml/dtd group=sys
-dir path=usr/share/man
-dir path=usr/share/man/man1
-dir path=usr/share/vpanels
-dir path=usr/share/vpanels/app
-dir path=usr/share/vpanels/conf
-dir path=usr/share/vpanels/locale
file path=usr/bin/sleeklock
file path=usr/bin/vp
-file path=usr/lib/rad/module/mod_files.so
-file path=usr/lib/rad/module/mod_network.so
-file path=usr/lib/rad/module/mod_panels.so
-file path=usr/lib/rad/module/mod_smf_old.so
+link path=usr/lib/rad/module/mod_files.so target=mod_files.so.1
+file path=usr/lib/rad/module/mod_files.so.1
+link path=usr/lib/rad/module/mod_network.so target=mod_network.so.1
+file path=usr/lib/rad/module/mod_network.so.1
+link path=usr/lib/rad/module/mod_panels.so target=mod_panels.so.1
+file path=usr/lib/rad/module/mod_panels.so.1
+link path=usr/lib/rad/module/mod_smf_old.so target=mod_smf_old.so.1
+file path=usr/lib/rad/module/mod_smf_old.so.1
file path=usr/share/lib/xml/dtd/vpanel.dtd.1
file path=usr/share/man/man1/vp.1
file path=usr/share/vpanels/app/vpanels-panels-browser.jar
--- a/components/visual-panels/core/system-management-visual-panels-doc.p5m Mon Oct 28 17:52:58 2013 -0700
+++ b/components/visual-panels/core/system-management-visual-panels-doc.p5m Wed Oct 30 16:53:48 2013 -0400
@@ -31,78 +31,6 @@
license ../vpanels.copyright license=Oracle
-dir path=usr
-dir path=usr/share
-dir path=usr/share/lib
-dir path=usr/share/lib/java
-dir path=usr/share/lib/java/javadoc
-dir path=usr/share/lib/java/javadoc/smf-old
-dir path=usr/share/lib/java/javadoc/smf-old/com
-dir path=usr/share/lib/java/javadoc/smf-old/com/oracle
-dir path=usr/share/lib/java/javadoc/smf-old/com/oracle/solaris
-dir path=usr/share/lib/java/javadoc/smf-old/com/oracle/solaris/scf
-dir path=usr/share/lib/java/javadoc/smf-old/com/oracle/solaris/scf/common
-dir path=usr/share/lib/java/javadoc/smf-old/com/oracle/solaris/vp
-dir path=usr/share/lib/java/javadoc/smf-old/com/oracle/solaris/vp/panel
-dir path=usr/share/lib/java/javadoc/smf-old/com/oracle/solaris/vp/panel/common
-dir path=usr/share/lib/java/javadoc/smf-old/com/oracle/solaris/vp/panel/common/api
-dir path=usr/share/lib/java/javadoc/smf-old/com/oracle/solaris/vp/panel/common/api/smf_old
-dir path=usr/share/lib/java/javadoc/smf-old/resources
-dir path=usr/share/lib/java/javadoc/vpanels-panel
-dir path=usr/share/lib/java/javadoc/vpanels-panel/com
-dir path=usr/share/lib/java/javadoc/vpanels-panel/com/oracle
-dir path=usr/share/lib/java/javadoc/vpanels-panel/com/oracle/solaris
-dir path=usr/share/lib/java/javadoc/vpanels-panel/com/oracle/solaris/vp
-dir path=usr/share/lib/java/javadoc/vpanels-panel/com/oracle/solaris/vp/panel
-dir path=usr/share/lib/java/javadoc/vpanels-panel/com/oracle/solaris/vp/panel/common
-dir path=usr/share/lib/java/javadoc/vpanels-panel/com/oracle/solaris/vp/panel/common/action
-dir path=usr/share/lib/java/javadoc/vpanels-panel/com/oracle/solaris/vp/panel/common/api
-dir path=usr/share/lib/java/javadoc/vpanels-panel/com/oracle/solaris/vp/panel/common/api/auth
-dir path=usr/share/lib/java/javadoc/vpanels-panel/com/oracle/solaris/vp/panel/common/api/file
-dir path=usr/share/lib/java/javadoc/vpanels-panel/com/oracle/solaris/vp/panel/common/api/network
-dir path=usr/share/lib/java/javadoc/vpanels-panel/com/oracle/solaris/vp/panel/common/api/panel
-dir path=usr/share/lib/java/javadoc/vpanels-panel/com/oracle/solaris/vp/panel/common/api/time
-dir path=usr/share/lib/java/javadoc/vpanels-panel/com/oracle/solaris/vp/panel/common/control
-dir path=usr/share/lib/java/javadoc/vpanels-panel/com/oracle/solaris/vp/panel/common/model
-dir path=usr/share/lib/java/javadoc/vpanels-panel/com/oracle/solaris/vp/panel/common/smf
-dir path=usr/share/lib/java/javadoc/vpanels-panel/com/oracle/solaris/vp/panel/common/smf/depend
-dir path=usr/share/lib/java/javadoc/vpanels-panel/com/oracle/solaris/vp/panel/common/view
-dir path=usr/share/lib/java/javadoc/vpanels-panel/com/oracle/solaris/vp/panel/swing
-dir path=usr/share/lib/java/javadoc/vpanels-panel/com/oracle/solaris/vp/panel/swing/action
-dir path=usr/share/lib/java/javadoc/vpanels-panel/com/oracle/solaris/vp/panel/swing/control
-dir path=usr/share/lib/java/javadoc/vpanels-panel/com/oracle/solaris/vp/panel/swing/model
-dir path=usr/share/lib/java/javadoc/vpanels-panel/com/oracle/solaris/vp/panel/swing/smf
-dir path=usr/share/lib/java/javadoc/vpanels-panel/com/oracle/solaris/vp/panel/swing/timezone
-dir path=usr/share/lib/java/javadoc/vpanels-panel/com/oracle/solaris/vp/panel/swing/view
-dir path=usr/share/lib/java/javadoc/vpanels-panel/com/oracle/solaris/vp/panels
-dir path=usr/share/lib/java/javadoc/vpanels-panel/com/oracle/solaris/vp/panels/time
-dir path=usr/share/lib/java/javadoc/vpanels-panel/resources
-dir path=usr/share/lib/java/javadoc/vpanels-util
-dir path=usr/share/lib/java/javadoc/vpanels-util/com
-dir path=usr/share/lib/java/javadoc/vpanels-util/com/oracle
-dir path=usr/share/lib/java/javadoc/vpanels-util/com/oracle/solaris
-dir path=usr/share/lib/java/javadoc/vpanels-util/com/oracle/solaris/vp
-dir path=usr/share/lib/java/javadoc/vpanels-util/com/oracle/solaris/vp/util
-dir path=usr/share/lib/java/javadoc/vpanels-util/com/oracle/solaris/vp/util/cli
-dir path=usr/share/lib/java/javadoc/vpanels-util/com/oracle/solaris/vp/util/cli/exception
-dir path=usr/share/lib/java/javadoc/vpanels-util/com/oracle/solaris/vp/util/common
-dir path=usr/share/lib/java/javadoc/vpanels-util/com/oracle/solaris/vp/util/common/propinfo
-dir path=usr/share/lib/java/javadoc/vpanels-util/com/oracle/solaris/vp/util/misc
-dir path=usr/share/lib/java/javadoc/vpanels-util/com/oracle/solaris/vp/util/misc/converter
-dir path=usr/share/lib/java/javadoc/vpanels-util/com/oracle/solaris/vp/util/misc/event
-dir path=usr/share/lib/java/javadoc/vpanels-util/com/oracle/solaris/vp/util/misc/exception
-dir path=usr/share/lib/java/javadoc/vpanels-util/com/oracle/solaris/vp/util/misc/finder
-dir path=usr/share/lib/java/javadoc/vpanels-util/com/oracle/solaris/vp/util/misc/predicate
-dir path=usr/share/lib/java/javadoc/vpanels-util/com/oracle/solaris/vp/util/misc/property
-dir path=usr/share/lib/java/javadoc/vpanels-util/com/oracle/solaris/vp/util/swing
-dir path=usr/share/lib/java/javadoc/vpanels-util/com/oracle/solaris/vp/util/swing/event
-dir path=usr/share/lib/java/javadoc/vpanels-util/com/oracle/solaris/vp/util/swing/glass
-dir path=usr/share/lib/java/javadoc/vpanels-util/com/oracle/solaris/vp/util/swing/layout
-dir path=usr/share/lib/java/javadoc/vpanels-util/com/oracle/solaris/vp/util/swing/property
-dir path=usr/share/lib/java/javadoc/vpanels-util/com/oracle/solaris/vp/util/swing/propinfo
-dir path=usr/share/lib/java/javadoc/vpanels-util/com/oracle/solaris/vp/util/swing/time
-dir path=usr/share/lib/java/javadoc/vpanels-util/com/oracle/solaris/vp/util/swing/tree
-dir path=usr/share/lib/java/javadoc/vpanels-util/resources
file path=usr/share/lib/java/javadoc/smf-old/allclasses-frame.html
file path=usr/share/lib/java/javadoc/smf-old/allclasses-noframe.html
file path=usr/share/lib/java/javadoc/smf-old/com/oracle/solaris/scf/common/FMRI.html
@@ -115,7 +43,7 @@
file path=usr/share/lib/java/javadoc/smf-old/com/oracle/solaris/scf/common/package-tree.html
file path=usr/share/lib/java/javadoc/smf-old/com/oracle/solaris/scf/common/ScfConstants.html
file path=usr/share/lib/java/javadoc/smf-old/com/oracle/solaris/scf/common/ScfException.html
-file path=usr/share/lib/java/javadoc/smf-old/com/oracle/solaris/vp/panel/common/api/smf_old/AggregatorMXBean.html
+file path=usr/share/lib/java/javadoc/smf-old/com/oracle/solaris/vp/panel/common/api/smf_old/Aggregator.html
file path=usr/share/lib/java/javadoc/smf-old/com/oracle/solaris/vp/panel/common/api/smf_old/Dependency.html
file path=usr/share/lib/java/javadoc/smf-old/com/oracle/solaris/vp/panel/common/api/smf_old/Instance.html
file path=usr/share/lib/java/javadoc/smf-old/com/oracle/solaris/vp/panel/common/api/smf_old/LogInfo.html
@@ -127,7 +55,7 @@
file path=usr/share/lib/java/javadoc/smf-old/com/oracle/solaris/vp/panel/common/api/smf_old/PropertyType.html
file path=usr/share/lib/java/javadoc/smf-old/com/oracle/solaris/vp/panel/common/api/smf_old/PropertyVisibility.html
file path=usr/share/lib/java/javadoc/smf-old/com/oracle/solaris/vp/panel/common/api/smf_old/Service.html
-file path=usr/share/lib/java/javadoc/smf-old/com/oracle/solaris/vp/panel/common/api/smf_old/ServiceInfoMXBean.html
+file path=usr/share/lib/java/javadoc/smf-old/com/oracle/solaris/vp/panel/common/api/smf_old/ServiceInfo.html
file path=usr/share/lib/java/javadoc/smf-old/com/oracle/solaris/vp/panel/common/api/smf_old/SmfError.html
file path=usr/share/lib/java/javadoc/smf-old/com/oracle/solaris/vp/panel/common/api/smf_old/SmfErrorCode.html
file path=usr/share/lib/java/javadoc/smf-old/com/oracle/solaris/vp/panel/common/api/smf_old/SmfState.html
@@ -170,28 +98,25 @@
file path=usr/share/lib/java/javadoc/vpanels-panel/com/oracle/solaris/vp/panel/common/api/auth/RoleHint.html
file path=usr/share/lib/java/javadoc/vpanels-panel/com/oracle/solaris/vp/panel/common/api/auth/UnauthorizedException.html
file path=usr/share/lib/java/javadoc/vpanels-panel/com/oracle/solaris/vp/panel/common/api/auth/UserHint.html
-file path=usr/share/lib/java/javadoc/vpanels-panel/com/oracle/solaris/vp/panel/common/api/file/FileBrowserMXBean.html
-file path=usr/share/lib/java/javadoc/vpanels-panel/com/oracle/solaris/vp/panel/common/api/file/FileBrowserUtil.html
+file path=usr/share/lib/java/javadoc/vpanels-panel/com/oracle/solaris/vp/panel/common/api/file/FileBrowser.html
file path=usr/share/lib/java/javadoc/vpanels-panel/com/oracle/solaris/vp/panel/common/api/file/FileSnapshot.html
file path=usr/share/lib/java/javadoc/vpanels-panel/com/oracle/solaris/vp/panel/common/api/file/package-frame.html
file path=usr/share/lib/java/javadoc/vpanels-panel/com/oracle/solaris/vp/panel/common/api/file/package-summary.html
file path=usr/share/lib/java/javadoc/vpanels-panel/com/oracle/solaris/vp/panel/common/api/file/package-tree.html
file path=usr/share/lib/java/javadoc/vpanels-panel/com/oracle/solaris/vp/panel/common/api/file/RemoteFile.html
file path=usr/share/lib/java/javadoc/vpanels-panel/com/oracle/solaris/vp/panel/common/api/file/RemoteFileSystemView.html
-file path=usr/share/lib/java/javadoc/vpanels-panel/com/oracle/solaris/vp/panel/common/api/network/NetworkMXBean.html
-file path=usr/share/lib/java/javadoc/vpanels-panel/com/oracle/solaris/vp/panel/common/api/network/NetworkUtil.html
+file path=usr/share/lib/java/javadoc/vpanels-panel/com/oracle/solaris/vp/panel/common/api/network/Network.html
file path=usr/share/lib/java/javadoc/vpanels-panel/com/oracle/solaris/vp/panel/common/api/network/package-frame.html
file path=usr/share/lib/java/javadoc/vpanels-panel/com/oracle/solaris/vp/panel/common/api/network/package-summary.html
file path=usr/share/lib/java/javadoc/vpanels-panel/com/oracle/solaris/vp/panel/common/api/network/package-tree.html
file path=usr/share/lib/java/javadoc/vpanels-panel/com/oracle/solaris/vp/panel/common/api/panel/CustomPanel.html
-file path=usr/share/lib/java/javadoc/vpanels-panel/com/oracle/solaris/vp/panel/common/api/panel/MBeanUtil.html
file path=usr/share/lib/java/javadoc/vpanels-panel/com/oracle/solaris/vp/panel/common/api/panel/package-frame.html
file path=usr/share/lib/java/javadoc/vpanels-panel/com/oracle/solaris/vp/panel/common/api/panel/package-summary.html
file path=usr/share/lib/java/javadoc/vpanels-panel/com/oracle/solaris/vp/panel/common/api/panel/package-tree.html
-file path=usr/share/lib/java/javadoc/vpanels-panel/com/oracle/solaris/vp/panel/common/api/panel/PanelMXBean.html
-file path=usr/share/lib/java/javadoc/vpanels-panel/com/oracle/solaris/vp/panel/common/api/panel/PanelMXBeanTracker.html
+file path=usr/share/lib/java/javadoc/vpanels-panel/com/oracle/solaris/vp/panel/common/api/panel/Panel.html
+file path=usr/share/lib/java/javadoc/vpanels-panel/com/oracle/solaris/vp/panel/common/api/panel/PanelBeanTracker.html
file path=usr/share/lib/java/javadoc/vpanels-panel/com/oracle/solaris/vp/panel/common/api/panel/ResourceDescriptor.html
-file path=usr/share/lib/java/javadoc/vpanels-panel/com/oracle/solaris/vp/panel/common/api/time/HasTimeMXBean.html
+file path=usr/share/lib/java/javadoc/vpanels-panel/com/oracle/solaris/vp/panel/common/api/time/HasTimeBean.html
file path=usr/share/lib/java/javadoc/vpanels-panel/com/oracle/solaris/vp/panel/common/api/time/package-frame.html
file path=usr/share/lib/java/javadoc/vpanels-panel/com/oracle/solaris/vp/panel/common/api/time/package-summary.html
file path=usr/share/lib/java/javadoc/vpanels-panel/com/oracle/solaris/vp/panel/common/api/time/package-tree.html
@@ -256,7 +181,7 @@
file path=usr/share/lib/java/javadoc/vpanels-panel/com/oracle/solaris/vp/panel/common/model/PanelDescriptor.html
file path=usr/share/lib/java/javadoc/vpanels-panel/com/oracle/solaris/vp/panel/common/model/PropertyChangeForwarder.html
file path=usr/share/lib/java/javadoc/vpanels-panel/com/oracle/solaris/vp/panel/common/model/View.html
-file path=usr/share/lib/java/javadoc/vpanels-panel/com/oracle/solaris/vp/panel/common/MXBeanTracker.html
+file path=usr/share/lib/java/javadoc/vpanels-panel/com/oracle/solaris/vp/panel/common/BeanTracker.html
file path=usr/share/lib/java/javadoc/vpanels-panel/com/oracle/solaris/vp/panel/common/package-frame.html
file path=usr/share/lib/java/javadoc/vpanels-panel/com/oracle/solaris/vp/panel/common/package-summary.html
file path=usr/share/lib/java/javadoc/vpanels-panel/com/oracle/solaris/vp/panel/common/package-tree.html
@@ -294,8 +219,8 @@
file path=usr/share/lib/java/javadoc/vpanels-panel/com/oracle/solaris/vp/panel/common/smf/PropertyValuePropInfo.html
file path=usr/share/lib/java/javadoc/vpanels-panel/com/oracle/solaris/vp/panel/common/smf/RepoManagedObject.html
file path=usr/share/lib/java/javadoc/vpanels-panel/com/oracle/solaris/vp/panel/common/smf/ServiceManagedObject.html
-file path=usr/share/lib/java/javadoc/vpanels-panel/com/oracle/solaris/vp/panel/common/smf/ServiceMXBean.html
-file path=usr/share/lib/java/javadoc/vpanels-panel/com/oracle/solaris/vp/panel/common/smf/ServiceMXBeanAdaptor.html
+file path=usr/share/lib/java/javadoc/vpanels-panel/com/oracle/solaris/vp/panel/common/smf/ServiceBean.html
+file path=usr/share/lib/java/javadoc/vpanels-panel/com/oracle/solaris/vp/panel/common/smf/ServiceBeanAdaptor.html
file path=usr/share/lib/java/javadoc/vpanels-panel/com/oracle/solaris/vp/panel/common/smf/ServicePanelDescriptor.html
file path=usr/share/lib/java/javadoc/vpanels-panel/com/oracle/solaris/vp/panel/common/smf/ServiceTracker.html
file path=usr/share/lib/java/javadoc/vpanels-panel/com/oracle/solaris/vp/panel/common/smf/ServiceUtil.html
@@ -460,19 +385,19 @@
file path=usr/share/lib/java/javadoc/vpanels-panel/com/oracle/solaris/vp/panel/swing/view/WizardPanel.html
file path=usr/share/lib/java/javadoc/vpanels-panel/com/oracle/solaris/vp/panel/swing/view/WizardStepPanel.html
file path=usr/share/lib/java/javadoc/vpanels-panel/com/oracle/solaris/vp/panels/time/Continent.html
-file path=usr/share/lib/java/javadoc/vpanels-panel/com/oracle/solaris/vp/panels/time/ContinentImpl.html
+file path=usr/share/lib/java/javadoc/vpanels-panel/com/oracle/solaris/vp/panels/time/Continent.html
+file path=usr/share/lib/java/javadoc/vpanels-panel/com/oracle/solaris/vp/panels/time/Coordinates.html
file path=usr/share/lib/java/javadoc/vpanels-panel/com/oracle/solaris/vp/panels/time/Coordinates.html
-file path=usr/share/lib/java/javadoc/vpanels-panel/com/oracle/solaris/vp/panels/time/CoordinatesImpl.html
file path=usr/share/lib/java/javadoc/vpanels-panel/com/oracle/solaris/vp/panels/time/Country.html
-file path=usr/share/lib/java/javadoc/vpanels-panel/com/oracle/solaris/vp/panels/time/CountryImpl.html
+file path=usr/share/lib/java/javadoc/vpanels-panel/com/oracle/solaris/vp/panels/time/Country.html
file path=usr/share/lib/java/javadoc/vpanels-panel/com/oracle/solaris/vp/panels/time/package-frame.html
file path=usr/share/lib/java/javadoc/vpanels-panel/com/oracle/solaris/vp/panels/time/package-summary.html
file path=usr/share/lib/java/javadoc/vpanels-panel/com/oracle/solaris/vp/panels/time/package-tree.html
file path=usr/share/lib/java/javadoc/vpanels-panel/com/oracle/solaris/vp/panels/time/ServerInfo.html
-file path=usr/share/lib/java/javadoc/vpanels-panel/com/oracle/solaris/vp/panels/time/ServerInfoImpl.html
-file path=usr/share/lib/java/javadoc/vpanels-panel/com/oracle/solaris/vp/panels/time/TimeMXBean.html
+file path=usr/share/lib/java/javadoc/vpanels-panel/com/oracle/solaris/vp/panels/time/ServerInfo.html
+file path=usr/share/lib/java/javadoc/vpanels-panel/com/oracle/solaris/vp/panels/time/Time.html
file path=usr/share/lib/java/javadoc/vpanels-panel/com/oracle/solaris/vp/panels/time/TimeZoneInfo.html
-file path=usr/share/lib/java/javadoc/vpanels-panel/com/oracle/solaris/vp/panels/time/TimeZoneInfoImpl.html
+file path=usr/share/lib/java/javadoc/vpanels-panel/com/oracle/solaris/vp/panels/time/TimeZoneInfo.html
file path=usr/share/lib/java/javadoc/vpanels-panel/constant-values.html
file path=usr/share/lib/java/javadoc/vpanels-panel/deprecated-list.html
file path=usr/share/lib/java/javadoc/vpanels-panel/help-doc.html
--- a/components/visual-panels/coreadm/src/java/vpanels/app/coreadm/build.xml Mon Oct 28 17:52:58 2013 -0700
+++ b/components/visual-panels/coreadm/src/java/vpanels/app/coreadm/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-coreadm" default="jar">
@@ -31,7 +31,6 @@
<path id="classpath.javac">
<path refid="classpath.panels" />
<pathelement location="${abs.rad.java}/rad.jar" />
- <pathelement location="${abs.rad.java}/adr.jar" />
</path>
<property name="panel.panel" value="coreadm" />
--- a/components/visual-panels/coreadm/src/java/vpanels/app/coreadm/com/oracle/solaris/vp/panels/coreadm/client/swing/CoreAdmPanelDescriptor.java Mon Oct 28 17:52:58 2013 -0700
+++ b/components/visual-panels/coreadm/src/java/vpanels/app/coreadm/com/oracle/solaris/vp/panels/coreadm/client/swing/CoreAdmPanelDescriptor.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.coreadm.client.swing;
@@ -28,10 +28,11 @@
import java.beans.*;
import java.io.IOException;
import java.util.*;
-import javax.management.*;
import javax.swing.Icon;
import javax.swing.border.Border;
-import com.oracle.solaris.adr.Stability;
+import com.oracle.solaris.rad.client.ADRName;
+import com.oracle.solaris.rad.client.Interface;
+import com.oracle.solaris.rad.connect.Connection;
import com.oracle.solaris.scf.common.ScfException;
import com.oracle.solaris.vp.panel.common.*;
import com.oracle.solaris.vp.panel.common.api.file.*;
@@ -59,16 +60,16 @@
private static String findSvc(ClientContext context) throws IOException
{
- ObjectName tmpon;
+ Connection conn = context.getConnectionInfo().getConnection();
+ ADRName tmpon;
+
try {
tmpon = ServiceUtil.getServiceObjectName(TMP_SERVICE, null);
- } catch (MalformedObjectNameException ex) {
+ Interface iface = conn.getObject(tmpon);
+ } catch (Exception ex) {
return (SERVICE);
}
-
- return (context.getConnectionInfo().getConnector().
- getMBeanServerConnection().isRegistered(tmpon) ?
- TMP_SERVICE : SERVICE);
+ return TMP_SERVICE;
}
//
@@ -78,7 +79,7 @@
private DefaultControl control;
private CoreConfig coreConfig_ = new CoreConfig();
private CoreAdmSettingsTab settingsTab_;
- private MXBeanTracker<FileBrowserMXBean> filesBeanTracker;
+ private BeanTracker<FileBrowser> filesBeanTracker;
private PropertyChangeListener filesBeanListener =
new PropertyChangeListener() {
@@ -93,17 +94,17 @@
//
public CoreAdmPanelDescriptor(String id, ClientContext context)
- throws InstanceNotFoundException, IOException, TrackerException,
+ throws IOException, TrackerException,
ScfException, InvalidScfDataException, MissingScfDataException {
super(id, context, findSvc(context), INSTANCE);
- filesBeanTracker = new MXBeanTracker<FileBrowserMXBean>(
- FileBrowserUtil.OBJECT_NAME, FileBrowserMXBean.class,
- Stability.PRIVATE, context);
+ filesBeanTracker = new BeanTracker<FileBrowser>(
+ (new FileBrowser()).getName(), FileBrowser.class,
+ context);
filesBeanTracker.addPropertyChangeListener(
- MXBeanTracker.PROPERTY_BEAN, filesBeanListener);
+ BeanTracker.PROPERTY_BEAN, filesBeanListener);
updateCoreConfig();
setComparator(SimpleHasId.COMPARATOR);
--- a/components/visual-panels/coreadm/src/java/vpanels/app/coreadm/com/oracle/solaris/vp/panels/coreadm/client/swing/CoreAdmSettingsTab.java Mon Oct 28 17:52:58 2013 -0700
+++ b/components/visual-panels/coreadm/src/java/vpanels/app/coreadm/com/oracle/solaris/vp/panels/coreadm/client/swing/CoreAdmSettingsTab.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.coreadm.client.swing;
@@ -28,6 +28,7 @@
import java.awt.Component;
import java.awt.event.*;
import java.util.Map;
+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.*;
@@ -100,7 +101,7 @@
value.write(descriptor.getService());
} catch (ScfException e) {
SmfUtil.throwActionException(e);
- } catch (SecurityException e) {
+ } catch (RadPrivilegeException e) {
throw new ActionUnauthorizedException(e);
}
--- a/components/visual-panels/coreadm/src/java/vpanels/app/coreadm/com/oracle/solaris/vp/panels/coreadm/client/swing/CoreConfig.java Mon Oct 28 17:52:58 2013 -0700
+++ b/components/visual-panels/coreadm/src/java/vpanels/app/coreadm/com/oracle/solaris/vp/panels/coreadm/client/swing/CoreConfig.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.coreadm.client.swing;
@@ -229,7 +229,7 @@
config.pattern_, config.enabled_, config.setid_);
}
- public ScopeConfig(ServiceMXBean service, String pfx, String altpfx)
+ public ScopeConfig(ServiceBean service, String pfx, String altpfx)
throws ScfException, InvalidScfDataException,
MissingScfDataException
{
@@ -295,7 +295,7 @@
* ScopeConfig methods.
*/
- void write(ServiceMXBean service, String pfx, String altpfx)
+ void write(ServiceBean service, String pfx, String altpfx)
throws ScfException
{
service.setPropertyValues(CONFIG_PG, altpfx + PROP_SFX_CONTENT,
@@ -389,7 +389,7 @@
new ScopeConfig(cc.processScope_), cc.logging_);
}
- CoreConfig(ServiceMXBean service) throws ScfException,
+ CoreConfig(ServiceBean service) throws ScfException,
InvalidScfDataException, MissingScfDataException
{
globalScope_ =
@@ -406,7 +406,7 @@
}
}
- void write(ServiceMXBean service) throws ScfException
+ void write(ServiceBean service) throws ScfException
{
globalScope_.write(service, PROP_PFX_GLOBAL, PROP_PFX_GLOBAL);
processScope_.write(service, PROP_PFX_PROC, PROP_PFX_ALTPROC);
--- a/components/visual-panels/coreadm/src/java/vpanels/app/coreadm/com/oracle/solaris/vp/panels/coreadm/client/swing/CustomCoreSchemeEditControl.java Mon Oct 28 17:52:58 2013 -0700
+++ b/components/visual-panels/coreadm/src/java/vpanels/app/coreadm/com/oracle/solaris/vp/panels/coreadm/client/swing/CustomCoreSchemeEditControl.java Wed Oct 30 16:53:48 2013 -0400
@@ -20,11 +20,12 @@
*/
/*
- * 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.coreadm.client.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.smf.SmfUtil;
@@ -80,7 +81,7 @@
value.write(descriptor.getService());
} catch (ScfException e) {
SmfUtil.throwActionException(e);
- } catch (SecurityException e) {
+ } catch (RadPrivilegeException e) {
throw new ActionUnauthorizedException(e);
}
--- a/components/visual-panels/coreadm/system-management-visual-panels-panel-coreadm-message-files.p5m Mon Oct 28 17:52:58 2013 -0700
+++ b/components/visual-panels/coreadm/system-management-visual-panels-panel-coreadm-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/panel-coreadm-message-files@$(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-coreadm.pot
file path=usr/share/vpanels/__LOCALE__/com/oracle/solaris/vp/panels/coreadm/client/swing/resources/Resources.properties
file path=usr/share/vpanels/__LOCALE__/com/oracle/solaris/vp/panels/coreadm/client/swing/path/resources/Resources.properties
--- a/components/visual-panels/coreadm/system-management-visual-panels-panel-coreadm.p5m Mon Oct 28 17:52:58 2013 -0700
+++ b/components/visual-panels/coreadm/system-management-visual-panels-panel-coreadm.p5m 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.
#
set name=pkg.fmri value=pkg:/system/management/visual-panels/panel-coreadm@$(IPS_COMPONENT_VERSION),$(BUILD_VERSION)
@@ -34,13 +34,6 @@
depend fmri=pkg:/system/management/visual-panels-core@$(IPS_COMPONENT_VERSION),$(BUILD_VERSION) type=require
depend fmri=pkg:/system/management/visual-panels/panel-coreadm/locale type=require
-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=usr/share/applications/vp-coreadm.desktop
file path=usr/share/vpanels/app/vpanels-panels-coreadm.jar
file path=usr/share/vpanels/conf/coreadm.xml
--- a/components/visual-panels/examples/src/apis/example-time2.xml Mon Oct 28 17:52:58 2013 -0700
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,34 +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.panels.example.time2">
-
- <interface name="Time">
- <!-- read/write raw milliseconds -->
- <property type="long" name="time" access="rw">
- <error />
- </property>
- </interface>
-</api>
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/components/visual-panels/examples/src/apis/example_time2.adr Wed Oct 30 16:53:48 2013 -0400
@@ -0,0 +1,34 @@
+<?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.panels.example.example_time2">
+ <version major="1" minor="0" />
+ <interface name="Time">
+ <!-- read/write raw milliseconds -->
+ <property type="long" name="time" access="rw">
+ <error />
+ </property>
+ </interface>
+</api>
--- a/components/visual-panels/examples/src/cmd/rad/mod/example-time2/Makefile Mon Oct 28 17:52:58 2013 -0700
+++ b/components/visual-panels/examples/src/cmd/rad/mod/example-time2/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
-MOD_APIS=example-time2
+VERS=.1
+MOD_APIS=example_time2
MOD_OBJS=example-time2.o
-MOD_LIBNAME=example-time2.so
+MOD_LIBNAME=example-time2.so$(VERS)
MOD_INSTALLDIR=$(RADDIR_MODULE)
APISDIR=../../../../apis
--- a/components/visual-panels/examples/src/cmd/rad/mod/example-time2/example-time2.c Mon Oct 28 17:52:58 2013 -0700
+++ b/components/visual-panels/examples/src/cmd/rad/mod/example-time2/example-time2.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/types.h>
@@ -35,7 +35,7 @@
#include <rad/adr.h>
#include <rad/rad_modapi.h>
-#include "api_example-time2.h"
+#include "api_example_time2.h"
/*ARGSUSED*/
conerr_t
@@ -43,7 +43,7 @@
adr_data_t **data, adr_data_t **error)
{
*data = adr_data_new_long((long long)time(NULL) * 1000);
- return (ce_ok);
+ return (CE_OK);
}
/*ARGSUSED*/
@@ -55,32 +55,35 @@
time_t newtime = (time_t)rawtime;
if (rawtime > LONG_MAX)
- return (ce_object);
+ return (CE_OBJECT);
if (stime(&newtime) == -1) {
if (errno == EPERM)
- return (ce_priv);
- return (ce_object);
+ return (CE_PRIV);
+ return (CE_OBJECT);
}
- return (ce_ok);
+ return (CE_OK);
}
-static rad_modinfo_t modinfo = { "example-time2", "Example Time2" };
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 *name = adr_name_fromstr(
- "com.oracle.solaris.vp.panels.example.time2:type=Time");
- (void) cont_insert_singleton(rad_container, name,
+ adr_name_t *name = adr_name_vcreate(
+ MOD_DOMAIN, 1, "type", "Time");
+ (void) rad_cont_insert_singleton(rad_container, name, &modinfo,
&interface_Time_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/examples/src/java/vpanels/app/examples/build-example.xml Mon Oct 28 17:52:58 2013 -0700
+++ b/components/visual-panels/examples/src/java/vpanels/app/examples/build-example.xml Wed Oct 30 16:53:48 2013 -0400
@@ -19,7 +19,7 @@
CDDL HEADER END
- Copyright (c) 2010, 2012, Oracle and/or its affiliates. All rights reserved.
+ Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved.
-->
<project name="vpanels-panels-examples" default="jar">
@@ -30,10 +30,9 @@
<fileset refid="proj.extlibs" />
<path refid="classpath.panels" />
<pathelement location="${abs.rad.java}/rad.jar" />
- <pathelement location="${abs.rad.java}/adr.jar" />
</path>
<target name="generate_project" depends="panelsdef.generate_project">
- <generate.adr api="example-time2.xml" />
+ <generate.adr api="example_time2.adr" />
</target>
</project>
--- a/components/visual-panels/examples/src/java/vpanels/app/examples/build.xml Mon Oct 28 17:52:58 2013 -0700
+++ b/components/visual-panels/examples/src/java/vpanels/app/examples/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 default="jar">
@@ -41,10 +41,6 @@
<attribute name="target" />
<sequential>
<runant target="@{target}"
- panel="example-time1"
- class="com.oracle.solaris.vp.panels.example.time1.client.swing.TimePanelDescriptor"/>
-
- <runant target="@{target}"
panel="example-time2"
class="com.oracle.solaris.vp.panels.example.time2.client.swing.TimePanelDescriptor"/>
</sequential>
--- a/components/visual-panels/examples/src/java/vpanels/app/examples/com/oracle/solaris/vp/panels/example/time1/client/swing/TimeControl.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.panels.example.time1.client.swing;
-
-import java.awt.Component;
-import java.util.Date;
-import com.oracle.solaris.vp.panel.swing.control.SwingControl;
-
-public class TimeControl extends SwingControl<TimePanelDescriptor, TimePanel> {
- //
- // Constructors
- //
-
- public TimeControl(TimePanelDescriptor descriptor) {
- super(descriptor.getId(), descriptor.getName(), descriptor);
- }
-
- //
- // SwingControl methods
- //
-
- @Override
- protected TimePanel createComponent() {
- return new TimePanel();
- }
-
- @Override
- protected void initComponent() {
- Date date = new Date();
- getComponent().getSpinnerDateModel().setValue(date);
- }
-}
--- a/components/visual-panels/examples/src/java/vpanels/app/examples/com/oracle/solaris/vp/panels/example/time1/client/swing/TimePanel.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.panels.example.time1.client.swing;
-
-import java.awt.*;
-import javax.swing.*;
-import com.oracle.solaris.vp.util.misc.finder.Finder;
-
-@SuppressWarnings({"serial"})
-public class TimePanel extends JPanel {
- //
- // Instance data
- //
-
- private SpinnerDateModel model;
-
- //
- // Constructors
- //
-
- public TimePanel() {
- JLabel label = new JLabel(Finder.getString("time.label"));
- model = new SpinnerDateModel();
- JSpinner spinner = new JSpinner(model);
-
- JPanel panel = new JPanel(new BorderLayout(5, 0));
- panel.add(label, BorderLayout.WEST);
- panel.add(spinner, BorderLayout.EAST);
-
- setLayout(new GridBagLayout());
- add(panel);
- }
-
- //
- // TimePanel methods
- //
-
- public SpinnerDateModel getSpinnerDateModel() {
- return model;
- }
-}
--- a/components/visual-panels/examples/src/java/vpanels/app/examples/com/oracle/solaris/vp/panels/example/time1/client/swing/TimePanelDescriptor.java Mon Oct 28 17:52:58 2013 -0700
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,83 +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.panels.example.time1.client.swing;
-
-import com.oracle.solaris.vp.panel.common.ClientContext;
-import com.oracle.solaris.vp.panel.common.control.*;
-import com.oracle.solaris.vp.panel.common.model.*;
-import com.oracle.solaris.vp.panel.swing.control.PanelFrameControl;
-import com.oracle.solaris.vp.panel.swing.model.SwingPanelDescriptor;
-import com.oracle.solaris.vp.util.misc.finder.Finder;
-
-public class TimePanelDescriptor
- extends AbstractPanelDescriptor<ManagedObject>
- implements SwingPanelDescriptor<ManagedObject> {
-
- //
- // Instance data
- //
-
- private DefaultControl control;
-
- //
- // Constructors
- //
-
- /**
- * Constructs a {@code TimePanelDescriptor}.
- *
- * @param id
- * a unique identifier for this Panel, taken from the panel
- * registration
- *
- * @param context
- * a handle to interact with the Visual Panels client
- */
- public TimePanelDescriptor(String id, ClientContext context) {
- super(id, context);
-
- control = new PanelFrameControl<TimePanelDescriptor>(this);
- control.addChildren(new TimeControl(this));
- }
-
- //
- // ManagedObject methods
- //
-
- @Override
- public String getName() {
- return Finder.getString("panel.time.name");
- }
-
- //
- // PanelDescriptor methods
- //
-
- @Override
- public Control getControl() {
- return control;
- }
-}
--- a/components/visual-panels/examples/src/java/vpanels/app/examples/com/oracle/solaris/vp/panels/example/time1/client/swing/resources/Resources.properties Mon Oct 28 17:52:58 2013 -0700
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,27 +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.
-#
-
-panel.time.name = Time Settings
-time.label = Date and Time:
--- a/components/visual-panels/examples/src/java/vpanels/app/examples/com/oracle/solaris/vp/panels/example/time2/client/swing/TimeControl.java Mon Oct 28 17:52:58 2013 -0700
+++ b/components/visual-panels/examples/src/java/vpanels/app/examples/com/oracle/solaris/vp/panels/example/time2/client/swing/TimeControl.java Wed Oct 30 16:53:48 2013 -0400
@@ -20,13 +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.example.time2.client.swing;
import java.util.Date;
-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.swing.control.SettingsControl;
@@ -61,9 +62,9 @@
long time = date.getTime();
try {
getPanelDescriptor().getTimeBean().settime(time);
- } catch (ObjectException e) {
+ } catch (RadObjectException e) {
throw new ActionFailedException(e);
- } catch (SecurityException e) {
+ } catch (RadPrivilegeException e) {
throw new ActionUnauthorizedException(e);
}
}
@@ -91,7 +92,7 @@
try {
long time = getPanelDescriptor().getTimeBean().gettime();
date = new Date(time);
- } catch (ObjectException e) {
+ } catch (RadObjectException e) {
/* Shouldn't happen */
date = new Date();
}
--- a/components/visual-panels/examples/src/java/vpanels/app/examples/com/oracle/solaris/vp/panels/example/time2/client/swing/TimePanelDescriptor.java Mon Oct 28 17:52:58 2013 -0700
+++ b/components/visual-panels/examples/src/java/vpanels/app/examples/com/oracle/solaris/vp/panels/example/time2/client/swing/TimePanelDescriptor.java Wed Oct 30 16:53:48 2013 -0400
@@ -20,19 +20,20 @@
*/
/*
- * 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.example.time2.client.swing;
-import com.oracle.solaris.adr.Stability;
+import java.io.IOException;
+import java.util.logging.Level;
+import com.oracle.solaris.rad.connect.Connection;
import com.oracle.solaris.vp.panel.common.*;
import com.oracle.solaris.vp.panel.common.control.*;
import com.oracle.solaris.vp.panel.common.model.*;
import com.oracle.solaris.vp.panel.swing.control.PanelFrameControl;
import com.oracle.solaris.vp.panel.swing.model.SwingPanelDescriptor;
-import com.oracle.solaris.vp.panels.example.time2.*;
-import com.oracle.solaris.vp.panels.example.time2.common.TimeUtil;
+import com.oracle.solaris.vp.panels.example.example_time2.*;
import com.oracle.solaris.vp.util.misc.finder.Finder;
public class TimePanelDescriptor
@@ -44,7 +45,7 @@
//
private DefaultControl control;
- private MXBeanTracker<TimeMXBean> beanTracker;
+ private Time bean;
//
// Constructors
@@ -61,15 +62,22 @@
* a handle to interact with the Visual Panels client
*/
public TimePanelDescriptor(String id, ClientContext context)
- throws TrackerException {
+ throws IOException {
super(id, context);
control = new PanelFrameControl<TimePanelDescriptor>(this);
control.addChildren(new TimeControl(this));
- beanTracker = new MXBeanTracker<TimeMXBean>(
- TimeUtil.OBJECT_NAME, TimeMXBean.class, Stability.PRIVATE, context);
+ try {
+ Connection conn = context.getConnectionInfo().getConnection();
+ bean = conn.getObject(new Time());
+ } catch (IOException e) {
+ String msg = "Error contacting server while creating " +
+ "proxy for: " + Time.class.getSimpleName();
+ getLog().log(Level.SEVERE, msg, e);
+ throw e;
+ }
}
//
@@ -81,7 +89,6 @@
*/
@Override
public void dispose() {
- beanTracker.dispose();
super.dispose();
}
@@ -103,7 +110,7 @@
// TimePanelDescriptor methods
//
- public TimeMXBean getTimeBean() {
- return beanTracker.getBean();
+ public Time getTimeBean() {
+ return bean;
}
}
--- a/components/visual-panels/examples/src/java/vpanels/app/examples/com/oracle/solaris/vp/panels/example/time2/common/TimeUtil.java Mon Oct 28 17:52:58 2013 -0700
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,40 +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.panels.example.time2.common;
-
-import javax.management.ObjectName;
-import com.oracle.solaris.vp.panel.common.api.panel.MBeanUtil;
-
-public class TimeUtil {
- //
- // Static data
- //
-
- public static final String DOMAIN =
- MBeanUtil.VP_PANEL_DOMAIN + ".example.time2";
- public static final ObjectName OBJECT_NAME =
- MBeanUtil.makeObjectName(DOMAIN, "Time");
-}
--- a/components/visual-panels/examples/system-management-visual-panels-panel-examples.p5m Mon Oct 28 17:52:58 2013 -0700
+++ b/components/visual-panels/examples/system-management-visual-panels-panel-examples.p5m 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.
#
set name=pkg.fmri value=pkg:/system/management/visual-panels/panel-examples@$(IPS_COMPONENT_VERSION),$(BUILD_VERSION)
@@ -33,15 +33,7 @@
depend fmri=pkg:/system/management/visual-panels-core@$(IPS_COMPONENT_VERSION),$(BUILD_VERSION) type=require
-dir path=usr
-dir path=usr/lib
-dir path=usr/lib/rad
-dir path=usr/lib/rad/module
-dir path=usr/share
-dir path=usr/share/vpanels
-dir path=usr/share/vpanels/app
-dir path=usr/share/vpanels/conf
-file path=usr/lib/rad/module/example-time2.so
+link path=usr/lib/rad/module/example-time2.so target=example-time2.so.1
+file path=usr/lib/rad/module/example-time2.so.1
file path=usr/share/vpanels/app/vpanels-panels-examples.jar
-file path=usr/share/vpanels/conf/example-time1.xml
file path=usr/share/vpanels/conf/example-time2.xml
--- a/components/visual-panels/firewall/src/java/vpanels/app/firewall/build.xml Mon Oct 28 17:52:58 2013 -0700
+++ b/components/visual-panels/firewall/src/java/vpanels/app/firewall/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-firewall" default="jar">
@@ -32,7 +32,6 @@
<fileset refid="proj.extlibs" />
<path refid="classpath.panels" />
<pathelement location="${abs.rad.java}/rad.jar" />
- <pathelement location="${abs.rad.java}/adr.jar" />
</path>
<property name="panel.panel" value="firewall" />
--- a/components/visual-panels/firewall/src/java/vpanels/app/firewall/com/oracle/solaris/vp/panels/firewall/client/swing/EnableServiceAction.java Mon Oct 28 17:52:58 2013 -0700
+++ b/components/visual-panels/firewall/src/java/vpanels/app/firewall/com/oracle/solaris/vp/panels/firewall/client/swing/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.panels.firewall.client.swing;
import java.util.List;
+import com.oracle.solaris.rad.client.RadPrivilegeException;
import com.oracle.solaris.vp.panel.common.action.*;
import com.oracle.solaris.vp.panel.swing.action.EnableManagedObjectAction;
import com.oracle.solaris.vp.panel.swing.control.SwingControl;
@@ -59,7 +60,7 @@
service.setEnabled(enable);
// } catch (ScfException e) {
// SmfUtil.throwActionException(e);
-// } catch (SecurityException e) {
+// } catch (RadPrivilegeException e) {
// throw new ActionUnauthorizedException(e);
// }
}
--- a/components/visual-panels/firewall/src/java/vpanels/app/firewall/com/oracle/solaris/vp/panels/firewall/client/swing/FirewallDefaultTab.java Mon Oct 28 17:52:58 2013 -0700
+++ b/components/visual-panels/firewall/src/java/vpanels/app/firewall/com/oracle/solaris/vp/panels/firewall/client/swing/FirewallDefaultTab.java Wed Oct 30 16:53:48 2013 -0400
@@ -20,13 +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.firewall.client.swing;
import java.awt.Component;
import java.util.Map;
+import com.oracle.solaris.rad.client.RadPrivilegeException;
import com.oracle.solaris.vp.panel.common.action.*;
import com.oracle.solaris.vp.panel.common.control.*;
import com.oracle.solaris.vp.panel.swing.control.SettingsControl;
@@ -93,7 +94,7 @@
getPanelDescriptor().updateAccessPolicy(policy);
getPanelDescriptor().getEnabledProperty().setValue(
enabledProperty.getValue());
- } catch (SecurityException e) {
+ } catch (RadPrivilegeException e) {
throw new ActionUnauthorizedException(e);
} finally {
setPropertyChangeIgnore(false);
--- a/components/visual-panels/firewall/src/java/vpanels/app/firewall/com/oracle/solaris/vp/panels/firewall/client/swing/FirewallOpenPortsTab.java Mon Oct 28 17:52:58 2013 -0700
+++ b/components/visual-panels/firewall/src/java/vpanels/app/firewall/com/oracle/solaris/vp/panels/firewall/client/swing/FirewallOpenPortsTab.java Wed Oct 30 16:53:48 2013 -0400
@@ -20,13 +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.firewall.client.swing;
import java.awt.Component;
import java.util.*;
+import com.oracle.solaris.rad.client.RadPrivilegeException;
import com.oracle.solaris.vp.panel.common.action.*;
import com.oracle.solaris.vp.panel.common.control.*;
import com.oracle.solaris.vp.panel.swing.control.SettingsControl;
@@ -78,7 +79,7 @@
setPropertyChangeIgnore(true);
try {
getPanelDescriptor().updateOpenPorts(pListProperty.getValue());
- } catch (SecurityException e) {
+ } catch (RadPrivilegeException e) {
throw new ActionUnauthorizedException(e);
} finally {
setPropertyChangeIgnore(false);
--- a/components/visual-panels/firewall/src/java/vpanels/app/firewall/com/oracle/solaris/vp/panels/firewall/client/swing/FirewallOverrideTab.java Mon Oct 28 17:52:58 2013 -0700
+++ b/components/visual-panels/firewall/src/java/vpanels/app/firewall/com/oracle/solaris/vp/panels/firewall/client/swing/FirewallOverrideTab.java Wed Oct 30 16:53:48 2013 -0400
@@ -20,13 +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.panels.firewall.client.swing;
import java.awt.Component;
import java.util.Map;
+import com.oracle.solaris.rad.client.RadPrivilegeException;
import com.oracle.solaris.vp.panel.common.action.*;
import com.oracle.solaris.vp.panel.common.control.*;
import com.oracle.solaris.vp.panel.swing.control.SettingsControl;
@@ -84,7 +85,7 @@
try {
getPanelDescriptor().updateOvrAccessPolicy(aProperty.getValue());
- } catch (SecurityException e) {
+ } catch (RadPrivilegeException e) {
throw new ActionUnauthorizedException(e);
} finally {
setPropertyChangeIgnore(false);
--- a/components/visual-panels/firewall/src/java/vpanels/app/firewall/com/oracle/solaris/vp/panels/firewall/client/swing/FirewallPanelDescriptor.java Mon Oct 28 17:52:58 2013 -0700
+++ b/components/visual-panels/firewall/src/java/vpanels/app/firewall/com/oracle/solaris/vp/panels/firewall/client/swing/FirewallPanelDescriptor.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.firewall.client.swing;
@@ -29,13 +29,10 @@
import java.io.IOException;
import java.net.UnknownHostException;
import java.util.*;
-import javax.management.*;
-import javax.management.remote.JMXConnector;
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.jmx.RadJMX;
+import com.oracle.solaris.rad.client.RadObjectException;
+import com.oracle.solaris.rad.connect.Connection;
import com.oracle.solaris.scf.common.ScfException;
import com.oracle.solaris.vp.panel.common.*;
import com.oracle.solaris.vp.panel.common.api.network.*;
@@ -83,7 +80,7 @@
private DefaultControl control;
private RemoteFileSystemView fsView;
- private MXBeanTracker<NetworkMXBean> networkBeanTracker;
+ private BeanTracker<Network> networkBeanTracker;
private SimpleHasId tmpHasId = new SimpleHasId();
private SimpleSmfPropertyGroupInfo defaultPgInfo;
@@ -99,17 +96,16 @@
//
public FirewallPanelDescriptor(String id,
- ClientContext context) throws InstanceNotFoundException, IOException,
+ ClientContext context) throws IOException,
ScfException, InvalidScfDataException, MissingScfDataException,
- JMException, TrackerException {
+ TrackerException {
super(id, context, SERVICE, INSTANCE);
fsView = new RemoteFileSystemView(context);
- networkBeanTracker = new MXBeanTracker<NetworkMXBean>(
- NetworkUtil.OBJECT_NAME, NetworkMXBean.class, Stability.PRIVATE,
- context);
+ networkBeanTracker = new BeanTracker<Network>(
+ (new Network()).getName(), Network.class, context);
setComparator(SimpleHasId.COMPARATOR);
@@ -313,7 +309,7 @@
getEnabledProperty().reset();
}
- public NetworkMXBean getNetworkMXBean() {
+ public Network getNetworkBean() {
return networkBeanTracker.getBean();
}
@@ -330,27 +326,20 @@
}
private void populateServiceList() throws ScfException,
- InvalidScfDataException, MissingScfDataException, JMException {
+ InvalidScfDataException, MissingScfDataException {
ConnectionInfo cinfo = getClientContext().getConnectionInfo();
- JMXConnector jmxc = cinfo.getConnector();
+ Connection conn = cinfo.getConnection();
Set<Instance> instances = null;
- MBeanServerConnection mbsc = null;
- AggregatorMXBean aggbean = null;
try {
- ObjectName on =
- new ObjectName("com.oracle.solaris.vp.panel.common.api.smf_old"
- + ":type=Aggregator");
- mbsc = jmxc.getMBeanServerConnection();
- aggbean = RadJMX.newMXBeanProxy(mbsc, on,
- AggregatorMXBean.class, Stability.PRIVATE);
+ Aggregator aggbean = conn.getObject(new Aggregator());
instances = new HashSet<Instance>(aggbean.getinstances());
for (Instance inst : instances) {
ServiceManagedObject sobj = new ServiceManagedObject(this,
- mbsc, inst);
+ conn, inst);
if (!sobj.isFirewallSupported())
continue;
@@ -365,11 +354,9 @@
super.addChildren(sobj);
}
}
- } catch (ObjectException e) {
+ } catch (RadObjectException e) {
} catch (IOException e) {
- } catch (MalformedObjectNameException e) {
- } catch (InstanceNotFoundException e) {
- } catch (JMException e) {
+ } catch (Exception e) {
throw e; // Propagate proxy creation exception
}
--- a/components/visual-panels/firewall/src/java/vpanels/app/firewall/com/oracle/solaris/vp/panels/firewall/client/swing/PolicyTablePanel.java Mon Oct 28 17:52:58 2013 -0700
+++ b/components/visual-panels/firewall/src/java/vpanels/app/firewall/com/oracle/solaris/vp/panels/firewall/client/swing/PolicyTablePanel.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.firewall.client.swing;
@@ -33,8 +33,8 @@
import javax.swing.*;
import javax.swing.border.Border;
import javax.swing.table.DefaultTableCellRenderer;
-import com.oracle.solaris.rad.ObjectException;
-import com.oracle.solaris.vp.panel.common.api.network.NetworkMXBean;
+import com.oracle.solaris.rad.client.RadObjectException;
+import com.oracle.solaris.vp.panel.common.api.network.Network;
import com.oracle.solaris.vp.util.misc.finder.Finder;
import com.oracle.solaris.vp.util.swing.*;
import com.oracle.solaris.vp.util.swing.layout.*;
@@ -528,7 +528,7 @@
}
//
- // Methods for interaction with NetworkMXBean from
+ // Methods for interaction with NetworkBean from
// FirewallPanelDescriptor
//
@@ -539,24 +539,24 @@
public String getHostNameForIP(String ip) {
try {
return (descriptor == null ? ip :
- descriptor.getNetworkMXBean().getHostNameForIP(ip));
- } catch (ObjectException e) {
+ descriptor.getNetworkBean().getHostNameForIP(ip));
+ } catch (RadObjectException e) {
return ip;
}
}
public List<String> getNetworkInterfaces() {
try {
- return descriptor.getNetworkMXBean().getnetworkInterfaces();
- } catch (ObjectException e) {
+ return descriptor.getNetworkBean().getnetworkInterfaces();
+ } catch (RadObjectException e) {
return Collections.emptyList();
}
}
public List<String> hostGetIPs(String hostName) {
try {
- return descriptor.getNetworkMXBean().hostGetIPs(hostName);
- } catch (ObjectException e) {
+ return descriptor.getNetworkBean().hostGetIPs(hostName);
+ } catch (RadObjectException e) {
return Collections.emptyList();
}
}
--- a/components/visual-panels/firewall/src/java/vpanels/app/firewall/com/oracle/solaris/vp/panels/firewall/client/swing/ServiceEditControl.java Mon Oct 28 17:52:58 2013 -0700
+++ b/components/visual-panels/firewall/src/java/vpanels/app/firewall/com/oracle/solaris/vp/panels/firewall/client/swing/ServiceEditControl.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.firewall.client.swing;
@@ -28,6 +28,7 @@
import java.net.UnknownHostException;
import java.util.*;
import java.util.logging.Level;
+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.*;
@@ -155,7 +156,7 @@
} catch (ScfException e) {
SmfUtil.throwActionException(e);
- } catch (SecurityException e) {
+ } catch (RadPrivilegeException e) {
throw new ActionUnauthorizedException(e);
} finally {
setPropertyChangeIgnore(false);
--- a/components/visual-panels/firewall/src/java/vpanels/app/firewall/com/oracle/solaris/vp/panels/firewall/client/swing/ServiceManagedObject.java Mon Oct 28 17:52:58 2013 -0700
+++ b/components/visual-panels/firewall/src/java/vpanels/app/firewall/com/oracle/solaris/vp/panels/firewall/client/swing/ServiceManagedObject.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.firewall.client.swing;
@@ -30,12 +30,11 @@
import java.net.UnknownHostException;
import java.util.*;
import java.util.logging.Level;
-import javax.management.*;
import javax.swing.*;
-import com.oracle.solaris.adr.Stability;
-import com.oracle.solaris.rad.jmx.IncompatibleVersionException;
-import com.oracle.solaris.rad.jmx.RadJMX;
-import com.oracle.solaris.rad.jmx.RadNotification;
+import com.oracle.solaris.rad.client.ADRName;
+import com.oracle.solaris.rad.client.RadException;
+import com.oracle.solaris.rad.client.Version;
+import com.oracle.solaris.rad.connect.Connection;
import com.oracle.solaris.scf.common.ScfException;
import com.oracle.solaris.vp.panel.common.*;
import com.oracle.solaris.vp.panel.common.action.ActionFailedException;
@@ -50,8 +49,7 @@
@SuppressWarnings({"serial"})
public class ServiceManagedObject
extends AbstractManagedObject<ManagedObject>
- implements HasIcon, HasAccessPolicy, ConnectionListener,
- NotificationListener {
+ implements HasIcon, HasAccessPolicy, ConnectionListener {
//
// Static data
@@ -85,10 +83,10 @@
//
private FirewallPanelDescriptor descriptor;
- private MBeanServerConnection mbsc;
+ private Connection conn;
private AggregatedRefreshService bean;
private SimpleSmfPropertyGroupInfo pgInfo;
- private ObjectName oName;
+ private ADRName aname;
private String svcName;
private String id;
@@ -103,15 +101,14 @@
//
public ServiceManagedObject(FirewallPanelDescriptor descriptor,
- MBeanServerConnection mbsc, Instance inst)
- throws IOException, MalformedObjectNameException, ScfException,
- InvalidScfDataException, MissingScfDataException,
- InstanceNotFoundException, IncompatibleVersionException, JMException {
+ Connection conn, Instance inst) throws IOException,
+ ScfException, InvalidScfDataException,
+ MissingScfDataException {
this.descriptor = descriptor;
- oName = inst.getObjectName();
- svcName = ServiceUtil.toService(oName);
- id = ServiceUtil.toFMRI(oName);
+ aname = inst.getObjectName();
+ svcName = ServiceUtil.toService(aname);
+ id = ServiceUtil.toFMRI(aname);
bean = new AggregatedRefreshService();
connectionUpdate(descriptor.getClientContext().getConnectionInfo());
@@ -170,55 +167,15 @@
try {
connectionUpdate(info);
} catch (IOException e) {
- getLog().log(Level.SEVERE, Finder.getString("error.jmx.general"),
+ getLog().log(Level.SEVERE, Finder.getString("error.server.general"),
e);
- } catch (JMException e) {
- // Message logged, ignore.
}
}
@Override
public void connectionFailed(ConnectionEvent event) {
- if (mbsc != null) {
- try {
- mbsc.removeNotificationListener(oName, this);
-
- // The connection is likely already closed
- } catch (Throwable ignore) {
- }
-
- mbsc = null;
- }
- }
-
- //
- // NotificationListener methods
- //
-
- /**
- * Handles changes to this {@code ServiceManagedObject}.
- * This implementation listens only for {@code StateChangeNotification}s and
- * fires a {@code PropertyChangeEvent} to registered {@code
- * PropertyChangeEvent}s.
- */
- @Override
- public void handleNotification(Notification n, Object h) {
- boolean success = false;
-
- if (n instanceof RadNotification && n.getType().equals("statechange")) {
- try {
- refresh();
- success = true;
- } catch (ScfException e) {
- getLog().log(Level.SEVERE,
- Finder.getString("error.io.repository"), e);
- }
- }
-
- if (success) {
- PropertyChangeEvent event = new PropertyChangeEvent(
- this, null, null, null);
- firePropertyChange(event);
+ if (conn != null) {
+ conn = null;
}
}
@@ -227,36 +184,23 @@
//
protected void connectionUpdate(ConnectionInfo info)
- throws IOException, InstanceNotFoundException, JMException {
-
- if (mbsc != null) {
- try {
- mbsc.removeNotificationListener(oName, this);
+ throws IOException, RadException {
- // If something prevented us from removing ourselves as a
- // notification listener, it probably doesn't matter anymore.
- } catch (Throwable ignore) {
- }
- mbsc = null;
+ if (conn != null) {
+ conn = null;
}
try {
- mbsc = info.getConnector().getMBeanServerConnection();
- mbsc.addNotificationListener(oName, this, null, null);
- bean.setService(new ServiceMXBeanAdaptor(
- RadJMX.newMXBeanProxy(mbsc, oName,
- ServiceInfoMXBean.class, Stability.PRIVATE)));
- } catch (InstanceNotFoundException e) {
+ conn = info.getConnection();
+ bean.setService(new ServiceBeanAdaptor(
+ (ServiceInfo)conn.getObject(aname)));
+ } catch (RadException e) {
getLog().log(Level.SEVERE,
- Finder.getString("error.jmx.mxbean.missing", oName), e);
+ Finder.getString("error.server.object.missing", aname), e);
throw e;
- } catch (IncompatibleVersionException e) {
- getLog().log(Level.SEVERE,
- Finder.getString("error.jmx.proxy.version"), e);
- throw e;
- } catch (JMException e) {
+ } catch (IOException e) {
getLog().log(Level.WARNING,
- Finder.getString("error.jmx.proxy.general"), e);
+ Finder.getString("error.server.proxy.general"), e);
throw e;
}
}
--- a/components/visual-panels/firewall/src/java/vpanels/app/firewall/com/oracle/solaris/vp/panels/firewall/client/swing/resources/Resources.properties Mon Oct 28 17:52:58 2013 -0700
+++ b/components/visual-panels/firewall/src/java/vpanels/app/firewall/com/oracle/solaris/vp/panels/firewall/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.
#
access.value.long.USE_GLOBAL = Use global access policy
@@ -48,13 +48,12 @@
dialog.port.range.label = Port(s)
dialog.port.range.separator = -
-error.jmx.general = could not communicate with remote host
-error.jmx.mxbean.missing= Cannot locate "{0}" in MBeanServer
-error.jmx.proxy.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.
-error.jmx.proxy.general = An error occurred while creating the service MBean proxy.
+error.hostname.invalid = Unable to validate "{0}"
+error.io.repository = Error communicating with repository.
error.repository.missing.property = Missing property "{0}"
-error.io.repository = Error communicating with repository.
-error.hostname.invalid = Unable to validate "{0}"
+error.server.general = could not communicate with remote host
+error.server.object.missing = Cannot locate "{0}" in server
+error.server.proxy.general = An error occurred while creating the service proxy interface.
error.settings.customfile.empty = Custom file is not specified
list.button.add = Add
--- a/components/visual-panels/firewall/system-management-visual-panels-panel-firewall-message-files.p5m Mon Oct 28 17:52:58 2013 -0700
+++ b/components/visual-panels/firewall/system-management-visual-panels-panel-firewall-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/panel-firewall-message-files@$(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-firewall.pot
file path=usr/share/vpanels/__LOCALE__/com/oracle/solaris/vp/panels/firewall/client/swing/help/firewall.html
file path=usr/share/vpanels/__LOCALE__/com/oracle/solaris/vp/panels/firewall/client/swing/help/toc.xml
--- a/components/visual-panels/firewall/system-management-visual-panels-panel-firewall.p5m Mon Oct 28 17:52:58 2013 -0700
+++ b/components/visual-panels/firewall/system-management-visual-panels-panel-firewall.p5m 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.
#
set name=pkg.fmri value=pkg:/system/management/visual-panels/panel-firewall@$(IPS_COMPONENT_VERSION),$(BUILD_VERSION)
@@ -35,13 +35,6 @@
depend fmri=pkg:/system/management/visual-panels-core@$(IPS_COMPONENT_VERSION),$(BUILD_VERSION) type=require
depend fmri=pkg:/system/management/visual-panels/panel-firewall/locale type=require
-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=usr/share/applications/vp-firewall.desktop
file path=usr/share/vpanels/app/vpanels-panels-firewall.jar
file path=usr/share/vpanels/conf/firewall.xml
--- a/components/visual-panels/make-rules/Makefile.env Mon Oct 28 17:52:58 2013 -0700
+++ b/components/visual-panels/make-rules/Makefile.env Wed Oct 30 16:53:48 2013 -0400
@@ -136,13 +136,12 @@
JAVA = $(JAVA_HOME)/bin/java
# Consumers must depend on java (or java/adr)
-ADRLOC=$(RAD_JAVA_DIR)/adr.jar
RADADRGEN = $(ENV) \
RADADR_SCHEMA=/usr/share/lib/xml/rng/radadr.rng.1 \
RADADR_XSLDIR=/usr/share/lib/xml/style \
- RADADR_JARDIR=$(RAD_JAVA_DIR) \
/usr/bin/radadrgen
+
# Lint
LINTFLAGS = -s -errtags=yes -errsecurity=core -errwarn=%all
--- a/components/visual-panels/make-rules/Makefile.targ Mon Oct 28 17:52:58 2013 -0700
+++ b/components/visual-panels/make-rules/Makefile.targ 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.
#
#
@@ -96,11 +96,11 @@
$(LINTLIB): $(LINTSRCS)
$(LINT.c) -mnuvxy -o $(LIBNAME) $(LINTSRCS) > $(LINTOUT) 2>&1
-api_%.h api_%_impl.c: $(APISDIR)/%.xml
- $(RADADRGEN) -c . -rm $(ADROPTS) $<
+api_%.h api_%_impl.c: $(APISDIR)/%.adr
+ $(RADADRGEN) -s server -l c -d . $<
-api_%.h api_%_impl.c: %.xml
- $(RADADRGEN) -c . -rm $(ADROPTS) $<
+api_%.h api_%_impl.c: %.adr
+ $(RADADRGEN) -s server -l c -d . $<
.c.o:
$(COMPILE.c) $(OUTPUT_OPTION) $<
--- a/components/visual-panels/make-rules/mapfile.module Mon Oct 28 17:52:58 2013 -0700
+++ b/components/visual-panels/make-rules/mapfile.module Wed Oct 30 16:53:48 2013 -0400
@@ -20,10 +20,24 @@
#
#
-# Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved.
#
-# The only symbol modules need export is _rad_init.
+#
+# MAPFILE HEADER START
+#
+# WARNING: STOP NOW. DO NOT MODIFY THIS FILE.
+# Object versioning must comply with the rules detailed in
+#
+# usr/src/lib/README.mapfiles
+#
+# You should not be making modifications here until you've read the most current
+# copy of that file. If you need help, contact a gatekeeper for guidance.
+#
+# MAPFILE HEADER END
+#
+
+# The only symbols that modules need to export are _rad_reg & _rad_init.
# Enforcing this eliminates bloat and noise in .dynsym/.dynstr,
# and in turn helps reduce disk and memory footprint.
@@ -31,23 +45,28 @@
SYMBOL_VERSION SUNWprivate {
global:
+ _rad_fini;
_rad_init;
+ _rad_reg;
# Module API
rad_module_register { FLAGS = PARENT };
+ rad_module_init { FLAGS = PARENT };
+ rad_module_find_by_namespace { FLAGS = PARENT };
- instance_create { FLAGS = PARENT };
- instance_hold { FLAGS = PARENT };
- instance_rele { FLAGS = PARENT };
- instance_getname { FLAGS = PARENT };
- instance_getdata { FLAGS = PARENT };
- instance_notify { FLAGS = PARENT };
+ rad_instance_create { FLAGS = PARENT };
+ rad_instance_hold { FLAGS = PARENT };
+ rad_instance_rele { FLAGS = PARENT };
+ rad_instance_getname { FLAGS = PARENT };
+ rad_instance_getdata { FLAGS = PARENT };
+ rad_instance_notify { FLAGS = PARENT };
- cont_insert { FLAGS = PARENT };
- cont_insert_singleton { FLAGS = PARENT };
- cont_insert_singleton_id { FLAGS = PARENT };
- cont_remove { FLAGS = PARENT };
- cont_register_dynamic { FLAGS = PARENT };
+ rad_cont_insert { FLAGS = PARENT };
+ rad_cont_insert_singleton { FLAGS = PARENT };
+ rad_cont_insert_singleton_id { FLAGS = PARENT };
+ rad_cont_remove { FLAGS = PARENT };
+ rad_cont_supercede { FLAGS = PARENT };
+ rad_cont_register_dynamic { FLAGS = PARENT };
rad_log { FLAGS = PARENT };
rad_log_alloc { FLAGS = PARENT };
@@ -86,26 +105,6 @@
rad_isproxy { FLAGS = PARENT };
rad_container { FLAGS = PARENT };
-
- # Lists
- list_create { FLAGS = PARENT };
- list_destroy { FLAGS = PARENT };
- list_head { FLAGS = PARENT };
- list_insert_after { FLAGS = PARENT };
- list_insert_before { FLAGS = PARENT };
- list_insert_head { FLAGS = PARENT };
- list_insert_tail { FLAGS = PARENT };
- list_is_empty { FLAGS = PARENT };
- list_link_active { FLAGS = PARENT };
- list_link_init { FLAGS = PARENT };
- list_link_replace { FLAGS = PARENT };
- list_move_tail { FLAGS = PARENT };
- list_next { FLAGS = PARENT };
- list_prev { FLAGS = PARENT };
- list_remove { FLAGS = PARENT };
- list_remove_head { FLAGS = PARENT };
- list_remove_tail { FLAGS = PARENT };
- list_tail { FLAGS = PARENT };
local:
*;
};
--- a/components/visual-panels/smf/src/cmd/rad/mod/smf/common.c Mon Oct 28 17:52:58 2013 -0700
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,1168 +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) 2011, 2012, Oracle and/or its affiliates. All rights reserved.
- */
-
-#include <stdio.h>
-#include <string.h>
-#include <rad/adr.h>
-#include <rad/adr_object.h>
-#include <rad/rad_modapi.h>
-#include "api_smf.h"
-#include "smfutil.h"
-#include "rhandle.h"
-#include "datatype.h"
-
-/*ARGSUSED*/
-conerr_t
-interface_Entity_read_fmri(rad_instance_t *inst, adr_attribute_t *attr,
- adr_data_t **data, adr_data_t **error)
-{
- smfobj_t *smfo = instance_getdata(inst);
- *data = adr_data_new_string(smfo->fmri, LT_COPY);
- return (*data == NULL ? ce_nomem : ce_ok);
-}
-
-/*ARGSUSED*/
-conerr_t
-interface_Entity_read_scope(rad_instance_t *inst, adr_attribute_t *attr,
- adr_data_t **data, adr_data_t **error)
-{
- *data = adr_data_new_string("localhost", LT_CONST);
- return (*data == NULL ? ce_nomem : ce_ok);
-}
-
-/*ARGSUSED*/
-conerr_t
-interface_Entity_read_service(rad_instance_t *inst, adr_attribute_t *attr,
- adr_data_t **data, adr_data_t **error)
-{
- smfobj_t *smfo = instance_getdata(inst);
- *data = adr_data_new_string(smfo->sname, LT_COPY);
- return (*data == NULL ? ce_nomem : ce_ok);
-}
-
-
-/*
- * Common retry callback for collecting data from property groups
- * directly attached to a service or in the running snapshot of an
- * instance. Will scan only property groups of the specified type,
- * and will return an array of the specified ADR type.
- *
- * An error of SE_NOTFOUND from a callback routine indicates the
- * property group isn't of interest and should be skipped.
- */
-
-struct pgargs {
- smfobj_t *smfo;
- adr_type_t *type;
- const char *pgtype;
- svcerr_t (*cb)(scf_handle_t *, scf_propertygroup_t *, adr_data_t **);
-};
-
-/*ARGSUSED*/
-static svcerr_t
-rt_collect_pgs(scf_handle_t *h, void *arg, adr_data_t **ret, adr_data_t **error)
-{
- struct pgargs *pga = arg;
- smfobj_t *smfo = pga->smfo;
- smfu_entity_t entity = SMFU_ENTITY_INIT;
- svcerr_t se = SE_OK;
- adr_data_t *result = adr_data_new_array(pga->type, 5);
- scf_propertygroup_t *pg = scf_pg_create(h);
- scf_iter_t *iter = scf_iter_create(h);
-
- if (pg == NULL || iter == NULL) {
- se = SE_FATAL;
- goto done;
- }
-
- if ((se = smfu_lookup(h, smfo->sname, smfo->iname, &entity)) != SE_OK)
- goto done;
-
- if ((se = smfu_iter_pg_r(h, &entity, pga->pgtype, iter)) != SE_OK)
- goto done;
-
- int err;
- while ((err = scf_iter_next_pg(iter, pg)) > 0) {
- adr_data_t *item = NULL;
- se = pga->cb(h, pg, &item);
- if (se == SE_OK)
- (void) adr_array_add(result, item);
- else if (se != SE_NOTFOUND)
- goto done;
- }
- se = (err != 0) ? smfu_maperr(scf_error()) : SE_OK;
-
-done:
- scf_iter_destroy(iter);
- smfu_entity_destroy(&entity);
- scf_pg_destroy(pg);
-
- *ret = result;
- return (se);
-}
-
-/*ARGSUSED*/
-conerr_t
-interface_Entity_read_dependencies(rad_instance_t *inst, adr_attribute_t *attr,
- adr_data_t **data, adr_data_t **error)
-{
- struct pgargs pga = {
- .smfo = instance_getdata(inst),
- .type = &t_array__Dependency,
- .pgtype = SCF_GROUP_DEPENDENCY,
- .cb = create_Dependency
- };
- return (smfu_rtrun(rt_collect_pgs, &pga, data, error));
-}
-
-/*ARGSUSED*/
-conerr_t
-interface_Entity_read_manpages(rad_instance_t *inst, adr_attribute_t *attr,
- adr_data_t **data, adr_data_t **error)
-{
- struct pgargs pga = {
- .smfo = instance_getdata(inst),
- .type = &t_array__Manpage,
- .pgtype = SCF_GROUP_TEMPLATE,
- .cb = create_Manpage
- };
- return (smfu_rtrun(rt_collect_pgs, &pga, data, error));
-}
-
-/*ARGSUSED*/
-conerr_t
-interface_Entity_read_doclinks(rad_instance_t *inst, adr_attribute_t *attr,
- adr_data_t **data, adr_data_t **error)
-{
- struct pgargs pga = {
- .smfo = instance_getdata(inst),
- .type = &t_array__Doclink,
- .pgtype = SCF_GROUP_TEMPLATE,
- .cb = create_Doclink
- };
- return (smfu_rtrun(rt_collect_pgs, &pga, data, error));
-}
-
-/*ARGSUSED*/
-static svcerr_t
-rt_read_pgs(scf_handle_t *h, void *arg, adr_data_t **ret, adr_data_t **error)
-{
- smfobj_t *smfo = arg;
- svcerr_t se = SE_OK;
- smfu_entity_t entity = SMFU_ENTITY_INIT;
-
- scf_propertygroup_t *pg = scf_pg_create(h);
- scf_iter_t *iter = scf_iter_create(h);
- adr_data_t *result = adr_data_new_array(&t_array__PropertyGroup, 5);
-
- if (pg == NULL || iter == NULL) {
- se = SE_FATAL;
- goto done;
- }
-
- if ((se = smfu_lookup(h, smfo->sname, smfo->iname, &entity)) != SE_OK)
- goto done;
-
- if ((se = smfu_iter_pg(&entity, NULL, iter)) != SE_OK)
- goto done;
-
- int e;
- while ((e = scf_iter_next_pg(iter, pg)) > 0) {
- adr_data_t *pgdata;
- if ((se = create_PropertyGroup(pg, &pgdata)) != SE_OK)
- goto done;
- (void) adr_array_add(result, pgdata);
- }
- if (e != 0)
- se = smfu_maperr(scf_error());
-
-done:
- scf_iter_destroy(iter);
- scf_pg_destroy(pg);
- smfu_entity_destroy(&entity);
-
- *ret = result;
- return (se);
-}
-
-/*ARGSUSED*/
-conerr_t
-interface_Entity_read_pgs(rad_instance_t *inst, adr_attribute_t *attr,
- adr_data_t **data, adr_data_t **error)
-{
- return (smfu_rtrun(rt_read_pgs, instance_getdata(inst), data, error));
-}
-
-
-/*ARGSUSED*/
-static svcerr_t
-rt_invoke_delete(scf_handle_t *h, void *arg, adr_data_t **ret,
- adr_data_t **error)
-{
- smfobj_t *smfo = arg;
- svcerr_t se = SE_OK;
- smfu_entity_t entity = SMFU_ENTITY_INIT;
-
- if ((se = smfu_lookup(h, smfo->sname, smfo->iname, &entity)) != SE_OK)
- goto done;
-
- int e = (entity.instance != NULL) ?
- scf_instance_delete(entity.instance) :
- scf_service_delete(entity.service);
-
- if (e != 0) {
- switch (scf_error()) {
- case SCF_ERROR_PERMISSION_DENIED:
- se = error_scf(error, &e__ErrorCode_DENIED, NULL,
- NULL, NULL);
- break;
- case SCF_ERROR_BACKEND_READONLY:
- se = error_scf(error, &e__ErrorCode_READONLY, NULL,
- NULL, NULL);
- break;
- case SCF_ERROR_EXISTS:
- se = error_scf(error, &e__ErrorCode_EXISTS, NULL,
- NULL, NULL);
- break;
- default:
- se = smfu_maperr(scf_error());
- }
- }
-done:
- smfu_entity_destroy(&entity);
- return (se);
-}
-
-/*ARGSUSED*/
-conerr_t
-interface_Entity_invoke_delete(rad_instance_t *inst, adr_method_t *meth,
- adr_data_t **ret, adr_data_t **args, int count, adr_data_t **error)
-{
- return (smfu_rtrun(rt_invoke_delete, instance_getdata(inst), NULL,
- error));
-}
-
-
-/*ARGSUSED*/
-static svcerr_t
-rt_invoke_deleteCust(scf_handle_t *h, void *arg, adr_data_t **ret,
- adr_data_t **error)
-{
- smfobj_t *smfo = arg;
- svcerr_t se = SE_OK;
- smfu_entity_t entity = SMFU_ENTITY_INIT;
-
- if ((se = smfu_lookup(h, smfo->sname, smfo->iname, &entity)) != SE_OK)
- goto done;
-
- int e = (entity.instance != NULL) ?
- scf_instance_delcust(entity.instance) :
- scf_service_delcust(entity.service);
-
- if (e != 0) {
- switch (scf_error()) {
- case SCF_ERROR_PERMISSION_DENIED:
- se = error_scf(error, &e__ErrorCode_DENIED, NULL,
- NULL, NULL);
- break;
- case SCF_ERROR_BACKEND_READONLY:
- se = error_scf(error, &e__ErrorCode_READONLY, NULL,
- NULL, NULL);
- break;
- case SCF_ERROR_DELETED:
- se = error_scf(error, &e__ErrorCode_NOTFOUND, NULL,
- (entity.instance != NULL) ? smfo->iname :
- smfo->sname, NULL);
- break;
- default:
- se = smfu_maperr(scf_error());
- }
- }
-done:
- smfu_entity_destroy(&entity);
- return (se);
-}
-
-/*ARGSUSED*/
-conerr_t
-interface_Entity_invoke_deleteCust(rad_instance_t *inst, adr_method_t *meth,
- adr_data_t **ret, adr_data_t **args, int count, adr_data_t **error)
-{
- return (smfu_rtrun(rt_invoke_deleteCust, instance_getdata(inst), NULL,
- error));
-}
-
-/*ARGSUSED*/
-static svcerr_t
-rt_invoke_createPG(scf_handle_t *h, void *arg, adr_data_t **ret,
- adr_data_t **error)
-{
- radarg_t *ra = arg;
- smfobj_t *smfo = instance_getdata(ra->inst);
- const char *pgname = adr_data_to_string(ra->args[0]);
- const char *pgtype = adr_data_to_string(ra->args[1]);
- unsigned int pgflags = adr_data_to_uinteger(ra->args[2]);
- svcerr_t se = SE_OK;
- smfu_entity_t entity = SMFU_ENTITY_INIT;
-
- if ((se = smfu_lookup(h, smfo->sname, smfo->iname, &entity)) != SE_OK)
- goto done;
-
- int e = (entity.instance != NULL) ?
- scf_instance_add_pg(entity.instance, pgname, pgtype,
- pgflags, NULL) :
- scf_service_add_pg(entity.service, pgname, pgtype,
- pgflags, NULL);
-
- if (e != 0) {
- switch (scf_error()) {
- case SCF_ERROR_INVALID_ARGUMENT:
- se = error_scf(error, &e__ErrorCode_BADVALUE,
- &e__ErrorTarget_PROPERTYGROUP, NULL, NULL);
- break;
- case SCF_ERROR_PERMISSION_DENIED:
- se = error_scf(error, &e__ErrorCode_DENIED, NULL,
- NULL, NULL);
- break;
- case SCF_ERROR_BACKEND_READONLY:
- se = error_scf(error, &e__ErrorCode_READONLY, NULL,
- NULL, NULL);
- break;
- case SCF_ERROR_EXISTS:
- se = error_scf(error, &e__ErrorCode_EXISTS,
- &e__ErrorTarget_PROPERTYGROUP, NULL, NULL);
- break;
- default:
- se = smfu_maperr(scf_error());
- }
- }
-done:
- smfu_entity_destroy(&entity);
- return (se);
-}
-
-/*ARGSUSED*/
-conerr_t
-interface_Entity_invoke_createPG(rad_instance_t *inst, adr_method_t *meth,
- adr_data_t **ret, adr_data_t **args, int count, adr_data_t **error)
-{
- radarg_t ra = { .inst = inst, .args = args };
- return (smfu_rtrun(rt_invoke_createPG, &ra, NULL, error));
-}
-
-
-/*ARGSUSED*/
-static svcerr_t
-rt_invoke_deletePG(scf_handle_t *h, void *arg, adr_data_t **ret,
- adr_data_t **error)
-{
- radarg_t *ra = arg;
- smfobj_t *smfo = instance_getdata(ra->inst);
- const char *pgname = adr_data_to_string(ra->args[0]);
- svcerr_t se = SE_OK;
- smfu_entity_t entity = SMFU_ENTITY_INIT;
- scf_propertygroup_t *pg = scf_pg_create(h);
-
- if (pg == NULL) {
- se = SE_FATAL;
- goto done;
- }
-
- if ((se = smfu_lookup(h, smfo->sname, smfo->iname, &entity)) != SE_OK)
- goto done;
-
- if ((se = smfu_get_pg(&entity, pgname, pg, error)) != SE_OK)
- goto done;
-
- if (scf_pg_delete(pg) != 0) {
- switch (scf_error()) {
- case SCF_ERROR_PERMISSION_DENIED:
- se = error_scf(error, &e__ErrorCode_DENIED, NULL,
- NULL, NULL);
- break;
- case SCF_ERROR_BACKEND_READONLY:
- se = error_scf(error, &e__ErrorCode_READONLY, NULL,
- NULL, NULL);
- break;
- default:
- se = smfu_maperr(scf_error());
- }
- }
-
-done:
- scf_pg_destroy(pg);
- smfu_entity_destroy(&entity);
- return (se);
-}
-
-/*ARGSUSED*/
-conerr_t
-interface_Entity_invoke_deletePG(rad_instance_t *inst, adr_method_t *meth,
- adr_data_t **ret, adr_data_t **args, int count, adr_data_t **error)
-{
- radarg_t ra = { .inst = inst, .args = args };
- return (smfu_rtrun(rt_invoke_deletePG, &ra, NULL, error));
-}
-
-
-/*ARGSUSED*/
-static svcerr_t
-rt_invoke_deletePGCust(scf_handle_t *h, void *arg, adr_data_t **ret,
- adr_data_t **error)
-{
- radarg_t *ra = arg;
- smfobj_t *smfo = instance_getdata(ra->inst);
- const char *pgname = adr_data_to_string(ra->args[0]);
- svcerr_t se = SE_OK;
- smfu_entity_t entity = SMFU_ENTITY_INIT;
- scf_propertygroup_t *pg = scf_pg_create(h);
-
- if (pg == NULL) {
- se = SE_FATAL;
- goto done;
- }
-
- if ((se = smfu_lookup(h, smfo->sname, smfo->iname, &entity)) != SE_OK)
- goto done;
-
- if ((se = smfu_get_pg(&entity, pgname, pg, error)) != SE_OK)
- goto done;
-
- if (scf_pg_delcust(pg) != 0) {
- switch (scf_error()) {
- case SCF_ERROR_PERMISSION_DENIED:
- se = error_scf(error, &e__ErrorCode_DENIED, NULL,
- NULL, NULL);
- break;
- case SCF_ERROR_BACKEND_READONLY:
- se = error_scf(error, &e__ErrorCode_READONLY, NULL,
- NULL, NULL);
- break;
- case SCF_ERROR_DELETED:
- se = error_scf(error, &e__ErrorCode_NOTFOUND,
- &e__ErrorTarget_PROPERTYGROUP, pgname, NULL);
- break;
- default:
- se = smfu_maperr(scf_error());
- }
- }
-
-done:
- scf_pg_destroy(pg);
- smfu_entity_destroy(&entity);
- return (se);
-}
-
-/*ARGSUSED*/
-conerr_t
-interface_Entity_invoke_deletePGCust(rad_instance_t *inst, adr_method_t *meth,
- adr_data_t **ret, adr_data_t **args, int count, adr_data_t **error)
-{
- radarg_t ra = { .inst = inst, .args = args };
- return (smfu_rtrun(rt_invoke_deletePGCust, &ra, NULL, error));
-}
-
-static svcerr_t
-rt_invoke_readProperties(scf_handle_t *h, void *arg, adr_data_t **ret,
- adr_data_t **error)
-{
- radarg_t *ra = arg;
- smfobj_t *smfo = instance_getdata(ra->inst);
- const char *pgname = adr_data_to_string(ra->args[0]);
- svcerr_t se = SE_OK;
- smfu_entity_t entity = SMFU_ENTITY_INIT;
- scf_propertygroup_t *pg = scf_pg_create(h);
-
- if (pg == NULL) {
- se = SE_FATAL;
- goto done;
- }
-
- if ((se = smfu_lookup(h, smfo->sname, smfo->iname, &entity)) != SE_OK)
- goto done;
-
- if ((se = smfu_get_pg(&entity, pgname, pg, error)) != SE_OK)
- goto done;
-
- se = create_Properties(h, pg, ret, error);
-done:
- scf_pg_destroy(pg);
- smfu_entity_destroy(&entity);
- return (se);
-}
-
-/*ARGSUSED*/
-conerr_t
-interface_Entity_invoke_readProperties(rad_instance_t *inst, adr_method_t *meth,
- adr_data_t **ret, adr_data_t **args, int count, adr_data_t **error)
-{
- radarg_t ra = { .inst = inst, .args = args };
- return (smfu_rtrun(rt_invoke_readProperties, &ra, ret, error));
-}
-
-/*ARGSUSED*/
-static svcerr_t
-tx_write_prop(scf_handle_t *h, scf_transaction_t *tx,
- const char *name, scf_type_t type, adr_data_t *values, adr_data_t **error)
-{
- scf_transaction_entry_t *entry = scf_entry_create(h);
-
- if (entry == NULL)
- return (SE_FATAL);
-
- int r = scf_transaction_property_change(tx, entry, name, type);
- if (r == -1) {
- if (scf_error() == SCF_ERROR_NOT_FOUND) {
- r = scf_transaction_property_new(tx, entry, name, type);
- } else if (scf_error() == SCF_ERROR_TYPE_MISMATCH) {
- r = scf_transaction_property_change_type(tx, entry,
- name, type);
- }
-
- if (r == -1) {
- int e = scf_error();
- scf_entry_destroy(entry);
- if (e == SCF_ERROR_INVALID_ARGUMENT)
- return (error_scf(error, &e__ErrorCode_BADVALUE,
- &e__ErrorTarget_PROPERTY, name, NULL));
- else if (e == SCF_ERROR_IN_USE)
- return (error_scf(error, &e__ErrorCode_INVALID,
- &e__ErrorTarget_PROPERTY, name, NULL));
- return (smfu_maperr(e));
- }
- }
-
- int nvalues = adr_array_size(values);
- for (int i = 0; i < nvalues; i++) {
- const char *vstr = adr_data_to_string(adr_array_get(values, i));
- scf_value_t *v = scf_value_create(h);
- if (v == NULL)
- return (SE_FATAL);
- if (scf_value_set_from_string(v, type, vstr) == -1 ||
- scf_entry_add_value(entry, v) == -1) {
- int e = scf_error();
- scf_value_destroy(v);
- if (e == SCF_ERROR_INVALID_ARGUMENT)
- return (error_scf(error, &e__ErrorCode_BADVALUE,
- &e__ErrorTarget_VALUE, name, NULL));
- return (smfu_maperr(e));
- }
- }
-
- return (SE_OK);
-}
-
-/*ARGSUSED*/
-static svcerr_t
-rt_invoke_writeProperties(scf_handle_t *h, void *arg, adr_data_t **ret,
- adr_data_t **error)
-{
- radarg_t *ra = arg;
- smfobj_t *smfo = instance_getdata(ra->inst);
- const char *pgname = adr_data_to_string(ra->args[0]);
- adr_data_t *data = ra->args[1];
- svcerr_t se = SE_OK;
- smfu_entity_t entity = SMFU_ENTITY_INIT;
- scf_propertygroup_t *pg = scf_pg_create(h);
- scf_transaction_t *tx = scf_transaction_create(h);
-
- if (pg == NULL || tx == NULL) {
- se = SE_FATAL;
- goto done;
- }
-
- if ((se = smfu_lookup(h, smfo->sname, smfo->iname, &entity)) != SE_OK)
- goto done;
-
- if ((se = smfu_get_pg(&entity, pgname, pg, error)) != SE_OK)
- goto done;
-
-top:
- if (scf_transaction_start(tx, pg) == -1)
- goto txerror;
-
- int nprops = adr_array_size(data);
- for (int i = 0; i < nprops; i++) {
- adr_data_t *propdata = adr_array_get(data, i);
- const char *propname =
- adr_data_to_string(adr_struct_get(propdata, "name"));
- scf_type_t proptype =
- from_PropertyType(adr_struct_get(propdata, "type"));
- adr_data_t *values = adr_struct_get(propdata, "values");
-
- se = tx_write_prop(h, tx, propname, proptype, values, error);
- if (se != SE_OK)
- goto done;
- }
-
- int r;
- if ((r = scf_transaction_commit(tx)) == 1)
- goto done;
-
- if (r == 0 && scf_pg_update(pg) != -1) {
- scf_transaction_destroy_children(tx);
- scf_transaction_reset(tx);
- goto top;
- }
-
-txerror:
- switch (scf_error()) {
- case SCF_ERROR_PERMISSION_DENIED:
- se = error_scf(error, &e__ErrorCode_DENIED, NULL,
- NULL, NULL);
- break;
- case SCF_ERROR_BACKEND_READONLY:
- se = error_scf(error, &e__ErrorCode_READONLY, NULL,
- NULL, NULL);
- break;
- default:
- se = smfu_maperr(scf_error());
- }
-
-done:
- scf_transaction_destroy_children(tx);
- scf_transaction_destroy(tx);
- scf_pg_destroy(pg);
-
- return (se);
-}
-
-/*ARGSUSED*/
-conerr_t
-interface_Entity_invoke_writeProperties(rad_instance_t *inst,
- adr_method_t *meth, adr_data_t **ret, adr_data_t **args, int count,
- adr_data_t **error)
-{
- radarg_t ra = { .inst = inst, .args = args };
- return (smfu_rtrun(rt_invoke_writeProperties, &ra, NULL, error));
-}
-
-static svcerr_t
-rt_invoke_readProperty(scf_handle_t *h, void *arg, adr_data_t **ret,
- adr_data_t **error)
-{
- radarg_t *ra = arg;
- smfobj_t *smfo = instance_getdata(ra->inst);
- const char *pgname = adr_data_to_string(ra->args[0]);
- const char *propname = adr_data_to_string(ra->args[1]);
- svcerr_t se = SE_OK;
- smfu_entity_t entity = SMFU_ENTITY_INIT;
- scf_propertygroup_t *pg = scf_pg_create(h);
- scf_property_t *prop = scf_property_create(h);
- scf_iter_t *iter = scf_iter_create(h);
- scf_value_t *value = scf_value_create(h);
-
- if (pg == NULL || prop == NULL || iter == NULL || value == NULL) {
- se = SE_FATAL;
- goto done;
- }
-
- if ((se = smfu_lookup(h, smfo->sname, smfo->iname, &entity)) != SE_OK)
- goto done;
-
- if ((se = smfu_get_pg(&entity, pgname, pg, error)) != SE_OK)
- goto done;
-
- if (scf_pg_get_property(pg, propname, prop) == -1) {
- if ((se = smfu_maperr(scf_error())) == SE_NOTFOUND)
- (void) error_scf(error, &e__ErrorCode_NOTFOUND,
- &e__ErrorTarget_PROPERTY, NULL, NULL);
- goto done;
- }
- se = create_Property(prop, iter, value, ret, error);
-done:
- scf_value_destroy(value);
- scf_iter_destroy(iter);
- scf_property_destroy(prop);
- scf_pg_destroy(pg);
- smfu_entity_destroy(&entity);
- return (se);
-}
-
-/*ARGSUSED*/
-conerr_t
-interface_Entity_invoke_readProperty(rad_instance_t *inst, adr_method_t *meth,
- adr_data_t **ret, adr_data_t **args, int count, adr_data_t **error)
-{
- radarg_t ra = { .inst = inst, .args = args };
- return (smfu_rtrun(rt_invoke_readProperty, &ra, ret, error));
-}
-
-
-/*ARGSUSED*/
-static svcerr_t
-rt_invoke_writeProperty(scf_handle_t *h, void *arg, adr_data_t **ret,
- adr_data_t **error)
-{
- radarg_t *ra = arg;
- smfobj_t *smfo = instance_getdata(ra->inst);
- const char *pgname = adr_data_to_string(ra->args[0]);
- const char *propname = adr_data_to_string(ra->args[1]);
- scf_type_t proptype = from_PropertyType(ra->args[2]);
- adr_data_t *data = ra->args[3];
- svcerr_t se = SE_OK;
- smfu_entity_t entity = SMFU_ENTITY_INIT;
- scf_propertygroup_t *pg = scf_pg_create(h);
- scf_transaction_t *tx = scf_transaction_create(h);
-
- if (pg == NULL || tx == NULL) {
- se = internal_error(error, NULL);
- goto done;
- }
-
- if ((se = smfu_lookup(h, smfo->sname, smfo->iname, &entity)) != SE_OK)
- goto done;
-
- if ((se = smfu_get_pg(&entity, pgname, pg, error)) != SE_OK)
- goto done;
-
-top:
- if (scf_transaction_start(tx, pg) == -1)
- goto txerror;
-
- if ((se = tx_write_prop(h, tx, propname, proptype, data, error))
- != SE_OK)
- goto done;
-
- int r;
- if ((r = scf_transaction_commit(tx)) == 1)
- goto done;
-
- if (r == 0 && scf_pg_update(pg) != -1) {
- scf_transaction_destroy_children(tx);
- scf_transaction_reset(tx);
- goto top;
- }
-
-txerror:
- switch (scf_error()) {
- case SCF_ERROR_PERMISSION_DENIED:
- se = error_scf(error, &e__ErrorCode_DENIED, NULL,
- NULL, NULL);
- break;
- case SCF_ERROR_BACKEND_READONLY:
- se = error_scf(error, &e__ErrorCode_READONLY, NULL,
- NULL, NULL);
- break;
- default:
- se = smfu_maperr(scf_error());
- }
-
-done:
- scf_transaction_destroy_children(tx);
- scf_transaction_destroy(tx);
- scf_pg_destroy(pg);
-
- return (se);
-}
-
-/*ARGSUSED*/
-conerr_t
-interface_Entity_invoke_writeProperty(rad_instance_t *inst, adr_method_t *meth,
- adr_data_t **ret, adr_data_t **args, int count, adr_data_t **error)
-{
- radarg_t ra = { .inst = inst, .args = args };
- return (smfu_rtrun(rt_invoke_writeProperty, &ra, NULL, error));
-}
-
-static svcerr_t
-tx_delete_prop(scf_handle_t *h, scf_transaction_t *tx,
- const char *name, adr_data_t **error)
-{
- scf_transaction_entry_t *entry = scf_entry_create(h);
-
- if (entry == NULL)
- return (SE_FATAL);
-
- if (scf_transaction_property_delete(tx, entry, name) == -1) {
- int e = scf_error();
- scf_entry_destroy(entry);
- switch (e) {
- case SCF_ERROR_NOT_FOUND:
- return (error_scf(error, &e__ErrorCode_NOTFOUND,
- &e__ErrorTarget_PROPERTY, name, NULL));
- case SCF_ERROR_INVALID_ARGUMENT:
- return (error_scf(error, &e__ErrorCode_BADVALUE,
- &e__ErrorTarget_PROPERTY, name, NULL));
- case SCF_ERROR_IN_USE:
- return (error_scf(error, &e__ErrorCode_INVALID,
- &e__ErrorTarget_PROPERTY, name, NULL));
- }
- return (smfu_maperr(e));
- }
- return (SE_OK);
-}
-
-/*ARGSUSED*/
-static svcerr_t
-rt_invoke_deleteProperty(scf_handle_t *h, void *arg, adr_data_t **ret,
- adr_data_t **error)
-{
- radarg_t *ra = arg;
- smfobj_t *smfo = instance_getdata(ra->inst);
- const char *pgname = adr_data_to_string(ra->args[0]);
- const char *propname = adr_data_to_string(ra->args[1]);
- svcerr_t se = SE_OK;
- smfu_entity_t entity = SMFU_ENTITY_INIT;
- scf_propertygroup_t *pg = scf_pg_create(h);
- scf_transaction_t *tx = scf_transaction_create(h);
-
- if (pg == NULL || tx == NULL) {
- se = internal_error(error, NULL);
- goto done;
- }
-
- if ((se = smfu_lookup(h, smfo->sname, smfo->iname, &entity)) != SE_OK)
- goto done;
-
- if ((se = smfu_get_pg(&entity, pgname, pg, error)) != SE_OK)
- goto done;
-
-top:
- if (scf_transaction_start(tx, pg) == -1)
- goto txerror;
-
- if ((se = tx_delete_prop(h, tx, propname, error)) != SE_OK)
- goto done;
-
- int r;
- if ((r = scf_transaction_commit(tx)) == 1)
- goto done;
-
- if (r == 0 && scf_pg_update(pg) != -1) {
- scf_transaction_destroy_children(tx);
- scf_transaction_reset(tx);
- goto top;
- }
-
-txerror:
- switch (scf_error()) {
- case SCF_ERROR_PERMISSION_DENIED:
- se = error_scf(error, &e__ErrorCode_DENIED, NULL,
- NULL, NULL);
- break;
- case SCF_ERROR_BACKEND_READONLY:
- se = error_scf(error, &e__ErrorCode_READONLY, NULL,
- NULL, NULL);
- break;
- default:
- se = smfu_maperr(scf_error());
- }
-
-done:
- scf_transaction_destroy_children(tx);
- scf_transaction_destroy(tx);
- scf_pg_destroy(pg);
-
- return (se);
-}
-
-/*ARGSUSED*/
-conerr_t
-interface_Entity_invoke_deleteProperty(rad_instance_t *inst, adr_method_t *meth,
- adr_data_t **ret, adr_data_t **args, int count, adr_data_t **error)
-{
- radarg_t ra = { .inst = inst, .args = args };
- return (smfu_rtrun(rt_invoke_deleteProperty, &ra, NULL, error));
-}
-
-static svcerr_t
-tx_delete_propcust(scf_handle_t *h, scf_transaction_t *tx,
- const char *name, adr_data_t **error)
-{
- svcerr_t se = SE_OK;
- scf_transaction_entry_t *entry = scf_entry_create(h);
-
- if (entry == NULL)
- return (SE_FATAL);
-
- if (scf_transaction_property_delcust(tx, entry, name) == -1) {
- int e = scf_error();
- scf_entry_destroy(entry);
- switch (e) {
- case SCF_ERROR_PERMISSION_DENIED:
- se = error_scf(error, &e__ErrorCode_DENIED, NULL,
- NULL, NULL);
- break;
- case SCF_ERROR_BACKEND_READONLY:
- se = error_scf(error, &e__ErrorCode_READONLY, NULL,
- NULL, NULL);
- break;
- case SCF_ERROR_DELETED:
- se = error_scf(error, &e__ErrorCode_NOTFOUND,
- &e__ErrorTarget_PROPERTY, name, NULL);
- break;
- default:
- se = smfu_maperr(e);
- }
- }
- return (se);
-}
-
-/*ARGSUSED*/
-static svcerr_t
-rt_invoke_deletePropertyCust(scf_handle_t *h, void *arg, adr_data_t **ret,
- adr_data_t **error)
-{
- radarg_t *ra = arg;
- smfobj_t *smfo = instance_getdata(ra->inst);
- const char *pgname = adr_data_to_string(ra->args[0]);
- const char *propname = adr_data_to_string(ra->args[1]);
- svcerr_t se = SE_OK;
- smfu_entity_t entity = SMFU_ENTITY_INIT;
- scf_propertygroup_t *pg = scf_pg_create(h);
- scf_transaction_t *tx = scf_transaction_create(h);
-
- if (pg == NULL || tx == NULL) {
- se = internal_error(error, NULL);
- goto done;
- }
-
- if ((se = smfu_lookup(h, smfo->sname, smfo->iname, &entity)) != SE_OK)
- goto done;
-
- if ((se = smfu_get_pg(&entity, pgname, pg, error)) != SE_OK)
- goto done;
-
-top:
- if (scf_transaction_start(tx, pg) == -1)
- goto txerror;
-
- if ((se = tx_delete_propcust(h, tx, propname, error)) != SE_OK)
- goto done;
-
- int r;
- if ((r = scf_transaction_commit(tx)) == 1)
- goto done;
-
- if (r == 0 && scf_pg_update(pg) != -1) {
- scf_transaction_destroy_children(tx);
- scf_transaction_reset(tx);
- goto top;
- }
-
-txerror:
- switch (scf_error()) {
- case SCF_ERROR_PERMISSION_DENIED:
- se = error_scf(error, &e__ErrorCode_DENIED, NULL,
- NULL, NULL);
- break;
- case SCF_ERROR_BACKEND_READONLY:
- se = error_scf(error, &e__ErrorCode_READONLY, NULL,
- NULL, NULL);
- break;
- default:
- se = smfu_maperr(scf_error());
- }
-
-done:
- scf_transaction_destroy_children(tx);
- scf_transaction_destroy(tx);
- scf_pg_destroy(pg);
-
- return (se);
-}
-
-/*ARGSUSED*/
-conerr_t
-interface_Entity_invoke_deletePropertyCust(rad_instance_t *inst,
- adr_method_t *meth, adr_data_t **ret, adr_data_t **args, int count,
- adr_data_t **error)
-{
- radarg_t ra = { .inst = inst, .args = args };
- return (smfu_rtrun(rt_invoke_deletePropertyCust, &ra, NULL, error));
-}
-
-/*
- * Common retry callback for reading old-style template data from
- * either a service's directly-attached property groups or an
- * instance's running snapshot.
- */
-
-struct tmplarg {
- smfobj_t *smfo;
- const char *pgname;
- const char *locale;
-};
-
-/*ARGSUSED*/
-static svcerr_t
-rt_get_template(scf_handle_t *h, void *arg, adr_data_t **ret,
- adr_data_t **error)
-{
- struct tmplarg *ta = arg;
- svcerr_t se = SE_OK;
- smfu_entity_t entity = SMFU_ENTITY_INIT;
- scf_propertygroup_t *pg = scf_pg_create(h);
- char *str = NULL;
-
- if (pg == NULL) {
- se = SE_FATAL;
- goto done;
- }
-
- if ((se = smfu_lookup(h, ta->smfo->sname, ta->smfo->iname,
- &entity)) != SE_OK)
- goto done;
-
- if ((se = smfu_get_pg_r(h, &entity, ta->pgname, pg)) == SE_OK &&
- (se = smfu_get_l10n_str(h, pg, ta->locale, &str)) == SE_OK) {
- if ((*ret = adr_data_new_string(str, LT_FREE)) == NULL)
- se = SE_FATAL;
- } else if (se == SE_NOTFOUND) {
- se = SE_OK;
- }
-
-done:
- smfu_entity_destroy(&entity);
- scf_pg_destroy(pg);
-
- return (se);
-}
-
-/*ARGSUSED*/
-conerr_t
-interface_Entity_invoke_getCommonName(rad_instance_t *inst, adr_method_t *meth,
- adr_data_t **ret, adr_data_t **args, int count, adr_data_t **error)
-{
- struct tmplarg ta = {
- .smfo = instance_getdata(inst),
- .pgname = SCF_PG_TM_COMMON_NAME,
- .locale = adr_data_to_string(args[0])
- };
- return (smfu_rtrun_opt(rt_get_template, &ta, ret, error));
-}
-
-/*ARGSUSED*/
-conerr_t
-interface_Entity_invoke_getDescription(rad_instance_t *inst, adr_method_t *meth,
- adr_data_t **ret, adr_data_t **args, int count, adr_data_t **error)
-{
- struct tmplarg ta = {
- .smfo = instance_getdata(inst),
- .pgname = SCF_PG_TM_DESCRIPTION,
- .locale = adr_data_to_string(args[0])
- };
- return (smfu_rtrun_opt(rt_get_template, &ta, ret, error));
-}
-
-
-/*ARGSUSED*/
-static svcerr_t
-rt_invoke_getPGTemplates(scf_handle_t *h, void *arg, adr_data_t **ret,
- adr_data_t **error)
-{
- radarg_t *ra = arg;
- smfobj_t *smfo = instance_getdata(ra->inst);
- const char *locale = adr_data_to_string(ra->args[0]);
- svcerr_t se = SE_OK;
- adr_data_t *result = adr_data_new_array(&t_array__PGTemplate, 5);
-
- scf_pg_tmpl_t *pgtmpl = scf_tmpl_pg_create(h);
- if (pgtmpl == NULL) {
- se = SE_FATAL;
- goto done;
- }
-
- int e;
- while ((e = scf_tmpl_iter_pgs(pgtmpl, smfo->fmri, NULL, NULL,
- SCF_PG_TMPL_FLAG_CURRENT)) == 1) {
- adr_data_t *t = NULL;
- if ((se = create_PGTemplate(pgtmpl, locale, &t)) != SE_OK)
- goto done;
- (void) adr_array_add(result, t);
- }
- if (e == -1)
- se = smfu_maperr(scf_error());
-done:
- *ret = result;
- scf_tmpl_pg_destroy(pgtmpl);
-
- return (se);
-}
-
-/*ARGSUSED*/
-conerr_t
-interface_Entity_invoke_getPGTemplates(rad_instance_t *inst, adr_method_t *meth,
- adr_data_t **ret, adr_data_t **args, int count, adr_data_t **error)
-{
- radarg_t ra = { .inst = inst, .args = args };
- return (smfu_rtrun(rt_invoke_getPGTemplates, &ra, ret, error));
-}
-
-
-/*ARGSUSED*/
-static svcerr_t
-rt_invoke_getPropTemplates(scf_handle_t *h, void *arg, adr_data_t **ret,
- adr_data_t **error)
-{
- radarg_t *ra = arg;
- smfobj_t *smfo = instance_getdata(ra->inst);
- const char *pgname = adr_data_to_string(ra->args[0]);
- const char *pgtype = adr_data_to_string(ra->args[1]);
- const char *locale = adr_data_to_string(ra->args[2]);
- svcerr_t se = SE_OK;
- adr_data_t *result = adr_data_new_array(&t_array__PropTemplate, 5);
-
- scf_pg_tmpl_t *pgtmpl = scf_tmpl_pg_create(h);
- scf_prop_tmpl_t *proptmpl = scf_tmpl_prop_create(h);
-
- if (pgtmpl == NULL || proptmpl == NULL) {
- se = SE_FATAL;
- goto done;
- }
-
- if (scf_tmpl_get_by_pg_name(smfo->fmri, NULL, pgname, pgtype, pgtmpl,
- 0) == -1) {
- se = smfu_maperr(scf_error());
- goto done;
- }
-
- int e;
- while ((e = scf_tmpl_iter_props(pgtmpl, proptmpl, 0)) == 0) {
- adr_data_t *t = NULL;
- if ((se = create_PropTemplate(proptmpl, locale, &t)) != SE_OK)
- goto done;
- (void) adr_array_add(result, t);
- }
- if (e == -1)
- se = smfu_maperr(scf_error());
-done:
- *ret = result;
- scf_tmpl_prop_destroy(proptmpl);
- scf_tmpl_pg_destroy(pgtmpl);
-
- return (se);
-}
-
-/*ARGSUSED*/
-conerr_t
-interface_Entity_invoke_getPropTemplates(rad_instance_t *inst,
- adr_method_t *meth, adr_data_t **ret, adr_data_t **args, int count,
- adr_data_t **error)
-{
- radarg_t ra = { .inst = inst, .args = args };
- return (smfu_rtrun(rt_invoke_getPropTemplates, &ra, ret, error));
-}
--- a/components/visual-panels/smf/src/cmd/rad/mod/smf/datatype.c Mon Oct 28 17:52:58 2013 -0700
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,739 +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) 2011, 2012, Oracle and/or its affiliates. All rights reserved.
- */
-
-#include <sys/list.h>
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <string.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <stddef.h>
-#include <unistd.h>
-#include <fcntl.h>
-#include <assert.h>
-#include <limits.h>
-
-#include <libscf.h>
-#include <libscf_priv.h>
-
-#include <rad/adr.h>
-#include <rad/rad_modapi.h>
-
-#include "api_smf.h"
-#include "rhandle.h"
-#include "smfutil.h"
-#include "datatype.h"
-
-/*
- * Routines for creating ADR data objects from SCF types or objects.
- * Consumed by the API entry points.
- */
-
-adr_data_t *
-create_SMFState(const char *state)
-{
- if (strcmp(state, SCF_STATE_STRING_UNINIT) == 0) {
- return (&e__SMFState_UNINIT);
- } else if (strcmp(state, SCF_STATE_STRING_MAINT) == 0) {
- return (&e__SMFState_MAINT);
- } else if (strcmp(state, SCF_STATE_STRING_LEGACY) == 0) {
- return (&e__SMFState_LEGACY);
- } else {
- return (adr_data_new_enum_byname(&t__SMFState, state));
- }
-}
-
-static adr_data_t *
-create_DepGrouping(const char *grouping)
-{
- if (strcmp(grouping, SCF_DEP_REQUIRE_ALL) == 0)
- return (&e__DepGrouping_REQUIRE_ALL);
- else if (strcmp(grouping, SCF_DEP_REQUIRE_ANY) == 0)
- return (&e__DepGrouping_REQUIRE_ANY);
- else if (strcmp(grouping, SCF_DEP_EXCLUDE_ALL) == 0)
- return (&e__DepGrouping_EXCLUDE_ALL);
- else if (strcmp(grouping, SCF_DEP_OPTIONAL_ALL) == 0)
- return (&e__DepGrouping_OPTIONAL_ALL);
- return (NULL);
-}
-
-static adr_data_t *
-create_DepRestart(const char *restarton)
-{
- if (strcmp(restarton, SCF_DEP_RESET_ON_ERROR) == 0)
- return (&e__DepRestart_ERROR);
- if (strcmp(restarton, SCF_DEP_RESET_ON_RESTART) == 0)
- return (&e__DepRestart_RESTART);
- if (strcmp(restarton, SCF_DEP_RESET_ON_REFRESH) == 0)
- return (&e__DepRestart_REFRESH);
- if (strcmp(restarton, SCF_DEP_RESET_ON_NONE) == 0)
- return (&e__DepRestart_NONE);
- return (NULL);
-}
-
-static adr_data_t *
-create_PropertyType(scf_type_t type)
-{
- adr_data_t *result = adr_data_new_enum(&t__PropertyType, type);
- assert(result != NULL);
- return (result);
-}
-
-scf_type_t
-from_PropertyType(adr_data_t *type)
-{
- return (adr_enum_tovalue(type));
-}
-
-static adr_data_t *
-create_PropertyVisibility(uint8_t visibility)
-{
- switch (visibility) {
- case SCF_TMPL_VISIBILITY_HIDDEN:
- return (&e__PropertyVisibility_HIDDEN);
- case SCF_TMPL_VISIBILITY_READONLY:
- return (&e__PropertyVisibility_READONLY);
- case SCF_TMPL_VISIBILITY_READWRITE:
- return (&e__PropertyVisibility_READWRITE);
- }
- return (NULL);
-}
-
-/*
- * Creates a Dependency object.
- *
- * A return value of SE_NOTFOUND implies that the property group wasn't
- * a dependency and should be skipped.
- */
-svcerr_t
-create_Dependency(scf_handle_t *scfhandle, scf_propertygroup_t *pg,
- adr_data_t **ret)
-{
- svcerr_t se = SE_OK;
- char type[max_pgtype + 1];
- char grouping[max_value + 1];
- char restarton[max_value + 1];
- char pgname[max_name + 1];
-
- scf_iter_t *iter = scf_iter_create(scfhandle);
- scf_property_t *prop = scf_property_create(scfhandle);
- scf_value_t *val = scf_value_create(scfhandle);
-
- if (iter == NULL || prop == NULL || val == NULL) {
- se = SE_FATAL;
- goto out;
- }
-
- if (scf_pg_get_name(pg, pgname, sizeof (pgname)) == -1 ||
- scf_pg_get_property(pg, SCF_PROPERTY_GROUPING, prop) != 0 ||
- scf_property_get_value(prop, val) != 0 ||
- scf_value_get_as_string(val, grouping, sizeof (grouping)) == -1 ||
- scf_pg_get_property(pg, SCF_PROPERTY_RESTART_ON, prop) != 0 ||
- scf_property_get_value(prop, val) != 0 ||
- scf_value_get_as_string(val, restarton, sizeof (restarton)) == -1 ||
- scf_pg_get_property(pg, SCF_PROPERTY_ENTITIES, prop) != 0 ||
- scf_iter_property_values(iter, prop) != 0) {
- se = smfu_maperr(scf_error());
- goto out;
- }
-
- adr_data_t *group = create_DepGrouping(grouping);
- adr_data_t *restart = create_DepRestart(restarton);
- if (group == NULL || restart == NULL) {
- se = SE_NOTFOUND;
- goto out;
- }
-
- adr_data_t *result = adr_data_new_struct(&t__Dependency);
- adr_struct_set(result, "name", adr_data_new_string(pgname, LT_COPY));
- adr_struct_set(result, "grouping", group);
- adr_struct_set(result, "restartOn", restart);
- adr_data_t *array = adr_data_new_array(&adr_t_array_string, 5);
- adr_struct_set(result, "target", array);
-
- while (scf_iter_next_value(iter, val) > 0) {
- if (scf_value_get_as_string(val, type, sizeof (type)) == -1) {
- se = smfu_maperr(scf_error());
- adr_data_free(result);
- goto out;
- }
- (void) adr_array_add(array, adr_data_new_string(type, LT_COPY));
- }
- if (!adr_data_verify(result, NULL, B_TRUE)) {
- se = SE_FATAL;
- adr_data_free(result);
- goto out;
- }
-
- *ret = result;
-out:
- scf_value_destroy(val);
- scf_property_destroy(prop);
- scf_iter_destroy(iter);
- return (se);
-}
-
-/*
- * Creates a Manpage object.
- *
- * A return value of SE_NOTFOUND implies that the property group wasn't
- * a man page and should be skipped.
- */
-svcerr_t
-create_Manpage(scf_handle_t *scfhandle, scf_propertygroup_t *pg,
- adr_data_t **ret)
-{
- char manpath[max_value + 1];
- char section[max_value + 1];
- char title[max_name + 1];
- char pgname[max_name + 1];
- svcerr_t se = SE_OK;
-
- if (scf_pg_get_name(pg, pgname, sizeof (pgname)) == -1)
- return (smfu_maperr(scf_error()));
-
- if (strncmp(SCF_PG_TM_MAN_PREFIX, pgname,
- strlen(SCF_PG_TM_MAN_PREFIX)) != 0)
- return (SE_NOTFOUND);
-
-
- scf_property_t *prop = scf_property_create(scfhandle);
- scf_value_t *val = scf_value_create(scfhandle);
-
- if (prop == NULL || val == NULL) {
- se = SE_FATAL;
- goto out;
- }
-
- if (scf_pg_get_property(pg, SCF_PROPERTY_TM_MANPATH, prop) != 0 ||
- scf_property_get_value(prop, val) != 0 ||
- scf_value_get_as_string(val, manpath, sizeof (manpath)) == -1 ||
- scf_pg_get_property(pg, SCF_PROPERTY_TM_TITLE, prop) != 0 ||
- scf_property_get_value(prop, val) != 0 ||
- scf_value_get_as_string(val, title, sizeof (title)) == -1 ||
- scf_pg_get_property(pg, SCF_PROPERTY_TM_SECTION, prop) != 0 ||
- scf_property_get_value(prop, val) != 0 ||
- scf_value_get_as_string(val, section, sizeof (section)) == -1) {
- se = smfu_maperr(scf_error());
- goto out;
- }
-
- adr_data_t *result = adr_data_new_struct(&t__Manpage);
- adr_struct_set(result, "title", adr_data_new_string(title, LT_COPY));
- adr_struct_set(result, "section",
- adr_data_new_string(section, LT_COPY));
- if (strcmp(manpath, ":default") != 0) {
- adr_data_t *mp = adr_data_new_string(manpath, LT_COPY);
- if (mp == NULL) {
- se = SE_FATAL;
- adr_data_free(result);
- goto out;
- }
- adr_struct_set(result, "path",
- adr_data_new_string(manpath, LT_COPY));
- }
-
- if (!adr_data_verify(result, NULL, B_TRUE)) {
- se = SE_FATAL;
- adr_data_free(result);
- goto out;
- }
-
- *ret = result;
-out:
- scf_value_destroy(val);
- scf_property_destroy(prop);
- return (se);
-}
-
-/*
- * Creates a Doclink object.
- *
- * A return value of SE_NOTFOUND implies that the property group wasn't
- * a doclink and should be skipped.
- */
-svcerr_t
-create_Doclink(scf_handle_t *scfhandle, scf_propertygroup_t *pg,
- adr_data_t **ret)
-{
- char name[max_value + 1];
- char uri[max_value + 1];
- char pgname[max_name + 1];
- svcerr_t se = SE_OK;
-
- if (scf_pg_get_name(pg, pgname, sizeof (pgname)) == -1)
- return (smfu_maperr(scf_error()));
-
- if (strncmp(SCF_PG_TM_DOC_PREFIX, pgname,
- strlen(SCF_PG_TM_DOC_PREFIX)) != 0)
- return (SE_NOTFOUND);
-
- scf_property_t *prop = scf_property_create(scfhandle);
- scf_value_t *val = scf_value_create(scfhandle);
-
- if (prop == NULL || val == NULL) {
- se = SE_FATAL;
- goto out;
- }
-
- if (scf_pg_get_property(pg, SCF_PROPERTY_TM_NAME, prop) != 0 ||
- scf_property_get_value(prop, val) != 0 ||
- scf_value_get_as_string(val, name, sizeof (name)) == -1 ||
- scf_pg_get_property(pg, SCF_PROPERTY_TM_URI, prop) != 0 ||
- scf_property_get_value(prop, val) != 0 ||
- scf_value_get_as_string(val, uri, sizeof (uri)) == -1) {
- se = smfu_maperr(scf_error());
- goto out;
- }
-
- adr_data_t *result = adr_data_new_struct(&t__Doclink);
- adr_struct_set(result, "name", adr_data_new_string(name, LT_COPY));
- adr_struct_set(result, "uri", adr_data_new_string(uri, LT_COPY));
-
- if (!adr_data_verify(result, NULL, B_TRUE)) {
- se = SE_FATAL;
- adr_data_free(result);
- goto out;
- }
-
- *ret = result;
-out:
- scf_value_destroy(val);
- scf_property_destroy(prop);
- return (se);
-}
-
-svcerr_t
-create_PropertyGroup(scf_propertygroup_t *pg, adr_data_t **ret)
-{
- char name[max_value + 1];
- char type[max_pgtype + 1];
- uint32_t flags;
- svcerr_t se = SE_OK;
-
- if (scf_pg_get_name(pg, name, sizeof (name)) == -1 ||
- scf_pg_get_type(pg, type, sizeof (type)) == -1 ||
- scf_pg_get_flags(pg, &flags) == -1) {
- se = smfu_maperr(scf_error());
- goto out;
- }
-
- adr_data_t *result = adr_data_new_struct(&t__PropertyGroup);
- adr_struct_set(result, "name", adr_data_new_string(name, LT_COPY));
- adr_struct_set(result, "type", adr_data_new_string(type, LT_COPY));
- adr_struct_set(result, "flags", adr_data_new_uinteger(flags));
-
- if (!adr_data_verify(result, NULL, B_TRUE)) {
- se = SE_FATAL;
- adr_data_free(result);
- goto out;
- }
-
- *ret = result;
-out:
- return (se);
-}
-
-svcerr_t
-create_Property(scf_property_t *prop, scf_iter_t *iter, scf_value_t *value,
- adr_data_t **ret, adr_data_t **error)
-{
- char name[max_name + 1];
- scf_type_t type;
-
- if (scf_property_get_name(prop, name, sizeof (name)) == -1 ||
- scf_property_type(prop, &type) == -1 ||
- scf_iter_property_values(iter, prop))
- return (smfu_maperr(scf_error()));
-
- adr_data_t *values = adr_data_new_array(&adr_t_array_string, 5);
- int err;
- while ((err = scf_iter_next_value(iter, value)) > 0) {
- char *valstr;
- if (smfu_value_get_string(value, &valstr) != 0) {
- adr_data_free(values);
- return (SE_FATAL);
- }
- (void) adr_array_add(values,
- adr_data_new_string(valstr, LT_FREE));
- }
- if (err != 0) {
- if (scf_error() == SCF_ERROR_PERMISSION_DENIED)
- return (error_scf(error, &e__ErrorCode_DENIED, NULL,
- NULL, NULL));
- else
- return (smfu_maperr(scf_error()));
- }
-
- adr_data_t *result = adr_data_new_struct(&t__Property);
- adr_struct_set(result, "name", adr_data_new_string(name, LT_COPY));
- adr_struct_set(result, "type", create_PropertyType(type));
- adr_struct_set(result, "values", values);
- *ret = result;
-
- return (SE_OK);
-}
-
-svcerr_t
-create_Properties(scf_handle_t *scfhandle, scf_propertygroup_t *pg,
- adr_data_t **ret, adr_data_t **error)
-{
- svcerr_t se = SE_OK;
- scf_iter_t *piter = scf_iter_create(scfhandle);
- scf_iter_t *viter = scf_iter_create(scfhandle);
- scf_value_t *value = scf_value_create(scfhandle);
- scf_property_t *prop = scf_property_create(scfhandle);
- adr_data_t *result = adr_data_new_array(&t_array__Property, 5);
-
- if (piter == NULL || viter == NULL || value == NULL || prop == NULL) {
- se = SE_FATAL;
- goto out;
- }
-
- if (scf_iter_pg_properties(piter, pg) == -1) {
- se = smfu_maperr(scf_error());
- goto out;
- }
-
- int err;
- while ((err = scf_iter_next_property(piter, prop)) > 0) {
- adr_data_t *propdata = NULL;
- if ((se = create_Property(prop, viter, value, &propdata,
- error)) != SE_OK)
- goto out;
- (void) adr_array_add(result, propdata);
- }
- if (err != 0)
- se = smfu_maperr(scf_error());
-
-out:
- if (se != SE_OK)
- adr_data_free(result);
- else
- *ret = result;
-
- scf_iter_destroy(piter);
- scf_iter_destroy(viter);
- scf_value_destroy(value);
- scf_property_destroy(prop);
-
- return (se);
-}
-
-svcerr_t
-create_ExtendedState(scf_handle_t *scfhandle, scf_instance_t *instance,
- adr_data_t **ret)
-{
- scf_propertygroup_t *pg = scf_pg_create(scfhandle);
- scf_property_t *prop = scf_property_create(scfhandle);
- scf_value_t *value = scf_value_create(scfhandle);
- adr_data_t *result = adr_data_new_struct(&t__ExtendedState);
- svcerr_t se = SE_FATAL;
- int serr;
- adr_data_t *dstr;
- char *str;
- int64_t sec;
- int32_t nsec;
- uint64_t ctid;
- uint8_t bool;
-
- if (pg == NULL || prop == NULL || value == NULL)
- goto error;
-
- if (scf_instance_get_pg(instance, SCF_PG_RESTARTER, pg) == -1)
- goto scferror;
-
- if (scf_pg_get_property(pg, SCF_PROPERTY_STATE, prop) == -1 ||
- scf_property_get_value(prop, value) == -1)
- goto scferror;
- if (smfu_value_get_string(value, &str) != 0)
- goto error;
- adr_struct_set(result, "state", create_SMFState(str));
- free(str);
-
- if (scf_pg_get_property(pg, SCF_PROPERTY_NEXT_STATE, prop) == -1 ||
- scf_property_get_value(prop, value) == -1)
- goto scferror;
- if (smfu_value_get_string(value, &str) != 0)
- goto error;
- adr_struct_set(result, "nextState", create_SMFState(str));
- free(str);
-
- if (scf_pg_get_property(pg, SCF_PROPERTY_AUX_STATE, prop) == -1 ||
- scf_property_get_value(prop, value) == -1)
- goto scferror;
- if (smfu_value_get_string(value, &str) != 0)
- goto error;
- if ((dstr = adr_data_new_string(str, LT_FREE)) == NULL)
- goto error;
- adr_struct_set(result, "auxstate", dstr);
-
- if (scf_pg_get_property(pg, SCF_PROPERTY_STATE_TIMESTAMP, prop) == -1 ||
- scf_property_get_value(prop, value) == -1 ||
- scf_value_get_time(value, &sec, &nsec) == -1)
- goto scferror;
- adr_struct_set(result, "stime", adr_data_new_time(sec, nsec));
-
- if (scf_pg_get_property(pg, SCF_PROPERTY_CONTRACT, prop) == -1 ||
- scf_property_get_value(prop, value) == -1) {
- if (scf_error() == SCF_ERROR_NOT_FOUND)
- adr_struct_set(result, "contractid",
- adr_data_new_integer(-1));
- else
- goto scferror;
- } else if (scf_value_get_count(value, &ctid) == -1) {
- goto scferror;
- } else {
- adr_struct_set(result, "contractid",
- adr_data_new_integer(ctid <= INT_MAX ? ctid : -1));
- }
-
- if ((serr = smfu_read_enabled(instance, pg, prop, value, SCF_PG_GENERAL,
- &bool)) != 0) {
- se = smfu_maperr(serr);
- goto error;
- }
- adr_data_t *persist = adr_data_new_boolean(bool > 0);
- adr_struct_set(result, "enabled", persist);
-
- if ((serr = smfu_read_enabled(instance, pg, prop, value,
- SCF_PG_GENERAL_OVR, &bool)) == 0) {
- adr_struct_set(result, "enabled_temp",
- adr_data_new_boolean(bool > 0));
- } else if (serr == SCF_ERROR_NOT_FOUND) {
- adr_struct_set(result, "enabled_temp", adr_data_ref(persist));
- } else {
- se = smfu_maperr(serr);
- goto error;
- }
-
- *ret = result;
-
- return (SE_OK);
-
-scferror:
- se = smfu_maperr(scf_error());
-error:
- adr_data_free(result);
- return (se);
-}
-
-svcerr_t
-create_PGTemplate(scf_pg_tmpl_t *pgtmpl, const char *locale, adr_data_t **ret)
-{
- adr_data_t *pt = adr_data_new_struct(&t__PGTemplate);
- adr_data_t *dstr;
- char *str;
- svcerr_t se = SE_FATAL;
-
- if (scf_tmpl_pg_name(pgtmpl, &str) == -1)
- goto scferror;
- adr_struct_set(pt, "pgname", adr_data_new_string(str, LT_FREE));
-
- if (scf_tmpl_pg_type(pgtmpl, &str) == -1)
- goto scferror;
- adr_struct_set(pt, "pgtype", adr_data_new_string(str, LT_FREE));
-
- if (scf_tmpl_pg_common_name(pgtmpl, locale, &str) == -1) {
- if (scf_error() != SCF_ERROR_NOT_FOUND)
- goto scferror;
- } else {
- if ((dstr = adr_data_new_string(str, LT_FREE)) == NULL)
- goto error;
- adr_struct_set(pt, "name", dstr);
- }
-
- if (scf_tmpl_pg_description(pgtmpl, locale, &str) == -1) {
- if (scf_error() != SCF_ERROR_NOT_FOUND)
- goto scferror;
- } else {
- if ((dstr = adr_data_new_string(str, LT_FREE)) == NULL)
- goto error;
- adr_struct_set(pt, "description", dstr);
- }
-
- uint8_t req;
- if (scf_tmpl_pg_required(pgtmpl, &req) == -1) {
- if (scf_error() != SCF_ERROR_NOT_FOUND)
- goto scferror;
- req = 0;
- }
- adr_struct_set(pt, "required", adr_data_new_boolean(req > 0));
-
- *ret = pt;
- return (SE_OK);
-
-scferror:
- se = smfu_maperr(scf_error());
-error:
- adr_data_free(pt);
- return (se);
-}
-
-svcerr_t
-create_PropTemplate(scf_prop_tmpl_t *proptmpl, const char *locale,
- adr_data_t **ret)
-{
- adr_data_t *pt = adr_data_new_struct(&t__PropTemplate);
- adr_data_t *dstr;
- char *str;
- svcerr_t se = SE_FATAL;
-
- if (scf_tmpl_prop_name(proptmpl, &str) == -1)
- goto error;
- adr_struct_set(pt, "propname", adr_data_new_string(str, LT_FREE));
-
- scf_type_t type;
- if (scf_tmpl_prop_type(proptmpl, &type) == -1) {
- if (scf_error() != SCF_ERROR_NOT_FOUND)
- goto scferror;
- type = SCF_TYPE_INVALID;
- }
- adr_struct_set(pt, "proptype", create_PropertyType(type));
-
- if (scf_tmpl_prop_common_name(proptmpl, locale, &str) == -1) {
- if (scf_error() != SCF_ERROR_NOT_FOUND)
- goto scferror;
- } else {
- if ((dstr = adr_data_new_string(str, LT_FREE)) == NULL)
- goto error;
- adr_struct_set(pt, "name", dstr);
- }
-
- if (scf_tmpl_prop_description(proptmpl, locale, &str) == -1) {
- if (scf_error() != SCF_ERROR_NOT_FOUND)
- goto scferror;
- } else {
- if ((dstr = adr_data_new_string(str, LT_FREE)) == NULL)
- goto error;
- adr_struct_set(pt, "description", dstr);
- }
-
- if (scf_tmpl_prop_units(proptmpl, locale, &str) == -1) {
- if (scf_error() != SCF_ERROR_NOT_FOUND)
- goto scferror;
- } else {
- if ((dstr = adr_data_new_string(str, LT_FREE)) == NULL)
- goto error;
- adr_struct_set(pt, "units", dstr);
- }
-
- uint8_t req;
- if (scf_tmpl_prop_required(proptmpl, &req) == -1) {
- if (scf_error() != SCF_ERROR_NOT_FOUND)
- goto scferror;
- req = 0;
- }
- adr_struct_set(pt, "required", adr_data_new_boolean(req > 0));
-
- uint64_t min, max;
- if (scf_tmpl_prop_cardinality(proptmpl, &min, &max) == -1) {
- if (scf_error() != SCF_ERROR_NOT_FOUND)
- goto scferror;
- min = max = 0;
- }
- adr_struct_set(pt, "cardinality_min", adr_data_new_ulong(min));
- adr_struct_set(pt, "cardinality_max", adr_data_new_ulong(max));
-
- uint8_t vis;
- if (scf_tmpl_prop_visibility(proptmpl, &vis) == -1) {
- if (scf_error() != SCF_ERROR_NOT_FOUND)
- goto scferror;
- vis = SCF_TMPL_VISIBILITY_READWRITE;
- }
- adr_struct_set(pt, "visibility", create_PropertyVisibility(vis));
-
- scf_values_t values;
- if (scf_tmpl_prop_internal_seps(proptmpl, &values) == 0) {
- adr_data_t *array =
- adr_data_new_array(&adr_t_array_string, values.value_count);
- for (int i = 0; i < values.value_count; i++)
- (void) adr_array_add(array, adr_data_new_string(
- values.values_as_strings[i], LT_COPY));
- if (!adr_data_verify(array, NULL, B_TRUE)) {
- adr_data_free(array);
- goto error;
- }
- adr_struct_set(pt, "separators", array);
- scf_values_destroy(&values);
- } else {
- if (scf_error() != SCF_ERROR_NOT_FOUND)
- goto scferror;
- }
-
- *ret = pt;
- return (SE_OK);
-
-scferror:
- se = smfu_maperr(scf_error());
-error:
- adr_data_free(pt);
- return (se);
-}
-
-
-svcerr_t
-create_Instance(scf_instance_t *instance, const char *sname, const char *iname,
- adr_data_t **data, scf_propertygroup_t *pg, scf_property_t *prop,
- scf_value_t *val)
-{
- char statestr[MAX_SCF_STATE_STRING_SZ];
- ssize_t len;
- int64_t seconds;
- int32_t nsec;
-
- if (scf_instance_get_pg(instance, SCF_PG_RESTARTER, pg) != 0)
- return (smfu_maperr(scf_error()));
-
- if (scf_pg_get_property(pg, SCF_PROPERTY_STATE, prop) != 0 ||
- scf_property_get_value(prop, val) != 0 ||
- (len = scf_value_get_as_string(val, statestr,
- MAX_SCF_STATE_STRING_SZ)) == -1) {
- return (smfu_maperr(scf_error()));
- } else if (len > MAX_SCF_STATE_STRING_SZ - 1) {
- return (SE_FATAL);
- }
-
- if (scf_pg_get_property(pg, SCF_PROPERTY_STATE_TIMESTAMP, prop) != 0 ||
- scf_property_get_value(prop, val) != 0 ||
- scf_value_get_time(val, &seconds, &nsec) != 0)
- return (smfu_maperr(scf_error()));
-
- adr_data_t *inst = adr_data_new_struct(&t__Instance);
- adr_struct_set(inst, "fmri",
- adr_data_new_string(smfu_fmri_alloc(sname, iname), LT_FREE));
- adr_struct_set(inst, "objectName",
- adr_data_new_name(smfu_name_alloc(sname, iname)));
- adr_struct_set(inst, "stime", adr_data_new_time(seconds, nsec));
- adr_struct_set(inst, "state", create_SMFState(statestr));
-
- if (!adr_data_verify(inst, NULL, B_TRUE)) {
- adr_data_free(inst);
- return (SE_FATAL);
- }
-
- *data = inst;
- return (SE_OK);
-}
--- a/components/visual-panels/smf/src/cmd/rad/mod/smf/datatype.h Mon Oct 28 17:52:58 2013 -0700
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,67 +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) 2011, 2012, Oracle and/or its affiliates. All rights reserved.
- */
-
-#ifndef _DATATYPE_H
-#define _DATATYPE_H
-
-#include <sys/types.h>
-#include <rad/adr.h>
-#include <rad/rad_modapi.h>
-#include <libscf.h>
-
-#include "smfutil.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-adr_data_t *create_SMFState(const char *);
-scf_type_t from_PropertyType(adr_data_t *);
-
-svcerr_t create_Dependency(scf_handle_t *, scf_propertygroup_t *,
- adr_data_t **);
-svcerr_t create_Manpage(scf_handle_t *, scf_propertygroup_t *, adr_data_t **);
-svcerr_t create_Doclink(scf_handle_t *, scf_propertygroup_t *, adr_data_t **);
-
-svcerr_t create_PropertyGroup(scf_propertygroup_t *, adr_data_t **);
-
-svcerr_t create_Property(scf_property_t *, scf_iter_t *, scf_value_t *,
- adr_data_t **, adr_data_t **);
-svcerr_t create_Properties(scf_handle_t *, scf_propertygroup_t *, adr_data_t **,
- adr_data_t **);
-
-svcerr_t create_ExtendedState(scf_handle_t *, scf_instance_t *, adr_data_t **);
-
-svcerr_t create_PGTemplate(scf_pg_tmpl_t *, const char *, adr_data_t **);
-svcerr_t create_PropTemplate(scf_prop_tmpl_t *, const char *, adr_data_t **);
-
-svcerr_t create_Instance(scf_instance_t *, const char *, const char *,
- adr_data_t **, scf_propertygroup_t *, scf_property_t *, scf_value_t *);
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* _DATATYPE_H */
--- a/components/visual-panels/smf/src/cmd/rad/mod/smf/instance.c Mon Oct 28 17:52:58 2013 -0700
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,719 +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) 2011, 2012, Oracle and/or its affiliates. All rights reserved.
- */
-
-#include <sys/stat.h>
-#include <fcntl.h>
-#include <unistd.h>
-#include <rad/adr.h>
-#include <rad/adr_object.h>
-#include <rad/rad_modapi.h>
-#include <stdio.h>
-#include <errno.h>
-#include <libscf.h>
-#include <libscf_priv.h>
-#include "api_smf.h"
-#include "rhandle.h"
-#include "smfutil.h"
-#include "datatype.h"
-
-/*ARGSUSED*/
-conerr_t
-interface_Instance_read_instance(rad_instance_t *inst, adr_attribute_t *attr,
- adr_data_t **data, adr_data_t **error)
-{
- smfobj_t *smfo = instance_getdata(inst);
- *data = adr_data_new_string(smfo->iname, LT_COPY);
- return (*data == NULL ? ce_nomem : ce_ok);
-}
-
-
-/*ARGSUSED*/
-static svcerr_t
-rt_read_restarter(scf_handle_t *h, void *arg, adr_data_t **ret,
- adr_data_t **error)
-{
- smfobj_t *smfo = arg;
- smfu_entity_t entity = SMFU_ENTITY_INIT;
- svcerr_t se = SE_OK;
- char fmri[max_fmri + 1];
-
- scf_propertygroup_t *pg = scf_pg_create(h);
- scf_property_t *prop = scf_property_create(h);
- scf_value_t *value = scf_value_create(h);
-
- if (pg == NULL || prop == NULL || value == NULL) {
- se = SE_FATAL;
- goto done;
- }
-
- if ((se = smfu_lookup(h, smfo->sname, smfo->iname, &entity)) != SE_OK)
- goto done;
- se = smfu_get_pg_r(h, &entity, SCF_PG_GENERAL, pg);
- if (se != SE_OK)
- goto done;
-
- if (scf_pg_get_property(pg, SCF_PROPERTY_RESTARTER, prop) == -1) {
- if (scf_error() == SCF_ERROR_NOT_FOUND)
- *ret = adr_data_new_string(SCF_SERVICE_STARTD,
- LT_CONST);
- else
- se = smfu_maperr(scf_error());
- goto done;
- }
-
- if (scf_property_get_value(prop, value) == -1 ||
- scf_value_get_as_string(value, fmri, sizeof (fmri)) == -1) {
- se = smfu_maperr(scf_error());
- goto done;
- }
-
- *ret = adr_data_new_string(fmri, LT_COPY);
-
-done:
- scf_value_destroy(value);
- scf_property_destroy(prop);
- scf_pg_destroy(pg);
- smfu_entity_destroy(&entity);
-
- return (se);
-}
-
-/*ARGSUSED*/
-conerr_t
-interface_Instance_read_restarter(rad_instance_t *inst, adr_attribute_t *attr,
- adr_data_t **data, adr_data_t **error)
-{
- return (smfu_rtrun(rt_read_restarter, instance_getdata(inst), data,
- error));
-}
-
-
-/*ARGSUSED*/
-static svcerr_t
-rt_read_enabled(scf_handle_t *h, void *arg, adr_data_t **ret,
- adr_data_t **error)
-{
- smfobj_t *smfo = arg;
- smfu_entity_t entity = SMFU_ENTITY_INIT;
- svcerr_t se = SE_OK;
-
- scf_propertygroup_t *pg = scf_pg_create(h);
- scf_property_t *prop = scf_property_create(h);
- scf_value_t *value = scf_value_create(h);
-
- if (pg == NULL || prop == NULL || value == NULL) {
- se = SE_FATAL;
- goto done;
- }
-
- if ((se = smfu_lookup(h, smfo->sname, smfo->iname, &entity)) != SE_OK)
- goto done;
-
- uint8_t bool;
- scf_error_t serr = smfu_read_enabled(entity.instance, pg, prop,
- value, SCF_PG_GENERAL_OVR, &bool);
- if (serr == SCF_ERROR_NOT_FOUND)
- serr = smfu_read_enabled(entity.instance, pg, prop,
- value, SCF_PG_GENERAL, &bool);
-
- if (serr == 0)
- *ret = adr_data_new_boolean(bool > 0);
- else
- se = smfu_maperr(serr);
-
-done:
- scf_value_destroy(value);
- scf_property_destroy(prop);
- scf_pg_destroy(pg);
- smfu_entity_destroy(&entity);
-
- return (se);
-}
-
-/*ARGSUSED*/
-conerr_t
-interface_Instance_read_enabled(rad_instance_t *inst, adr_attribute_t *attr,
- adr_data_t **data, adr_data_t **error)
-{
- return (smfu_rtrun(rt_read_enabled, instance_getdata(inst), data,
- error));
-}
-
-
-/*ARGSUSED*/
-static svcerr_t
-rt_read_state(scf_handle_t *h, void *arg, adr_data_t **ret, adr_data_t **error)
-{
- smfobj_t *smfo = arg;
- smfu_entity_t entity = SMFU_ENTITY_INIT;
- svcerr_t se = SE_OK;
- char statestr[MAX_SCF_STATE_STRING_SZ];
-
- scf_propertygroup_t *pg = scf_pg_create(h);
- scf_property_t *prop = scf_property_create(h);
- scf_value_t *value = scf_value_create(h);
-
- if (pg == NULL || prop == NULL || value == NULL) {
- se = SE_FATAL;
- goto done;
- }
-
- if ((se = smfu_lookup(h, smfo->sname, smfo->iname, &entity)) != SE_OK)
- goto done;
-
- if (scf_instance_get_pg(entity.instance, SCF_PG_RESTARTER, pg) == -1 ||
- scf_pg_get_property(pg, SCF_PROPERTY_STATE, prop) == -1 ||
- scf_property_get_value(prop, value) == -1 ||
- scf_value_get_as_string(value, statestr, sizeof (statestr)) == -1) {
- se = smfu_maperr(scf_error());
- goto done;
- }
-
- *ret = create_SMFState(statestr);
-done:
- scf_value_destroy(value);
- scf_property_destroy(prop);
- scf_pg_destroy(pg);
- smfu_entity_destroy(&entity);
- return (se);
-}
-
-/*ARGSUSED*/
-conerr_t
-interface_Instance_read_state(rad_instance_t *inst, adr_attribute_t *attr,
- adr_data_t **data, adr_data_t **error)
-{
- return (smfu_rtrun(rt_read_state, instance_getdata(inst), data, error));
-}
-
-
-/*ARGSUSED*/
-static svcerr_t
-rt_read_ex_state(scf_handle_t *h, void *arg, adr_data_t **ret,
- adr_data_t **error)
-{
- smfobj_t *smfo = arg;
- smfu_entity_t entity = SMFU_ENTITY_INIT;
- svcerr_t se = SE_OK;
-
- if ((se = smfu_lookup(h, smfo->sname, smfo->iname, &entity)) != SE_OK)
- return (SE_FATAL);
-
- se = create_ExtendedState(h, entity.instance, ret);
- smfu_entity_destroy(&entity);
- return (se);
-}
-
-/*ARGSUSED*/
-conerr_t
-interface_Instance_read_ex_state(rad_instance_t *inst, adr_attribute_t *attr,
- adr_data_t **data, adr_data_t **error)
-{
- return (smfu_rtrun(rt_read_ex_state, instance_getdata(inst), data,
- error));
-}
-
-
-/*ARGSUSED*/
-static svcerr_t
-rt_read_snapshots(scf_handle_t *h, void *arg, adr_data_t **ret,
- adr_data_t **error)
-{
- smfobj_t *smfo = arg;
- smfu_entity_t entity = SMFU_ENTITY_INIT;
- svcerr_t se = SE_OK;
- char sname[max_name + 1];
-
- scf_snapshot_t *snap = scf_snapshot_create(h);
- scf_iter_t *iter = scf_iter_create(h);
- adr_data_t *rdata = adr_data_new_array(&adr_t_array_string, 6);
-
- if (snap == NULL || iter == NULL) {
- se = SE_FATAL;
- goto done;
- }
-
- if ((se = smfu_lookup(h, smfo->sname, smfo->iname, &entity)) != SE_OK)
- goto done;
-
- if (scf_iter_instance_snapshots(iter, entity.instance) == -1) {
- se = smfu_maperr(scf_error());
- goto done;
- }
-
- int e;
- while ((e = scf_iter_next_snapshot(iter, snap)) > 0) {
- if (scf_snapshot_get_name(snap, sname, sizeof (sname)) == -1) {
- se = smfu_maperr(scf_error());
- goto done;
- }
- (void) adr_array_add(rdata,
- adr_data_new_string(sname, LT_COPY));
- }
- if (e != 0)
- se = smfu_maperr(scf_error());
-
-done:
- smfu_entity_destroy(&entity);
- scf_iter_destroy(iter);
- scf_snapshot_destroy(snap);
- *ret = rdata;
-
- return (se);
-}
-
-/*ARGSUSED*/
-conerr_t
-interface_Instance_read_snapshots(rad_instance_t *inst, adr_attribute_t *attr,
- adr_data_t **data, adr_data_t **error)
-{
- return (smfu_rtrun(rt_read_snapshots, instance_getdata(inst), data,
- error));
-}
-
-
-static svcerr_t
-rt_invoke_readSnapshotPGs(scf_handle_t *h, void *arg, adr_data_t **ret,
- adr_data_t **error)
-{
- radarg_t *ra = arg;
- smfobj_t *smfo = instance_getdata(ra->inst);
- const char *snapname =
- ra->args[0] == NULL ? NULL : adr_data_to_string(ra->args[0]);
- smfu_entity_t entity = SMFU_ENTITY_INIT;
- svcerr_t se = SE_OK;
- scf_error_t serr;
-
- scf_propertygroup_t *pg = scf_pg_create(h);
- scf_iter_t *iter = scf_iter_create(h);
- adr_data_t *result = adr_data_new_array(&t_array__PropertyGroup, 5);
-
- if (pg == NULL || iter == NULL) {
- se = SE_FATAL;
- goto done;
- }
-
- if ((se = smfu_lookup(h, smfo->sname, smfo->iname, &entity)) != SE_OK)
- goto done;
-
- if ((serr = smfu_instance_iter_composed_pgs(h, entity.instance,
- snapname, NULL, iter)) != 0) {
- if (serr == SCF_ERROR_NOT_FOUND)
- se = error_scf(error, &e__ErrorCode_NOTFOUND,
- &e__ErrorTarget_SNAPSHOT, NULL, NULL);
- else
- se = smfu_maperr(serr);
- goto done;
- }
-
- int e;
- while ((e = scf_iter_next_pg(iter, pg)) > 0) {
- adr_data_t *dep;
- if ((se = create_PropertyGroup(pg, &dep)) != SE_OK)
- goto done;
- (void) adr_array_add(result, dep);
- }
- if (e != 0)
- se = smfu_maperr(scf_error());
-
-done:
- *ret = result;
- scf_iter_destroy(iter);
- scf_pg_destroy(pg);
- smfu_entity_destroy(&entity);
- return (se);
-}
-
-/*ARGSUSED*/
-conerr_t
-interface_Instance_invoke_readSnapshotPGs(rad_instance_t *inst,
- adr_method_t *meth, adr_data_t **ret, adr_data_t **args, int count,
- adr_data_t **error)
-{
- radarg_t ra = { .inst = inst, .args = args };
- return (smfu_rtrun(rt_invoke_readSnapshotPGs, &ra, ret, error));
-}
-
-
-static svcerr_t
-rt_invoke_readSnapshotProperties(scf_handle_t *h, void *arg, adr_data_t **ret,
- adr_data_t **error)
-{
- radarg_t *ra = arg;
- smfobj_t *smfo = instance_getdata(ra->inst);
- const char *snapname =
- ra->args[0] == NULL ? NULL : adr_data_to_string(ra->args[0]);
- const char *pgname = adr_data_to_string(ra->args[1]);
- smfu_entity_t entity = SMFU_ENTITY_INIT;
- svcerr_t se = SE_OK;
-
- scf_propertygroup_t *pg = scf_pg_create(h);
-
- if (pg == NULL) {
- se = SE_FATAL;
- goto done;
- }
-
- if ((se = smfu_lookup(h, smfo->sname, smfo->iname, &entity)) != SE_OK)
- goto done;
-
- if ((se = smfu_instance_get_composed_pg(h, entity.instance, snapname,
- pgname, pg, error)) != SE_OK)
- goto done;
-
- se = create_Properties(h, pg, ret, error);
-done:
- scf_pg_destroy(pg);
- smfu_entity_destroy(&entity);
- return (se);
-}
-
-/*ARGSUSED*/
-conerr_t
-interface_Instance_invoke_readSnapshotProperties(rad_instance_t *inst,
- adr_method_t *meth, adr_data_t **ret, adr_data_t **args, int count,
- adr_data_t **error)
-{
- radarg_t ra = { .inst = inst, .args = args };
- return (smfu_rtrun(rt_invoke_readSnapshotProperties, &ra, ret, error));
-}
-
-
-static svcerr_t
-rt_invoke_readSnapshotProperty(scf_handle_t *h, void *arg, adr_data_t **ret,
- adr_data_t **error)
-{
- radarg_t *ra = arg;
- smfobj_t *smfo = instance_getdata(ra->inst);
- const char *snapname =
- ra->args[0] == NULL ? NULL : adr_data_to_string(ra->args[0]);
- const char *pgname = adr_data_to_string(ra->args[1]);
- const char *propname = adr_data_to_string(ra->args[2]);
- smfu_entity_t entity = SMFU_ENTITY_INIT;
- svcerr_t se = SE_OK;
-
- scf_propertygroup_t *pg = scf_pg_create(h);
- scf_property_t *prop = scf_property_create(h);
- scf_iter_t *iter = scf_iter_create(h);
- scf_value_t *value = scf_value_create(h);
-
- if (pg == NULL || prop == NULL || iter == NULL || value == NULL) {
- se = SE_FATAL;
- goto done;
- }
-
- if ((se = smfu_lookup(h, smfo->sname, smfo->iname, &entity)) != SE_OK)
- goto done;
-
- if ((se = smfu_instance_get_composed_pg(h, entity.instance, snapname,
- pgname, pg, error)) != SE_OK)
- goto done;
-
- if (scf_pg_get_property(pg, propname, prop) == -1) {
- if (scf_error() == SCF_ERROR_NOT_FOUND)
- se = error_scf(error, &e__ErrorCode_NOTFOUND,
- &e__ErrorTarget_PROPERTY, propname, NULL);
- else
- se = smfu_maperr(scf_error());
- goto done;
- }
-
- se = create_Property(prop, iter, value, ret, error);
-
-done:
- scf_value_destroy(value);
- scf_iter_destroy(iter);
- scf_property_destroy(prop);
- scf_pg_destroy(pg);
- smfu_entity_destroy(&entity);
- return (se);
-}
-
-/*ARGSUSED*/
-conerr_t
-interface_Instance_invoke_readSnapshotProperty(rad_instance_t *inst,
- adr_method_t *meth, adr_data_t **ret, adr_data_t **args, int count,
- adr_data_t **error)
-{
- radarg_t ra = { .inst = inst, .args = args };
- return (smfu_rtrun(rt_invoke_readSnapshotProperty, &ra, ret, error));
-}
-
-
-/*
- * Custom retry implementation for smf_*_instance() routines.
- */
-static boolean_t
-smf_action(conerr_t *result, adr_data_t **error, int rval)
-{
- if (rval == 0) {
- *result = ce_ok;
- return (B_FALSE);
- }
-
- svcerr_t se = SE_OK;
- switch (scf_error()) {
- case SCF_ERROR_BACKEND_READONLY:
- se = error_scf(error, &e__ErrorCode_READONLY, NULL, NULL, NULL);
- break;
- case SCF_ERROR_PERMISSION_DENIED:
- se = error_scf(error, &e__ErrorCode_DENIED, NULL, NULL, NULL);
- break;
- case SCF_ERROR_CONSTRAINT_VIOLATED:
- se = error_scf(error, &e__ErrorCode_INVALID, NULL, NULL, NULL);
- break;
- default:
- se = smfu_maperr(scf_error());
- }
-
- if (se == SE_NOTFOUND) {
- *result = ce_notfound;
- return (B_FALSE);
- }
-
- if (se == SE_FATAL) {
- (void) internal_error(error, NULL);
- *result = ce_object;
- return (B_FALSE);
- }
-
- return (B_TRUE);
-}
-
-/*ARGSUSED*/
-conerr_t
-interface_Instance_invoke_clear(rad_instance_t *inst, adr_method_t *meth,
- adr_data_t **ret, adr_data_t **args, int count, adr_data_t **error)
-{
- smfobj_t *smfo = instance_getdata(inst);
- /* boolean_t sync = adr_data_to_boolean(args[0]); */
-
- conerr_t res;
- while (smf_action(&res, error, smf_restore_instance(smfo->fmri)))
- ;
- return (res);
-}
-
-/*ARGSUSED*/
-conerr_t
-interface_Instance_invoke_restart(rad_instance_t *inst, adr_method_t *meth,
- adr_data_t **ret, adr_data_t **args, int count, adr_data_t **error)
-{
- smfobj_t *smfo = instance_getdata(inst);
- /* boolean_t sync = adr_data_to_boolean(args[0]); */
-
- conerr_t res;
- while (smf_action(&res, error, smf_restart_instance(smfo->fmri)))
- ;
- return (res);
-}
-
-/*ARGSUSED*/
-conerr_t
-interface_Instance_invoke_refresh(rad_instance_t *inst, adr_method_t *meth,
- adr_data_t **ret, adr_data_t **args, int count, adr_data_t **error)
-{
- smfobj_t *smfo = instance_getdata(inst);
- /* boolean_t sync = adr_data_to_boolean(args[0]); */
-
- conerr_t res;
- while (smf_action(&res, error, smf_refresh_instance(smfo->fmri)))
- ;
- return (res);
-}
-
-/*ARGSUSED*/
-conerr_t
-interface_Instance_invoke_maintain(rad_instance_t *inst, adr_method_t *meth,
- adr_data_t **ret, adr_data_t **args, int count, adr_data_t **error)
-{
- smfobj_t *smfo = instance_getdata(inst);
- boolean_t imm = adr_data_to_boolean(args[0]);
- boolean_t temp = adr_data_to_boolean(args[1]);
- /* boolean_t sync = adr_data_to_boolean(args[2]); */
-
- int flags = 0;
- if (imm)
- flags |= SMF_IMMEDIATE;
- if (temp)
- flags |= SMF_TEMPORARY;
-
- conerr_t res;
- while (smf_action(&res, error,
- smf_maintain_instance(smfo->fmri, flags)))
- ;
- return (res);
-}
-
-/*ARGSUSED*/
-conerr_t
-interface_Instance_invoke_enable(rad_instance_t *inst, adr_method_t *meth,
- adr_data_t **ret, adr_data_t **args, int count, adr_data_t **error)
-{
- smfobj_t *smfo = instance_getdata(inst);
- boolean_t temp = adr_data_to_boolean(args[0]);
- /* boolean_t sync = adr_data_to_boolean(args[1]); */
-
- int flags = 0;
- if (temp)
- flags |= SMF_TEMPORARY;
-
- conerr_t res;
- while (smf_action(&res, error, smf_enable_instance(smfo->fmri, flags)))
- ;
- return (res);
-}
-
-/*ARGSUSED*/
-conerr_t
-interface_Instance_invoke_disable(rad_instance_t *inst, adr_method_t *meth,
- adr_data_t **ret, adr_data_t **args, int count, adr_data_t **error)
-{
- smfobj_t *smfo = instance_getdata(inst);
- boolean_t temp = adr_data_to_boolean(args[0]);
- /* boolean_t sync = adr_data_to_boolean(args[1]); */
-
- int flags = 0;
- if (temp)
- flags |= SMF_TEMPORARY;
-
- conerr_t res;
- while (smf_action(&res, error, smf_disable_instance(smfo->fmri, flags)))
- ;
- return (res);
-}
-
-
-static svcerr_t
-rt_get_logfile(scf_handle_t *h, void *arg, adr_data_t **ret, adr_data_t **error)
-{
- smfobj_t *smfo = arg;
- smfu_entity_t entity = SMFU_ENTITY_INIT;
- svcerr_t se = SE_OK;
-
- scf_propertygroup_t *pg = scf_pg_create(h);
- scf_property_t *prop = scf_property_create(h);
- scf_value_t *value = scf_value_create(h);
- char *logfile;
-
- if (pg == NULL || prop == NULL || value == NULL) {
- se = SE_FATAL;
- goto done;
- }
-
- if ((se = smfu_lookup(h, smfo->sname, smfo->iname, &entity)) != SE_OK)
- goto done;
-
- if (scf_instance_get_pg(entity.instance, SCF_PG_RESTARTER, pg) == -1 ||
- scf_pg_get_property(pg, SCF_PROPERTY_LOGFILE, prop) == -1 ||
- scf_property_get_value(prop, value) == -1) {
- if (scf_error() == SCF_ERROR_NOT_FOUND) {
- se = error_scf(error, &e__ErrorCode_NOTFOUND, NULL,
- NULL, NULL);
- } else {
- se = smfu_maperr(scf_error());
- }
- goto done;
- }
-
- scf_error_t serr = smfu_value_get_string(value, &logfile);
- if (serr != 0) {
- se = smfu_maperr(serr);
- goto done;
- }
-
- *ret = adr_data_new_string(logfile, LT_FREE);
-done:
- scf_pg_destroy(pg);
- scf_property_destroy(prop);
- scf_value_destroy(value);
- smfu_entity_destroy(&entity);
- return (se);
-}
-
-/*ARGSUSED*/
-conerr_t
-interface_Instance_invoke_getLogInfo(rad_instance_t *inst, adr_method_t *meth,
- adr_data_t **ret, adr_data_t **args, int count, adr_data_t **error)
-{
- adr_data_t *logfile = NULL;
- conerr_t ce = smfu_rtrun(rt_get_logfile, instance_getdata(inst),
- &logfile, error);
- if (ce != ce_ok)
- return (ce);
-
- struct stat st;
- if (stat(adr_data_to_string(logfile), &st) != 0) {
- adr_data_free(logfile);
- (void) error_scf(error, &e__ErrorCode_NOTFOUND, NULL, NULL,
- NULL);
- return (ce_object);
- }
-
- int max_size = adr_data_to_integer(args[0]);
- int bsize = max_size >= 0 && max_size < st.st_size ?
- max_size : st.st_size;
-
- char *buffer = malloc(bsize);
- if (buffer == NULL) {
- (void) internal_error(error, NULL);
- adr_data_free(logfile);
- return (ce_object);
- }
-
- int fd;
- if ((fd = open(adr_data_to_string(logfile), O_RDONLY)) == -1) {
- (void) error_scf(error, (errno == EACCES) ?
- &e__ErrorCode_DENIED : &e__ErrorCode_INTERNAL,
- NULL, NULL, NULL);
- adr_data_free(logfile);
- free(buffer);
- return (ce_object);
- }
-
- if (pread(fd, buffer, bsize, st.st_size - bsize) != bsize) {
- (void) internal_error(error, NULL);
- adr_data_free(logfile);
- free(buffer);
- (void) close(fd);
- return (ce_object);
- }
-
- (void) close(fd);
-
- adr_data_t *result = adr_data_new_struct(&t__LogInfo);
- adr_struct_set(result, "name", logfile);
- adr_struct_set(result, "size", adr_data_new_integer(st.st_size));
- adr_struct_set(result, "MTime", adr_data_new_time_ts(&st.st_mtim));
- adr_struct_set(result, "contents",
- adr_data_new_opaque(buffer, bsize, LT_FREE));
-
- if ((*ret = adr_data_purify(result)) == NULL) {
- (void) internal_error(error, NULL);
- return (ce_object);
- }
-
- return (ce_ok);
-}
--- a/components/visual-panels/smf/src/cmd/rad/mod/smf/mod_smf.c Mon Oct 28 17:52:58 2013 -0700
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,422 +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) 2011, 2012, Oracle and/or its affiliates. All rights reserved.
- */
-
-#include <sys/list.h>
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <string.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <stddef.h>
-#include <unistd.h>
-#include <fcntl.h>
-#include <assert.h>
-
-#include <libscf.h>
-#include <libscf_priv.h>
-
-#include <rad/adr.h>
-#include <rad/rad_modapi.h>
-
-#include "api_smf.h"
-#include "rhandle.h"
-#include "smfutil.h"
-#include "datatype.h"
-
-/*
- * The SMF rad module.
- *
- * This module is atypically involved due to the sheer size of the
- * exported API, the complexity of consuming SMF, and the fact
- * the exported API represents a significant abstraction of the
- * underlying functionality.
- *
- * This file (mod_smf.c) contains the rad module linkage, the dynamic
- * namespace callbacks, and the implementation of the master object.
- *
- * smfutil.c and rhandle.c contain a variety of routines that factor
- * common combinations of libscf operations into more manageable
- * chunks.
- *
- * datatype.c contains routines that map a libscf type or object into
- * the appropriate ADR type.
- *
- * common.c contains the implementation of attributes and methods
- * common to instances and services.
- *
- * service.c and instance.c contain the implementation of attributes
- * and methods specific to services and instances, respectively.
- */
-
-/*
- * "Master" object implementation.
- */
-
-struct read_services_data {
- adr_data_t *rsd_result;
- adr_data_t *rsd_insts;
-};
-
-/*
- * Master.service instance iteration callback. Adds the name of the
- * instance to the current service's instance list.
- */
-/*ARGSUSED*/
-static svcerr_t
-read_services_inst_cb(scf_handle_t *scfhandle, scf_instance_t *instance,
- const char *sname, const char *iname, void *arg)
-{
- struct read_services_data *rsd = arg;
-
- assert(rsd->rsd_insts != NULL);
- (void) adr_array_add(rsd->rsd_insts,
- adr_data_new_string(iname, LT_COPY));
-
- return (SE_OK);
-}
-
-/*
- * master.service service iteration callback. Constructs a service and
- * adds it to the list. Stores a pointer to the service's instance
- * list in the iteration data for use by the instance iteration
- * callback.
- */
-/*ARGSUSED*/
-static svcerr_t
-read_services_svc_cb(scf_handle_t *scfhandle, scf_service_t *service,
- const char *sname, void *arg)
-{
- struct read_services_data *rsd = arg;
-
- rsd->rsd_insts = adr_data_new_array(&adr_t_array_string, 5);
-
- adr_data_t *sdata = adr_data_new_struct(&t__Service);
- adr_struct_set(sdata, "fmri",
- adr_data_new_string(smfu_fmri_alloc(sname, NULL), LT_FREE));
- adr_struct_set(sdata, "objectName",
- adr_data_new_name(smfu_name_alloc(sname, NULL)));
- adr_struct_set(sdata, "instances", rsd->rsd_insts);
- (void) adr_array_add(rsd->rsd_result, sdata);
-
- return (SE_OK);
-}
-
-/*ARGSUSED*/
-static svcerr_t
-rt_read_services(scf_handle_t *h, void *arg, adr_data_t **ret,
- adr_data_t **error)
-{
- adr_data_t *result = adr_data_new_array(&t_array__Service, 200);
- struct read_services_data rsd = { result, NULL };
-
- svcerr_t se = smfu_iter_svcs(h, read_services_svc_cb,
- read_services_inst_cb, &rsd);
-
- *ret = result;
- return (se);
-}
-
-/* ARGSUSED */
-conerr_t
-interface_Master_read_services(rad_instance_t *inst, adr_attribute_t *attr,
- adr_data_t **data, adr_data_t **error)
-{
- return (smfu_rtrun(rt_read_services, NULL, data, error));
-}
-
-struct read_instances_data {
- adr_data_t *rid_result;
-
- /*
- * For efficiency, reuse a single set of objects.
- */
- scf_propertygroup_t *rid_pg;
- scf_property_t *rid_prop;
- scf_value_t *rid_val;
-};
-
-/*
- * master.instances instance iteration callback. Constructs an
- * Instance and adds it to the list.
- */
-/*ARGSUSED*/
-static svcerr_t
-read_instances_cb(scf_handle_t *scfhandle, scf_instance_t *instance,
- const char *sname, const char *iname, void *arg)
-{
- if (!scf_instance_is_complete(instance))
- return (SE_OK);
-
- struct read_instances_data *rid = arg;
- svcerr_t se;
-
- adr_data_t *inst = NULL;
- if ((se = create_Instance(instance, sname, iname, &inst,
- rid->rid_pg, rid->rid_prop, rid->rid_val)) == SE_OK)
- (void) adr_array_add(rid->rid_result, inst);
-
- return (se == SE_NOTFOUND ? SE_OK : se);
-}
-
-/*
- * master.instances read callback. Iterates over all instances,
- * constructing a list of Instance objects that are returned to the
- * caller.
- */
-/*ARGSUSED*/
-static svcerr_t
-rt_read_instances(scf_handle_t *h, void *arg, adr_data_t **ret,
- adr_data_t **error)
-{
- struct read_instances_data rid;
- svcerr_t se;
-
- rid.rid_pg = scf_pg_create(h);
- rid.rid_prop = scf_property_create(h);
- rid.rid_val = scf_value_create(h);
-
- if (rid.rid_pg == NULL || rid.rid_prop == NULL || rid.rid_val == NULL) {
- se = SE_FATAL;
- goto out;
- }
-
- rid.rid_result = adr_data_new_array(&t_array__Instance, 200);
- se = smfu_iter_svcs(h, NULL, read_instances_cb, &rid);
-
-out:
- scf_value_destroy(rid.rid_val);
- scf_property_destroy(rid.rid_prop);
- scf_pg_destroy(rid.rid_pg);
-
- *ret = rid.rid_result;
- return (se);
-}
-
-/* ARGSUSED */
-conerr_t
-interface_Master_read_instances(rad_instance_t *inst, adr_attribute_t *attr,
- adr_data_t **data, adr_data_t **error)
-{
- return (smfu_rtrun(rt_read_instances, NULL, data, error));
-}
-
-struct listdata {
- adr_name_t *ld_pattern;
- adr_data_t *ld_result;
-};
-
-/*
- * Module linkage & dynamic namespace callbacks.
- */
-
-/*
- * Dynamic list instance iteration callback. Compares the instance with
- * the pattern; if it matches adds the instance's name to the list.
- */
-/*ARGSUSED*/
-static svcerr_t
-list_insts(scf_handle_t *scfhandle, scf_instance_t *instance, const char *sname,
- const char *iname, void *arg)
-{
- if (!scf_instance_is_complete(instance))
- return (SE_OK);
-
- struct listdata *ld = arg;
- adr_name_t *name = smfu_name_alloc(sname, iname);
- if (name == NULL)
- return (SE_FATAL);
-
- if (adr_name_match(name, ld->ld_pattern))
- (void) adr_array_add(ld->ld_result,
- adr_data_new_string(adr_name_tostr(name), LT_FREE));
- adr_name_rele(name);
-
- return (SE_OK);
-}
-
-/*
- * Dynamic list service iteration callback. Compares the service with
- * the pattern; if it matches adds the service's name to the list.
- */
-/*ARGSUSED*/
-static svcerr_t
-list_svcs(scf_handle_t *scfhandle, scf_service_t *service, const char *sname,
- void *arg)
-{
- struct listdata *ld = arg;
- adr_name_t *name = smfu_name_alloc(sname, NULL);
- if (name == NULL)
- return (SE_FATAL);
-
- if (adr_name_match(name, ld->ld_pattern))
- (void) adr_array_add(ld->ld_result,
- adr_data_new_string(adr_name_tostr(name), LT_FREE));
- adr_name_rele(name);
-
- return (SE_OK);
-}
-
-struct arg_listf {
- adr_name_t *pattern;
- boolean_t instance;
-};
-
-/*
- * Dynamic namespace list callback. Iterates over all services or
- * instances, accumulating their object names.
- */
-/*ARGSUSED*/
-static svcerr_t
-rt_listf(scf_handle_t *h, void *arg, adr_data_t **ret, adr_data_t **error)
-{
- struct arg_listf *rtarg = (struct arg_listf *)arg;
- adr_data_t *result = adr_data_new_array(&adr_t_array_string, 300);
- struct listdata ld = { rtarg->pattern, result };
-
- svcerr_t se = smfu_iter_svcs(h, rtarg->instance ? NULL : list_svcs,
- rtarg->instance ? list_insts : NULL, &ld);
-
- *ret = result;
- return (se);
-}
-
-/*
- * Dynamic namespace list handler.
- */
-static conerr_t
-smf_listf(adr_name_t *pattern, adr_data_t **names, void *arg)
-{
- struct arg_listf rtarg = { pattern, (boolean_t)arg };
-
- conerr_t ce = smfu_rtrun(rt_listf, &rtarg, names, NULL);
- return (ce == ce_object ? ce_system : ce);
-}
-
-/*
- * Dynamic namespace lookup handler.
- */
-static conerr_t
-smf_lookupf(adr_name_t **name, rad_instance_t **inst, void *arg)
-{
- const char *sname = adr_name_key(*name, SMF_KEY_SERVICE);
- const char *iname = adr_name_key(*name, SMF_KEY_INSTANCE);
- const char *scope = adr_name_key(*name, SMF_KEY_SCOPE);
- boolean_t instance = (boolean_t)arg;
- int kcount = scope != NULL ? 3 : 2; /* type, service, [scope] */
-
- if (instance) {
- /* Instances must specify an instance */
- if (iname == NULL)
- return (ce_notfound);
- kcount += 1;
- } else {
- /* Services may not specify an instance */
- if (iname != NULL)
- return (ce_notfound);
- }
-
- /* Reject names with bad keys/values */
- if (sname == NULL || kcount != adr_name_nkeys(*name))
- return (ce_notfound);
-
- /*
- * Reject non-localhost scopes and remap localhost scopes to a
- * canonical non-scoped form.
- */
- if (scope != NULL) {
- if (strcmp(scope, SCF_SCOPE_LOCAL) != 0)
- return (ce_notfound);
- adr_name_t *newname = smfu_name_alloc(sname, iname);
- if (newname == NULL)
- return (ce_nomem);
- adr_name_rele(*name);
- *name = newname;
- assert(*inst == NULL);
- return (ce_ok);
- }
-
- /* Fail if the service/instance doesn't exist */
- if (smfu_test(sname, iname) != SE_OK)
- return (ce_notfound);
-
- /* Create and return new rad instance for the service/instance */
-
- smfobj_t *smfo;
- if ((smfo = smfu_obj_alloc(sname, iname)) == NULL)
- return (ce_nomem);
-
- *inst = instance_create(adr_name_hold(*name),
- instance ? &interface_Instance_svr : &interface_Service_svr,
- smfo, (void(*)(void *))smfu_obj_free);
-
- return (ce_ok);
-}
-
-static rad_modinfo_t modinfo = { "smf", "SMF module" };
-
-int
-_rad_init(void *handle)
-{
- adr_name_t *spat, *ipat, *mpat;
-
- if (rad_module_register(handle, RAD_MODVERSION, &modinfo) == -1)
- return (-1);
-
- if (rad_isproxy)
- return (0);
-
- smfu_init();
-
- /*
- * Create singleton, static master object.
- */
-
- mpat = adr_name_vcreate(SMF_DOMAIN, 1, SMF_KEY_TYPE, SMF_TYPE_MASTER);
- rad_instance_t *agg_inst =
- instance_create(mpat, &interface_Master_svr, NULL, NULL);
- if (agg_inst != NULL)
- (void) cont_insert(rad_container, agg_inst, INST_ID_PICK);
-
- /*
- * Register dynamic namespace handlers for services and instances.
- * We must register twice: once for type=service and once for
- * type=instance. We use the same callbacks for both.
- */
- spat = adr_name_vcreate(SMF_DOMAIN, 1, SMF_KEY_TYPE, SMF_TYPE_SERVICE);
- if (spat != NULL) {
- (void) cont_register_dynamic(rad_container, spat, smf_listf,
- smf_lookupf, (void *)B_FALSE);
- adr_name_rele(spat);
- }
-
- ipat = adr_name_vcreate(SMF_DOMAIN, 1, SMF_KEY_TYPE, SMF_TYPE_INSTANCE);
- if (ipat != NULL) {
- (void) cont_register_dynamic(rad_container, ipat, smf_listf,
- smf_lookupf, (void *)B_TRUE);
- adr_name_rele(ipat);
- }
-
- return (0);
-}
--- a/components/visual-panels/smf/src/cmd/rad/mod/smf/rhandle.c Mon Oct 28 17:52:58 2013 -0700
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,110 +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) 2011, 2012, Oracle and/or its affiliates. All rights reserved.
- */
-
-#include <stdlib.h>
-#include <assert.h>
-#include <pthread.h>
-
-#include <libscf.h>
-#include <rad/rad_modapi.h>
-
-#include "rhandle.h"
-
-static pthread_mutex_t handle_lock = PTHREAD_MUTEX_INITIALIZER;
-static rad_handle_t *rhandle;
-
-/*
- * Rebinding a repository handle after the connection is broken
- * requires that we correctly drain all its users, which is difficult.
- * Instead we wrap and reference count the handle, and force callers
- * to re-fetch the latest handle on connection failures.
- */
-
-static scf_handle_t *
-handle_create(void)
-{
- scf_handle_t *h = scf_handle_create(SCF_VERSION);
- if (h == NULL)
- return (NULL);
-
- if (scf_handle_bind(h) == -1) {
- scf_handle_destroy(h);
- return (NULL);
- }
- return (h);
-}
-
-rad_handle_t *
-rh_fetch(void)
-{
- rad_handle_t *rh;
-
- rad_mutex_enter(&handle_lock);
- if (rhandle != NULL) {
- rh = rhandle;
- rh->rh_refs++;
- } else {
- rh = malloc(sizeof (rad_handle_t));
- if (rh == NULL)
- goto out;
- if ((rh->rh_hdl = handle_create()) == NULL) {
- free(rh);
- rh = NULL;
- goto out;
- }
- rh->rh_refs = 1;
- rhandle = rh;
- }
-out:
- rad_mutex_exit(&handle_lock);
-
- return (rh);
-}
-
-void
-rh_rele(rad_handle_t *rh)
-{
- if (rh == NULL)
- return;
-
- rad_mutex_enter(&handle_lock);
- if (--rh->rh_refs == 0 && rhandle != rh) {
- scf_handle_destroy(rh->rh_hdl);
- free(rh);
- }
- rad_mutex_exit(&handle_lock);
-}
-
-void
-rh_kill(rad_handle_t *rh)
-{
- if (rh == NULL)
- return;
-
- rad_mutex_enter(&handle_lock);
- if (rhandle == rh)
- rhandle = NULL;
- rad_mutex_exit(&handle_lock);
-}
--- a/components/visual-panels/smf/src/cmd/rad/mod/smf/rhandle.h Mon Oct 28 17:52:58 2013 -0700
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,63 +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) 2011, 2012, Oracle and/or its affiliates. All rights reserved.
- */
-
-#ifndef _RHANDLE_H
-#define _RHANDLE_H
-
-#include <libscf.h>
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/*
- * A rad_handle_t is a wrapper around a single scf_handle_t that
- * permits sharing it between multiple users and facilitates
- * reconnecting in case svc.configd dies.
- *
- * A caller uses rh_fetch() to get the rad_handle_t. The enclosed
- * scf_handle_t is guaranteed to be valid (though not necessarily
- * functional) until they call rh_rele().
- *
- * If the scf_handle_t doesn't work, the caller should call rh_kill()
- * before calling rh_rele(), and then call rh_fetch() to get a fresh
- * (hopefully working) handle.
- */
-
-typedef struct rad_handle {
- scf_handle_t *rh_hdl; /* handle */
- int rh_refs; /* references */
-} rad_handle_t;
-
-rad_handle_t *rh_fetch(void);
-void rh_rele(rad_handle_t *);
-void rh_kill(rad_handle_t *);
-#define rh_hdl(rh) (rh == NULL ? NULL : rh->rh_hdl)
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* _RHANDLE_H */
--- a/components/visual-panels/smf/src/cmd/rad/mod/smf/service.c Mon Oct 28 17:52:58 2013 -0700
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,97 +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.
- */
-
-#include <stdio.h>
-#include <rad/adr.h>
-#include <rad/adr_object.h>
-#include <rad/rad_modapi.h>
-
-#include "api_smf.h"
-#include "smfutil.h"
-#include "rhandle.h"
-
-/*
- * service.instances read callback. Looks up the service, iterates
- * over its instances, stores their names in an array, and returns the
- * array to the caller.
- */
-/*ARGSUSED*/
-static svcerr_t
-rt_read_instances(scf_handle_t *h, void *arg, adr_data_t **ret,
- adr_data_t **error)
-{
- smfobj_t *smfo = arg;
- char iname[max_name + 1];
- svcerr_t se;
- smfu_entity_t entity = SMFU_ENTITY_INIT;
- adr_data_t *array = adr_data_new_array(&adr_t_array_string, 5);
-
- scf_instance_t *instance = scf_instance_create(h);
- scf_iter_t *iter = scf_iter_create(h);
-
- if (instance == NULL || iter == NULL) {
- se = SE_FATAL;
- goto done;
- }
-
- if ((se = smfu_lookup(h, smfo->sname, NULL, &entity)) != SE_OK)
- goto done;
-
- if (scf_iter_service_instances(iter, entity.service) != 0) {
- se = smfu_maperr(scf_error());
- goto done;
- }
-
- int err;
- while ((err = scf_iter_next_instance(iter, instance)) > 0) {
- if (scf_instance_get_name(instance, iname,
- sizeof (iname)) == -1) {
- se = smfu_maperr(scf_error());
- goto done;
- }
- (void) adr_array_add(array,
- adr_data_new_string(iname, LT_COPY));
- }
-
- if (err != 0)
- se = smfu_maperr(scf_error());
-
-done:
- smfu_entity_destroy(&entity);
- scf_instance_destroy(instance);
- scf_iter_destroy(iter);
-
- *ret = array;
- return (se);
-}
-
-/*ARGSUSED*/
-conerr_t
-interface_Service_read_instances(rad_instance_t *inst, adr_attribute_t *attr,
- adr_data_t **data, adr_data_t **error)
-{
- return (smfu_rtrun(rt_read_instances, instance_getdata(inst), data,
- error));
-}
--- a/components/visual-panels/smf/src/cmd/rad/mod/smf/smfutil.c Mon Oct 28 17:52:58 2013 -0700
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,684 +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) 2011, 2012, Oracle and/or its affiliates. All rights reserved.
- */
-
-#include <sys/list.h>
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <string.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <stddef.h>
-#include <unistd.h>
-#include <fcntl.h>
-#include <assert.h>
-
-#include <libscf.h>
-#include <libscf_priv.h>
-
-#include <rad/adr.h>
-#include <rad/rad_modapi.h>
-
-#include "api_smf.h"
-#include "rhandle.h"
-#include "smfutil.h"
-
-/* Shared with other files */
-ssize_t max_fmri;
-ssize_t max_name;
-ssize_t max_value;
-ssize_t max_pgtype;
-
-svcerr_t
-error_scf(adr_data_t **error, adr_data_t *code, adr_data_t *target,
- const char *aux, const char *msg)
-{
- assert(adr_data_type(code) == &t__ErrorCode);
- assert(target == NULL || adr_data_type(target) == &t__ErrorTarget);
-
- if (error != NULL) {
- adr_data_t *e = adr_data_new_struct(&t__SmfError);
- adr_struct_set(e, "error", code);
- adr_struct_set(e, "target", target == NULL ?
- &e__ErrorTarget_NONE : target);
- if (aux != NULL)
- adr_struct_set(e, "aux",
- adr_data_new_string(aux, LT_COPY));
- if (msg != NULL)
- adr_struct_set(e, "message",
- adr_data_new_string(msg, LT_COPY));
- *error = adr_data_purify(e);
- }
- return (SE_FATAL);
-}
-
-svcerr_t
-internal_error(adr_data_t **error, const char *msg)
-{
- return (error_scf(error, &e__ErrorCode_INTERNAL, NULL, NULL, msg));
-}
-
-/*
- * Generic error-mapping routine.
- *
- * Maps connection errors to SE_RECONNECT, deletions to SE_RETRY,
- * notfound to SE_NOTFOUND, and everything else to SE_FATAL.
- */
-svcerr_t
-smfu_maperr(scf_error_t e)
-{
- switch (e) {
- case SCF_ERROR_DELETED:
- return (SE_RETRY);
- case SCF_ERROR_NO_SERVER:
- case SCF_ERROR_NOT_BOUND:
- case SCF_ERROR_CONNECTION_BROKEN:
- return (SE_RECONNECT);
- case SCF_ERROR_NOT_FOUND:
- return (SE_NOTFOUND);
- default:
- return (SE_FATAL);
- }
-}
-
-
-/*
- * Reads the specified instance's "enabled" property from the named
- * property group. Returns an error code or 0 on success.
- */
-scf_error_t
-smfu_read_enabled(scf_instance_t *inst, scf_propertygroup_t *pg,
- scf_property_t *prop, scf_value_t *value, const char *pgname, uint8_t *bool)
-{
- if (scf_instance_get_pg(inst, pgname, pg) == -1 ||
- scf_pg_get_property(pg, SCF_PROPERTY_ENABLED, prop) == -1 ||
- scf_property_get_value(prop, value) == -1 ||
- scf_value_get_boolean(value, bool) == -1)
- return (scf_error());
- return (0);
-}
-
-/*
- * Gets a value as a string, allocating the necessary buffer and
- * returning it in *strp. Returns an error code or 0 on success.
- */
-scf_error_t
-smfu_value_get_string(scf_value_t *val, char **strp)
-{
- ssize_t len, l;
- char *s = NULL;
-
- len = scf_value_get_as_string(val, NULL, 0);
- for (; len != -1; len = l) {
- s = malloc(len + 1);
- if (s == NULL)
- return (SCF_ERROR_NO_MEMORY);
-
- l = scf_value_get_as_string(val, s, len + 1);
- if (l == len) {
- *strp = s;
- return (0);
- }
- free(s);
- }
-
- return (scf_error());
-}
-
-/*
- * Gets the named pg in the composed view of the named snapshot. If
- * snapname is not specified, the current pgs/properties are returned.
- * The caller must allocate the pg. Returns an error code or SE_OK
- * on success.
- */
-svcerr_t
-smfu_instance_get_composed_pg(scf_handle_t *handle, scf_instance_t *instance,
- const char *snapname, const char *pgname, scf_propertygroup_t *pg,
- adr_data_t **error)
-{
- svcerr_t se = SE_OK;
- scf_snapshot_t *snap = NULL;
-
- if (snapname != NULL) {
- if ((snap = scf_snapshot_create(handle)) == NULL)
- return (SE_FATAL);
- if (scf_instance_get_snapshot(instance, snapname,
- snap) == -1) {
- if ((se = smfu_maperr(scf_error())) == SE_NOTFOUND)
- (void) error_scf(error, &e__ErrorCode_NOTFOUND,
- &e__ErrorTarget_SNAPSHOT, snapname, NULL);
- scf_snapshot_destroy(snap);
- return (se);
- }
- }
- if (scf_instance_get_pg_composed(instance, snap, pgname,
- pg) == -1) {
- if ((se = smfu_maperr(scf_error())) == SE_NOTFOUND)
- (void) error_scf(error, &e__ErrorCode_NOTFOUND,
- &e__ErrorTarget_PROPERTYGROUP, pgname, NULL);
- }
- if (snap != NULL)
- scf_snapshot_destroy(snap);
- return (se);
-}
-
-/*
- * Wrappers around the scf_iter_{instance,service} routines that take an
- * optional type. Behave like normal scf_* routines on error.
- */
-
-static int
-iter_instance_pgs(scf_iter_t *iter, scf_instance_t *inst, const char *type)
-{
- if (type == NULL)
- return (scf_iter_instance_pgs(iter, inst));
- return (scf_iter_instance_pgs_typed(iter, inst, type));
-}
-
-static int
-iter_instance_pgs_composed(scf_iter_t *iter, scf_instance_t *inst,
- scf_snapshot_t *snap, const char *type)
-{
- if (type == NULL)
- return (scf_iter_instance_pgs_composed(iter, inst, snap));
- return (scf_iter_instance_pgs_typed_composed(iter, inst, snap, type));
-}
-
-static int
-iter_service_pgs(scf_iter_t *iter, scf_service_t *service, const char *type)
-{
- if (type == NULL)
- return (scf_iter_service_pgs(iter, service));
- return (scf_iter_service_pgs_typed(iter, service, type));
-}
-
-
-/*
- * Iterates over pgs in the composed view of the named snapshot. If
- * snapname is not specified, the current pgs/properties are used. A
- * property group type may be specified. Returns an error code or 0
- * on success.
- */
-scf_error_t
-smfu_instance_iter_composed_pgs(scf_handle_t *handle, scf_instance_t *instance,
- const char *snapname, const char *pgtype, scf_iter_t *iter)
-{
- int err = 0;
- scf_snapshot_t *snap = NULL;
- if (snapname != NULL) {
- if ((snap = scf_snapshot_create(handle)) == NULL ||
- scf_instance_get_snapshot(instance, snapname, snap) == -1) {
- err = scf_error();
- goto done;
- }
- }
- if (iter_instance_pgs_composed(iter, instance, snap, pgtype) == -1)
- err = scf_error();
-
-done:
- if (snap != NULL)
- scf_snapshot_destroy(snap);
- return (err);
-}
-
-
-/*
- * Operates like scf_pg_get_property, but takes a fallback property
- * that is returned if the first one isn't found. Behaves like normal
- * scf_* routines on error.
- */
-static int
-smfu_pg_get_fb_prop(scf_propertygroup_t *pg,
- const char *name, const char *fbname, scf_property_t *prop)
-{
- int res = scf_pg_get_property(pg, name, prop);
- if (res != 0 && scf_error() == SCF_ERROR_NOT_FOUND)
- res = scf_pg_get_property(pg, fbname, prop);
- return (res);
-}
-
-/*
- * Reads a string value from a traditionally localized template
- * property group (i.e. description, common name). First tries the
- * specified locale and then falls back to the C locale.
- */
-svcerr_t
-smfu_get_l10n_str(scf_handle_t *handle, scf_propertygroup_t *pg,
- const char *locale, char **result)
-{
- scf_property_t *prop = scf_property_create(handle);
- scf_value_t *value = scf_value_create(handle);
- svcerr_t se = SE_OK;
-
- if (prop == NULL || value == NULL) {
- se = SE_FATAL;
- goto done;
- }
-
- if (smfu_pg_get_fb_prop(pg, locale, "C", prop) != 0 ||
- scf_property_get_value(prop, value) != 0) {
- se = smfu_maperr(scf_error());
- goto done;
- }
-
- scf_error_t serr = smfu_value_get_string(value, result);
- if (serr != 0)
- se = smfu_maperr(serr);
-
-done:
- scf_property_destroy(prop);
- scf_value_destroy(value);
- return (se);
-}
-
-/*
- * Obtains the specified property group of the service/instance
- * identified by "entity". For a service, returns the directly
- * attached property group, for an instance, returns the property group
- * from the composed view of the running snapshot.
- */
-svcerr_t
-smfu_get_pg_r(scf_handle_t *handle, smfu_entity_t *entity, const char *name,
- scf_propertygroup_t *pg)
-{
- svcerr_t se = SE_OK;
-
- if (entity->instance != NULL) {
- se = smfu_instance_get_composed_pg(handle, entity->instance,
- "running", name, pg, NULL);
- } else if (scf_service_get_pg(entity->service, name, pg) != 0) {
- se = smfu_maperr(scf_error());
- }
-
- return (se);
-}
-
-/*
- * Iterates over the property groups, of type "type" if "type" is
- * non-NULL, of the service/instance identified by "entity". For a
- * service, iterates over directly attached property groups, for an
- * instance, iterates over the property groups in the composed view of
- * the running snapshot.
- */
-svcerr_t
-smfu_iter_pg_r(scf_handle_t *handle, smfu_entity_t *entity, const char *type,
- scf_iter_t *iter)
-{
- svcerr_t se = SE_OK;
-
- if (entity->instance != NULL) {
- scf_error_t scferr = smfu_instance_iter_composed_pgs(handle,
- entity->instance, "running", type, iter);
- if (scferr != 0)
- se = smfu_maperr(scferr);
- } else if (iter_service_pgs(iter, entity->service, type) != 0) {
- se = smfu_maperr(scf_error());
- }
-
- return (se);
-}
-
-/*
- * Obtains the specified property group of the service/instance
- * identified by "entity". For both services and instances, returns
- * the directly attached property group.
- */
-svcerr_t
-smfu_get_pg(smfu_entity_t *entity, const char *name,
- scf_propertygroup_t *pg, adr_data_t **error)
-{
- svcerr_t se = SE_OK;
-
- if (entity->instance != NULL) {
- if (scf_instance_get_pg(entity->instance, name, pg) != 0)
- se = smfu_maperr(scf_error());
- } else if (scf_service_get_pg(entity->service, name, pg) != 0) {
- se = smfu_maperr(scf_error());
- }
-
- if (se == SE_NOTFOUND)
- (void) error_scf(error, &e__ErrorCode_NOTFOUND,
- &e__ErrorTarget_PROPERTYGROUP, NULL, NULL);
-
- return (se);
-}
-
-/*
- * Iterates over the property groups, of type "type" if "type" is
- * non-NULL, of the service/instance identified by "entity". For both
- * services and instances, iterates over directly attached property
- * groups.
- */
-svcerr_t
-smfu_iter_pg(smfu_entity_t *entity, const char *type,
- scf_iter_t *iter)
-{
- svcerr_t se = SE_OK;
-
- if (entity->instance != NULL) {
- if (iter_instance_pgs(iter, entity->instance, type) != 0)
- se = smfu_maperr(scf_error());
- } else if (iter_service_pgs(iter, entity->service, type) != 0) {
- se = smfu_maperr(scf_error());
- }
-
- return (se);
-}
-
-/*
- * Iterates over all services and instances on the system. Calls scb()
- * on each service if scb is non-NULL. Calls icb() on each instance if
- * icb is non-NULL.
- */
-svcerr_t
-smfu_iter_svcs(scf_handle_t *h, svc_callback_t scb, inst_callback_t icb,
- void *arg)
-{
- svcerr_t se = SE_OK;
-
- scf_scope_t *scope = scf_scope_create(h);
- scf_iter_t *siter = scf_iter_create(h);
- scf_iter_t *iiter = scf_iter_create(h);
- scf_service_t *service = scf_service_create(h);
- scf_instance_t *instance = scf_instance_create(h);
- char sname[max_name + 1];
- char iname[max_name + 1];
-
- if (scope == NULL || siter == NULL || iiter == NULL ||
- service == NULL || instance == NULL) {
- se = SE_FATAL;
- goto out;
- }
-
- if (scf_handle_get_scope(h, SCF_SCOPE_LOCAL, scope) == -1 ||
- scf_iter_scope_services(siter, scope) == -1) {
- se = smfu_maperr(scf_error());
- goto out;
- }
-
- int e;
- while ((e = scf_iter_next_service(siter, service)) > 0) {
- if (scf_service_get_name(service, sname, sizeof (sname))
- == -1) {
- se = smfu_maperr(scf_error());
- goto out;
- }
- if (scb) {
- if ((se = scb(h, service, sname, arg)) != SE_OK)
- goto out;
- }
-
- if (icb) {
- if (scf_iter_service_instances(iiter, service) == -1) {
- se = smfu_maperr(scf_error());
- goto out;
- }
- while (scf_iter_next_instance(iiter, instance) > 0) {
- if (scf_instance_get_name(instance, iname,
- sizeof (iname)) == -1) {
- se = smfu_maperr(scf_error());
- goto out;
- }
- se = icb(h, instance, sname, iname, arg);
- if (se != SE_OK)
- goto out;
- }
- }
- }
- if (e != 0)
- se = smfu_maperr(scf_error());
-
-out:
- scf_instance_destroy(instance);
- scf_service_destroy(service);
- scf_iter_destroy(iiter);
- scf_iter_destroy(siter);
- scf_scope_destroy(scope);
- return (se == SE_BREAK ? SE_OK : se);
-}
-
-/*
- * Look up an entity based on service and (optional) instance name.
- */
-svcerr_t
-smfu_lookup(scf_handle_t *scfhandle, const char *sname, const char *iname,
- smfu_entity_t *entity)
-{
- svcerr_t se = SE_FATAL;
- scf_scope_t *scope = scf_scope_create(scfhandle);
- scf_service_t *service = scf_service_create(scfhandle);
- scf_instance_t *instance = scf_instance_create(scfhandle);
-
- if (scope == NULL || service == NULL || instance == NULL) {
- se = SE_FATAL;
- goto error;
- }
-
- if (scf_handle_get_scope(scfhandle, SCF_SCOPE_LOCAL, scope) != 0 ||
- scf_scope_get_service(scope, sname, service) != 0) {
- se = smfu_maperr(scf_error());
- goto error;
- }
-
- if (iname != NULL) {
- if (scf_service_get_instance(service, iname, instance) != 0) {
- se = smfu_maperr(scf_error());
- goto error;
- }
- entity->instance = instance;
- }
-
- entity->service = service;
- scf_scope_destroy(scope);
- return (SE_OK);
-
-error:
- scf_instance_destroy(instance);
- scf_service_destroy(service);
- scf_scope_destroy(scope);
-
- if (se == SE_NOTFOUND)
- return (SE_STALE);
- return (se);
-}
-
-/*
- * Free an entity.
- */
-void
-smfu_entity_destroy(smfu_entity_t *entity)
-{
- scf_service_destroy(entity->service);
- scf_instance_destroy(entity->instance);
-}
-
-
-/*
- * Test for the existence of service sname, optionally with instance iname.
- */
-svcerr_t
-smfu_test(const char *sname, const char *iname)
-{
- svcerr_t se;
- do {
- rad_handle_t *rh = rh_fetch();
- if (rh == NULL) {
- se = smfu_maperr(scf_error());
- } else {
- smfu_entity_t entity = SMFU_ENTITY_INIT;
- se = smfu_lookup(rh_hdl(rh), sname, iname, &entity);
- smfu_entity_destroy(&entity);
- }
-
- if (se == SE_RECONNECT)
- rh_kill(rh);
- rh_rele(rh);
- } while (se == SE_RETRY || se == SE_RECONNECT);
-
- return (se);
-}
-
-/*
- * Construct the ADR name for a service/instance.
- */
-adr_name_t *
-smfu_name_alloc(const char *sname, const char *iname)
-{
- if (iname != NULL)
- return (adr_name_vcreate(SMF_DOMAIN, 3,
- SMF_KEY_TYPE, SMF_TYPE_INSTANCE,
- SMF_KEY_SERVICE, sname,
- SMF_KEY_INSTANCE, iname));
- return (adr_name_vcreate(SMF_DOMAIN, 2,
- SMF_KEY_TYPE, SMF_TYPE_SERVICE,
- SMF_KEY_SERVICE, sname));
-}
-
-/*
- * Construct the FMRI for a service/instance.
- */
-char *
-smfu_fmri_alloc(const char *sname, const char *iname)
-{
- char *result = NULL;
- if (iname != NULL)
- (void) asprintf(&result, "svc:/%s:%s", sname, iname);
- else
- (void) asprintf(&result, "svc:/%s", sname);
- return (result);
-}
-
-void
-smfu_obj_free(smfobj_t *obj)
-{
- free(obj->sname);
- free(obj->iname);
- free(obj->fmri);
- free(obj);
-}
-
-smfobj_t *
-smfu_obj_alloc(const char *sname, const char *iname)
-{
- smfobj_t *smfo = rad_zalloc(sizeof (smfobj_t));
- if (smfo == NULL)
- return (NULL);
-
- if ((smfo->sname = strdup(sname)) == NULL ||
- (iname != NULL && (smfo->iname = strdup(iname)) == NULL) ||
- (smfo->fmri = smfu_fmri_alloc(sname, iname)) == NULL) {
- smfu_obj_free(smfo);
- return (NULL);
- }
-
- return (smfo);
-}
-
-
-/*
- * Automatic retry mechanism.
- *
- * Calls cb() repeatedly while it returns SE_RETRY, reconnecting to the
- * repository as necessary.
- *
- * For the convenience of the callback, if a adr_data_t pointer is stored
- * in its result argument on failure it is freed. Also verifies the
- * result on success.
- */
-static conerr_t
-smfu_rtrun_int(smfu_rtfunc_t cb, void *arg, adr_data_t **ret,
- adr_data_t **error, boolean_t nullable)
-{
- svcerr_t se = SE_OK;
- adr_data_t *result = NULL;
-
- do {
- rad_handle_t *rh = rh_fetch();
- if (rh == NULL)
- se = smfu_maperr(scf_error());
- else
- se = cb(rh_hdl(rh), arg, &result, error);
-
- if (se != SE_OK && result != NULL) {
- adr_data_free(result);
- result = NULL;
- }
-
- if (se == SE_RECONNECT)
- rh_kill(rh);
- rh_rele(rh);
- } while (se == SE_RETRY || se == SE_RECONNECT);
-
- assert(ret != NULL || result == NULL);
- if (ret != NULL && se == SE_OK) {
- if ((nullable && result == NULL) ||
- adr_data_verify(result, NULL, B_TRUE)) {
- *ret = result;
- } else {
- adr_data_free(result);
- se = internal_error(error, NULL);
- }
- }
-
- if (se == SE_OK)
- return (ce_ok);
- if (se == SE_STALE)
- return (ce_notfound);
-
- if (se == SE_FATAL || se == SE_NOTFOUND) {
- if (error != NULL && *error == NULL)
- (void) internal_error(error, NULL);
- return (ce_object);
- }
-
- /* Shouldn't be seeing SE_RETRY, SE_RECONNECT, SE_BREAK */
- rad_log(RL_FATAL, "smfu_rtrun: callback returned bad error: %d", se);
- return (ce_system);
-}
-
-conerr_t
-smfu_rtrun_opt(smfu_rtfunc_t cb, void *arg, adr_data_t **ret,
- adr_data_t **error)
-{
- return (smfu_rtrun_int(cb, arg, ret, error, B_TRUE));
-}
-
-conerr_t
-smfu_rtrun(smfu_rtfunc_t cb, void *arg, adr_data_t **ret, adr_data_t **error)
-{
- return (smfu_rtrun_int(cb, arg, ret, error, B_FALSE));
-}
-
-
-void
-smfu_init()
-{
- /*
- * Initialize constants
- */
- max_fmri = scf_limit(SCF_LIMIT_MAX_FMRI_LENGTH);
- max_pgtype = scf_limit(SCF_LIMIT_MAX_PG_TYPE_LENGTH);
- max_name = scf_limit(SCF_LIMIT_MAX_NAME_LENGTH);
- max_value = scf_limit(SCF_LIMIT_MAX_VALUE_LENGTH);
-}
--- a/components/visual-panels/smf/src/cmd/rad/mod/smf/smfutil.h Mon Oct 28 17:52:58 2013 -0700
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,186 +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) 2011, 2012, Oracle and/or its affiliates. All rights reserved.
- */
-
-#ifndef _SMFUTIL_H
-#define _SMFUTIL_H
-
-#include <sys/types.h>
-#include <rad/adr.h>
-#include <rad/rad_modapi.h>
-#include <libscf.h>
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/*
- * SMF object names.
- *
- * All names are in the "com.oracle.solaris.rad.smf" domain.
- *
- * Services have a "type" of "Service", and specify a "service" name.
- *
- * Instances have a "type" of "Instance, and specify both "service" and
- * "instance" names.
- *
- * Both services and instances may specify a "scope". If no scope is
- * specified, localhost is assumed. The canonical object name for an
- * object with a scope of localhost does not specify a scope.
- *
- * A singleton object of "type" "Master" provides aggregate information
- * and operations.
- */
-
-#define SMF_DOMAIN "com.oracle.solaris.rad.smf"
-#define SMF_KEY_TYPE "type"
-#define SMF_TYPE_INSTANCE "Instance"
-#define SMF_TYPE_SERVICE "Service"
-#define SMF_TYPE_MASTER "Master"
-#define SMF_KEY_SCOPE "scope"
-#define SMF_KEY_SERVICE "service"
-#define SMF_KEY_INSTANCE "instance"
-
-/*
- * Error conditions used to manage flow within the SMF module.
- */
-typedef enum svcerr {
- /* Top-level error conditions */
- SE_OK, /* Success */
- SE_FATAL, /* Operation failed */
- SE_NOTFOUND, /* Something not found (fatal if uncaught) */
- SE_STALE, /* Service/instance not found (stale rad instance) */
- SE_RECONNECT, /* Reconnect and retry */
- SE_RETRY, /* Retry w/o reconnecting */
-
- /* Special internal error conditions */
- SE_BREAK /* Stop iterating, return SE_OK */
-} svcerr_t;
-
-/*
- * Per service/instance rad instance data
- */
-typedef struct smfobj {
- char *sname;
- char *iname;
- char *fmri;
-} smfobj_t;
-
-/*
- * A simple abstraction around what could be a service or an instance.
- */
-typedef struct smfu_entity {
- scf_service_t *service;
- scf_instance_t *instance;
-} smfu_entity_t;
-
-#define SMFU_ENTITY_INIT { NULL, NULL }
-
-/*
- * Useful SMF constants obtainable only programmatically.
- */
-extern ssize_t max_fmri;
-extern ssize_t max_name;
-extern ssize_t max_value;
-extern ssize_t max_pgtype;
-
-/*
- * Error handling routines
- */
-svcerr_t error_scf(adr_data_t **, adr_data_t *, adr_data_t *, const char *,
- const char *);
-svcerr_t internal_error(adr_data_t **error, const char *msg);
-svcerr_t smfu_maperr(scf_error_t);
-
-typedef svcerr_t (*svc_callback_t)(scf_handle_t *, scf_service_t *,
- const char *sname, void *arg);
-typedef svcerr_t (*inst_callback_t)(scf_handle_t *, scf_instance_t *,
- const char *sname, const char *iname, void *arg);
-
-/*
- * SCF-like factored routines
- */
-scf_error_t smfu_read_enabled(scf_instance_t *, scf_propertygroup_t *,
- scf_property_t *, scf_value_t *, const char *, uint8_t *);
-scf_error_t smfu_value_get_string(scf_value_t *val, char **strp);
-svcerr_t smfu_instance_get_composed_pg(scf_handle_t *handle,
- scf_instance_t *instance, const char *snapname, const char *pgname,
- scf_propertygroup_t *pg, adr_data_t **error);
-scf_error_t smfu_instance_iter_composed_pgs(scf_handle_t *handle,
- scf_instance_t *instance, const char *snapname, const char *pgtype,
- scf_iter_t *iter);
-
-svcerr_t smfu_get_l10n_str(scf_handle_t *handle, scf_propertygroup_t *pg,
- const char *locale, char **result);
-
-/*
- * Operate on directly-attached property groups.
- */
-svcerr_t smfu_get_pg(smfu_entity_t *entity, const char *name,
- scf_propertygroup_t *pg, adr_data_t **);
-svcerr_t smfu_iter_pg(smfu_entity_t *entity, const char *type,
- scf_iter_t *iter);
-
-/*
- * Operate on an instance's running snapshot or a service.
- */
-svcerr_t smfu_get_pg_r(scf_handle_t *handle, smfu_entity_t *entity,
- const char *name, scf_propertygroup_t *pg);
-svcerr_t smfu_iter_pg_r(scf_handle_t *handle, smfu_entity_t *entity,
- const char *type, scf_iter_t *iter);
-
-/*
- * Service/instance lookup routines.
- */
-svcerr_t smfu_iter_svcs(scf_handle_t *, svc_callback_t, inst_callback_t,
- void *);
-svcerr_t smfu_lookup(scf_handle_t *, const char *, const char *,
- smfu_entity_t *);
-svcerr_t smfu_test(const char *, const char *);
-
-void smfu_entity_destroy(smfu_entity_t *);
-
-adr_name_t *smfu_name_alloc(const char *, const char *);
-char *smfu_fmri_alloc(const char *, const char *);
-smfobj_t *smfu_obj_alloc(const char *, const char *);
-void smfu_obj_free(smfobj_t *);
-
-/* A frequently used lexical scope surrogate */
-typedef struct radarg {
- rad_instance_t *inst;
- adr_data_t **args;
-} radarg_t;
-
-typedef svcerr_t (*smfu_rtfunc_t)(scf_handle_t *, void *, adr_data_t **,
- adr_data_t **);
-conerr_t smfu_rtrun(smfu_rtfunc_t, void *, adr_data_t **, adr_data_t **);
-conerr_t smfu_rtrun_opt(smfu_rtfunc_t, void *, adr_data_t **, adr_data_t **);
-
-void smfu_init();
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* _SMFUTIL_H */
--- a/components/visual-panels/smf/src/java/vpanels/app/smf/build.xml Mon Oct 28 17:52:58 2013 -0700
+++ b/components/visual-panels/smf/src/java/vpanels/app/smf/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-smf" default="jar">
@@ -35,6 +35,5 @@
<path id="classpath.javac">
<path refid="classpath.panels" />
<pathelement location="${abs.rad.java}/rad.jar" />
- <pathelement location="${abs.rad.java}/adr.jar" />
</path>
</project>
--- a/components/visual-panels/smf/src/java/vpanels/app/smf/com/oracle/solaris/vp/panels/smf/client/swing/SmfPanelDescriptor.java Mon Oct 28 17:52:58 2013 -0700
+++ b/components/visual-panels/smf/src/java/vpanels/app/smf/com/oracle/solaris/vp/panels/smf/client/swing/SmfPanelDescriptor.java Wed Oct 30 16:53:48 2013 -0400
@@ -20,13 +20,12 @@
*/
/*
- * 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.smf.client.swing;
import java.io.IOException;
-import javax.management.InstanceNotFoundException;
import com.oracle.solaris.vp.panel.common.*;
import com.oracle.solaris.vp.panel.common.control.*;
import com.oracle.solaris.vp.panel.common.model.*;
@@ -55,7 +54,7 @@
//
public SmfPanelDescriptor(String id, ClientContext context)
- throws InstanceNotFoundException, IOException, TrackerException {
+ throws IOException, TrackerException {
super(id, context);
setName(Finder.getString("smf.panel.name"));
--- a/components/visual-panels/smf/src/java/vpanels/app/svcs/build.xml Mon Oct 28 17:52:58 2013 -0700
+++ b/components/visual-panels/smf/src/java/vpanels/app/svcs/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-svcs" default="jar">
@@ -41,6 +41,5 @@
<path id="classpath.javac">
<path refid="classpath.panels" />
<pathelement location="${abs.rad.java}/rad.jar" />
- <pathelement location="${abs.rad.java}/adr.jar" />
</path>
</project>
--- a/components/visual-panels/smf/src/java/vpanels/app/svcs/com/oracle/solaris/vp/panels/svcs/client/swing/SvcsPanelDescriptor.java Mon Oct 28 17:52:58 2013 -0700
+++ b/components/visual-panels/smf/src/java/vpanels/app/svcs/com/oracle/solaris/vp/panels/svcs/client/swing/SvcsPanelDescriptor.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.svcs.client.swing;
@@ -28,7 +28,6 @@
import java.beans.PropertyChangeListener;
import java.io.IOException;
import java.util.*;
-import javax.management.InstanceNotFoundException;
import com.oracle.solaris.vp.panel.common.*;
import com.oracle.solaris.vp.panel.common.control.*;
import com.oracle.solaris.vp.panel.common.model.*;
@@ -56,7 +55,7 @@
@SuppressWarnings({"unchecked"})
public SvcsPanelDescriptor(String id, ClientContext context)
- throws InstanceNotFoundException, IOException, TrackerException {
+ throws IOException, TrackerException {
super(id, context);
--- a/components/visual-panels/smf/system-management-visual-panels-panel-smf-message-files.p5m Mon Oct 28 17:52:58 2013 -0700
+++ b/components/visual-panels/smf/system-management-visual-panels-panel-smf-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/panel-smf-message-files@$(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-svcs.pot
file path=usr/share/vpanels/__LOCALE__/com/oracle/solaris/vp/panels/smf/client/swing/resources/Resources.properties
file path=usr/share/vpanels/__LOCALE__/com/oracle/solaris/vp/panels/svcs/client/swing/resources/Resources.properties
--- a/components/visual-panels/smf/system-management-visual-panels-panel-smf.p5m Mon Oct 28 17:52:58 2013 -0700
+++ b/components/visual-panels/smf/system-management-visual-panels-panel-smf.p5m 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.
#
set name=pkg.fmri value=pkg:/system/management/visual-panels/panel-smf@$(IPS_COMPONENT_VERSION),$(BUILD_VERSION)
@@ -34,17 +34,6 @@
depend fmri=pkg:/system/management/visual-panels-core@$(IPS_COMPONENT_VERSION),$(BUILD_VERSION) type=require
depend fmri=pkg:/system/management/visual-panels/panel-smf/locale type=require
-dir path=etc
-dir path=etc/gconf group=sys
-dir path=etc/gconf/schemas group=sys
-dir path=usr
-dir path=usr/lib
-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/gconf/schemas/scf.schemas
file path=usr/lib/service-browser mode=0555
file path=usr/share/applications/vp-svcs.desktop
--- a/components/visual-panels/sysmon/src/java/vpanels/app/sysmon/build.xml Mon Oct 28 17:52:58 2013 -0700
+++ b/components/visual-panels/sysmon/src/java/vpanels/app/sysmon/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-sysmon" default="jar">
@@ -40,6 +40,5 @@
<path id="classpath.javac">
<path refid="classpath.panels" />
<pathelement location="${abs.rad.java}/rad.jar" />
- <pathelement location="${abs.rad.java}/adr.jar" />
</path>
</project>
--- a/components/visual-panels/sysmon/src/java/vpanels/app/sysmon/com/oracle/solaris/vp/panels/sysmon/client/swing/SmfMonitoredResource.java Mon Oct 28 17:52:58 2013 -0700
+++ b/components/visual-panels/sysmon/src/java/vpanels/app/sysmon/com/oracle/solaris/vp/panels/sysmon/client/swing/SmfMonitoredResource.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.sysmon.client.swing;
@@ -28,7 +28,6 @@
import java.beans.PropertyChangeListener;
import java.io.IOException;
import java.util.List;
-import javax.management.InstanceNotFoundException;
import javax.swing.Icon;
import com.oracle.solaris.vp.panel.common.*;
import com.oracle.solaris.vp.panel.common.control.*;
@@ -61,7 +60,7 @@
//
public SmfMonitoredResource(ClientContext context)
- throws InstanceNotFoundException, IOException, TrackerException {
+ throws IOException, TrackerException {
this.context = context;
setName(NAME);
--- a/components/visual-panels/sysmon/src/java/vpanels/app/sysmon/com/oracle/solaris/vp/panels/sysmon/client/swing/SysMonPanelDescriptor.java Mon Oct 28 17:52:58 2013 -0700
+++ b/components/visual-panels/sysmon/src/java/vpanels/app/sysmon/com/oracle/solaris/vp/panels/sysmon/client/swing/SysMonPanelDescriptor.java Wed Oct 30 16:53:48 2013 -0400
@@ -20,14 +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.panels.sysmon.client.swing;
import java.io.IOException;
import java.util.List;
-import javax.management.InstanceNotFoundException;
import javax.swing.*;
import com.oracle.solaris.vp.panel.common.*;
import com.oracle.solaris.vp.panel.common.control.Control;
@@ -76,7 +75,7 @@
//
public SysMonPanelDescriptor(String id, ClientContext context)
- throws InstanceNotFoundException, IOException, TrackerException {
+ throws IOException, TrackerException {
super(id, context);
--- a/components/visual-panels/sysmon/system-management-visual-panels-panel-sysmon-message-files.p5m Mon Oct 28 17:52:58 2013 -0700
+++ b/components/visual-panels/sysmon/system-management-visual-panels-panel-sysmon-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/panel-apache-message-files@$(IPS_COMPONENT_VERSION),$(BUILD_VERSION)
@@ -31,11 +31,5 @@
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-sysmon.pot
file path=usr/share/vpanels/__LOCALE__/com/oracle/solaris/vp/panels/sysmon/client/swing/resources/Resources.properties
--- a/components/visual-panels/sysmon/system-management-visual-panels-panel-sysmon.p5m Mon Oct 28 17:52:58 2013 -0700
+++ b/components/visual-panels/sysmon/system-management-visual-panels-panel-sysmon.p5m 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.
#
set name=pkg.fmri value=pkg:/system/management/visual-panels/panel-sysmon@$(IPS_COMPONENT_VERSION),$(BUILD_VERSION)
@@ -34,14 +34,6 @@
depend fmri=pkg:/system/management/visual-panels-core@$(IPS_COMPONENT_VERSION),$(BUILD_VERSION) type=require
depend fmri=pkg:/system/management/visual-panels/panel-sysmon/locale type=require
-dir path=usr
-dir path=usr/share
-dir path=usr/share/gnome group=other
-dir path=usr/share/gnome/autostart
-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=usr/share/gnome/autostart/vp-sysmon.desktop
file path=usr/share/vpanels/app/vpanels-panels-sysmon.jar
file path=usr/share/vpanels/conf/sysmon.xml
--- a/components/visual-panels/time/src/cmd/rad/mod/time/Makefile Mon Oct 28 17:52:58 2013 -0700
+++ b/components/visual-panels/time/src/cmd/rad/mod/time/Makefile Wed Oct 30 16:53:48 2013 -0400
@@ -20,15 +20,17 @@
#
#
-# 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 $(SRC)/make-rules/Makefile.env
LDLIBS += -lscf
+
+VERS=.1
MOD_APIS=time
MOD_OBJS=mod_time.o smfutil.o
-MOD_LIBNAME=mod_time.so
+MOD_LIBNAME=mod_time.so$(VERS)
MOD_INSTALLDIR=$(RADDIR_MODULE)
APISDIR=$(PROJ_CORE)/apis
--- a/components/visual-panels/time/src/cmd/rad/mod/time/mod_time.c Mon Oct 28 17:52:58 2013 -0700
+++ b/components/visual-panels/time/src/cmd/rad/mod/time/mod_time.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>
@@ -54,7 +54,7 @@
adr_data_t **data, adr_data_t **error)
{
*data = adr_data_new_time_now();
- return (ce_ok);
+ return (CE_OK);
}
#define NSPERUS (NANOSEC / MICROSEC)
@@ -79,7 +79,7 @@
}
if (seconds > LONG_MAX)
- return (ce_object);
+ return (CE_OBJECT);
newtime = (time_t)seconds;
adj.tv_sec = 0;
@@ -87,11 +87,11 @@
if (stime(&newtime) == -1 || adjtime(&adj, NULL) == -1) {
if (errno == EPERM)
- return (ce_priv);
- return (ce_object);
+ return (CE_PRIV);
+ return (CE_OBJECT);
}
- return (ce_ok);
+ return (CE_OK);
}
/*ARGSUSED*/
@@ -105,7 +105,7 @@
conerr_t err = smfu_get_property((char *)SCF_INSTANCE_ENV,
SMF_TZ_PGNAME, SMF_TZ_PROPNAME, tz, PATH_MAX - n);
- if (err == ce_ok) {
+ if (err == CE_OK) {
/*
* The stored time zone may be the name of a symlink
* (i.e. "localtime"), under ZONEINFO_DIR. Resolve that symlink
@@ -223,7 +223,7 @@
}
*data = result;
- return (ce_ok);
+ return (CE_OK);
}
/*ARGSUSED*/
@@ -233,7 +233,7 @@
{
/* XXX: Crude */
*data = adr_data_new_boolean(getuid() == 0);
- return (ce_ok);
+ return (CE_OK);
}
/*ARGSUSED*/
@@ -262,7 +262,7 @@
(void) fclose(file);
*data = result;
- return (ce_ok);
+ return (CE_OK);
}
/*ARGSUSED*/
@@ -295,7 +295,7 @@
(void) fclose(file);
*data = result;
- return (ce_ok);
+ return (CE_OK);
}
/*
@@ -434,7 +434,7 @@
(void) fclose(file);
*data = result;
- return (ce_ok);
+ return (CE_OK);
}
/*ARGSUSED*/
@@ -506,30 +506,37 @@
/* Rename temp file */
if (chmod(NTP_CONF_TMP, 0644) == 0 &&
rename(NTP_CONF_TMP, NTP_CONF) == 0)
- return (ce_ok);
+ return (CE_OK);
writefailed:
err = errno;
(void) unlink(NTP_CONF_TMP);
errorout:
- return (err == EACCES ? ce_priv : ce_object);
+ return (err == EACCES ? CE_PRIV : CE_OBJECT);
}
-static rad_modinfo_t modinfo = { "time", "Time 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", "Time");
+ conerr_t cerr = rad_cont_insert_singleton(rad_container, aname,
+ &modinfo, &interface_Time_svr);
+ adr_name_rele(aname);
+ if (cerr != CE_OK) {
+ rad_log(RL_ERROR, "(mod_time) failed to insert Time");
return (-1);
-
- if (rad_isproxy)
- return (0);
-
- (void) cont_insert_singleton(rad_container,
- adr_name_fromstr("com.oracle.solaris.vp.panels.time:type=Time"),
- &interface_Time_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/time/src/cmd/rad/mod/time/smfutil.c Mon Oct 28 17:52:58 2013 -0700
+++ b/components/visual-panels/time/src/cmd/rad/mod/time/smfutil.c Wed Oct 30 16:53:48 2013 -0400
@@ -20,7 +20,7 @@
*/
/*
- * Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011, 2013, Oracle and/or its affiliates. All rights reserved.
*/
#include <rad/rad_modapi.h>
@@ -47,11 +47,11 @@
{
switch (e) {
case SCF_ERROR_NONE:
- return (ce_ok);
+ return (CE_OK);
case SCF_ERROR_PERMISSION_DENIED:
- return (ce_priv);
+ return (CE_PRIV);
default:
- return (ce_system);
+ return (CE_SYSTEM);
}
}
@@ -59,7 +59,7 @@
smfu_get_property(char *fmri, char *pgname, char *propname, char *value,
size_t n)
{
- 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);
@@ -70,7 +70,7 @@
if (scfhandle == NULL || service == NULL || instance == NULL ||
pg == NULL || prop == NULL || iter == NULL || val == NULL) {
- err = ce_nomem;
+ err = CE_NOMEM;
goto out;
}
@@ -114,7 +114,7 @@
conerr_t
smfu_set_property(char *fmri, char *pgname, char *propname, char *value)
{
- 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);
@@ -128,7 +128,7 @@
if (scfhandle == NULL || service == NULL || instance == NULL ||
pg == NULL || prop == NULL || tx == NULL || ent == NULL ||
val == NULL) {
- err = ce_nomem;
+ err = CE_NOMEM;
goto out;
}
--- a/components/visual-panels/time/src/java/vpanels/app/time/build.xml Mon Oct 28 17:52:58 2013 -0700
+++ b/components/visual-panels/time/src/java/vpanels/app/time/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-time" default="jar">
@@ -32,7 +32,6 @@
<fileset refid="proj.extlibs" />
<path refid="classpath.panels" />
<pathelement location="${abs.rad.java}/rad.jar" />
- <pathelement location="${abs.rad.java}/adr.jar" />
</path>
<property name="panel.panel" value="time" />
--- a/components/visual-panels/time/src/java/vpanels/app/time/com/oracle/solaris/vp/panels/time/client/swing/MainControl.java Mon Oct 28 17:52:58 2013 -0700
+++ b/components/visual-panels/time/src/java/vpanels/app/time/com/oracle/solaris/vp/panels/time/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.time.client.swing;
@@ -29,7 +29,7 @@
import java.util.*;
import javax.swing.*;
import javax.swing.Timer;
-import com.oracle.solaris.rad.ObjectException;
+import com.oracle.solaris.rad.client.RadObjectException;
import com.oracle.solaris.vp.panel.common.control.*;
import com.oracle.solaris.vp.panel.swing.control.*;
import com.oracle.solaris.vp.panel.swing.timezone.TimeZoneModel;
@@ -170,8 +170,8 @@
String zoneId;
try {
- zoneId = descriptor.getTimeMXBean().getdefaultTimeZone();
- } catch (ObjectException e) {
+ zoneId = descriptor.getTimeBean().getdefaultTimeZone();
+ } catch (RadObjectException e) {
zoneId = "UTC";
}
TimeZone zone = TimeZone.getTimeZone(zoneId);
--- a/components/visual-panels/time/src/java/vpanels/app/time/com/oracle/solaris/vp/panels/time/client/swing/NTPModel.java Mon Oct 28 17:52:58 2013 -0700
+++ b/components/visual-panels/time/src/java/vpanels/app/time/com/oracle/solaris/vp/panels/time/client/swing/NTPModel.java Wed Oct 30 16:53:48 2013 -0400
@@ -20,13 +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.panels.time.client.swing;
import java.util.*;
-import com.oracle.solaris.rad.ObjectException;
+import com.oracle.solaris.rad.client.RadObjectException;
+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.api.smf_old.SmfState;
@@ -63,13 +64,13 @@
// XXX generic NTPModel shouldn't assume a ServicePanelDescriptor
enabled_ = getSource().isEnabled();
try {
- servers_ = getSource().getTimeMXBean().getntpServers();
- } catch (ObjectException e) {
+ servers_ = getSource().getTimeBean().getntpServers();
+ } catch (RadObjectException e) {
servers_ = Collections.emptyList();
}
// Read only state
- ServiceMXBean service = getSource().getService();
+ ServiceBean service = getSource().getService();
try {
state_ = service.getState();
nextState_ = service.getNextState();
@@ -83,15 +84,15 @@
validate();
TimePanelDescriptor descriptor = getSource();
- TimeMXBean bean = descriptor.getTimeMXBean();
+ Time bean = descriptor.getTimeBean();
try {
bean.setntpServers(servers_);
- } catch (SecurityException e) {
+ } catch (RadPrivilegeException e) {
throw new ActionUnauthorizedException(e);
- } catch (ObjectException e) {
+ } catch (RadObjectException e) {
throw new ActionFailedException(
Finder.getString("ntp.error.syserror"), e);
}
@@ -102,7 +103,7 @@
smfEnabledProp.setValue(enabled_);
smfEnabledProp.saveToRepo();
- } catch (SecurityException e) {
+ } catch (RadPrivilegeException e) {
throw new ActionUnauthorizedException(e);
} catch (ScfException e) {
--- a/components/visual-panels/time/src/java/vpanels/app/time/com/oracle/solaris/vp/panels/time/client/swing/ServersPropertySynchronizer.java Mon Oct 28 17:52:58 2013 -0700
+++ b/components/visual-panels/time/src/java/vpanels/app/time/com/oracle/solaris/vp/panels/time/client/swing/ServersPropertySynchronizer.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.time.client.swing;
@@ -89,7 +89,7 @@
for (int row = 0; row < n; row++) {
String server = (String)model.getValueAt(row, 0);
Boolean enabled = (Boolean)model.getValueAt(row, 1);
- value[row] = new ServerInfoImpl(server, enabled);
+ value[row] = new ServerInfo(server, enabled);
}
return value;
--- a/components/visual-panels/time/src/java/vpanels/app/time/com/oracle/solaris/vp/panels/time/client/swing/TimeModel.java Mon Oct 28 17:52:58 2013 -0700
+++ b/components/visual-panels/time/src/java/vpanels/app/time/com/oracle/solaris/vp/panels/time/client/swing/TimeModel.java Wed Oct 30 16:53:48 2013 -0400
@@ -20,16 +20,17 @@
*/
/*
- * 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.time.client.swing;
import java.util.Date;
-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.model.AbstractModel;
-import com.oracle.solaris.vp.panels.time.TimeMXBean;
+import com.oracle.solaris.vp.panels.time.Time;
import com.oracle.solaris.vp.util.misc.finder.Finder;
public class TimeModel extends AbstractModel<TimePanelDescriptor> {
@@ -48,9 +49,9 @@
public void load() {
try {
- offset_ = getSource().getTimeMXBean().gettime().getTime() -
+ offset_ = getSource().getTimeBean().gettime().getTime() -
System.currentTimeMillis();
- } catch (ObjectException e) {
+ } catch (RadObjectException e) {
offset_ = 0;
}
}
@@ -58,15 +59,15 @@
public void save() throws ActionFailedException,
ActionUnauthorizedException {
- TimeMXBean bean = getSource().getTimeMXBean();
+ Time bean = getSource().getTimeBean();
try {
bean.settime(new Date(System.currentTimeMillis() + offset_));
- } catch (SecurityException e) {
+ } catch (RadPrivilegeException e) {
throw new ActionUnauthorizedException(e);
- } catch (ObjectException e) {
+ } catch (RadObjectException e) {
throw new ActionFailedException(Finder.getString(
"time.time.error.syserror"), e);
}
--- a/components/visual-panels/time/src/java/vpanels/app/time/com/oracle/solaris/vp/panels/time/client/swing/TimePanelDescriptor.java Mon Oct 28 17:52:58 2013 -0700
+++ b/components/visual-panels/time/src/java/vpanels/app/time/com/oracle/solaris/vp/panels/time/client/swing/TimePanelDescriptor.java Wed Oct 30 16:53:48 2013 -0400
@@ -20,21 +20,18 @@
*/
/*
- * 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.time.client.swing;
import java.io.IOException;
import java.util.List;
-import javax.management.*;
import javax.swing.*;
-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.panel.MBeanUtil;
import com.oracle.solaris.vp.panel.common.api.smf_old.SmfState;
-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.control.*;
import com.oracle.solaris.vp.panel.common.model.*;
import com.oracle.solaris.vp.panel.common.smf.*;
@@ -47,7 +44,7 @@
@SuppressWarnings({"serial"})
public class TimePanelDescriptor
extends ServicePanelDescriptor<ManagedObject>
- implements SwingPanelDescriptor<ManagedObject>, HasIcons, HasTimeMXBean {
+ implements SwingPanelDescriptor<ManagedObject>, HasIcons, HasTimeBean {
//
// Static data
@@ -67,7 +64,7 @@
//
private DefaultControl control;
- private MXBeanTracker<TimeMXBean> beanTracker;
+ private BeanTracker<Time> beanTracker;
private boolean hasFullPrivs;
//
@@ -75,18 +72,16 @@
//
public TimePanelDescriptor(String id, ClientContext context)
- throws IOException, InstanceNotFoundException, ScfException,
+ throws IOException, ScfException,
InvalidScfDataException, MissingScfDataException,
TrackerException {
super(id, context, SERVICE, INSTANCE);
- ObjectName oName = MBeanUtil.makeObjectName(
- MBeanUtil.VP_PANEL_DOMAIN + ".time", "Time");
- beanTracker = new MXBeanTracker<TimeMXBean>(
- oName, TimeMXBean.class, Stability.PRIVATE, context);
+ beanTracker = new BeanTracker<Time>(
+ (new Time()).getName(), Time.class, context);
- hasFullPrivs = getTimeMXBean().issufficientlyPrivileged();
+ hasFullPrivs = getTimeBean().issufficientlyPrivileged();
refresh(true);
control = new PanelFrameControl<TimePanelDescriptor>(this);
@@ -103,11 +98,11 @@
}
//
- // HasTimeMXBean methods
+ // HasTimeBean methods
//
@Override
- public TimeMXBean getTimeMXBean() {
+ public Time getTimeBean() {
return beanTracker.getBean();
}
--- a/components/visual-panels/time/src/java/vpanels/app/time/com/oracle/solaris/vp/panels/time/client/swing/TimeZoneObject.java Mon Oct 28 17:52:58 2013 -0700
+++ b/components/visual-panels/time/src/java/vpanels/app/time/com/oracle/solaris/vp/panels/time/client/swing/TimeZoneObject.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.time.client.swing;
@@ -63,7 +63,7 @@
onsave.run();
}
};
- panel_ = new TimeZonePanel(desc.getTimeMXBean(), updateModel);
+ panel_ = new TimeZonePanel(desc.getTimeBean(), updateModel);
SimpleModelControl<?, TimePanelDescriptor, ?> control =
SimpleModelControl.createControl(ID, NAME, desc, dataModel, panel_);
control.setHelpMapID("timezone");
--- a/components/visual-panels/time/system-management-visual-panels-panel-time-message-files.p5m Mon Oct 28 17:52:58 2013 -0700
+++ b/components/visual-panels/time/system-management-visual-panels-panel-time-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/panel-time-message-files@$(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-time.pot
file path=usr/share/vpanels/__LOCALE__/com/oracle/solaris/vp/panels/time/client/swing/resources/Resources.properties
file path=usr/share/vpanels/__LOCALE__/com/oracle/solaris/vp/panels/time/client/swing/help/app.hs
--- a/components/visual-panels/time/system-management-visual-panels-panel-time.p5m Mon Oct 28 17:52:58 2013 -0700
+++ b/components/visual-panels/time/system-management-visual-panels-panel-time.p5m 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.
#
set name=pkg.fmri value=pkg:/system/management/visual-panels/panel-time@$(IPS_COMPONENT_VERSION),$(BUILD_VERSION)
@@ -35,17 +35,8 @@
depend fmri=pkg:/system/management/visual-panels-core@$(IPS_COMPONENT_VERSION),$(BUILD_VERSION) type=require
depend fmri=pkg:/system/management/visual-panels/panel-time/locale type=require
-dir path=usr
-dir path=usr/lib
-dir path=usr/lib/rad
-dir path=usr/lib/rad/module
-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=usr/lib/rad/module/mod_time.so
+link path=usr/lib/rad/module/mod_time.so target=mod_time.so.1
+file path=usr/lib/rad/module/mod_time.so.1
file path=usr/share/applications/vp-time.desktop
file path=usr/share/vpanels/app/vpanels-panels-time.jar
file path=usr/share/vpanels/conf/time.xml
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/components/visual-panels/usermgr/src/apis/usermgr.adr Wed Oct 30 16:53:48 2013 -0400
@@ -0,0 +1,741 @@
+<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
+<!--
+ Copyright (c) 2012, 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.rad.usermgr">
+
+ <version major="1" minor="0"/>
+ <struct name="Group">
+ <summary>
+ describes a Solaris group
+ </summary>
+ <doc>
+ Fully describes a Solaris group, contains
+ group name, group id, group members.
+ </doc>
+ <field type="string" name="groupName">
+ <summary> Specifies the group name.</summary>
+ </field>
+ <field type="uinteger" name="groupID">
+ <summary> Specifies the Gid of the group.</summary>
+ </field>
+ <field name="groupMembers">
+ <summary> Specifies the members of the group.</summary>
+ <list type="string"/>
+ </field>
+ </struct>
+
+ <struct name="User">
+ <summary>
+ describes a Solaris user
+ </summary>
+ <doc>
+ Fully describes a Solaris user, contains
+ account, home directory and security attributes
+ associated with a user. See man passwd(4),
+ shadow(4), userattr(4) for more info on fields.
+ </doc>
+ <field type="string" name="username" nullable="false">
+ <summary> username for the account. </summary>
+ </field>
+ <field type="uinteger" name="userID">
+ <summary> UID for the account. </summary>
+ </field>
+ <field type="uinteger" name="groupID">
+ <summary> GID for the account. </summary>
+ </field>
+ <field type="string" name="description" nullable="true">
+ <summary> gecos info for the account. </summary>
+ </field>
+ <field type="string" name="homeDirectory" nullable="true">
+ <summary> homedirectory location for the account. </summary>
+ </field>
+ <field type="string" name="defaultShell" nullable="true">
+ <summary> default shell for the account. </summary>
+ </field>
+ <field type="integer" name="inactive">
+ <summary> Number of inactivity days allowed for the account.
+ </summary>
+ </field>
+ <field type="integer" name="min">
+ <summary> Minimum number of days between password changes
+ for the account.
+ </summary>
+ </field>
+ <field type="integer" name="max">
+ <summary> Maximum cemunber of days the password is valid for
+ the account.
+ </summary>
+ </field>
+ <field type="integer" name="warn">
+ <summary> Number of days before password expires the user
+ is warned.
+ </summary>
+ </field>
+ <field type="string" name="expire" nullable="true">
+ <summary> The date after which login will not be allowed for
+ the account. The date format is %y-%m-%d %H:%M:%S.
+ </summary>
+ </field>
+ <field type="string" name="lockAfterRetries" nullable="true">
+ <summary> Specifies whether the account is locked
+ after failed logins execeeds the allowable
+ limit.
+ </summary>
+ </field>
+ <field type="string" name="alwaysAuditFlags" nullable="true">
+ <summary> Specifies per-user always audit pre-selection
+ flags.
+ </summary>
+ </field>
+ <field type="string" name="neverAuditFlags" nullable="true">
+ <summary> Specifies per-user never-audit
+ pre-selection flags.
+ </summary>
+ </field>
+ <field type="string" name="type" nullable="true">
+ <summary> specifies whether account is role or user. </summary>
+ </field>
+ <field type="string" name="defaultProj" nullable="true">
+ <summary> specifies the default project for the account. </summary>
+ </field>
+ <field type="string" name="clearance" nullable="true">
+ <summary> Specifies the max label at which the user can
+ operate.
+ </summary>
+ </field>
+ <field type="string" name="minLabel" nullable="true">
+ <summary> Specifies the min labelthat the user can login .</summary>
+ </field>
+ <field type="string" name="roleAuth" nullable="true">
+ <summary> Specifies whether the account user role or user
+ password for role authentication.
+ </summary>
+ </field>
+ <field type="string" name="idleCmd" nullable="true">
+ <summary> Specifies when the desktop session for the user gets
+ locked.
+ </summary>
+ </field>
+ <field type="string" name="idleTime" nullable="true">
+ <summary> Specifies the idle time before the idlecmd is
+ executed.
+ </summary>
+ </field>
+ <field type="string" name="accountStatus" nullable="true">
+ <summary> Specifies the status of the account.</summary>
+ </field>
+ <field name="roles" nullable="true">
+ <summary> Specifies the roles that have been assigned to the
+ account.
+ </summary>
+ <list type="string"/>
+ </field>
+ <field name="profiles" nullable="true">
+ <summary> Specifies the profiles that have been assigned to the
+ account.
+ </summary>
+ <list type="string"/>
+ </field>
+ <field name="authProfiles" nullable="true">
+ <summary> Specifies the authenticated profiles that have been
+ assigned to the account.
+ </summary>
+ <list type="string"/>
+ </field>
+ <field name="auths" nullable="true">
+ <summary> Specifies the authorizations that have been assigned
+ to the account.
+ </summary>
+ <list type="string"/>
+ </field>
+ <field name="defaultPriv" nullable="true">
+ <summary> Specifies the default set of privileges assigned to
+ user at login.
+ </summary>
+ <list type="string"/>
+ </field>
+ <field name="limitPriv" nullable="true">
+ <summary> Specifies the maximum set of privileges the user or
+ process started by the user can obtain.
+ </summary>
+ <list type="string"/>
+ </field>
+ <field name="groups" nullable="true">
+ <summary> Specifies the supplemental groups that have been
+ assigned to the account.
+ </summary>
+ <list type="string"/>
+ </field>
+ </struct>
+
+ <struct name="UserChangeFields">
+ <summary>
+ Keeps track of all the fields that have been
+ changed in the user object.
+ </summary>
+ <doc>
+ Keeps track of all the fields that have been
+ changed in the user object. For every field
+ that has been changed in the User object the
+ respective changeField will be set to true.
+ </doc>
+ <field type="boolean" name="gidChanged"/>
+ <field type="boolean" name="descChanged"/>
+ <field type="boolean" name="homedirChanged"/>
+ <field type="boolean" name="defShellChanged"/>
+ <field type="boolean" name="profilesChanged"/>
+ <field type="boolean" name="authProfilesChanged"/>
+ <field type="boolean" name="rolesChanged"/>
+ <field type="boolean" name="authsChanged"/>
+ <field type="boolean" name="limitPrivChanged"/>
+ <field type="boolean" name="groupsChanged"/>
+ <field type="boolean" name="lockAfterRetriesChanged"/>
+ <field type="boolean" name="alwaysAuditChanged"/>
+ <field type="boolean" name="neverAuditChanged"/>
+ <field type="boolean" name="typeChanged"/>
+ <field type="boolean" name="defaultProjChanged"/>
+ <field type="boolean" name="minLabelChanged"/>
+ <field type="boolean" name="roleAuthChanged"/>
+ <field type="boolean" name="idleCmdChanged"/>
+ <field type="boolean" name="idleTimeChanged"/>
+ <field type="boolean" name="expireChanged"/>
+ <field type="boolean" name="minChanged"/>
+ <field type="boolean" name="maxChanged"/>
+ <field type="boolean" name="warnChanged"/>
+ <field type="boolean" name="uidChanged"/>
+ </struct>
+
+ <enum name="UserMgrErrorType">
+ <summary>User Manager api error types</summary>
+ <value name="INVALIDDATA"/>
+ <value name="USEREXISTS"/>
+ <value name="PERMDENIED"/>
+ <value name="READERROR"/>
+ <value name="LASTADMIN"/>
+ <value name="ROOTADMIN"/>
+ <value name="PASSERROR"/>
+ </enum>
+
+ <enum name="ScopeType">
+ <summary>Name service scope types</summary>
+ <value name="FILES"/>
+ <value name="LDAP"/>
+ </enum>
+
+ <struct name="UserMgrError">
+ <field typeref="UserMgrErrorType" name="errorCode"/>
+ </struct>
+
+ <enum name="UserType">
+ <value name="NORMAL"/>
+ <value name="ROLE"/>
+ </enum>
+
+ <interface name="UserMgr">
+ <summary>
+ Set of operations that can be performed on
+ users and roles.
+ </summary>
+
+ <property name="users" access="ro">
+ <summary>
+ Lists users.
+ </summary>
+ <doc>
+ Lists the users present in the selected
+ scope based on the filter options.
+ </doc>
+ <list typeref="User"/>
+ <error typeref="UserMgrError">
+ <doc>
+ <list>
+ <item>
+ <code>READERROR</code> - when unable to read user after
+ </item>
+ </list>
+ </doc>
+ </error>
+ </property>
+
+ <property name="groups" access="ro">
+ <summary>
+ Lists groups.
+ </summary>
+ <doc>
+ Lists the groups present in the selected
+ scope.
+ </doc>
+ <list typeref="Group"/>
+ <error typeref="UserMgrError">
+ <doc>
+ <list>
+ <item>
+ <code>READERROR</code> - when unable to read the groups database.
+ </item>
+ </list>
+ </doc>
+ </error>
+ </property>
+
+ <property name="shells" access="ro">
+ <summary>
+ Lists shells.
+ </summary>
+ <doc>
+ Lists the set of available shells
+ that can be set as default shell for users.
+ </doc>
+ <list type="string"/>
+ <error typeref="UserMgrError">
+ <doc>
+ <list>
+ <item>
+ <code>READERROR</code> - when unable to read the default shells.
+ </item>
+ </list>
+ </doc>
+ </error>
+ </property>
+
+ <property name="defaultUser" typeref="User" access="ro">
+ <summary>
+ Lists user defaults.
+ </summary>
+ <doc>
+ Lists the default values for groups, basedir,
+ project, shell, skel, inactive, expire,
+ auths, profiles, roles, limitPriv,
+ defaultPriv, lockAfterRetries used for
+ creation of users and roles.
+ </doc>
+ <error typeref="UserMgrError">
+ <doc>
+ <list>
+ <item>
+ <code>READERROR</code> - when unable to read default user properties.
+ </item>
+ </list>
+ </doc>
+ </error>
+ </property>
+
+ <property name="scopes" access="ro">
+ <summary>
+ Lists scopes.
+ </summary>
+ <doc>
+ Lists the set of name service repositories
+ that can be administered.
+ </doc>
+ <list type="string"/>
+ <error typeref="UserMgrError">
+ <doc>
+ <list>
+ <item>
+ <code>READERROR</code> - when unable to read the name services that can be managed.
+ </item>
+ </list>
+ </doc>
+ </error>
+ </property>
+
+
+ <property name="roles" access="ro">
+ <summary>
+ Lists assigned roles.
+ </summary>
+ <doc>
+ Lists the roles assigned to a user.
+ </doc>
+ <list type="string"/>
+ <error typeref="UserMgrError">
+ <doc>
+ <list>
+ <item>
+ <code>READERROR</code> - when unable to read user roles
+ </item>
+ </list>
+ </doc>
+ </error>
+ </property>
+
+ <property name="profiles" access="ro">
+ <summary>
+ Lists assigned profiles.
+ </summary>
+ <doc>
+ Lists the profiles assigned to a user.
+ </doc>
+ <list type="string"/>
+ <error typeref="UserMgrError">
+ <doc>
+ <list>
+ <item>
+ <code>READERROR</code> - when unable to read user profiles.
+ </item>
+ </list>
+ </doc>
+ </error>
+ </property>
+
+ <property name="auths" access="ro">
+ <summary>
+ Lists assigned authorizations.
+ </summary>
+ <doc>
+ Lists the authorizations assigned to a user.
+ </doc>
+ <list type="string"/>
+ <error typeref="UserMgrError">
+ <doc>
+ <list>
+ <item>
+ <code>READERROR</code> - when unable to read user authorizations.
+ </item>
+ </list>
+ </doc>
+ </error>
+ </property>
+
+ <property name="defaultPrivs" access="ro">
+ <summary>
+ Lists default privileges.
+ </summary>
+ <doc>
+ Lists the default privileges assigned to a user.
+ </doc>
+ <list type="string"/>
+ <error typeref="UserMgrError">
+ <doc>
+ <list>
+ <item>
+ <code>READERROR</code> - when unable to read user's default privileges.
+ </item>
+ </list>
+ </doc>
+ </error>
+ </property>
+
+ <property name="limitPrivs" access="ro">
+ <summary>
+ Lists limit privileges.
+ </summary>
+ <doc>
+ Lists the limit privileges assigned to a user.
+ </doc>
+ <list type="string"/>
+ <error typeref="UserMgrError">
+ <doc>
+ <list>
+ <item>
+ <code>READERROR</code> - when unable to read user's limit privileges.
+ </item>
+ </list>
+ </doc>
+ </error>
+ </property>
+
+ <property name="supplGroups" access="ro">
+ <summary>
+ Lists supplemental groups.
+ </summary>
+ <doc>
+ Lists the supplemental groups that the user
+ is a member of.
+ </doc>
+ <list type="string"/>
+ <error typeref="UserMgrError">
+ <doc>
+ <list>
+ <item>
+ <code>READERROR</code> - when unable to read user's supplemental groups.
+ </item>
+ </list>
+ </doc>
+ </error>
+ </property>
+
+ <property name="auditClasses" access="ro">
+ <summary>
+ Lists Assigned Audit Classes.
+ </summary>
+ <doc>
+ Lists the audit classes that are assigned to
+ the user.
+ </doc>
+ <list type="string"/>
+ <error typeref="UserMgrError">
+ <doc>
+ <list>
+ <item>
+ <code>READERROR</code> - when unable to read user's assigned audit classes.
+ </item>
+ </list>
+ </doc>
+ </error>
+ </property>
+
+ <property name="pamUserConfFiles" access="ro">
+ <summary>
+ Lists users PAM configuration files.
+ </summary>
+ <doc>
+ Lists the per-user PAM configuration files.
+ </doc>
+ <list type="string"/>
+ <error typeref="UserMgrError">
+ <doc>
+ <list>
+ <item>
+ <code>READERROR</code> - when unable to read user specific PAM configuration files.
+ </item>
+ </list>
+ </doc>
+ </error>
+ </property>
+
+ <method name="getUser">
+ <summary>
+ gets User information for a given username.
+ </summary>
+ <doc>
+ Gets the user information for a given username from
+ the name service repository based on the filter
+ options.
+ </doc>
+ <result typeref="User"/>
+ <error typeref="UserMgrError">
+ <doc>
+ <list>
+ <item>
+ <code>READERROR</code> - when unable to read user
+ </item>
+ </list>
+ </doc>
+ </error>
+ <argument type="string" name="username">
+ <summary> Specifies the username for which the
+ account information is to be retrieved.
+ </summary>
+ </argument>
+ </method>
+
+ <method name="addUser">
+ <summary>
+ Add user or role.
+ </summary>
+ <doc>
+ Adds a user or role to the selected name
+ service repository based on the filter
+ options. Applies the properties set in
+ the user object as the account, password,
+ security attributes.
+ Sets INVALIDDATA error when arguments are not valid.
+ Sets PASSERROR error when password update fails.
+ Sets READERROR error when unable to read user after
+ successful addition of new user.
+ Sets USEREXISTS error user already exists with same
+ username.
+ </doc>
+ <result typeref="User"/>
+ <error typeref="UserMgrError">
+ <doc>
+ <list>
+ <item>
+ <code>INVALIDDATA</code> - when arguments are not valid.
+ </item>
+ <item>
+ <code>INVALIDDATA</code> - when arguments are not valid.
+ </item>
+ <item>
+ <code>READERROR</code> - when unable to read user after adding new user.
+ </item>
+ </list>
+ </doc>
+ </error>
+ <argument typeref="User" name="user">
+ <summary> user object which contains attributes of new
+ user account to be created.
+ </summary>
+ </argument>
+ <argument type="secret" name="password">
+ <summary> password to be set for the new user account.
+ </summary>
+ </argument>
+ </method>
+
+ <method name="modifyUser">
+ <summary>
+ Modify user or role.
+ </summary>
+ <doc>
+ Modifies users or roles present in the selected
+ scope based on the filter options.
+ Applies the changed fields in the user object
+ to the user or role attributes.
+ Sets INVALIDDATA error when arguments are not valid.
+ Sets PASSERROR error when password update fails.
+ Sets READERROR error when unable to read user after
+ successful modification of user.
+ </doc>
+ <result typeref="User"/>
+ <error typeref="UserMgrError">
+ <doc>
+ <list>
+ <item>
+ <code>INVALIDDATA</code> - when arguments are not valid.
+ </item>
+ <item>
+ <code>INVALIDDATA</code> - when arguments are not valid.
+ </item>
+ <item>
+ <code>READERROR</code> - when unable to read user after adding new user.
+ </item>
+ </list>
+ </doc>
+ </error>
+ <argument typeref="User" name="user">
+ <summary> user object which contains user attributes
+ to be modified.
+ </summary>
+ </argument>
+ <argument typeref="UserChangeFields" name="changeFields">
+ <summary> Indicates which fields have been modified
+ in the user object by the client.
+ </summary>
+ </argument>
+ <argument type="secret" name="password" nullable="true">
+ <summary> password to be set for the new user account.
+ </summary>
+ </argument>
+ </method>
+
+ <method name="deleteUser">
+ <summary>
+ Delete user.
+ </summary>
+ <doc>
+ Deletes user or role based on username
+ present in the selected scope based on the
+ filter options.
+ Sets READERROR error on failure.
+ </doc>
+ <error typeref="UserMgrError">
+ <doc>
+ <list>
+ <item>
+ <code>READERROR</code> - when unable to read user
+ </item>
+ </list>
+ </doc>
+ </error>
+ <argument type="string" name="username">
+ <summary> username of account that needs to be deleted. </summary>
+ </argument>
+ </method>
+
+ <method name="selectScope">
+ <summary>
+ sets the name-service repository scope.
+ </summary>
+ <doc>
+ Sets the name-service repository scope.
+ All subsequent operations will use the specified scope.
+ </doc>
+ <argument name="scope" typeref="ScopeType">
+ <summary> Specifies the name-service scope to
+ be used for managing users.
+ </summary>
+ </argument>
+ </method>
+
+ <method name="setFilter">
+ <summary>
+ Sets the filter options.
+ </summary>
+ <doc>
+ Sets the filter options which are used for
+ all the subsequent operations. The options
+ are user or role and search string. The
+ default search string is empty string ("").
+ </doc>
+ <argument name="usertype" typeref="UserType">
+ <summary> Specifies if users or roles
+ will be managed.
+ </summary>
+ </argument>
+ <argument name="searchstring" type="string">
+ <summary> Specifies the string to match
+ against user or role names to be managed.
+ </summary>
+ </argument>
+ </method>
+
+ <method name="isSystemLabeled">
+ <summary>Checks if System is Labeled.
+ </summary>
+ <doc>
+ Checks if the Trusted Extensions feature is
+ enabled on the system.
+ Returns true if successful and sets
+ Sets READERROR error on failure.
+ </doc>
+ <result type="boolean" />
+ <error typeref="UserMgrError">
+ <doc>
+ <list>
+ <item>
+ <code>READERROR</code> - when checking if Trusted Extensions is enabled fails.
+ </item>
+ </list>
+ </doc>
+ </error>
+ </method>
+
+ <method name="getUserType">
+ <summary>Gets the user type.
+ </summary>
+ <doc>
+ Checks if the user is role or normal user.
+ Returns UserType set to role or normal user.
+ Sets READERROR error on failure.
+ </doc>
+ <result typeref="UserType"/>
+ <error typeref="UserMgrError">
+ <doc>
+ <list>
+ <item>
+ <code>READERROR</code> - when checking if Trusted Extensions is enabled fails.
+ </item>
+ </list>
+ </doc>
+ </error>
+ <argument name="username" type="string">
+ <summary> Specifies user name to check for user or role.
+ </summary>
+ </argument>
+ </method>
+ </interface>
+</api>
--- a/components/visual-panels/usermgr/src/apis/usermgr.xml Mon Oct 28 17:52:58 2013 -0700
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,733 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
-<!--
- Copyright (c) 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.rad.usermgr">
-
- <struct name="Group">
- <summary>
- describes a Solaris group
- </summary>
- <doc>
- Fully describes a Solaris group, contains
- group name, group id, group members.
- </doc>
- <field type="string" name="groupName">
- <summary> Specifies the group name.</summary>
- </field>
- <field type="uinteger" name="groupID">
- <summary> Specifies the Gid of the group.</summary>
- </field>
- <field name="groupMembers">
- <summary> Specifies the members of the group.</summary>
- <list type="string"/>
- </field>
- </struct>
-
- <struct name="User">
- <summary>
- describes a Solaris user
- </summary>
- <doc>
- Fully describes a Solaris user, contains
- account, home directory and security attributes
- associated with a user. See man passwd(4),
- shadow(4), userattr(4) for more info on fields.
- </doc>
- <field type="string" name="username" nullable="false">
- <summary> username for the account. </summary>
- </field>
- <field type="uinteger" name="userID">
- <summary> UID for the account. </summary>
- </field>
- <field type="uinteger" name="groupID">
- <summary> GID for the account. </summary>
- </field>
- <field type="string" name="description" nullable="true">
- <summary> gecos info for the account. </summary>
- </field>
- <field type="string" name="homeDirectory" nullable="true">
- <summary> homedirectory location for the account. </summary>
- </field>
- <field type="string" name="defaultShell" nullable="true">
- <summary> default shell for the account. </summary>
- </field>
- <field type="integer" name="inactive">
- <summary> Number of inactivity days allowed for the account.
- </summary>
- </field>
- <field type="integer" name="min">
- <summary> Minimum number of days between password changes
- for the account.
- </summary>
- </field>
- <field type="integer" name="max">
- <summary> Maximum cemunber of days the password is valid for
- the account.
- </summary>
- </field>
- <field type="integer" name="warn">
- <summary> Number of days before password expires the user
- is warned.
- </summary>
- </field>
- <field type="string" name="expire" nullable="true">
- <summary> The date after which login will not be allowed for
- the account. The date format is %y-%m-%d %H:%M:%S.
- </summary>
- </field>
- <field type="string" name="lockAfterRetries" nullable="true">
- <summary> Specifies whether the account is locked
- after failed logins execeeds the allowable
- limit.
- </summary>
- </field>
- <field type="string" name="alwaysAuditFlags" nullable="true">
- <summary> Specifies per-user always audit pre-selection
- flags.
- </summary>
- </field>
- <field type="string" name="neverAuditFlags" nullable="true">
- <summary> Specifies per-user never-audit
- pre-selection flags.
- </summary>
- </field>
- <field type="string" name="type" nullable="true">
- <summary> specifies whether account is role or user. </summary>
- </field>
- <field type="string" name="defaultProj" nullable="true">
- <summary> specifies the default project for the account. </summary>
- </field>
- <field type="string" name="clearance" nullable="true">
- <summary> Specifies the max label at which the user can
- operate.
- </summary>
- </field>
- <field type="string" name="minLabel" nullable="true">
- <summary> Specifies the min labelthat the user can login .</summary>
- </field>
- <field type="string" name="roleAuth" nullable="true">
- <summary> Specifies whether the account user role or user
- password for role authentication.
- </summary>
- </field>
- <field type="string" name="idleCmd" nullable="true">
- <summary> Specifies when the desktop session for the user gets
- locked.
- </summary>
- </field>
- <field type="string" name="idleTime" nullable="true">
- <summary> Specifies the idle time before the idlecmd is
- executed.
- </summary>
- </field>
- <field type="string" name="accountStatus" nullable="true">
- <summary> Specifies the status of the account.</summary>
- </field>
- <field name="roles" nullable="true">
- <summary> Specifies the roles that have been assigned to the
- account.
- </summary>
- <list type="string"/>
- </field>
- <field name="profiles" nullable="true">
- <summary> Specifies the profiles that have been assigned to the
- account.
- </summary>
- <list type="string"/>
- </field>
- <field name="auths" nullable="true">
- <summary> Specifies the authorizations that have been assigned
- to the account.
- </summary>
- <list type="string"/>
- </field>
- <field name="defaultPriv" nullable="true">
- <summary> Specifies the default set of privileges assigned to
- user at login.
- </summary>
- <list type="string"/>
- </field>
- <field name="limitPriv" nullable="true">
- <summary> Specifies the maximum set of privileges the user or
- process started by the user can obtain.
- </summary>
- <list type="string"/>
- </field>
- <field name="groups" nullable="true">
- <summary> Specifies the supplemental groups that have been
- assigned to the account.
- </summary>
- <list type="string"/>
- </field>
- </struct>
-
- <struct name="UserChangeFields">
- <summary>
- Keeps track of all the fields that have been
- changed in the user object.
- </summary>
- <doc>
- Keeps track of all the fields that have been
- changed in the user object. For every field
- that has been changed in the User object the
- respective changeField will be set to true.
- </doc>
- <field type="boolean" name="gidChanged"/>
- <field type="boolean" name="descChanged"/>
- <field type="boolean" name="homedirChanged"/>
- <field type="boolean" name="defShellChanged"/>
- <field type="boolean" name="profilesChanged"/>
- <field type="boolean" name="rolesChanged"/>
- <field type="boolean" name="authsChanged"/>
- <field type="boolean" name="limitPrivChanged"/>
- <field type="boolean" name="groupsChanged"/>
- <field type="boolean" name="lockAfterRetriesChanged"/>
- <field type="boolean" name="alwaysAuditChanged"/>
- <field type="boolean" name="neverAuditChanged"/>
- <field type="boolean" name="typeChanged"/>
- <field type="boolean" name="defaultProjChanged"/>
- <field type="boolean" name="minLabelChanged"/>
- <field type="boolean" name="roleAuthChanged"/>
- <field type="boolean" name="idleCmdChanged"/>
- <field type="boolean" name="idleTimeChanged"/>
- <field type="boolean" name="expireChanged"/>
- <field type="boolean" name="minChanged"/>
- <field type="boolean" name="maxChanged"/>
- <field type="boolean" name="warnChanged"/>
- <field type="boolean" name="uidChanged"/>
- </struct>
-
- <enum name="UserMgrErrorType">
- <summary>User Manager api error types</summary>
- <value name="INVALIDDATA"/>
- <value name="USEREXISTS"/>
- <value name="PERMDENIED"/>
- <value name="READERROR"/>
- <value name="LASTADMIN"/>
- <value name="ROOTADMIN"/>
- <value name="PASSERROR"/>
- </enum>
-
- <enum name="ScopeType">
- <summary>Name service scope types</summary>
- <value name="FILES"/>
- <value name="LDAP"/>
- </enum>
-
- <struct name="UserMgrError">
- <field typeref="UserMgrErrorType" name="errorCode"/>
- </struct>
-
- <enum name="UserType">
- <value name="NORMAL"/>
- <value name="ROLE"/>
- </enum>
-
- <interface name="UserMgr">
- <summary>
- Set of operations that can be performed on
- users and roles.
- </summary>
- <version major="0" minor="1" stability="private"/>
-
- <property name="users" access="ro">
- <summary>
- Lists users.
- </summary>
- <doc>
- Lists the users present in the selected
- scope based on the filter options.
- </doc>
- <list typeref="User"/>
- <error typeref="UserMgrError">
- <doc>
- <list>
- <item>
- <code>READERROR</code> - when unable to read user after
- </item>
- </list>
- </doc>
- </error>
- </property>
-
- <property name="groups" access="ro">
- <summary>
- Lists groups.
- </summary>
- <doc>
- Lists the groups present in the selected
- scope.
- </doc>
- <list typeref="Group"/>
- <error typeref="UserMgrError">
- <doc>
- <list>
- <item>
- <code>READERROR</code> - when unable to read the groups database.
- </item>
- </list>
- </doc>
- </error>
- </property>
-
- <property name="shells" access="ro">
- <summary>
- Lists shells.
- </summary>
- <doc>
- Lists the set of available shells
- that can be set as default shell for users.
- </doc>
- <list type="string"/>
- <error typeref="UserMgrError">
- <doc>
- <list>
- <item>
- <code>READERROR</code> - when unable to read the default shells.
- </item>
- </list>
- </doc>
- </error>
- </property>
-
- <property name="defaultUser" typeref="User" access="ro">
- <summary>
- Lists user defaults.
- </summary>
- <doc>
- Lists the default values for groups, basedir,
- project, shell, skel, inactive, expire,
- auths, profiles, roles, limitPriv,
- defaultPriv, lockAfterRetries used for
- creation of users and roles.
- </doc>
- <error typeref="UserMgrError">
- <doc>
- <list>
- <item>
- <code>READERROR</code> - when unable to read default user properties.
- </item>
- </list>
- </doc>
- </error>
- </property>
-
- <property name="scopes" access="ro">
- <summary>
- Lists scopes.
- </summary>
- <doc>
- Lists the set of name service repositories
- that can be administered.
- </doc>
- <list type="string"/>
- <error typeref="UserMgrError">
- <doc>
- <list>
- <item>
- <code>READERROR</code> - when unable to read the name services that can be managed.
- </item>
- </list>
- </doc>
- </error>
- </property>
-
-
- <property name="roles" access="ro">
- <summary>
- Lists assigned roles.
- </summary>
- <doc>
- Lists the roles assigned to a user.
- </doc>
- <list type="string"/>
- <error typeref="UserMgrError">
- <doc>
- <list>
- <item>
- <code>READERROR</code> - when unable to read user roles
- </item>
- </list>
- </doc>
- </error>
- </property>
-
- <property name="profiles" access="ro">
- <summary>
- Lists assigned profiles.
- </summary>
- <doc>
- Lists the profiles assigned to a user.
- </doc>
- <list type="string"/>
- <error typeref="UserMgrError">
- <doc>
- <list>
- <item>
- <code>READERROR</code> - when unable to read user profiles.
- </item>
- </list>
- </doc>
- </error>
- </property>
-
- <property name="auths" access="ro">
- <summary>
- Lists assigned authorizations.
- </summary>
- <doc>
- Lists the authorizations assigned to a user.
- </doc>
- <list type="string"/>
- <error typeref="UserMgrError">
- <doc>
- <list>
- <item>
- <code>READERROR</code> - when unable to read user authorizations.
- </item>
- </list>
- </doc>
- </error>
- </property>
-
- <property name="defaultPrivs" access="ro">
- <summary>
- Lists default privileges.
- </summary>
- <doc>
- Lists the default privileges assigned to a user.
- </doc>
- <list type="string"/>
- <error typeref="UserMgrError">
- <doc>
- <list>
- <item>
- <code>READERROR</code> - when unable to read user's default privileges.
- </item>
- </list>
- </doc>
- </error>
- </property>
-
- <property name="limitPrivs" access="ro">
- <summary>
- Lists limit privileges.
- </summary>
- <doc>
- Lists the limit privileges assigned to a user.
- </doc>
- <list type="string"/>
- <error typeref="UserMgrError">
- <doc>
- <list>
- <item>
- <code>READERROR</code> - when unable to read user's limit privileges.
- </item>
- </list>
- </doc>
- </error>
- </property>
-
- <property name="supplGroups" access="ro">
- <summary>
- Lists supplemental groups.
- </summary>
- <doc>
- Lists the supplemental groups that the user
- is a member of.
- </doc>
- <list type="string"/>
- <error typeref="UserMgrError">
- <doc>
- <list>
- <item>
- <code>READERROR</code> - when unable to read user's supplemental groups.
- </item>
- </list>
- </doc>
- </error>
- </property>
-
- <property name="auditClasses" access="ro">
- <summary>
- Lists Assigned Audit Classes.
- </summary>
- <doc>
- Lists the audit classes that are assigned to
- the user.
- </doc>
- <list type="string"/>
- <error typeref="UserMgrError">
- <doc>
- <list>
- <item>
- <code>READERROR</code> - when unable to read user's assigned audit classes.
- </item>
- </list>
- </doc>
- </error>
- </property>
-
- <property name="pamUserConfFiles" access="ro">
- <summary>
- Lists users PAM configuration files.
- </summary>
- <doc>
- Lists the per-user PAM configuration files.
- </doc>
- <list type="string"/>
- <error typeref="UserMgrError">
- <doc>
- <list>
- <item>
- <code>READERROR</code> - when unable to read user specific PAM configuration files.
- </item>
- </list>
- </doc>
- </error>
- </property>
-
- <method name="getUser">
- <summary>
- gets User information for a given username.
- </summary>
- <doc>
- Gets the user information for a given username from
- the name service repository based on the filter
- options.
- </doc>
- <result typeref="User"/>
- <error typeref="UserMgrError">
- <doc>
- <list>
- <item>
- <code>READERROR</code> - when unable to read user
- </item>
- </list>
- </doc>
- </error>
- <argument type="string" name="username">
- <summary> Specifies the username for which the
- account information is to be retrieved.
- </summary>
- </argument>
- </method>
-
- <method name="addUser">
- <summary>
- Add user or role.
- </summary>
- <doc>
- Adds a user or role to the selected name
- service repository based on the filter
- options. Applies the properties set in
- the user object as the account, password,
- security attributes.
- Sets INVALIDDATA error when arguments are not valid.
- Sets PASSERROR error when password update fails.
- Sets READERROR error when unable to read user after
- successful addition of new user.
- Sets USEREXISTS error user already exists with same
- username.
- </doc>
- <result typeref="User"/>
- <error typeref="UserMgrError">
- <doc>
- <list>
- <item>
- <code>INVALIDDATA</code> - when arguments are not valid.
- </item>
- <item>
- <code>INVALIDDATA</code> - when arguments are not valid.
- </item>
- <item>
- <code>READERROR</code> - when unable to read user after adding new user.
- </item>
- </list>
- </doc>
- </error>
- <argument typeref="User" name="user">
- <summary> user object which contains attributes of new
- user account to be created.
- </summary>
- </argument>
- <argument type="secret" name="password">
- <summary> password to be set for the new user account.
- </summary>
- </argument>
- </method>
-
- <method name="modifyUser">
- <summary>
- Modify user or role.
- </summary>
- <doc>
- Modifies users or roles present in the selected
- scope based on the filter options.
- Applies the changed fields in the user object
- to the user or role attributes.
- Sets INVALIDDATA error when arguments are not valid.
- Sets PASSERROR error when password update fails.
- Sets READERROR error when unable to read user after
- successful modification of user.
- </doc>
- <result typeref="User"/>
- <error typeref="UserMgrError">
- <doc>
- <list>
- <item>
- <code>INVALIDDATA</code> - when arguments are not valid.
- </item>
- <item>
- <code>INVALIDDATA</code> - when arguments are not valid.
- </item>
- <item>
- <code>READERROR</code> - when unable to read user after adding new user.
- </item>
- </list>
- </doc>
- </error>
- <argument typeref="User" name="user">
- <summary> user object which contains user attributes
- to be modified.
- </summary>
- </argument>
- <argument type="secret" name="password" nullable="true">
- <summary> password to be set for the new user account.
- </summary>
- </argument>
- <argument typeref="UserChangeFields" name="changeFields">
- <summary> Indicates which fields have been modified
- in the user object by the client.
- </summary>
- </argument>
- </method>
-
- <method name="deleteUser">
- <summary>
- Delete user.
- </summary>
- <doc>
- Deletes user or role based on username
- present in the selected scope based on the
- filter options.
- Sets READERROR error on failure.
- </doc>
- <error typeref="UserMgrError">
- <doc>
- <list>
- <item>
- <code>READERROR</code> - when unable to read user
- </item>
- </list>
- </doc>
- </error>
- <argument type="string" name="username">
- <summary> username of account that needs to be deleted. </summary>
- </argument>
- </method>
-
- <method name="selectScope">
- <summary>
- sets the name-service repository scope.
- </summary>
- <doc>
- Sets the name-service repository scope.
- All subsequent operations will use the specified scope.
- </doc>
- <argument name="scope" typeref="ScopeType">
- <summary> Specifies the name-service scope to
- be used for managing users.
- </summary>
- </argument>
- </method>
-
- <method name="setFilter">
- <summary>
- Sets the filter options.
- </summary>
- <doc>
- Sets the filter options which are used for
- all the subsequent operations. The options
- are user or role and search string.
- </doc>
- <argument name="usertype" typeref="UserType">
- <summary> Specifies if users or roles
- will be managed.
- </summary>
- </argument>
- <argument name="searchstring" type="string">
- <summary> Specifies the string to match
- against user or role names to be managed.
- </summary>
- </argument>
- </method>
-
- <method name="isSystemLabeled">
- <summary>Checks if System is Labeled.
- </summary>
- <doc>
- Checks if the Trusted Extensions feature is
- enabled on the system.
- Returns true if successful and sets
- Sets READERROR error on failure.
- </doc>
- <result type="boolean" />
- <error typeref="UserMgrError">
- <doc>
- <list>
- <item>
- <code>READERROR</code> - when checking if Trusted Extensions is enabled fails.
- </item>
- </list>
- </doc>
- </error>
- </method>
-
- <method name="getUserType">
- <summary>Gets the user type.
- </summary>
- <doc>
- Checks if the user is role or normal user.
- Returns UserType set to role or normal user.
- Sets READERROR error on failure.
- </doc>
- <result typeref="UserType"/>
- <error typeref="UserMgrError">
- <doc>
- <list>
- <item>
- <code>READERROR</code> - when checking if Trusted Extensions is enabled fails.
- </item>
- </list>
- </doc>
- </error>
- <argument name="username" type="string">
- <summary> Specifies user name to check for user or role.
- </summary>
- </argument>
- </method>
- </interface>
-</api>
--- a/components/visual-panels/usermgr/src/java/vpanels/app/usermgr/build.xml Mon Oct 28 17:52:58 2013 -0700
+++ b/components/visual-panels/usermgr/src/java/vpanels/app/usermgr/build.xml Wed Oct 30 16:53:48 2013 -0400
@@ -19,7 +19,7 @@
CDDL HEADER END
- Copyright (c) 2010, 2012, Oracle and/or its affiliates. All rights reserved.
+ Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved.
-->
<project name="vpanels-panels-usermgr" default="jar">
@@ -32,7 +32,6 @@
<fileset refid="proj.extlibs" />
<path refid="classpath.panels" />
<pathelement location="${abs.rad.java}/rad.jar" />
- <pathelement location="${abs.rad.java}/adr.jar" />
</path>
<property name="panel.panel" value="usermgr" />
@@ -44,7 +43,7 @@
<property name="panel.icon.dst" value="usermgr.png" />
<target name="generate_project" depends="panelsdef.generate_project">
- <generate.adrimpl api="usermgr.xml" />
+ <generate.adr api="usermgr.adr" />
<generate.struct/>
</target>
</project>
--- a/components/visual-panels/usermgr/src/java/vpanels/app/usermgr/com/oracle/solaris/vp/panels/usermgr/client/swing/AddUserAction.java Mon Oct 28 17:52:58 2013 -0700
+++ b/components/visual-panels/usermgr/src/java/vpanels/app/usermgr/com/oracle/solaris/vp/panels/usermgr/client/swing/AddUserAction.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.usermgr.client.swing;
@@ -30,6 +30,7 @@
import java.util.List;
import javax.swing.*;
import javax.swing.text.JTextComponent;
+import com.oracle.solaris.rad.client.ADRUinteger;
import com.oracle.solaris.vp.panel.common.action.*;
import com.oracle.solaris.vp.panel.common.control.*;
import com.oracle.solaris.vp.panel.swing.action.AddManagedObjectAction;
@@ -52,7 +53,7 @@
<UserManagedObject, AddUserAction.Data, UserManagedObject> {
private UserManagedObject umo = null;
- private UserImpl user = null;
+ private User user = null;
//
// Inner classes
@@ -76,10 +77,10 @@
public MutableProperty<String> groupProperty = new StringProperty();
public MutableProperty<String> homeProperty = new StringProperty();
public MutableProperty<String> shellProperty = new StringProperty();
- public MutableProperty<char[]> passProperty =
- new BasicMutableProperty<char[]>();
- public MutableProperty<char[]> passConfirmProperty =
- new BasicMutableProperty<char[]>();
+ public MutableProperty<String> passProperty =
+ new BasicMutableProperty<String>();
+ public MutableProperty<String> passConfirmProperty =
+ new BasicMutableProperty<String>();
private JOptionPane pane;
private JDialog dialog;
@@ -102,7 +103,7 @@
title);
}
- private JPanel createForm() {
+ private JPanel createForm() {
ActionListener listener =
new ActionListener() {
@Override
@@ -210,7 +211,7 @@
for (Group g : descriptor.getGroups()) {
groupCombo.addItem(g.getGroupName());
- if (user.getGroupID() == g.getGroupID()) {
+ if (user.getGroupID().equals(g.getGroupID())) {
groupCombo.setSelectedItem(g.getGroupName());
}
}
@@ -265,13 +266,13 @@
gbc.gridx = GridBagConstraints.RELATIVE;
form.add(shellCombo, gbc);
- // Password
+ // Password
actString = new ActionString("usermgr.basic.label.pass");
JLabel passLabel = new JLabel(actString.getString());
passLabel.setDisplayedMnemonic(actString.getMnemonic());
- JPasswordField passField = new JPasswordField(width);
- passField.addActionListener(listener);
+ JPasswordField passField = new JPasswordField(width);
+ passField.addActionListener(listener);
new PasswordFieldPropertySynchronizer(passProperty, passField, false);
// Connect the label to the field
@@ -377,11 +378,9 @@
@Override
public UserManagedObject workBusy(List<UserManagedObject> selection,
- Data uData) throws ActionFailedException,
- ActionAbortedException,
+ Data uData) throws ActionFailedException, ActionAbortedException,
ActionUnauthorizedException {
-
UserMgrPanelDescriptor descriptor = control.getPanelDescriptor();
String username = uData.nameProperty.getValue();
@@ -394,8 +393,8 @@
String shell = uData.shellProperty.getValue();
String homedir = uData.homeProperty.getValue();
- char[] password = uData.passProperty.getValue();
- char[] password2 = uData.passConfirmProperty.getValue();
+ String password = uData.passProperty.getValue();
+ String password2 = uData.passConfirmProperty.getValue();
UserMgrUtils.validatePassword(true, password, password2);
UserMgrUtils.clearPassword(password2);
@@ -403,7 +402,7 @@
user.setUsername(username);
if (uData.uidProperty.isChanged()) {
long uid = uData.uidProperty.getValue();
- user.setUserID(uid);
+ user.setUserID(new ADRUinteger(uid));
}
user.setDescription(description);
--- a/components/visual-panels/usermgr/src/java/vpanels/app/usermgr/com/oracle/solaris/vp/panels/usermgr/client/swing/AdvancedSettingsDialog.java Mon Oct 28 17:52:58 2013 -0700
+++ b/components/visual-panels/usermgr/src/java/vpanels/app/usermgr/com/oracle/solaris/vp/panels/usermgr/client/swing/AdvancedSettingsDialog.java Wed Oct 30 16:53:48 2013 -0400
@@ -20,7 +20,7 @@
*/
/*
- * Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011, 2013, Oracle and/or its affiliates. All rights reserved.
*/
package com.oracle.solaris.vp.panels.usermgr.client.swing;
@@ -90,6 +90,7 @@
new GroupsSettings(),
new RolesSettings(),
new RightsSettings(),
+ new AuthRightsSettings(),
new AuthsSettings()
};
@@ -97,6 +98,7 @@
private AdvancedSettings roleSettings[] = {
new GroupsSettings(),
new RightsSettings(),
+ new AuthRightsSettings(),
new AuthsSettings()
};
@@ -108,6 +110,7 @@
private String title = Finder.getString("usermgr.advanced.title");
private MutableProperty<String> rightsProperty = new StringProperty();
+ private MutableProperty<String> authRightsProperty = new StringProperty();
private MutableProperty<String> rolesProperty = new StringProperty();
private MutableProperty<String> groupsProperty = new StringProperty();
private MutableProperty<String> authsProperty = new StringProperty();
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/components/visual-panels/usermgr/src/java/vpanels/app/usermgr/com/oracle/solaris/vp/panels/usermgr/client/swing/AuthRightsPanel.java Wed Oct 30 16:53:48 2013 -0400
@@ -0,0 +1,631 @@
+/*
+ * 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) 2004, 2013, Oracle and/or its affiliates. All rights reserved.
+ */
+
+package com.oracle.solaris.vp.panels.usermgr.client.swing;
+
+import javax.swing.*;
+import javax.swing.event.*;
+import javax.swing.tree.*;
+import javax.swing.border.*;
+
+import java.awt.*;
+import java.awt.event.*;
+import java.util.*;
+
+import com.oracle.solaris.vp.util.misc.finder.Finder;
+
+/**
+ * SMC code adapted for Visual Panels
+ *
+ * Rights Profiles Panel for Rights Settings
+ */
+public class AuthRightsPanel extends JPanel {
+
+
+ public static Arranger profPanel;
+ private static DblTreeNode srcRoot;
+ private static DblTreeNode dstRoot;
+ private DefaultTreeModel srcModel, dstModel;
+
+ private DblTreeNode [] profNodes;
+ private ProfTreeNode [] profTreeNodes;
+
+ private ProfTreeNode currProfTreeNode;
+ private DblTreeNode currDblTreeNode;
+
+ private String targetRightName;
+ private String targetRight;
+ private JPanel securityPanel;
+
+ private UserManagedObject userObj = null;
+ private UserMgrPanelDescriptor panelDesc = null;
+
+ private Vector vAllRightObjs = null;
+
+ private boolean isProfListOK = true;
+
+ /**
+ * Constructs a panel to contain supplementary rights properties for
+ * the right object.
+ */
+ public AuthRightsPanel(UserMgrPanelDescriptor panelDesc,
+ UserManagedObject userObj) {
+
+ super();
+ this.panelDesc = panelDesc;
+ this.userObj = userObj;
+
+ createGui();
+ loadProfiles();
+ } // constructor
+
+
+ /**
+ * Method for creating GUI
+ */
+ private void createGui() {
+
+ // Set the panel layout
+ GridBagConstraints gbc = new GridBagConstraints();
+ this.setLayout(new GridBagLayout());
+
+ // Excluded and Included rights panel
+ securityPanel = null;
+
+ profPanel = new Arranger("usermgr.advanced.auth_rights.available",
+ "usermgr.advanced.auth_rights.granted");
+
+ Dimension dimension = new Dimension(200, 300);
+ profPanel.srcTree.setCellRenderer(new ProfileRenderer(this));
+ profPanel.srcTree.setVisibleRowCount(10);
+ profPanel.srcTree.setSize(dimension);
+
+ profPanel.dstTree.setCellRenderer(new ProfileRenderer(this));
+ profPanel.dstTree.setVisibleRowCount(10);
+ profPanel.dstTree.setSize(dimension);
+
+ Constraints.constrain(this, profPanel,
+ 0, 0, 1, 1,
+ gbc.BOTH, gbc.CENTER,
+ 1.0, 1.0, 10, 10, 10, 10);
+
+ } // end createGui
+
+
+ /**
+ * Load the Source and Destination trees for rights excluded and
+ * included lists.
+ */
+ private void loadProfiles() {
+
+ // Reset the data models. So old data is discarded
+ profPanel.resetModels();
+
+
+ // Initialize the excluded rights list with all profiles
+ // except for the current one, since a profile can not be
+ // assigned to itself. Note that all profiles are created
+ // as top-level profiles.
+
+ vAllRightObjs = getAvailableProfs();
+
+ srcModel = (DefaultTreeModel) profPanel.srcTree.getModel();
+ srcRoot = (DblTreeNode) srcModel.getRoot();
+
+ dstModel = (DefaultTreeModel) profPanel.dstTree.getModel();
+ dstRoot = (DblTreeNode) dstModel.getRoot();
+
+ profNodes = new DblTreeNode[vAllRightObjs.size()];
+ profTreeNodes = new ProfTreeNode[vAllRightObjs.size()];
+
+ int n = 0;
+ Enumeration e = vAllRightObjs.elements();
+
+ // Build an array of tree nodes that can be used for sorting.
+
+ while (e.hasMoreElements()) {
+ String rightObj = (String)e.nextElement();
+ String rightName = rightObj;
+
+ profTreeNodes[n] = new ProfTreeNode(rightObj);
+
+ n++;
+ }
+
+ // Sort the list of ProfTreeNode objects.
+
+ if (profTreeNodes.length > 1) {
+ NodeCompare comp = new NodeCompare();
+ Sort.sort(profTreeNodes, comp);
+ }
+
+ // With the sorted tree nodes, now we build the src tree.
+ for (int i = 0; i < profTreeNodes.length; i++) {
+ profNodes[i] = new DblTreeNode((Object)profTreeNodes[i]);
+
+ srcModel.insertNodeInto(profNodes[i], srcRoot, i);
+ TreePath nodepath = new TreePath(profNodes[i].getPath());
+ // Make initial display of excluded list
+ profPanel.srcTree.scrollPathToVisible(nodepath);
+ }
+
+
+ // Set TreeModel listeners
+ srcModel.addTreeModelListener(new TreeModelListener() {
+
+ public void treeNodesInserted(TreeModelEvent e) {
+ enableProfileChoices(e);
+ }
+
+ public void treeNodesRemoved(TreeModelEvent e) {
+ disableProfileChoices(e);
+ }
+
+ public void treeNodesChanged(TreeModelEvent e) {}
+
+ public void treeStructureChanged(TreeModelEvent e) {}
+
+ });
+
+ dstModel.addTreeModelListener(new TreeModelListener() {
+
+ public void treeNodesInserted(TreeModelEvent e) {
+ updateDstTree(e);
+ }
+
+ public void treeNodesRemoved(TreeModelEvent e) {
+ updateDstTree(e);
+ }
+
+ public void treeNodesChanged(TreeModelEvent e) {}
+
+ public void treeStructureChanged(TreeModelEvent e) {}
+
+ });
+
+ // Build subprofiles recursively
+ for (int i = 0; i < profNodes.length; i++) {
+ rebuildSubProfiles(profNodes[i], profNodes[i]);
+ }
+
+ String [] subProfList = null;
+
+ // Get the list of profiles that are assigned to current user/role
+ // (in user_attr entry).
+ String rights = userObj.getAuthRights();
+ if (rights != null) {
+ subProfList = userObj.getAuthRights().split(",");
+ }
+
+ profPanel.setInitSelection();
+ if (rights == null || subProfList == null) {
+ return;
+ }
+
+ // Move subprofiles of current profile from excluded list
+ // to included list.
+ // Note that a dimmed profile will stay dimmed after the move.
+ // Therefore, a user can not "unassign" a dimmed profile on the
+ // included list.
+
+
+ for (int j = 0; j < subProfList.length; j++) {
+ boolean foundSubProf = false;
+
+ int count = 0;
+ for (int i = 0; i < profNodes.length; i++) {
+ String profString = profNodes[i].toString();
+
+ if (profString.equals(subProfList[j])) {
+ foundSubProf = true;
+ count = i;
+ break;
+ }
+
+ }
+
+ if (foundSubProf) {
+ profPanel.initLeaf(profPanel.srcTree,
+ profPanel.dstTree, profNodes[count]);
+ }
+ }
+
+ profPanel.setInitSelection();
+
+ } // end loadProfiles
+
+
+ private void updateDstTree(TreeModelEvent e) {
+
+ Vector<DblTreeNode> inclProfsVec = new Vector<DblTreeNode>();
+ Enumeration inclProfsEnum = dstRoot.breadthFirstEnumeration();
+
+ while (inclProfsEnum.hasMoreElements()) {
+ DblTreeNode node = (DblTreeNode)inclProfsEnum.nextElement();
+ inclProfsVec.addElement(node);
+ node.setConflict(false);
+ }
+
+ // Maintain included names as array as optimization
+
+ DblTreeNode [] inclProfs = new DblTreeNode[inclProfsVec.size()];
+ inclProfsVec.copyInto(inclProfs);
+
+ if (inclProfs.length < 2)
+ return;
+
+ for (int i = 0; i < inclProfs.length; i++) {
+ String testString = inclProfs[i].toString();
+
+ for (int j = i + 1; j < inclProfs.length; j++) {
+ if (testString.equals(inclProfs[j].toString())) {
+ inclProfs[j].setConflict(true);
+ inclProfs[i].setConflict(true);
+ TreeNode [] nodes = inclProfs[j].getPath();
+ DblTreeNode parentProf = (DblTreeNode)nodes[1];
+ parentProf.setConflict(true);
+ }
+ }
+ }
+
+ } // end updateDstTree
+
+
+ private void enableProfileChoices(TreeModelEvent e) {
+
+ // Get names of currently included profiles
+ if (e.getPath().length > 1)
+ return;
+
+ Vector<String> inclProfsVec = new Vector<String>();
+ Enumeration inclProfs = dstRoot.depthFirstEnumeration();
+
+ while (inclProfs.hasMoreElements()) {
+ inclProfsVec.addElement(inclProfs.nextElement().toString());
+ }
+
+ // Maintain included names as array as optimization
+
+ String [] inclProfNames = new String[inclProfsVec.size()];
+ inclProfsVec.copyInto(inclProfNames);
+
+ // Look for excluded list items needing updating
+
+ Enumeration topProfs = srcRoot.children();
+ while (topProfs.hasMoreElements()) {
+ DblTreeNode nextTop = (DblTreeNode)topProfs.nextElement();
+ boolean matchFound = false;
+ Enumeration exclProfs = nextTop.depthFirstEnumeration();
+
+ while (exclProfs.hasMoreElements()) {
+ String testString = exclProfs.nextElement().toString();
+ for (int i = 0; i < inclProfNames.length; i++) {
+ if (testString.equals(inclProfNames[i])) {
+ matchFound = true;
+ break;
+ }
+ }
+ if (matchFound)
+ break;
+ }
+
+ // A Profile hierarchy needs to be enabled
+
+ if (!matchFound) {
+ exclProfs = nextTop.depthFirstEnumeration();
+ while (exclProfs.hasMoreElements()) {
+ DblTreeNode onNode =
+ (DblTreeNode) exclProfs.nextElement();
+ onNode.setConflict(false);
+ }
+ nextTop.setConflict(false);
+ }
+ }
+
+ } // end enableProfileChoices
+
+
+ private void disableProfileChoices(TreeModelEvent e) {
+
+ if (e.getPath().length > 1)
+ return;
+
+ Object[] children = e.getChildren();
+ DblTreeNode node = (DblTreeNode)children[0];
+ Enumeration kids = node.breadthFirstEnumeration();
+ while (kids.hasMoreElements()) {
+ disableRecursively((DblTreeNode)kids.nextElement());
+ }
+
+ } // end disableProfileChoices
+
+
+ private void disableRecursively(DblTreeNode node) {
+
+ String testString = node.toString();
+ Enumeration exclProfs = srcRoot.breadthFirstEnumeration();
+ while (exclProfs.hasMoreElements()) {
+ DblTreeNode exclNode = (DblTreeNode)exclProfs.nextElement();
+ if (testString.equals(exclNode.toString())) {
+ TreeNode [] nodes = exclNode.getPath();
+
+ DblTreeNode parentProf = (DblTreeNode)nodes[1];
+ if (!parentProf.isConflict()) {
+ parentProf.setConflict(true);
+ exclNode.setConflict(true);
+ }
+ }
+ }
+
+ } // end disableRecursively
+
+
+ private void rebuildSubProfiles(DblTreeNode profNode, DblTreeNode topNode) {
+
+ // First unlink the old children
+ int childCount = profNode.getChildCount();
+ for (int i = 0; i < childCount; i++) {
+ DblTreeNode child = (DblTreeNode) srcModel.getChild(profNode, 0);
+ srcModel.removeNodeFromParent(child);
+ }
+
+ // Then recursively construct new nodes for all the children
+ DblTreeNode childNode;
+ int i = 0;
+ Enumeration topList = topNode.breadthFirstEnumeration();
+
+ // Find sub-profile list in RightObj of cached tree node
+ ProfTreeNode pTreeNode = (ProfTreeNode)profNode.getUserObject();
+ String rObj = pTreeNode.getRightObj();
+ // ProfAttrObj targetProfAttr = rObj.getProfAttr();
+
+ String [] profList = null; // targetProfAttr.getProfNames();
+
+ if (profList == null)
+ return;
+
+ for (int k = 0; k < profList.length; k++) {
+ String name = profList[k];
+
+ // Prevent infinite recursive loops
+ boolean cyclic = false;
+ while (topList.hasMoreElements()) {
+ if (name.equals(topList.nextElement().toString())) {
+ cyclic = true;
+ // Mark the parent as cyclic
+ topNode.setCyclic(true);
+ Enumeration dupNodes = topNode.breadthFirstEnumeration();
+ while (dupNodes.hasMoreElements()) {
+ childNode = (DblTreeNode)dupNodes.nextElement();
+ if (name.equals(childNode.toString())) {
+ childNode.setCyclic(true);
+ }
+ }
+ break;
+ }
+ }
+
+ for (int j = 0; j < profTreeNodes.length; j++) {
+ if (name.equals(profTreeNodes[j].toString())) {
+ childNode = new DblTreeNode((Object)profTreeNodes[j]);
+
+ srcModel.insertNodeInto(childNode, profNode, i++);
+ childNode.setEnabled(false);
+ if (cyclic)
+ childNode.setCyclic(true);
+ else
+ rebuildSubProfiles(childNode, topNode);
+ }
+ }
+ }
+
+ } // end rebuildSubProfiles
+
+
+ public String updateRightSubProps(String rightObj) {
+
+ if (isProfListOK) {
+ Vector<String> vAssignedProfs = new Vector<String>();
+
+ // Get the first generation children that are assigned to
+ // current profile.
+ DblTreeNode root = (DblTreeNode)dstModel.getRoot();
+ Enumeration kids;
+ kids = root.children();
+
+ while (kids.hasMoreElements()) {
+ DblTreeNode childNode;
+ childNode = (DblTreeNode)kids.nextElement();
+ vAssignedProfs.addElement(childNode.toString());
+ }
+
+ // ProfAttrObj profAttr = rightObj.getProfAttr();
+ // profAttr.setProfNamesVector(vAssignedProfs);
+ }
+ return (rightObj);
+
+ } // end updateRightSubProps
+
+ public Vector<String> getAssignedProfs() {
+ Vector<String> vAssignedProfs = new Vector<String>();
+
+ if (!isProfListOK) {
+ return vAssignedProfs;
+ }
+
+ // Get the first generation children that are assigned to
+ // current profile.
+ DblTreeNode root = (DblTreeNode)dstModel.getRoot();
+ Enumeration kids;
+ kids = root.children();
+ while (kids.hasMoreElements()) {
+ DblTreeNode childNode;
+ childNode = (DblTreeNode)kids.nextElement();
+ vAssignedProfs.addElement(childNode.toString());
+ }
+
+ return vAssignedProfs;
+ }
+
+ private Vector<String> getAvailableProfs() {
+ Vector<String> rights = new Vector<String>();
+ for (String s : panelDesc.getProfiles()) {
+ rights.add(s);
+
+ }
+ return (rights);
+ }
+
+ public void setUser(UserManagedObject userObj) {
+ this.userObj = userObj;
+ loadProfiles();
+ }
+
+ public UserManagedObject updateUser() {
+ Vector<String> vProfs = getAssignedProfs();
+ String profStr;
+
+ if (vProfs.size() > 0) {
+ profStr = vProfs.elementAt(0);
+ } else {
+ profStr = "";
+ }
+
+ for (int i = 1; i < vProfs.size(); i++) {
+ profStr = profStr.concat(",");
+ profStr = profStr.concat(vProfs.elementAt(i));
+ }
+
+ userObj.getAuthRightsProperty().setValue(profStr);
+
+ return (userObj);
+ }
+
+
+
+class ProfileRenderer extends DefaultTreeCellRenderer {
+
+ private boolean selected;
+ Icon warningIcon;
+ AuthRightsPanel rightsPanel;
+
+ public ProfileRenderer(AuthRightsPanel rightsPanel) {
+
+ this.rightsPanel = rightsPanel;
+ setClosedIcon(null);
+ setOpenIcon(null);
+ setLeafIcon(null);
+ warningIcon = Finder.getIcon("images/warning.gif");
+
+ }
+
+
+ public Component getTreeCellRendererComponent(
+ JTree tree,
+ Object value,
+ boolean selected,
+ boolean expanded,
+ boolean leaf,
+ int row,
+ boolean hasFocus) {
+
+ FocusEvent e = null;
+
+ this.selected = selected;
+
+ DefaultTreeCellRenderer cr =
+ (DefaultTreeCellRenderer)tree.getCellRenderer();
+ cr.setLeafIcon(null);
+ DblTreeNode node = (DblTreeNode)value;
+
+ if (node.getParent() == null) {
+ // maybe the same as row == 0
+ setText(node.toString());
+
+ } else if (node.getUserObject() instanceof ProfTreeNode) {
+ ProfTreeNode profsdef = (ProfTreeNode)node.getUserObject();
+ setText(profsdef.toString());
+ // setIcon(actionIcon);
+
+ if (node.isConflict())
+ if (tree == rightsPanel.profPanel.dstTree)
+ cr.setLeafIcon(warningIcon);
+ }
+
+ super.getTreeCellRendererComponent(tree, value, selected, expanded,
+ leaf, row, hasFocus);
+
+ return this;
+
+ } // end getTreeCellRendererComponent
+
+}
+
+class ProfTreeNode {
+
+ String name;
+ String rightObj = null;
+
+ public ProfTreeNode(String rightObj) {
+ this.rightObj = rightObj;
+ this.name = rightObj;
+ }
+
+ public String getRightObj() {
+ return rightObj;
+ }
+
+ public String toString() {
+ return name;
+ }
+
+}
+
+class NodeCompare implements Compare {
+
+ /**
+ * The compare method compares two ProfTreeNode objects by comparing
+ * their profile names. The parameters are specified as Object class
+ * objects for QuickSort.
+ *
+ * @param a The first Node.
+ * @param b The second Node.
+ *
+ */
+ public final int doCompare(Object a, Object b) {
+
+ ProfTreeNode e1, e2;
+ String e1Name, e2Name;
+
+ e1 = (ProfTreeNode)a;
+ e2 = (ProfTreeNode)b;
+ e1Name = e1.toString();
+ e2Name = e2.toString();
+ return (e1Name.compareTo(e2Name));
+
+ }
+
+}
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/components/visual-panels/usermgr/src/java/vpanels/app/usermgr/com/oracle/solaris/vp/panels/usermgr/client/swing/AuthRightsSettings.java Wed Oct 30 16:53:48 2013 -0400
@@ -0,0 +1,78 @@
+/*
+ * 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.panels.usermgr.client.swing;
+
+import javax.swing.*;
+import com.oracle.solaris.vp.util.misc.finder.Finder;
+import com.oracle.solaris.vp.util.misc.property.*;
+
+/**
+ * Implements Advanced Settings for Authenticated Profiles
+ */
+public class AuthRightsSettings extends AdvancedSettings {
+
+ private static final String NAME =
+ Finder.getString("usermgr.advanced.auth_rights");
+ private static final Icon ICON = Finder.getIcon(
+ "images/rights-24.png");
+
+ private UserMgrPanelDescriptor panelDesc = null;
+ private UserManagedObject userObj = null;
+ private AuthRightsPanel panel = null;
+
+ public AuthRightsSettings() {
+ super(NAME, ICON);
+ }
+
+ public void setUser(UserManagedObject userObj) {
+ if (panel == null) {
+ panel = new AuthRightsPanel(panelDesc, userObj);
+ }
+ panel.setUser(userObj);
+ getProperty().update(userObj.getAuthRights(), false);
+ }
+
+ public void updateUser() {
+ userObj = panel.updateUser();
+ getProperty().update(userObj.getAuthRights(), false);
+ }
+
+ public boolean isChanged() {
+ if (userObj != null) {
+ return (userObj.getAuthRightsProperty().isChanged());
+ } else {
+ return false;
+ }
+ }
+
+ public void init(UserMgrPanelDescriptor panelDesc) {
+ this.panelDesc = panelDesc;
+ }
+
+ public JPanel getPanel() {
+ return panel;
+ }
+}
--- a/components/visual-panels/usermgr/src/java/vpanels/app/usermgr/com/oracle/solaris/vp/panels/usermgr/client/swing/FilterUserAction.java Mon Oct 28 17:52:58 2013 -0700
+++ b/components/visual-panels/usermgr/src/java/vpanels/app/usermgr/com/oracle/solaris/vp/panels/usermgr/client/swing/FilterUserAction.java Wed Oct 30 16:53:48 2013 -0400
@@ -20,7 +20,7 @@
*/
/*
- * Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011, 2013, Oracle and/or its affiliates. All rights reserved.
*/
package com.oracle.solaris.vp.panels.usermgr.client.swing;
@@ -51,7 +51,7 @@
<UserManagedObject, FilterUserAction.Data, UserManagedObject> {
private UserManagedObject umo = null;
- private UserImpl user = null;
+ private User user = null;
//
// Inner classes
--- a/components/visual-panels/usermgr/src/java/vpanels/app/usermgr/com/oracle/solaris/vp/panels/usermgr/client/swing/UserManagedObject.java Mon Oct 28 17:52:58 2013 -0700
+++ b/components/visual-panels/usermgr/src/java/vpanels/app/usermgr/com/oracle/solaris/vp/panels/usermgr/client/swing/UserManagedObject.java Wed Oct 30 16:53:48 2013 -0400
@@ -20,13 +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.usermgr.client.swing;
import java.util.*;
import javax.swing.*;
+import com.oracle.solaris.rad.client.ADRUinteger;
import com.oracle.solaris.vp.panel.common.model.AbstractManagedObject;
import com.oracle.solaris.rad.usermgr.*;
import com.oracle.solaris.vp.util.misc.*;
@@ -59,10 +60,10 @@
private UserMgrPanelDescriptor descriptor;
private UserType type = UserType.NORMAL;
private boolean isNewUser = false;
- private UserChangeFieldsImpl modChanges = null;
+ private UserChangeFields modChanges = null;
- private MutableProperty<Long> groupIdProperty =
- new LongProperty();
+ private MutableProperty<ADRUinteger> groupIdProperty =
+ new ADRUintProperty();
private MutableProperty<String> homeDirProperty =
new StringProperty();
@@ -70,6 +71,9 @@
private MutableProperty<String> rightsProperty =
new StringProperty();
+ private MutableProperty<String> authRightsProperty =
+ new StringProperty();
+
private MutableProperty<String> rolesProperty =
new StringProperty();
@@ -85,8 +89,8 @@
private MutableProperty<String> userDescProperty =
new StringProperty();
- private MutableProperty<Long> userIdProperty =
- new LongProperty();
+ private MutableProperty<ADRUinteger> userIdProperty =
+ new ADRUintProperty();
private MutableProperty<String> userNameProperty =
new StringProperty();
@@ -94,13 +98,13 @@
private MutableProperty<String> accountStatusProperty =
new StringProperty();
- private MutableProperty<char[]> passProperty =
- new BasicMutableProperty<char[]>();
+ private MutableProperty<String> passProperty =
+ new BasicMutableProperty<String>();
{
ChangeableAggregator aggregator = getChangeableAggregator();
aggregator.addChangeables(groupIdProperty, homeDirProperty,
- passProperty, shellProperty,
- rolesProperty, rightsProperty, authsProperty, groupsProperty,
+ passProperty, shellProperty, rolesProperty, rightsProperty,
+ authRightsProperty, authsProperty, groupsProperty,
userDescProperty, userIdProperty, userNameProperty);
}
@@ -110,7 +114,7 @@
UserManagedObject(UserMgrPanelDescriptor descriptor,
User user, UserType type,
- char[] password, boolean bNewUser) {
+ String password, boolean bNewUser) {
this.descriptor = descriptor;
this.type = type;
@@ -125,6 +129,7 @@
rolesProperty.update(listToString(user.getRoles()), true);
rightsProperty.update(listToString(user.getProfiles()), true);
+ authRightsProperty.update(listToString(user.getAuthProfiles()), true);
authsProperty.update(listToString(user.getAuths()), true);
groupsProperty.update(listToString(user.getGroups()), true);
accountStatusProperty.update(user.getAccountStatus() == null ? ""
@@ -136,7 +141,7 @@
}
UserManagedObject(UserMgrPanelDescriptor descriptor,
- User user, char[] password) {
+ User user, String password) {
this(descriptor, user, UserType.NORMAL, password, true);
}
@@ -177,6 +182,7 @@
.append("\n\ttype: ")
.append(type == UserType.NORMAL ? "user" : "role")
.append("\n\trights: ").append(getRights())
+ .append("\n\tauth_rights: ").append(getAuthRights())
.append("\n\tauths: ").append(getAuths())
.append("\n\tgroups: ").append(getGroups())
.append("\n\troles: ").append(getRoles())
@@ -196,13 +202,13 @@
// Additional attributes
rolesProperty.update(listToString(user.getRoles()), true);
rightsProperty.update(listToString(user.getProfiles()), true);
+ authRightsProperty.update(listToString(user.getAuthProfiles()), true);
authsProperty.update(listToString(user.getAuths()), true);
groupsProperty.update(listToString(user.getGroups()), true);
}
- public void setUser(User user, char[] password) {
-
+ public void setUser(User user, String password) {
setUser(user);
passProperty.update(password, true);
@@ -211,7 +217,7 @@
// UserManagedObject methods
//
- public MutableProperty<Long> getGroupIdProperty() {
+ public MutableProperty<ADRUinteger> getGroupIdProperty() {
return groupIdProperty;
}
@@ -219,11 +225,14 @@
return homeDirProperty;
}
-
public MutableProperty<String> getRightsProperty() {
return rightsProperty;
}
+ public MutableProperty<String> getAuthRightsProperty() {
+ return authRightsProperty;
+ }
+
public MutableProperty<String> getRolesProperty() {
return rolesProperty;
}
@@ -240,7 +249,7 @@
return userDescProperty;
}
- public MutableProperty<char[]> getPassProperty() {
+ public MutableProperty<String> getPassProperty() {
return passProperty;
}
@@ -248,7 +257,7 @@
return shellProperty;
}
- public MutableProperty<Long> getUserIdProperty() {
+ public MutableProperty<ADRUinteger> getUserIdProperty() {
return userIdProperty;
}
@@ -268,11 +277,11 @@
return userDescProperty.getValue();
}
- public long getUserId() {
+ public ADRUinteger getUserId() {
return userIdProperty.getValue();
}
- public long getGroupId() {
+ public ADRUinteger getGroupId() {
return groupIdProperty.getValue();
}
@@ -280,7 +289,7 @@
return homeDirProperty.getValue();
}
- public char[] getPassword() {
+ public String getPassword() {
return passProperty.getValue();
}
@@ -296,6 +305,10 @@
return rightsProperty.getValue();
}
+ public String getAuthRights() {
+ return authRightsProperty.getValue();
+ }
+
public String getRoles() {
return rolesProperty.getValue();
}
@@ -333,8 +346,8 @@
// Construct a new User object from the defined properties
public User getNewUser() {
+ User newUser = getUninitializedUser();
- UserImpl newUser = new UserImpl();
newUser.setUsername(getUsername());
newUser.setUserID(getUserId());
newUser.setGroupID(getGroupId());
@@ -351,6 +364,11 @@
newUser.setProfiles(stringToList(getRights()));
}
+ if (getAuthRights() != null) {
+ // System.out.println("new user auth rights:" + getAuthRights());
+ newUser.setAuthProfiles(stringToList(getAuthRights()));
+ }
+
if (getRoles() != null) {
// System.out.println("new user roles:" + getRoles());
newUser.setRoles(stringToList(getRoles()));
@@ -370,8 +388,11 @@
// Construct a User object with only modified properties set
public User getModifiedUser() {
boolean bChanged = false;
- UserImpl modUser = new UserImpl();
- modChanges = new UserChangeFieldsImpl();
+ User modUser = getUninitializedUser();
+ modChanges = new UserChangeFields(false, false, false,
+ false, false, false, false, false, false, false,
+ false, false, false, false, false, false, false,
+ false, false, false, false, false, false, false);
// check each property for changes
if (userDescProperty.isChanged()) {
@@ -386,6 +407,7 @@
modUser.setGroupID(getGroupId());
bChanged = true;
}
+
if (passProperty.isChanged()) {
bChanged = true;
}
@@ -397,6 +419,13 @@
bChanged = true;
}
+ if (authRightsProperty.isChanged()) {
+ // System.out.println("mod user auth rights " + getAuthRights());
+ modUser.setAuthProfiles(stringToList(getAuthRights()));
+ modChanges.setAuthProfilesChanged(true);
+ bChanged = true;
+ }
+
if (rolesProperty.isChanged()) {
// System.out.println("mod user roles " + getRoles());
modUser.setRoles(stringToList(getRoles()));
@@ -459,7 +488,20 @@
return (list);
}
- public UserChangeFieldsImpl getModifiedChanges() {
+ public UserChangeFields getModifiedChanges() {
return (modChanges);
}
+
+ /*
+ * Set User fields to initial values
+ */
+ private User getUninitializedUser() {
+ return new User(null,
+ new ADRUinteger(0L), descriptor.getDefaultGroupID(),
+ null, null, null,
+ 0, 0, 0, 0,
+ null, null, null, null, null, null,
+ null, null, null, null, null, null,
+ null, null, null, null, null, null, null);
+ }
}
--- a/components/visual-panels/usermgr/src/java/vpanels/app/usermgr/com/oracle/solaris/vp/panels/usermgr/client/swing/UserMgrBasicControl.java Mon Oct 28 17:52:58 2013 -0700
+++ b/components/visual-panels/usermgr/src/java/vpanels/app/usermgr/com/oracle/solaris/vp/panels/usermgr/client/swing/UserMgrBasicControl.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.usermgr.client.swing;
@@ -28,6 +28,7 @@
import java.util.List;
import java.util.Map;
+import com.oracle.solaris.rad.client.ADRUinteger;
import com.oracle.solaris.rad.usermgr.*;
import com.oracle.solaris.vp.panel.common.action.*;
import com.oracle.solaris.vp.panel.common.control.*;
@@ -112,8 +113,8 @@
if (panel.getPassProperty().isChanged() ||
panel.getPassConfirmProperty().isChanged()) {
- char[] pass1 = panel.getPassProperty().getValue();
- char[] pass2 = panel.getPassConfirmProperty().getValue();
+ String pass1 = panel.getPassProperty().getValue();
+ String pass2 = panel.getPassConfirmProperty().getValue();
UserMgrUtils.validatePassword(umo.isNewUser(), pass1, pass2);
umo.getPassProperty().setValue(pass1);
}
@@ -138,13 +139,13 @@
panel.init(getPanelDescriptor(), umo);
}
- private long toGid(String gName) {
+ private ADRUinteger toGid(String gName) {
List<Group> groups = getPanelDescriptor().getGroups();
for (Group g : groups) {
if (gName.equals(g.getGroupName()))
return (g.getGroupID());
}
- return 1L;
+ return (new ADRUinteger(1L));
}
@Override
--- a/components/visual-panels/usermgr/src/java/vpanels/app/usermgr/com/oracle/solaris/vp/panels/usermgr/client/swing/UserMgrBasicPanel.java Mon Oct 28 17:52:58 2013 -0700
+++ b/components/visual-panels/usermgr/src/java/vpanels/app/usermgr/com/oracle/solaris/vp/panels/usermgr/client/swing/UserMgrBasicPanel.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.usermgr.client.swing;
@@ -29,6 +29,7 @@
import java.awt.event.*;
import javax.swing.*;
import javax.swing.border.Border;
+import com.oracle.solaris.rad.client.ADRUinteger;
import com.oracle.solaris.vp.panel.swing.view.ChangeIndicator;
import com.oracle.solaris.vp.util.misc.ChangeableAggregator;
import com.oracle.solaris.vp.util.misc.finder.Finder;
@@ -76,10 +77,10 @@
private JLabel passConfirmLabel;
private JPasswordField passConfirmField;
- private MutableProperty<char[]> passProperty =
- new BasicMutableProperty<char[]>();
- private MutableProperty<char[]> passConfirmProperty =
- new BasicMutableProperty<char[]>();
+ private MutableProperty<String> passProperty =
+ new BasicMutableProperty<String>();
+ private MutableProperty<String> passConfirmProperty =
+ new BasicMutableProperty<String>();
//
// Constructors
@@ -159,11 +160,11 @@
// PasswordPanel methods
//
- public MutableProperty<char[]> getPassProperty() {
+ public MutableProperty<String> getPassProperty() {
return passProperty;
}
- public MutableProperty<char[]> getPassConfirmProperty() {
+ public MutableProperty<String> getPassConfirmProperty() {
return passConfirmProperty;
}
@@ -232,11 +233,11 @@
return settingsProperty;
}
- public MutableProperty<char[]> getPassProperty() {
+ public MutableProperty<String> getPassProperty() {
return passPanel.passProperty;
}
- public MutableProperty<char[]> getPassConfirmProperty() {
+ public MutableProperty<String> getPassConfirmProperty() {
return passPanel.passConfirmProperty;
}
@@ -252,24 +253,24 @@
// Set the current and saved values for each property
nameField.setText(umo.getName());
- Long uidValue = new Long(umo.getUserId());
+ ADRUinteger uidValue = umo.getUserId();
uidField.setText(uidValue.toString());
descProperty.update(umo.getUserDescProperty().getSavedValue(), false);
descField.setText(umo.getUserDescription());
// group
- long gid = umo.getGroupId();
+ ADRUinteger gid = umo.getGroupId();
String gname = null;
- long savedGid = umo.getGroupIdProperty().getSavedValue();
+ ADRUinteger savedGid = umo.getGroupIdProperty().getSavedValue();
String savedGname = null;
if (groupCombo.getItemCount() > 0)
groupCombo.removeAllItems();
for (Group g : descriptor.getGroups()) {
groupCombo.addItem(g.getGroupName());
- if (gid == g.getGroupID())
+ if (gid.equals(g.getGroupID()))
gname = g.getGroupName();
- if (savedGid == g.getGroupID())
+ if (savedGid.equals(g.getGroupID()))
savedGname = g.getGroupName();
}
--- a/components/visual-panels/usermgr/src/java/vpanels/app/usermgr/com/oracle/solaris/vp/panels/usermgr/client/swing/UserMgrPanelDescriptor.java Mon Oct 28 17:52:58 2013 -0700
+++ b/components/visual-panels/usermgr/src/java/vpanels/app/usermgr/com/oracle/solaris/vp/panels/usermgr/client/swing/UserMgrPanelDescriptor.java Wed Oct 30 16:53:48 2013 -0400
@@ -20,20 +20,20 @@
*/
/*
- * 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.usermgr.client.swing;
import java.util.*;
import java.util.logging.Level;
-import javax.management.ObjectName;
import javax.swing.Icon;
-import com.oracle.solaris.adr.Stability;
-import com.oracle.solaris.rad.ObjectException;
+import com.oracle.solaris.rad.client.ADRUinteger;
+import com.oracle.solaris.rad.client.ADRName;
+import com.oracle.solaris.rad.client.RadObjectException;
+import com.oracle.solaris.rad.client.RadPrivilegeException;
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.panel.common.control.*;
import com.oracle.solaris.vp.panel.common.model.*;
import com.oracle.solaris.vp.panel.swing.control.PanelFrameControl;
@@ -53,12 +53,6 @@
// Static data
//
- // Constants needed for registering the MBean
- public static final String INTERFACE_NAME =
- "com.oracle.solaris.rad.usermgr";
- public static final ObjectName OBJECT_NAME =
- MBeanUtil.makeObjectName(INTERFACE_NAME, "UserMgr");
-
public static final String USER_TYPE_NORMAL = "normal";
public static final String SCOPE_FILES = "files";
public static final String MATCH_ALL = "";
@@ -74,7 +68,7 @@
private MainControl mc;
private DefaultControl control;
- private MXBeanTracker<UserMgrMXBean> beanTracker;
+ private BeanTracker<UserMgr> beanTracker;
private UserType uType;
private String scopeStr = SCOPE_FILES;
@@ -86,6 +80,7 @@
private List<String> shellList = null;
private List<Group> groupList = null;
private List<String> profileList = null;
+ private List<String> authProfileList = null;
private List<String> authList = null;
private List<String> roleList = null;
private List<String> supplgroups = null;
@@ -111,8 +106,8 @@
super(id, context);
- beanTracker = new MXBeanTracker<UserMgrMXBean>(
- OBJECT_NAME, UserMgrMXBean.class, Stability.PRIVATE, context);
+ beanTracker = new BeanTracker<UserMgr>((new UserMgr()).getName(),
+ UserMgr.class, context);
setComparator(SimpleHasId.COMPARATOR);
@@ -201,7 +196,7 @@
aggregator.reset();
}
- public UserMgrMXBean getUserMgrBean() {
+ public UserMgr getUserMgrBean() {
return beanTracker.getBean();
}
@@ -236,10 +231,10 @@
try {
getUserMgrBean().deleteUser(umo.getName());
deleteUserManagedObject(umo);
- } catch (SecurityException se) {
+ } catch (RadPrivilegeException se) {
throw new ActionUnauthorizedException(se);
- } catch (ObjectException e) {
- UserMgrError ume = e.getPayload(UserMgrError.class);
+ } catch (RadObjectException e) {
+ UserMgrError ume = (UserMgrError)e.getPayload();
String msg = Finder.getString("usermgr.error.invalidData");
String err = Finder.getString(
"usermgr.error.delete", umo.getUsername());
@@ -260,16 +255,16 @@
ActionFailedException, ActionUnauthorizedException {
try {
- char[] password = umo.getPassword();
- User user = getUserMgrBean().addUser(umo.getNewUser(), password);
+ String password = umo.getPassword();
+ User newUser = umo.getNewUser();
+ User user = getUserMgrBean().addUser(newUser, password);
addUserManagedObject(umo);
- Arrays.fill(password, (char)0);
+ password = null;
umo.updateUser(user);
-
- } catch (SecurityException se) {
+ } catch (RadPrivilegeException se) {
throw new ActionUnauthorizedException(se);
- } catch (ObjectException e) {
- UserMgrError ume = e.getPayload(UserMgrError.class);
+ } catch (RadObjectException e) {
+ UserMgrError ume = (UserMgrError)e.getPayload();
String msg;
UserMgrErrorType error = (ume != null) ?
ume.getErrorCode() : UserMgrErrorType.INVALIDDATA;
@@ -301,7 +296,6 @@
public void saveModifiedUsers() throws ActionAbortedException,
ActionFailedException, ActionUnauthorizedException {
-
List<UserManagedObject> kids = getChildren();
for (UserManagedObject umo : kids) {
if (umo.getChangeableAggregator().isChanged()) {
@@ -309,17 +303,16 @@
UserChangeFields changes = umo.getModifiedChanges();
try {
if (user != null) {
- char[] password = null;
+ String password = null;
if (umo.getPassProperty().isChanged())
password = umo.getPassword();
- getUserMgrBean().modifyUser(user, password, changes);
- if (password != null)
- Arrays.fill(password, (char)0);
+ getUserMgrBean().modifyUser(user, changes, password);
+ password = null;
}
- } catch (SecurityException se) {
+ } catch (RadPrivilegeException se) {
throw new ActionUnauthorizedException(se);
- } catch (ObjectException e) {
- UserMgrError ume = e.getPayload(UserMgrError.class);
+ } catch (RadObjectException e) {
+ UserMgrError ume = (UserMgrError)e.getPayload();
String msg;
UserMgrErrorType error = (ume != null) ?
ume.getErrorCode() : UserMgrErrorType.INVALIDDATA;
@@ -376,18 +369,22 @@
return roleList;
}
- public UserImpl getDefaultUser() {
- UserImpl defaultUser = new UserImpl(
- "", 0L, defUser.getGroupID(),
+ public User getDefaultUser() {
+ User defaultUser = new User(
+ "", new ADRUinteger(0L), defUser.getGroupID(),
"", "", defUser.getDefaultShell(),
0, 0, 0, 0,
"", "", "", "", "", "",
"", "", "", "", "", "",
- null, null, null, null, null, null);
+ null, null, null, null, null, null, null);
return defaultUser;
}
+ public ADRUinteger getDefaultGroupID() {
+ return defUser.getGroupID();
+ }
+
public void initUsers(String scopeStr,
String typeStr, String matchStr)
throws ActionFailedException {
@@ -395,8 +392,6 @@
String statusStr;
String listTitle;
-
-
statusStr = Finder.getString("usermgr.status.scope") +
" " + scopeStr;
if (typeStr.equals(USER_TYPE_NORMAL)) {
@@ -407,10 +402,9 @@
listTitle = Finder.getString("usermgr.list.title.role");
}
-
removeAllChildren();
try {
- UserMgrMXBean bean = getUserMgrBean();
+ UserMgr bean = getUserMgrBean();
// Set scope only if the scope changed
if (scopeStr.equals(this.scopeStr) == false) {
@@ -537,7 +531,7 @@
try {
user = getUserMgrBean().getUser(name);
- } catch (ObjectException e) {
+ } catch (RadObjectException e) {
getLog().log(Level.SEVERE, "Error getting user " +
name + " : ", e);
}
@@ -554,7 +548,7 @@
List<User> users = null;
try {
users = getUserMgrBean().getusers();
- } catch (ObjectException e) {
+ } catch (RadObjectException e) {
getLog().log(Level.SEVERE, "Error getting user list.", e);
}
return users;
--- a/components/visual-panels/usermgr/src/java/vpanels/app/usermgr/com/oracle/solaris/vp/panels/usermgr/client/swing/UserMgrUtils.java Mon Oct 28 17:52:58 2013 -0700
+++ b/components/visual-panels/usermgr/src/java/vpanels/app/usermgr/com/oracle/solaris/vp/panels/usermgr/client/swing/UserMgrUtils.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.usermgr.client.swing;
@@ -38,12 +38,9 @@
private static final int VALID_UID = 100;
private static final int VALID_HOMEDIRLEN = 2;
- public static void clearPassword(char[] password) {
- if (password != null) {
- for (int i = 0; i < password.length; i++) {
- password[i] = 0;
- }
- }
+ public static void clearPassword(String password) {
+ password = null;
+ return;
}
//
@@ -82,10 +79,12 @@
}
public static void validatePassword(boolean bNewUser,
- char[] pass1, char[] pass2) throws ActionFailedException {
+ String pass1, String pass2) throws ActionFailedException {
// Ensure that the passwords match
- if (!Arrays.equals(pass1, pass2)) {
+ if (pass1 != null && pass2 != null && pass1.equals(pass2))
+ return;
+ else {
throw new ActionFailedException(
Finder.getString("usermgr.error.pass.nomatch"));
}
--- a/components/visual-panels/usermgr/src/java/vpanels/app/usermgr/com/oracle/solaris/vp/panels/usermgr/client/swing/help/usermgr-advtab.html Mon Oct 28 17:52:58 2013 -0700
+++ b/components/visual-panels/usermgr/src/java/vpanels/app/usermgr/com/oracle/solaris/vp/panels/usermgr/client/swing/help/usermgr-advtab.html Wed Oct 30 16:53:48 2013 -0400
@@ -26,7 +26,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.
-->
<head>
<!-- GenHTML revision 25226-->
@@ -57,6 +57,9 @@
<li><p>Rights Profiles</p>
</li>
+<li><p>Authenticated Profiles</p>
+
+</li>
<li><p>Authorizations</p>
</li></ul>
--- a/components/visual-panels/usermgr/src/java/vpanels/app/usermgr/com/oracle/solaris/vp/panels/usermgr/client/swing/resources/Resources.properties Mon Oct 28 17:52:58 2013 -0700
+++ b/components/visual-panels/usermgr/src/java/vpanels/app/usermgr/com/oracle/solaris/vp/panels/usermgr/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.
#
#
@@ -110,6 +110,9 @@
usermgr.advanced.rights = Rights Profiles
usermgr.advanced.rights.available = Available Rights:
usermgr.advanced.rights.granted = Granted Rights:
+usermgr.advanced.auth_rights = Authenticated Profiles
+usermgr.advanced.auth_rights.available = Available Profiles:
+usermgr.advanced.auth_rights.granted = Granted Profiles:
usermgr.advanced.roles = Roles
usermgr.advanced.roles.available = Available Roles:
usermgr.advanced.roles.assigned = Assigned Roles:
--- a/components/visual-panels/usermgr/system-management-visual-panels-panel-usermgr-message-files.p5m Mon Oct 28 17:52:58 2013 -0700
+++ b/components/visual-panels/usermgr/system-management-visual-panels-panel-usermgr-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/panel-usermgr-message-files@$(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-usermgr.pot
file path=usr/share/vpanels/__LOCALE__/com/oracle/solaris/vp/panels/usermgr/client/swing/help/usermgr-createuser.html
file path=usr/share/vpanels/__LOCALE__/com/oracle/solaris/vp/panels/usermgr/client/swing/help/usermgr-moduser.html
--- a/components/visual-panels/usermgr/system-management-visual-panels-panel-usermgr.p5m Mon Oct 28 17:52:58 2013 -0700
+++ b/components/visual-panels/usermgr/system-management-visual-panels-panel-usermgr.p5m 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.
#
set name=pkg.fmri value=pkg:/system/management/visual-panels/panel-usermgr@$(IPS_COMPONENT_VERSION),$(BUILD_VERSION)
@@ -34,13 +34,6 @@
depend fmri=pkg:/system/management/visual-panels-core@$(IPS_COMPONENT_VERSION),$(BUILD_VERSION) type=require
depend fmri=pkg:/system/management/visual-panels/panel-usermgr/locale type=require
-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=usr/share/applications/vp-usermgr.desktop
file path=usr/share/vpanels/app/vpanels-panels-usermgr.jar
file path=usr/share/vpanels/conf/usermgr.xml
--- a/components/visual-panels/vpanels.copyright Mon Oct 28 17:52:58 2013 -0700
+++ b/components/visual-panels/vpanels.copyright Wed Oct 30 16:53:48 2013 -0400
@@ -1,1 +1,1 @@
-Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
+Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
--- a/components/visual-panels/zconsole/src/java/vpanels/app/zconsole/build.xml Mon Oct 28 17:52:58 2013 -0700
+++ b/components/visual-panels/zconsole/src/java/vpanels/app/zconsole/build.xml Wed Oct 30 16:53:48 2013 -0400
@@ -19,7 +19,7 @@
CDDL HEADER END
- Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved.
+ Copyright (c) 2011, 2013, Oracle and/or its affiliates. All rights reserved.
-->
<project name="vpanels-panels-zconsole" default="jar">
@@ -40,7 +40,7 @@
<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" />
+ <pathelement location="${abs.rad.java}/zonesbridge.jar" />
</path>
</project>
--- a/components/visual-panels/zconsole/src/java/vpanels/app/zconsole/com/oracle/solaris/vp/panels/zconsole/client/text/BeanToStdout.java Mon Oct 28 17:52:58 2013 -0700
+++ b/components/visual-panels/zconsole/src/java/vpanels/app/zconsole/com/oracle/solaris/vp/panels/zconsole/client/text/BeanToStdout.java Wed Oct 30 16:53:48 2013 -0400
@@ -20,22 +20,22 @@
*/
/*
- * Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011, 2013, Oracle and/or its affiliates. All rights reserved.
*/
package com.oracle.solaris.vp.panels.zconsole.client.text;
import java.io.IOException;
import java.util.logging.Level;
-import com.oracle.solaris.rad.ObjectException;
-import com.oracle.solaris.rad.zonesbridge.IOMXBean;
+import com.oracle.solaris.rad.client.RadObjectException;
+import com.oracle.solaris.rad.zonesbridge.IO;
public abstract class BeanToStdout extends ZoneIOThread {
//
// Constructors
//
- public BeanToStdout(IOMXBean bean, long token) {
+ public BeanToStdout(IO bean, long token) {
super(bean, token);
}
@@ -46,7 +46,7 @@
@Override
public void run() {
boolean success = true;
- IOMXBean bean = getBean();
+ IO bean = getBean();
long token = getToken();
try {
@@ -55,7 +55,7 @@
System.out.write(bytes);
System.out.flush();
}
- } catch (ObjectException e) {
+ } catch (RadObjectException e) {
// Console has been closed
} catch (IOException e) {
--- a/components/visual-panels/zconsole/src/java/vpanels/app/zconsole/com/oracle/solaris/vp/panels/zconsole/client/text/MainControl.java Mon Oct 28 17:52:58 2013 -0700
+++ b/components/visual-panels/zconsole/src/java/vpanels/app/zconsole/com/oracle/solaris/vp/panels/zconsole/client/text/MainControl.java Wed Oct 30 16:53:48 2013 -0400
@@ -20,15 +20,16 @@
*/
/*
- * Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011, 2013, Oracle and/or its affiliates. All rights reserved.
*/
package com.oracle.solaris.vp.panels.zconsole.client.text;
import java.util.Map;
import java.util.logging.Level;
-import com.oracle.solaris.rad.ObjectException;
-import com.oracle.solaris.rad.zonesbridge.IOMXBean;
+import com.oracle.solaris.rad.client.RadObjectException;
+import com.oracle.solaris.rad.client.RadPrivilegeException;
+import com.oracle.solaris.rad.zonesbridge.IO;
import com.oracle.solaris.vp.panel.common.ConnectionInfo;
import com.oracle.solaris.vp.panel.common.control.*;
import com.oracle.solaris.vp.util.misc.TermUtil;
@@ -49,7 +50,7 @@
private String zone;
private long token;
- private IOMXBean bean;
+ private IO bean;
private BeanToStdout beanToStdout;
private StdinToBean stdinToBean;
@@ -58,7 +59,7 @@
//
public MainControl(ZoneConsolePanelDescriptor descriptor,
- IOMXBean bean) {
+ IO bean) {
super(descriptor.getId(), descriptor.getName(), descriptor);
this.bean = bean;
@@ -92,7 +93,7 @@
try {
token = bean.openConsole(zone);
- } catch (SecurityException e) {
+ } catch (RadPrivilegeException e) {
ConnectionInfo info = getClientContext().getConnectionInfo();
String user = info.getRole();
if (user == null) {
@@ -100,7 +101,7 @@
}
throw new NavigationFailedException(Finder.getString(
"error.security", user, info.getHost(), zone), e);
- } catch (ObjectException e) {
+ } catch (RadObjectException e) {
ConnectionInfo info = getClientContext().getConnectionInfo();
String user = info.getRole();
if (user == null) {
@@ -165,7 +166,7 @@
private void closeBean() {
try {
bean.close(token);
- } catch (ObjectException e) {
+ } catch (RadObjectException e) {
getLog().log(Level.SEVERE, "unable to close console connection", e);
}
}
--- a/components/visual-panels/zconsole/src/java/vpanels/app/zconsole/com/oracle/solaris/vp/panels/zconsole/client/text/StdinToBean.java Mon Oct 28 17:52:58 2013 -0700
+++ b/components/visual-panels/zconsole/src/java/vpanels/app/zconsole/com/oracle/solaris/vp/panels/zconsole/client/text/StdinToBean.java Wed Oct 30 16:53:48 2013 -0400
@@ -20,15 +20,15 @@
*/
/*
- * Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011, 2013, Oracle and/or its affiliates. All rights reserved.
*/
package com.oracle.solaris.vp.panels.zconsole.client.text;
import java.io.*;
import java.util.logging.Level;
-import com.oracle.solaris.rad.ObjectException;
-import com.oracle.solaris.rad.zonesbridge.IOMXBean;
+import com.oracle.solaris.rad.client.RadObjectException;
+import com.oracle.solaris.rad.zonesbridge.IO;
import com.oracle.solaris.vp.util.misc.*;
public abstract class StdinToBean extends ZoneIOThread {
@@ -54,7 +54,7 @@
// Constructors
//
- public StdinToBean(IOMXBean bean, long token, byte escape, boolean noext) {
+ public StdinToBean(IO bean, long token, byte escape, boolean noext) {
super(bean, token);
this.escape = escape;
this.noext = noext;
@@ -67,7 +67,7 @@
@Override
public void run() {
boolean success = true;
- IOMXBean bean = getBean();
+ IO bean = getBean();
long token = getToken();
try {
@@ -150,7 +150,7 @@
getLog().log(Level.SEVERE, "unable to read from stdin", e);
success = false;
- } catch (ObjectException e) {
+ } catch (RadObjectException e) {
getLog().log(Level.SEVERE, "unable to write to console", e);
success = false;
}
--- a/components/visual-panels/zconsole/src/java/vpanels/app/zconsole/com/oracle/solaris/vp/panels/zconsole/client/text/ZoneConsolePanelDescriptor.java Mon Oct 28 17:52:58 2013 -0700
+++ b/components/visual-panels/zconsole/src/java/vpanels/app/zconsole/com/oracle/solaris/vp/panels/zconsole/client/text/ZoneConsolePanelDescriptor.java Wed Oct 30 16:53:48 2013 -0400
@@ -20,19 +20,17 @@
*/
/*
- * Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011, 2013, Oracle and/or its affiliates. All rights reserved.
*/
package com.oracle.solaris.vp.panels.zconsole.client.text;
import java.io.IOException;
import java.util.logging.Level;
-import javax.management.*;
-import com.oracle.solaris.adr.Stability;
-import com.oracle.solaris.rad.jmx.*;
-import com.oracle.solaris.rad.zonesbridge.IOMXBean;
+import com.oracle.solaris.rad.client.RadException;
+import com.oracle.solaris.rad.connect.Connection;
+import com.oracle.solaris.rad.zonesbridge.IO;
import com.oracle.solaris.vp.panel.common.ClientContext;
-import com.oracle.solaris.vp.panel.common.api.panel.MBeanUtil;
import com.oracle.solaris.vp.panel.common.control.Control;
import com.oracle.solaris.vp.panel.common.model.*;
@@ -51,34 +49,22 @@
//
public ZoneConsolePanelDescriptor(String id, ClientContext context)
- throws JMException, IncompatibleVersionException, IOException {
+ throws IOException {
super(id, context);
- MBeanServerConnection mbsc = context.getConnectionInfo().getConnector().
- getMBeanServerConnection();
-
- ObjectName oName = MBeanUtil.makeObjectName(
- "com.oracle.solaris.rad.zonesbridge", "IO");
-
- IOMXBean bean;
+ IO bean = null;
try {
- bean = RadJMX.newMXBeanProxy(mbsc, oName, IOMXBean.class,
- Stability.PRIVATE);
- } catch (IncompatibleVersionException e) {
- String msg = "Incompatible client and server versions for: " +
- IOMXBean.class.getSimpleName();
- getLog().log(Level.SEVERE, msg, e);
- throw e;
- } catch (JMException e) {
- // InstanceNotFoundException, IntrospectionException,
- // or ReflectionException
- String msg = "Error getting MBean information for: " + oName;
+ Connection conn = context.getConnectionInfo().getConnection();
+ bean = conn.getObject(new IO());
+ } catch (RadException e) {
+ String msg = "Error getting object information for: " +
+ IO.class.getSimpleName();
getLog().log(Level.SEVERE, msg, e);
throw e;
} catch (IOException e) {
- String msg = "Error contacting MBean server while creating " +
- "proxy for: " + IOMXBean.class.getSimpleName();
+ String msg = "Error contacting server while creating " +
+ "proxy for: " + IO.class.getSimpleName();
getLog().log(Level.SEVERE, msg, e);
throw e;
}
--- a/components/visual-panels/zconsole/src/java/vpanels/app/zconsole/com/oracle/solaris/vp/panels/zconsole/client/text/ZoneIOThread.java Mon Oct 28 17:52:58 2013 -0700
+++ b/components/visual-panels/zconsole/src/java/vpanels/app/zconsole/com/oracle/solaris/vp/panels/zconsole/client/text/ZoneIOThread.java Wed Oct 30 16:53:48 2013 -0400
@@ -20,13 +20,13 @@
*/
/*
- * Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011, 2013, Oracle and/or its affiliates. All rights reserved.
*/
package com.oracle.solaris.vp.panels.zconsole.client.text;
import java.util.logging.Logger;
-import com.oracle.solaris.rad.zonesbridge.IOMXBean;
+import com.oracle.solaris.rad.zonesbridge.IO;
public abstract class ZoneIOThread extends Thread {
//
@@ -39,14 +39,14 @@
// Instance data
//
- private IOMXBean bean;
+ private IO bean;
private long token;
//
// Constructors
//
- public ZoneIOThread(IOMXBean bean, long token) {
+ public ZoneIOThread(IO bean, long token) {
this.bean = bean;
this.token = token;
}
@@ -63,7 +63,7 @@
*/
public abstract void done(boolean success);
- public IOMXBean getBean() {
+ public IO getBean() {
return bean;
}
--- a/components/visual-panels/zconsole/system-management-visual-panels-panel-zconsole-message-files.p5m Mon Oct 28 17:52:58 2013 -0700
+++ b/components/visual-panels/zconsole/system-management-visual-panels-panel-zconsole-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/panel-zconsole-message-files@$(IPS_COMPONENT_VERSION),$(BUILD_VERSION)
@@ -31,8 +31,4 @@
license ../vpanels.copyright license=Oracle
-dir path=usr
-dir path=usr/share
-dir path=usr/share/vpanels
-dir path=usr/share/vpanels/__LOCALE__
file path=usr/share/vpanels/__LOCALE__/com/oracle/solaris/vp/panels/zconsole/client/text/resources/Resources.properties
--- a/components/visual-panels/zconsole/system-management-visual-panels-panel-zconsole.p5m Mon Oct 28 17:52:58 2013 -0700
+++ b/components/visual-panels/zconsole/system-management-visual-panels-panel-zconsole.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/panel-zconsole@$(IPS_COMPONENT_VERSION),$(BUILD_VERSION)
@@ -34,12 +34,6 @@
depend fmri=pkg:/system/management/visual-panels-core@$(IPS_COMPONENT_VERSION),$(BUILD_VERSION) type=require
depend fmri=pkg:/system/management/visual-panels/panel-zconsole/locale type=require
-dir path=usr
-dir path=usr/share
-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=usr/share/vpanels/app/vpanels-panels-zconsole.jar
file path=usr/share/vpanels/conf/zconsole.xml
file path=usr/share/vpanels/pixmaps/zconsole.png