⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 cpebean.java

📁 openacs source for CPE wan management
💻 JAVA
字号:
/* * To change this template, choose Tools | Templates * and open the template in the editor. */package org.openacs.web;import java.util.ArrayList;import java.util.Enumeration;import org.openacs.CPELocal;import org.openacs.message.GetParameterNamesResponse;import org.openacs.message.GetParameterValuesResponse;import org.openacs.utils.Ejb;/** * * @author Administrator */public class CpeBean {    public class Params {        public Params (String name, String value, boolean writable) {            this.name = name;            this.value = value;            this.writable = writable;        }        private String name;        private boolean writable;        private String value;                public String getName () {            return this.name;        }        public String getValue () {            return this.value;        }        public boolean getWritable () {            return this.writable;        }        @Override        public String toString () {            return name + (writable?"(W)":"(R)")+"="+value;        }    }    /** Creates a new instance of CpeBean */    public CpeBean() {    }    private String pathNames = ".";    public void setPathNames (String pathNames) {        this.pathNames = pathNames;        names = null;    }        public String getPathNames () {        return this.pathNames;    }            private ArrayList names = null;    public ArrayList getNames () {        if (names == null) {            CPELocal cpe = Ejb.lookupCPEBean();            GetParameterNamesResponse r = null; //cpe.GetParameterNames(oui, sn, pathNames, true);            String ns [] = new String [r.names.size()];            int count = 0;            Enumeration k = r.names.keys();            while (k.hasMoreElements()) {                String n = (String)k.nextElement();                if (!n.endsWith(".")) {                    ns[count++] = n;                    //System.out.println ("Add "+n);                }            }            //System.out.println ("Total "+count);            String ns2 [] = new String [count];            System.arraycopy (ns, 0, ns2, 0, count);            //System.out.println ("Total "+ns.length);            GetParameterValuesResponse v = null; //cpe.GetParameterValues(oui, sn, ns2);            k = r.names.keys();            ArrayList <Params> names = new ArrayList <Params> ();            //names = new ArrayList ();            while (k.hasMoreElements()) {                String n = (String)k.nextElement();                names.add(new Params(n, n.endsWith(".")?"":(String)v.values.get(n) , r.names.get(n).equals("1") ? true : false));            }            this.names = names;        }        return this.names;    }}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -