📄 authenticationschemesequenceitem.java
字号:
/*
* SSL-Explorer
*
* Copyright (C) 2003-2006 3SP LTD. All Rights Reserved
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2 of
* the License, or (at your option) any later version.
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public
* License along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
package com.sslexplorer.security;
import java.util.Iterator;
import com.sslexplorer.table.TableItem;
/**
* Implementation of a {@link com.sslexplorer.table.TableItem} that is used to
* wrap {@link com.sslexplorer.security.AuthenticationScheme} objects for
* display.
*
* @author Brett Smith <a href="mailto:brett@3sp.com"><brett@3sp.com></a>
* @version $Revision: 1.3 $
*/
public class AuthenticationSchemeSequenceItem implements TableItem {
// Private instance variables
private AuthenticationSchemeSequence sequence;
private boolean defaultSequence;
/**
* Constructor
*
* @param sequence sequence
*/
public AuthenticationSchemeSequenceItem(AuthenticationSchemeSequence sequence) {
this.sequence = sequence;
}
/**
* Get the authentication scheme sequence object this item wraps
*
* @return authentication scheme sequence
*/
public AuthenticationSchemeSequence getSequence() {
return sequence;
}
/**
* Get a description of the modules that the scheme consists of.
*
* @return description of the modules that the scheme consists of.
*
* TODO This needs to be done in a language neutral way
*/
public String getDescription() {
StringBuffer buf = new StringBuffer();
buf.append("Consists of ");
buf.append(sequence.getModuleCount());
if (sequence.getModuleCount() == 1) {
buf.append(" module");
} else {
buf.append(" modules");
}
buf.append(".<br/>");
for (Iterator i = sequence.modules(); i.hasNext();) {
buf.append(" <b>");
buf.append(i.next());
buf.append("</b><br/>");
}
return buf.toString();
}
/**
* Get whether the authentication scheme this item wraps is the
* default scheme.
*
* @return true if default authentication scheme
*/
public boolean getDefault() {
return defaultSequence;
}
/**
* Set whether this authentication scheme is the default.
*
* @param defaultSequence default authentication scheme sequence
*/
public void setDefault(boolean defaultSequence) {
this.defaultSequence = defaultSequence;
}
/* (non-Javadoc)
* @see com.sslexplorer.table.TableItem#getColumnValue(int)
*/
public Object getColumnValue(int col) {
switch (col) {
case 0:
return getSequence().getSchemeName();
case 1:
return Boolean.valueOf(getSequence().getEnabled());
default:
return Boolean.valueOf(getDefault());
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -