本文整理汇总了Java中org.globus.gsi.gssapi.auth.AuthorizationException类的典型用法代码示例。如果您正苦于以下问题:Java AuthorizationException类的具体用法?Java AuthorizationException怎么用?Java AuthorizationException使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
AuthorizationException类属于org.globus.gsi.gssapi.auth包,在下文中一共展示了AuthorizationException类的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: authorize
import org.globus.gsi.gssapi.auth.AuthorizationException; //导入依赖的package包/类
public void authorize(GSSContext context, String host) throws AuthorizationException {
if (authz == null || authz.length == 0) {
throw new AuthorizationException("No authorization");
}
else {
String message = "";
for (int i = 0; i < authz.length; i++) {
try {
authz[i].authorize(context, host);
return;
}
catch (AuthorizationException e) {
message = message + "\n" + e.getMessage();
}
}
throw new AuthorizationException(message);
}
}
示例2: start
import org.globus.gsi.gssapi.auth.AuthorizationException; //导入依赖的package包/类
/**
* @see AbstractExecutor#start()
*/
public void start() throws AuthorizationException,
IOException, ProcessException {
try {
Thread.sleep(Integer.valueOf(getSGEProperties().getSubmissionDelay()));
}
catch (InterruptedException e) {
logger.error(e.getStackTrace());
}
super.start();
}
示例3: start
import org.globus.gsi.gssapi.auth.AuthorizationException; //导入依赖的package包/类
@Override
public void start() throws AuthorizationException, IOException, ProcessException {
Process p = Runtime.getRuntime().exec(props.getSubmitCommand());
ProcessStreams ps = new ProcessStreams(p);
JobSpecification spec = this.getSpec();
// Basic stuff
if (!spec.getExecutableLocation().equals(FileLocation.REMOTE)) {
throw new IllegalArgumentException("Only remote executables supported");
}
writeSpec("directory", escape(spec.getDirectory()), ps.stdin);
writeSpec("executable", escape(spec.getExecutable()), ps.stdin);
if (spec.getArgumentsAsList() != null) {
for (String arg : spec.getArgumentsAsList()) {
writeSpec("arg", escape(arg), ps.stdin);
}
}
// Standard streams
if (spec.getStdInputLocation().overlaps(FileLocation.MEMORY)) {
throw new IllegalArgumentException("In-memory STDIN not supported");
}
if (spec.getStdInput() != null) {
writeSpec("stdin.location", spec.getStdInputLocation().toString(), ps.stdin);
writeSpec("stdin.path", spec.getStdInput(), ps.stdin);
}
writeStandardFileSpec(spec.getStdOutput(), spec.getStdOutputLocation(), "stdout", ps);
writeStandardFileSpec(spec.getStdError(), spec.getStdErrorLocation(), "stderr", ps);
// Environment variables
for (EnvironmentVariable var : spec.getEnvironment()) {
writeSpec("env." + var.getName(), escape(var.getValue()), ps.stdin);
}
// Attributes
for (String attr : spec.getAttributeNames()) {
Object o = spec.getAttribute(attr);
if (o != null) {
writeSpec("attr." + attr, escape(o.toString()), ps.stdin);
}
}
// Staging stuff
writeStagingSpec(spec.getStageIn(), "stagein", false, ps);
writeStagingSpec(spec.getStageOut(), "stageout", true, ps);
// Cleanup
if (spec.getCleanUpSet() != null) {
for (String ce : spec.getCleanUpSet()) {
writeSpec("cleanup", escape(ce), ps.stdin);
}
}
ps.stdin.close();
try {
int ec = p.waitFor();
if (logger.isDebugEnabled()) {
logger.debug(props.getSubmitCommandName() + " done (exit code " + ec + ")");
}
if (ec != 0) {
throw new ProcessException(props.getSubmitCommand() + " failed: " + read(ps.stderr));
}
}
catch (InterruptedException e) {
throw new ProcessException(e);
}
parseOutput(ps.stdout);
active = true;
if (logger.isDebugEnabled()) {
logger.debug("Submitted job with id '" + jobid + "'");
}
getQueuePoller().addJob(
job = createJob(jobid, stdout, spec.getStdOutputLocation(), stderr,
spec.getStdErrorLocation(), exitcode, this));
}
示例4: authorize
import org.globus.gsi.gssapi.auth.AuthorizationException; //导入依赖的package包/类
/**
* Performs MyProxy server authorization checks. The hostname of
* the server is compared with the hostname specified in the
* server's (topmost) certificate in the certificate chain. The
* hostnames must match exactly (in case-insensitive way). The
* service in the certificate may be "host" or "myproxy".
* <code>AuthorizationException</code> if the authorization fails.
* Otherwise, the function completes normally.
*
* @param context the security context.
* @param host host address of the peer.
* @exception AuthorizationException if the peer is
* not authorized to access/use the resource.
*/
public void authorize(GSSContext context, String host)
throws AuthorizationException {
try {
this.authzMyProxyService.authorize(context, host);
} catch (AuthorizationException e) {
this.authzHostService.authorize(context, host);
}
}