本文整理汇总了Java中org.sdnplatform.sync.internal.config.AuthScheme类的典型用法代码示例。如果您正苦于以下问题:Java AuthScheme类的具体用法?Java AuthScheme怎么用?Java AuthScheme使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
AuthScheme类属于org.sdnplatform.sync.internal.config包,在下文中一共展示了AuthScheme类的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: init
import org.sdnplatform.sync.internal.config.AuthScheme; //导入依赖的package包/类
protected void init(String[] args) {
try {
parser.parseArgument(args);
} catch (CmdLineException e) {
System.err.println(e.getMessage());
parser.printUsage(System.err);
System.exit(1);
}
if (help) {
parser.printUsage(System.err);
System.exit(1);
}
if (!AuthScheme.NO_AUTH.equals(authScheme)) {
if (keyStorePath == null) {
System.err.println("keyStorePath is required when " +
"authScheme is " + authScheme);
parser.printUsage(System.err);
System.exit(1);
}
if (keyStorePassword == null) {
Console con = System.console();
char[] password = con.readPassword("Enter key store password: ");
keyStorePassword = new String(password);
}
}
}
示例2: init
import org.sdnplatform.sync.internal.config.AuthScheme; //导入依赖的package包/类
protected void init(String[] args) {
try {
parser.parseArgument(args);
} catch (CmdLineException e) {
System.err.println(e.getMessage());
parser.printUsage(System.err);
System.exit(1);
}
if (help) {
parser.printUsage(System.err);
System.exit(1);
}
if (!AuthScheme.NO_AUTH.equals(authScheme)) {
if (keyStorePath == null) {
System.err.println("keyStorePath is required when " +
"authScheme is " + authScheme);
parser.printUsage(System.err);
System.exit(1);
}
if (keyStorePassword == null) {
Console con = System.console();
char[] password = con.readPassword("Enter key store password: ");
keyStorePassword = new String(password);
}
}
}
示例3: init
import org.sdnplatform.sync.internal.config.AuthScheme; //导入依赖的package包/类
@Override
protected void init(String[] args) {
super.init(args);
if (!AuthScheme.NO_AUTH.equals(authScheme)) {
if (!(new File(keyStorePath)).canRead()) {
System.err.println("Cannot read from key store " +
keyStorePath);
System.exit(1);
}
}
}
示例4: channelActive
import org.sdnplatform.sync.internal.config.AuthScheme; //导入依赖的package包/类
@Override
public void channelActive(ChannelHandlerContext ctx) throws Exception {
channelState = ChannelState.CONNECTED;
HelloMessage m = new HelloMessage();
if (getLocalNodeId() != null)
m.setNodeId(getLocalNodeId());
AsyncMessageHeader header = new AsyncMessageHeader();
header.setTransactionId(getTransactionId());
m.setHeader(header);
switch (getAuthScheme()) {
case NO_AUTH:
channelState = ChannelState.AUTHENTICATED;
m.setAuthScheme(org.sdnplatform.sync.thrift.
AuthScheme.NO_AUTH);
break;
case CHALLENGE_RESPONSE:
AuthChallengeResponse cr = new AuthChallengeResponse();
cr.setChallenge(generateChallenge());
m.setAuthScheme(org.sdnplatform.sync.thrift.
AuthScheme.CHALLENGE_RESPONSE);
m.setAuthChallengeResponse(cr);
break;
}
SyncMessage bsm = new SyncMessage(MessageType.HELLO);
bsm.setHello(m);
ctx.channel().writeAndFlush(bsm);
}
示例5: BootstrapClient
import org.sdnplatform.sync.internal.config.AuthScheme; //导入依赖的package包/类
public BootstrapClient(SyncManager syncManager, AuthScheme authScheme,
String keyStorePath, String keyStorePassword) {
super();
this.syncManager = syncManager;
this.authScheme = authScheme;
this.keyStorePath = keyStorePath;
this.keyStorePassword = keyStorePassword;
}
示例6: init
import org.sdnplatform.sync.internal.config.AuthScheme; //导入依赖的package包/类
@Override
public void init(FloodlightModuleContext context)
throws FloodlightModuleException {
Map<String, String> config = context.getConfigParams(this);
if (null != config.get("hostname"))
hostname = config.get("hostname");
if (null != config.get("port"))
port = Integer.parseInt(config.get("port"));
keyStorePath = config.get("keyStorePath");
keyStorePassword = config.get("keyStorePassword");
authScheme = AuthScheme.NO_AUTH;
try {
authScheme = AuthScheme.valueOf(config.get("authScheme"));
} catch (Exception e) {}
}
示例7: channelConnected
import org.sdnplatform.sync.internal.config.AuthScheme; //导入依赖的package包/类
@Override
public void channelConnected(ChannelHandlerContext ctx,
ChannelStateEvent e) throws Exception {
channelState = ChannelState.CONNECTED;
HelloMessage m = new HelloMessage();
if (getLocalNodeId() != null)
m.setNodeId(getLocalNodeId());
AsyncMessageHeader header = new AsyncMessageHeader();
header.setTransactionId(getTransactionId());
m.setHeader(header);
switch (getAuthScheme()) {
case NO_AUTH:
channelState = ChannelState.AUTHENTICATED;
m.setAuthScheme(org.sdnplatform.sync.thrift.
AuthScheme.NO_AUTH);
break;
case CHALLENGE_RESPONSE:
AuthChallengeResponse cr = new AuthChallengeResponse();
cr.setChallenge(generateChallenge());
m.setAuthScheme(org.sdnplatform.sync.thrift.
AuthScheme.CHALLENGE_RESPONSE);
m.setAuthChallengeResponse(cr);
break;
}
SyncMessage bsm = new SyncMessage(MessageType.HELLO);
bsm.setHello(m);
ctx.getChannel().write(bsm);
}
示例8: Bootstrap
import org.sdnplatform.sync.internal.config.AuthScheme; //导入依赖的package包/类
public Bootstrap(SyncManager syncManager, AuthScheme authScheme,
String keyStorePath, String keyStorePassword) {
super();
this.syncManager = syncManager;
this.authScheme = authScheme;
this.keyStorePath = keyStorePath;
this.keyStorePassword = keyStorePassword;
}
示例9: init
import org.sdnplatform.sync.internal.config.AuthScheme; //导入依赖的package包/类
@Override
protected void init(String[] args) {
super.init(args);
if (!AuthScheme.NO_AUTH.equals(authScheme)) {
if (!(new File(keyStorePath)).canRead()) {
System.err.println("Cannot read from key store " +
keyStorePath);
System.exit(1);
}
}
}