interface SystemDelegate
extends AbstractDelegate
{
public Node create(NodeTypeEnum type, URI uri)
throws ... ;
}
The SystemDelegate is the top level delegate that provides access to the VOSpace system, spanning multiple VOSpace services.
import java.net.URI;
import org.astrogrid.security.SecurityGuard;
import org.astrogrid.vospace.v11.client.node.Node;
import org.astrogrid.vospace.v11.client.node.NodeTypeEnum;
import org.astrogrid.vospace.v11.client.system.SystemDelegate;
import org.astrogrid.vospace.v11.client.system.SystemDelegateResolver;
import org.astrogrid.vospace.v11.client.system.SystemDelegateResolverImpl;
//
// Generate user name ....
String username = "albert" ;
//
// Load the user credentials ....
SecurityGuard guard = ....
//
// Create the new URI.
final URI baseuri = new URI(
"vos://service/base/"
);
final URI useruri = base.resolve(
username
);
//
// Create a VOSpace delegate resolver (using the default AG Registry client).
final SystemDelegateResolver resolver = new SystemDelegateResolverImpl()
//
// Create a VOSpace delegate (using the SecurityGuard credentials).
final SystemDelegate delegate = resolver.resolve(
guard
);
//
// Create the VOSpace node.
final Node node = delegate.create(
NodeTypeEnum.TREE_NODE,
useruri
);
log.debug("Node created");
log.debug(" URI [" + node.uri() + "]");
log.debug(" Type [" + node.type() + "]");
log.debug(" Name [" + node.name() + "]");
log.debug(" Path [" + node.path() + "]");
import org.astrogrid.registry.client.query.v1_0.RegistryService;
//
// Our registry delegate.
RegistryService registry = ....
//
// Create a VOSpace delegate resolver (using a custom registry client).
final SystemDelegateResolver resolver = new SystemDelegateResolverImpl(
registry
);
//
// Create the new URI.
final URI baseuri = new URI(
"vos://service/base/"
);
final URI useruri = base.resolve(
".auto"
);
![]() |
Click here for the AstroGrid Service Web |
This is the AstroGrid Development Wiki |
|