| 1 |
/* |
| 2 |
* Copyright 1999-2010 University of Chicago |
| 3 |
* |
| 4 |
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in |
| 5 |
* compliance with the License. You may obtain a copy of the License at |
| 6 |
* |
| 7 |
* http://www.apache.org/licenses/LICENSE-2.0 |
| 8 |
* |
| 9 |
* Unless required by applicable law or agreed to in writing, software distributed under the License is |
| 10 |
* distributed on an "AS IS" BASIS,WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either |
| 11 |
* express or implied. |
| 12 |
* |
| 13 |
* See the License for the specific language governing permissions and limitations under the License. |
| 14 |
*/ |
| 15 |
package org.globus.gsi.gssapi.net.example; |
| 16 |
|
| 17 |
import org.globus.gsi.gssapi.net.GssSocket; |
| 18 |
|
| 19 |
public class GetOpts extends org.globus.gsi.gssapi.example.GetOpts { |
| 20 |
|
| 21 |
public int wrapMode = GssSocket.SSL_MODE; |
| 22 |
|
| 23 |
public GetOpts(String usage, String helpMsg) { |
| 24 |
super(usage, helpMsg); |
| 25 |
} |
| 26 |
|
| 27 |
protected int parseArg(String[] args, int i) { |
| 28 |
if (args[i].equalsIgnoreCase("-wrap-mode")) { |
| 29 |
String arg = args[++i]; |
| 30 |
if (arg.equalsIgnoreCase("ssl")) { |
| 31 |
wrapMode = GssSocket.SSL_MODE; |
| 32 |
} else if (arg.equalsIgnoreCase("gsi")) { |
| 33 |
wrapMode = GssSocket.GSI_MODE; |
| 34 |
} else { |
| 35 |
error("Invalid -wrap-mode argument: " + arg); |
| 36 |
} |
| 37 |
return 1; |
| 38 |
} else { |
| 39 |
return super.parseArg(args, i); |
| 40 |
} |
| 41 |
} |
| 42 |
|
| 43 |
} |