Cacheable.html #8

  • //
  • public/
  • perforce/
  • api/
  • java/
  • p4package/
  • docs/
  • com/
  • perforce/
  • api/
  • Cacheable.html
  • View
  • Commits
  • Open Download .zip Download (15 KB)
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!--NewPage-->
<HTML>
<HEAD>
<!-- Generated by javadoc (build 1.5.0_08) on Mon Jan 28 12:25:38 PST 2008 -->
<TITLE>
Cacheable (Perforce API)
</TITLE>

<META NAME="keywords" CONTENT="com.perforce.api.Cacheable interface">

<LINK REL ="stylesheet" TYPE="text/css" HREF="../../../stylesheet.css" TITLE="Style">

<SCRIPT type="text/javascript">
function windowTitle()
{
    parent.document.title="Cacheable (Perforce API)";
}
</SCRIPT>
<NOSCRIPT>
</NOSCRIPT>

</HEAD>

<BODY BGCOLOR="white" onload="windowTitle();">


<!-- ========= START OF TOP NAVBAR ======= -->
<A NAME="navbar_top"><!-- --></A>
<A HREF="#skip-navbar_top" title="Skip navigation links"></A>
<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY="">
<TR>
<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
<A NAME="navbar_top_firstrow"><!-- --></A>
<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY="">
  <TR ALIGN="center" VALIGN="top">
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../com/perforce/api/package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> &nbsp;<FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="class-use/Cacheable.html"><FONT CLASS="NavBarFont1"><B>Use</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A>&nbsp;</TD>
  </TR>
</TABLE>
</TD>
<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
<a target="_top" href="http://www.perforce.com/"><img alt="Perforce" border="0" height="44" width="151" src="doc-files/perforce_logo.gif"></a></EM>
</TD>
</TR>

<TR>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
&nbsp;<A HREF="../../../com/perforce/api/Branch.html" title="class in com.perforce.api"><B>PREV CLASS</B></A>&nbsp;
&nbsp;<A HREF="../../../com/perforce/api/Change.html" title="class in com.perforce.api"><B>NEXT CLASS</B></A></FONT></TD>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
  <A HREF="../../../index.html?com/perforce/api/Cacheable.html" target="_top"><B>FRAMES</B></A>  &nbsp;
&nbsp;<A HREF="Cacheable.html" target="_top"><B>NO FRAMES</B></A>  &nbsp;
&nbsp;<SCRIPT type="text/javascript">
  <!--
  if(window==top) {
    document.writeln('<A HREF="../../../allclasses-noframe.html"><B>All Classes</B></A>');
  }
  //-->
</SCRIPT>
<NOSCRIPT>
  <A HREF="../../../allclasses-noframe.html"><B>All Classes</B></A>
</NOSCRIPT>


</FONT></TD>
</TR>
<TR>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
  SUMMARY:&nbsp;NESTED&nbsp;|&nbsp;FIELD&nbsp;|&nbsp;CONSTR&nbsp;|&nbsp;<A HREF="#method_summary">METHOD</A></FONT></TD>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
DETAIL:&nbsp;FIELD&nbsp;|&nbsp;CONSTR&nbsp;|&nbsp;<A HREF="#method_detail">METHOD</A></FONT></TD>
</TR>
</TABLE>
<A NAME="skip-navbar_top"></A>
<!-- ========= END OF TOP NAVBAR ========= -->

<HR>
<!-- ======== START OF CLASS DATA ======== -->
<H2>
<FONT SIZE="-1">
com.perforce.api</FONT>
<BR>
Interface Cacheable</H2>
<DL>
<DT><B>All Known Implementing Classes:</B> <DD><A HREF="../../../com/perforce/api/Branch.html" title="class in com.perforce.api">Branch</A>, <A HREF="../../../com/perforce/api/Change.html" title="class in com.perforce.api">Change</A>, <A HREF="../../../com/perforce/api/Client.html" title="class in com.perforce.api">Client</A>, <A HREF="../../../com/perforce/api/Counter.html" title="class in com.perforce.api">Counter</A>, <A HREF="../../../com/perforce/api/DirEntry.html" title="class in com.perforce.api">DirEntry</A>, <A HREF="../../../com/perforce/api/FileEntry.html" title="class in com.perforce.api">FileEntry</A>, <A HREF="../../../com/perforce/api/Group.html" title="class in com.perforce.api">Group</A>, <A HREF="../../../com/perforce/api/Job.html" title="class in com.perforce.api">Job</A>, <A HREF="../../../com/perforce/api/Label.html" title="class in com.perforce.api">Label</A>, <A HREF="../../../com/perforce/api/Mapping.html" title="class in com.perforce.api">Mapping</A>, <A HREF="../../../com/perforce/api/SourceControlObject.html" title="class in com.perforce.api">SourceControlObject</A>, <A HREF="../../../com/perforce/api/User.html" title="class in com.perforce.api">User</A></DD>
</DL>
<HR>
<DL>
<DT><PRE>public interface <B>Cacheable</B></DL>
</PRE>

<P>
An interface that indicates the implementing class can be cached for some
 period of time. Implementing classes will be stored in a
 <code>HashDecay</code> instance. Each instantiating class must create its
 own <code>HashDecay</code> instance and return a reference to it through 
 the <code>getCache</code> method.

 The update time is what is used by the <code>HasDecay</code> to determine
 when an object will decay and be discarded.
<P>

<P>
<DL>
<DT><B>Version:</B></DT>
  <DD>$Date: 2008/01/28 $ $Revision: #8 $</DD>
<DT><B>Author:</B></DT>
  <DD><a href="mailto:[email protected]">David Markley</a></DD>
<DT><B>See Also:</B><DD><A HREF="../../../com/perforce/api/HashDecay.html" title="class in com.perforce.api"><CODE>HashDecay</CODE></A></DL>
<HR>

<P>

<!-- ========== METHOD SUMMARY =========== -->

<A NAME="method_summary"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2">
<B>Method Summary</B></FONT></TH>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../com/perforce/api/Cacheable.html#clearCache()">clearCache</A></B>()</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Removes any cached objects.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../com/perforce/api/Cacheable.html#commit()">commit</A></B>()</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Stores this object back into Perforce, creating it if it
 didn't already exist.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;<A HREF="../../../com/perforce/api/HashDecay.html" title="class in com.perforce.api">HashDecay</A></CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../com/perforce/api/Cacheable.html#getCache()">getCache</A></B>()</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Returns the HashDecay instance for this class</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;long</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../com/perforce/api/Cacheable.html#getSyncTime()">getSyncTime</A></B>()</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Returns the time, in milliseconds, that this object was synchronized.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;long</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../com/perforce/api/Cacheable.html#getUpdateTime()">getUpdateTime</A></B>()</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Returns the time, in milliseconds, for this object's last update.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../com/perforce/api/Cacheable.html#inSync()">inSync</A></B>()</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Marks this object as being in in sync or valid.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../com/perforce/api/Cacheable.html#invalidate()">invalidate</A></B>()</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Invalidates this object.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;boolean</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../com/perforce/api/Cacheable.html#outOfSync(long)">outOfSync</A></B>(long&nbsp;threshold)</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Tests this object to see if it is out of sync.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../com/perforce/api/Cacheable.html#refreshUpdateTime()">refreshUpdateTime</A></B>()</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Sets the update time for this object to the current time.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../com/perforce/api/Cacheable.html#sync()">sync</A></B>()</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Brings this object back into sync with Perforce.</TD>
</TR>
</TABLE>
&nbsp;
<P>

<!-- ============ METHOD DETAIL ========== -->

<A NAME="method_detail"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2">
<B>Method Detail</B></FONT></TH>
</TR>
</TABLE>

<A NAME="clearCache()"><!-- --></A><H3>
clearCache</H3>
<PRE>
void <B>clearCache</B>()</PRE>
<DL>
<DD>Removes any cached objects.
<P>
<DD><DL>
</DL>
</DD>
</DL>
<HR>

<A NAME="commit()"><!-- --></A><H3>
commit</H3>
<PRE>
void <B>commit</B>()
            throws <A HREF="../../../com/perforce/api/CommitException.html" title="class in com.perforce.api">CommitException</A></PRE>
<DL>
<DD>Stores this object back into Perforce, creating it if it
 didn't already exist.
<P>
<DD><DL>

<DT><B>Throws:</B>
<DD><CODE><A HREF="../../../com/perforce/api/CommitException.html" title="class in com.perforce.api">CommitException</A></CODE></DL>
</DD>
</DL>
<HR>

<A NAME="getCache()"><!-- --></A><H3>
getCache</H3>
<PRE>
<A HREF="../../../com/perforce/api/HashDecay.html" title="class in com.perforce.api">HashDecay</A> <B>getCache</B>()</PRE>
<DL>
<DD>Returns the HashDecay instance for this class
<P>
<DD><DL>
</DL>
</DD>
</DL>
<HR>

<A NAME="getSyncTime()"><!-- --></A><H3>
getSyncTime</H3>
<PRE>
long <B>getSyncTime</B>()</PRE>
<DL>
<DD>Returns the time, in milliseconds, that this object was synchronized.
<P>
<DD><DL>
</DL>
</DD>
</DL>
<HR>

<A NAME="getUpdateTime()"><!-- --></A><H3>
getUpdateTime</H3>
<PRE>
long <B>getUpdateTime</B>()</PRE>
<DL>
<DD>Returns the time, in milliseconds, for this object's last update.
<P>
<DD><DL>
</DL>
</DD>
</DL>
<HR>

<A NAME="inSync()"><!-- --></A><H3>
inSync</H3>
<PRE>
void <B>inSync</B>()</PRE>
<DL>
<DD>Marks this object as being in in sync or valid.
<P>
<DD><DL>
</DL>
</DD>
</DL>
<HR>

<A NAME="invalidate()"><!-- --></A><H3>
invalidate</H3>
<PRE>
void <B>invalidate</B>()</PRE>
<DL>
<DD>Invalidates this object.
<P>
<DD><DL>
</DL>
</DD>
</DL>
<HR>

<A NAME="outOfSync(long)"><!-- --></A><H3>
outOfSync</H3>
<PRE>
boolean <B>outOfSync</B>(long&nbsp;threshold)</PRE>
<DL>
<DD>Tests this object to see if it is out of sync. Checks to see if the
 expiration time is within the specified number of milliseconds.
<P>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>threshold</CODE> - Number of milliseconds.
<DT><B>Returns:</B><DD>True if the object will be out of sync within the threshold.</DL>
</DD>
</DL>
<HR>

<A NAME="refreshUpdateTime()"><!-- --></A><H3>
refreshUpdateTime</H3>
<PRE>
void <B>refreshUpdateTime</B>()</PRE>
<DL>
<DD>Sets the update time for this object to the current time.
<P>
<DD><DL>
</DL>
</DD>
</DL>
<HR>

<A NAME="sync()"><!-- --></A><H3>
sync</H3>
<PRE>
void <B>sync</B>()
          throws <A HREF="../../../com/perforce/api/PerforceException.html" title="class in com.perforce.api">PerforceException</A></PRE>
<DL>
<DD>Brings this object back into sync with Perforce. This also sets the
 sets the update and sync time for this object.
<P>
<DD><DL>

<DT><B>Throws:</B>
<DD><CODE><A HREF="../../../com/perforce/api/PerforceException.html" title="class in com.perforce.api">PerforceException</A></CODE></DL>
</DD>
</DL>
<!-- ========= END OF CLASS DATA ========= -->
<HR>


<!-- ======= START OF BOTTOM NAVBAR ====== -->
<A NAME="navbar_bottom"><!-- --></A>
<A HREF="#skip-navbar_bottom" title="Skip navigation links"></A>
<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY="">
<TR>
<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
<A NAME="navbar_bottom_firstrow"><!-- --></A>
<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY="">
  <TR ALIGN="center" VALIGN="top">
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../com/perforce/api/package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> &nbsp;<FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="class-use/Cacheable.html"><FONT CLASS="NavBarFont1"><B>Use</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A>&nbsp;</TD>
  </TR>
</TABLE>
</TD>
<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
<a target="_top" href="http://www.perforce.com/"><img alt="Perforce" border="0" height="44" width="151" src="doc-files/perforce_logo.gif"></a></EM>
</TD>
</TR>

<TR>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
&nbsp;<A HREF="../../../com/perforce/api/Branch.html" title="class in com.perforce.api"><B>PREV CLASS</B></A>&nbsp;
&nbsp;<A HREF="../../../com/perforce/api/Change.html" title="class in com.perforce.api"><B>NEXT CLASS</B></A></FONT></TD>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
  <A HREF="../../../index.html?com/perforce/api/Cacheable.html" target="_top"><B>FRAMES</B></A>  &nbsp;
&nbsp;<A HREF="Cacheable.html" target="_top"><B>NO FRAMES</B></A>  &nbsp;
&nbsp;<SCRIPT type="text/javascript">
  <!--
  if(window==top) {
    document.writeln('<A HREF="../../../allclasses-noframe.html"><B>All Classes</B></A>');
  }
  //-->
</SCRIPT>
<NOSCRIPT>
  <A HREF="../../../allclasses-noframe.html"><B>All Classes</B></A>
</NOSCRIPT>


</FONT></TD>
</TR>
<TR>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
  SUMMARY:&nbsp;NESTED&nbsp;|&nbsp;FIELD&nbsp;|&nbsp;CONSTR&nbsp;|&nbsp;<A HREF="#method_summary">METHOD</A></FONT></TD>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
DETAIL:&nbsp;FIELD&nbsp;|&nbsp;CONSTR&nbsp;|&nbsp;<A HREF="#method_detail">METHOD</A></FONT></TD>
</TR>
</TABLE>
<A NAME="skip-navbar_bottom"></A>
<!-- ======== END OF BOTTOM NAVBAR ======= -->

<HR>
<i><a href="doc-files/LICENSE.TXT">Copyright</a> &#169; 2008, Perforce Software, All rights reserved.</i>
</BODY>
</HTML>
# Change User Description Committed
#9 8157 michael Archiving legacy java api projects which predate the supported P4Java api.
#8 6166 Sivananda Poreddy Fixing problem with last check related to javadoc
#7 6164 Sivananda Poreddy Updating the javadoc to include all the new changes
#6 6141 Sivananda Poreddy Updating the p4package with fixes, some new features, jar update, and doc updates
#5 2002 David Markley Integrated the latest changes for p4package to the public depot.
#4 1808 David Markley Updated Env class and fixed fstat issues.
Published new Javadocs.
#3 1361 David Markley Added convenience methods to the Env class.
#2 1334 David Markley Added more example code.
Added the Counter class.
Corrected the filelog methods for the FileEntry class.
#1 1043 David Markley Initial branch to public area.
//guest/david_markley/p4package/docs/com/perforce/api/Cacheable.html
#2 1037 David Markley Updated the documentation.
#1 1020 David Markley Added Perforce Java API documentation.
This is generated using JavaDoc.