Commit 061058d5 authored by Leigh B. Stoller's avatar Leigh B. Stoller
Browse files

Add urn() method to cons up a URN for slices.

Minor bug fix to caching.
parent 1f708e2e
......@@ -62,7 +62,6 @@ sub Lookup($$)
{
my ($class, $token) = @_;
# Look in cache first
return $slices{"$token"}
if (exists($slices{"$token"}));
......@@ -75,7 +74,10 @@ sub Lookup($$)
bless($slice, $class);
# Add to cache.
$slices{$slice->idx()} = $slice;
$slices{$slice->idx()} = $slice;
$slices{$slice->urn()} = $slice;
$slices{$slice->uuid()} = $slice;
$slices{$slice->hrn()} = $slice;
return $slice;
}
......@@ -134,6 +136,14 @@ sub slicename($)
return $slicename;
}
# Return the URN.
sub urn($)
{
my ($self) = @_;
return GeniHRN::Generate("@OURDOMAIN@", "slice", $self->slicename());
}
#
# Lookup slice by the experiment it is related to.
#
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment