|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorca.shirako.core.Ticket
public class Ticket
| Field Summary | |
|---|---|
protected IAuthorityProxy |
authority
The authority who owns the resources described in this concrete set |
protected LoggingTool |
logger
The logger |
protected int |
oldUnits
Units we used to have before the current extend |
protected IShirakoPlugin |
plugin
The plugin object |
protected java.util.Properties |
properties
Properties set by brokers and delivered to the site |
static java.lang.String |
PropertyAuthority
|
static java.lang.String |
PropertyDivisible
|
static java.lang.String |
PropertyIdentifiers
|
static java.lang.String |
PropertyOldUnits
|
static java.lang.String |
PropertyProperties
|
static java.lang.String |
PropertyTerm
|
static java.lang.String |
PropertyType
|
static java.lang.String |
PropertyUnits
|
protected ResourceReservation |
reservation
The reservation this TicketStub belongs to |
protected Term |
term
The term |
protected ResourceType |
type
The resource type |
protected int |
units
The number of units |
| Constructor Summary | |
|---|---|
Ticket()
|
|
Ticket(IShirakoPlugin plugin,
IAuthorityProxy authority,
ResourceReservation reservation)
Creates a new TicketStub |
|
Ticket(IShirakoPlugin plugin,
LoggingTool logger,
IAuthorityProxy authority,
ResourceType type,
int units,
Term term)
Creates a new TicketStub with an empty slice name |
|
Ticket(IShirakoPlugin plugin,
LoggingTool logger,
Ticket cset)
|
|
Ticket(Ticket cset)
|
|
| Method Summary | |
|---|---|
void |
add(IConcreteSet cs,
boolean configure)
Adds the passed set to the current set. |
void |
change(IConcreteSet cs,
Term term,
boolean configure)
Make changes to the resources committed to this concrete set. |
IConcreteSet |
clone()
Makes a clone of the concrete set. |
IConcreteSet |
cloneEmpty()
Makes an "empty" clone of this concrete set. |
void |
close()
Close - empty method |
IConcreteSet |
collectReleased()
ConcreteSet operations not meaningful to TicketStub |
void |
destroy()
Destroy the reservation |
void |
extend(Term term)
Extend the term on the reservation |
IConcreteSet |
extract(int count,
Term t,
java.util.Properties properties,
AuthToken client)
Write a new subticket for some subset of the units and some subinterval of the term covered by this ticket. |
LoggingTool |
getLogger()
|
java.lang.String |
getNotices()
Gets a string of notices or events pertaining to the underlying resources. |
int |
getOldUnits()
Returns the previous number of units |
java.util.Properties |
getProperties()
Returns the properties |
java.util.Properties |
getProperties(boolean create)
|
IAuthorityProxy |
getSiteProxy()
Return a proxy for the site authority that controls the resources named in this ticket. |
Term |
getTerm()
Returns the ticket term |
ITicket |
getTicket()
Returns the physical ticket |
ResourceType |
getType()
Returns the resource type of the associated ticket |
int |
getUnits()
Returns the number of units |
int |
holding(java.util.Date slotDate)
Returns how many units are in the set at the given time instance. |
int |
holding(Term t)
Returns how many units will be in the set for the given period of time. |
boolean |
isActive()
Active - valid tickets are always "active" if anyone asks. |
void |
modify(IConcreteSet cs,
boolean configure)
Updates the units in the current set with information contained in the passed set. |
void |
probe()
Probe - empty method |
void |
remove(IConcreteSet cs,
boolean configure)
Removes the passed set from the current set. |
void |
reset(java.util.Properties properties)
De-serializes the object from the given properties list. |
void |
revisit(IActor actor,
java.util.Properties p)
Recovers state of the component using a previously saved properties list and a references to the actor this component belongs to. |
java.util.Properties |
save()
Serializes the object into a properties list. |
void |
save(java.util.Properties p)
Serializes the object into the given properties list. |
IConcreteSet |
selectExtract(int count,
java.util.Properties p)
|
void |
setLogger(LoggingTool logger)
|
void |
setProperties(java.util.Properties p)
Sets the properties |
void |
setShirakoPlugin(IShirakoPlugin plugin)
|
void |
setSiteProxy(IAuthorityProxy site)
Set the proxy for the site authority |
void |
setTicket(ITicket ticket)
Sets the physical ticket |
void |
setup(ResourceReservation reservation)
Indicates that we're committing resources to a client (on an an agent). |
java.lang.String |
toString()
|
void |
validateConcrete(ResourceType type,
int units,
Term t)
Validate that the concrete set matches the abstract resource set parameters. |
void |
validateIncoming()
Validate the incoming ticket and add to the local TicketSet - no-op |
void |
validateOutgoing()
Validate the outgoing ticket - no-op |
| Methods inherited from class java.lang.Object |
|---|
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public static java.lang.String PropertyType
public static java.lang.String PropertyUnits
public static java.lang.String PropertyOldUnits
public static java.lang.String PropertyAuthority
public static java.lang.String PropertyTerm
public static java.lang.String PropertyProperties
public static final java.lang.String PropertyIdentifiers
public static final java.lang.String PropertyDivisible
protected IShirakoPlugin plugin
protected LoggingTool logger
protected ResourceReservation reservation
protected IAuthorityProxy authority
protected ResourceType type
protected int units
protected Term term
protected int oldUnits
protected java.util.Properties properties
| Constructor Detail |
|---|
public Ticket()
public Ticket(IShirakoPlugin plugin,
LoggingTool logger,
IAuthorityProxy authority,
ResourceType type,
int units,
Term term)
TicketStub with an empty slice name
public Ticket(IShirakoPlugin plugin,
IAuthorityProxy authority,
ResourceReservation reservation)
TicketStub
public Ticket(IShirakoPlugin plugin,
LoggingTool logger,
Ticket cset)
public Ticket(Ticket cset)
| Method Detail |
|---|
public IConcreteSet cloneEmpty()
IConcreteSet
cloneEmpty in interface IConcreteSetpublic IConcreteSet clone()
IConcreteSetIConcreteSet.cloneEmpty(), this
method preserves the set: the set elements are the same objects as the
original IConcreteSet, but the indexing structures are different. That
is, adding/removing units to the original should not affect the clone.
But modifications to an individual unit should be visible form the
original and the clone.
clone in interface IConcreteSetclone in class java.lang.Object
public IConcreteSet extract(int count,
Term t,
java.util.Properties properties,
AuthToken client)
throws java.lang.Exception
extract in interface IConcreteSetcount - how many units to extractt - the subinterval of the new subset of ticketsproperties - properties to attach to the extracted resources. If
any, these properties will replace any properties contained in
the set the resources are being extracted from.client - the client to extract resources to
java.lang.Exception - thrown if ticket term does not cover the extract set
term or if the ticket has insufficient units
public IConcreteSet selectExtract(int count,
java.util.Properties p)
throws java.lang.Exception
java.lang.Exception
public void validateIncoming()
throws java.lang.Exception
validateIncoming in interface IConcreteSetjava.lang.Exception
public void validateOutgoing()
throws java.lang.Exception
validateOutgoing in interface IConcreteSetjava.lang.Exception
public void validateConcrete(ResourceType type,
int units,
Term t)
throws java.lang.Exception
IConcreteSet
validateConcrete in interface IConcreteSettype - abstract resources resource typeunits - abstract resources unitst - abstract resources term
java.lang.Exceptionpublic int holding(Term t)
IConcreteSet
holding in interface IConcreteSett - period of time
public int holding(java.util.Date slotDate)
IConcreteSet
holding in interface IConcreteSetslotDate - time instance
public IAuthorityProxy getSiteProxy()
getSiteProxy in interface IConcreteSetpublic void setSiteProxy(IAuthorityProxy site)
setSiteProxy in interface IConcreteSetsite - the for this ticketpublic void setup(ResourceReservation reservation)
setup in interface IConcreteSetsname - the slice for the reservationrid - the reservation idterm - the reservation termproperties - any properties of the reservation
java.lang.Exception
public void add(IConcreteSet cs,
boolean configure)
throws java.lang.Exception
IConcreteSetIConcreteSet.extend(Term).
add in interface IConcreteSetcs - set to addconfigure - if true, configuration actions will be triggered for all
added units
java.lang.Exception
public void remove(IConcreteSet cs,
boolean configure)
throws java.lang.Exception
IConcreteSetIConcreteSet.extend(Term).
remove in interface IConcreteSetcs - set to removeconfigure - if true, configuration actions will be triggered for all
removed units
java.lang.Exception
public void modify(IConcreteSet cs,
boolean configure)
throws java.lang.Exception
IConcreteSetIConcreteSet.extend(Term).
modify in interface IConcreteSetcs - set containing the update dataconfigure - if true, configuration actions will be triggered for all
modified units
java.lang.Exception
public void change(IConcreteSet cs,
Term term,
boolean configure)
throws java.lang.Exception
change in interface IConcreteSetnew - concrete resourcesnew - term
java.lang.Exception - thrown if something is wrong
public void extend(Term term)
throws java.lang.Exception
extend in interface IConcreteSetterm - the revised term
java.lang.Exception
public void destroy()
throws java.lang.Exception
destroy in interface IConcreteSetjava.lang.Exception
public IConcreteSet collectReleased()
throws java.lang.Exception
collectReleased in interface IConcreteSetjava.lang.Exception - thrown when method is called
public void probe()
throws java.lang.Exception
probe in interface IConcreteSetjava.lang.Exception
public void close()
throws java.lang.Exception
close in interface IConcreteSetjava.lang.Exceptionpublic boolean isActive()
isActive in interface IConcreteSet
public java.util.Properties save()
throws java.lang.Exception
ISerialize
save in interface ISerializejava.lang.Exception
public void save(java.util.Properties p)
throws java.lang.Exception
ISerialize
save in interface ISerializep - properties list to serialize the object into
java.lang.Exception
public void reset(java.util.Properties properties)
throws java.lang.Exception
ISerialize
reset in interface ISerializeproperties - properties list containing the serialized version of
the object
java.lang.Exception
public void revisit(IActor actor,
java.util.Properties p)
throws java.lang.Exception
IRecover
revisit in interface IRecoveractor - actor object the component belongs top - properties list containing configuration data about the
component
java.lang.Exceptionpublic void setLogger(LoggingTool logger)
public LoggingTool getLogger()
public void setShirakoPlugin(IShirakoPlugin plugin)
setShirakoPlugin in interface IConcreteSetpublic java.lang.String getNotices()
getNotices in interface IConcreteSetpublic java.lang.String toString()
toString in class java.lang.Objectpublic ResourceType getType()
public int getUnits()
getUnits in interface IConcreteSetpublic int getOldUnits()
public Term getTerm()
public void setTicket(ITicket ticket)
ticket - public ITicket getTicket()
public void setProperties(java.util.Properties p)
p - public java.util.Properties getProperties()
public java.util.Properties getProperties(boolean create)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||