com.ptc.windchill.upgrade.blobrewrite
Class BackgroundBlobRewriter.Server

java.lang.Object
  extended bycom.ptc.windchill.upgrade.blobrewrite.BackgroundBlobRewriter.Server
All Implemented Interfaces:
RemoteAccess
Enclosing class:
BackgroundBlobRewriter

public static class BackgroundBlobRewriter.Server
extends Object
implements RemoteAccess

Accepts lightweight service requests in the MethodServer and delegates the work to static methods on the containing class.


Field Summary
private static String BLOB_REWRITE_QUEUE_NAME
           
private static BackgroundBlobRewriter.Server instance__
           
private  PrintWriter log_
           
private  String logLocation_
           
private  String serverUrl_
           
private static String STDERR
           
private  long totalCount_
           
private  long totalTime_
           
 
Fields inherited from interface wt.method.RemoteAccess
versionID
 
Constructor Summary
private BackgroundBlobRewriter.Server()
           
 
Method Summary
private  boolean containsBlobColumn(ClassInfo class_info)
           
private  void deleteAllQueuedEntries()
           
private  void emailwarning(String localized_message)
           
private  void emailwarning(String message_key, Object[] args)
           
protected  void finalize()
           
private  WTUser findUser(String email_or_id)
          Lookup a user using the email address or the id(authenticationName).
private  Calendar getCalendar()
           
private static BackgroundBlobRewriter.Server getInstance()
           
private  String getLocalizedTaskDescription()
           
private  PrintWriter getLog()
           
private  String getLogLocation()
           
private  ScheduleQueue getQueue()
           
private  String getServerUrl()
           
private  boolean inValidOperatingPeriod(Date time)
           
private  void makeFailureNotifyee(WTPrincipal principal)
           
private  Timestamp pickNextEarliestValidScheduledTime()
           
static void queueRewriteBlobs()
          Queues a request to rewrite all blobs for each concrete persistable class.
private  void queueRewriteBlobsFor(Vector class_names)
           
private  void queueRewriteBlobsForAllPersistables()
           
private  void report(String message)
           
private  void report(String message_key, Object[] args)
           
static void rewriteBlobs(Vector class_names)
          Queues a request to rewrite all blobs for each concrete persistable class specified in the provided vector of String class names.
 void rewriteBlobsFor(Vector class_names)
          Process the first class name in the list, then enqueue a job to process the remaining class names in the list.
private  void rewriteBlobsInPersistables(String class_name)
           
private  void sendQueueAdmilEmailAboutFailure(String failed_activity, Throwable t)
           
private  void sendQueueAdminEmail(String subject, String body)
           
private  void warning(String localized_message)
           
private  void warning(String message_key, Object[] args)
           
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

BLOB_REWRITE_QUEUE_NAME

private static final String BLOB_REWRITE_QUEUE_NAME
See Also:
Constant Field Values

STDERR

private static final String STDERR
See Also:
Constant Field Values

log_

private PrintWriter log_

logLocation_

private String logLocation_

serverUrl_

private String serverUrl_

totalCount_

private long totalCount_

totalTime_

private long totalTime_

instance__

private static BackgroundBlobRewriter.Server instance__
Constructor Detail

BackgroundBlobRewriter.Server

private BackgroundBlobRewriter.Server()
                               throws WTException
Method Detail

queueRewriteBlobs

public static void queueRewriteBlobs()
                              throws WTException
Queues a request to rewrite all blobs for each concrete persistable class.

Throws:
WTException

rewriteBlobs

public static void rewriteBlobs(Vector class_names)
                         throws WTException
Queues a request to rewrite all blobs for each concrete persistable class specified in the provided vector of String class names.

Throws:
WTException

getInstance

private static BackgroundBlobRewriter.Server getInstance()
                                                  throws WTException
Throws:
WTException

finalize

protected void finalize()
                 throws Throwable
Throws:
Throwable

getLog

private final PrintWriter getLog()

getLogLocation

private final String getLogLocation()

getServerUrl

private final String getServerUrl()

getQueue

private ScheduleQueue getQueue()
                        throws WTException
Throws:
WTException

deleteAllQueuedEntries

private void deleteAllQueuedEntries()
                             throws WTException
Throws:
WTException

queueRewriteBlobsForAllPersistables

private void queueRewriteBlobsForAllPersistables()
                                          throws WTException
Throws:
WTException

containsBlobColumn

private boolean containsBlobColumn(ClassInfo class_info)
                            throws WTIntrospectionException
Throws:
WTIntrospectionException

queueRewriteBlobsFor

private void queueRewriteBlobsFor(Vector class_names)
                           throws WTException
Throws:
WTException

getCalendar

private Calendar getCalendar()

inValidOperatingPeriod

private boolean inValidOperatingPeriod(Date time)

pickNextEarliestValidScheduledTime

private Timestamp pickNextEarliestValidScheduledTime()

makeFailureNotifyee

private void makeFailureNotifyee(WTPrincipal principal)
                          throws WTException
Throws:
WTException

getLocalizedTaskDescription

private String getLocalizedTaskDescription()

report

private void report(String message)

report

private void report(String message_key,
                    Object[] args)

warning

private void warning(String localized_message)

warning

private void warning(String message_key,
                     Object[] args)

emailwarning

private void emailwarning(String localized_message)

emailwarning

private void emailwarning(String message_key,
                          Object[] args)

rewriteBlobsFor

public void rewriteBlobsFor(Vector class_names)
                     throws WTException
Process the first class name in the list, then enqueue a job to process the remaining class names in the list. This assures that as each class is completed, only remaining classes will be processed in the event of a server restart.

Throws:
WTException

rewriteBlobsInPersistables

private void rewriteBlobsInPersistables(String class_name)
                                 throws WTException,
                                        WTPropertyVetoException,
                                        Throwable
Throws:
WTException
WTPropertyVetoException
Throwable

sendQueueAdminEmail

private void sendQueueAdminEmail(String subject,
                                 String body)

sendQueueAdmilEmailAboutFailure

private void sendQueueAdmilEmailAboutFailure(String failed_activity,
                                             Throwable t)

findUser

private WTUser findUser(String email_or_id)
                 throws WTException
Lookup a user using the email address or the id(authenticationName).

Returns:
the first user found or null if none is found
Throws:
WTException