|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectedu.ucsb.nceas.metacat.shared.BaseService
edu.ucsb.nceas.metacat.replication.ReplicationService
public class ReplicationService
| Field Summary | |
|---|---|
static java.lang.String |
FORCEREPLICATEDELETE
|
static java.lang.String |
METACAT_REPL_ERROR_MSG
|
static java.lang.String |
REPLICATION_LOG_FILE_NAME
|
static java.lang.String |
REPLICATIONUSER
|
| Fields inherited from class edu.ucsb.nceas.metacat.shared.BaseService |
|---|
_serviceName |
| Method Summary | |
|---|---|
protected void |
doRefresh()
|
static java.lang.String |
getCatalogXML()
Returns the xml_catalog table encoded in xml |
static int |
getHomeServerCodeForDocId(java.lang.String accNum)
Returns a home server location given a accnum |
static java.util.Hashtable<java.lang.String,java.lang.String> |
getHomeServerInfoForDocId(java.lang.String docId)
Method to get a host server information for given docid |
static ReplicationService |
getInstance()
Get the single instance of SessionService. |
static int |
getServerCodeForServerName(java.lang.String server)
Returns a server code given a server name |
static java.lang.String |
getServerNameForServerCode(int serverCode)
Returns the name of a server given a serverCode |
static java.lang.String |
getURLContent(java.net.URL u)
This method returns the content of a url |
protected static void |
handleForceReplicateDataFileRequest(java.util.Hashtable<java.lang.String,java.lang.String[]> params,
javax.servlet.http.HttpServletRequest request)
when a forcereplication data file request comes in, local host sends a readdata request to the requesting server (remote server) for the specified docid. |
protected static void |
handleForceReplicateDeleteRequest(java.io.PrintWriter out,
java.util.Hashtable<java.lang.String,java.lang.String[]> params,
javax.servlet.http.HttpServletResponse response,
javax.servlet.http.HttpServletRequest request)
|
protected static void |
handleForceReplicateRequest(java.io.PrintWriter out,
java.util.Hashtable<java.lang.String,java.lang.String[]> params,
javax.servlet.http.HttpServletResponse response,
javax.servlet.http.HttpServletRequest request)
when a forcereplication request comes in, local host sends a read request to the requesting server (remote server) for the specified docid. |
protected static java.lang.String |
handleGetCatalogRequest(java.io.PrintWriter out,
java.util.Hashtable<java.lang.String,java.lang.String[]> params,
javax.servlet.http.HttpServletResponse response,
boolean printFlag)
Sends the contents of the xml_catalog table encoded in xml The xml format is: All of the sub elements of row are #PCDATA If printFlag == false then do not print to out. |
protected static void |
handleGetDataFileRequest(java.io.OutputStream outPut,
java.util.Hashtable<java.lang.String,java.lang.String[]> params,
javax.servlet.http.HttpServletResponse response)
Sends a datafile to a remote host |
protected static void |
handleGetDocumentInfoRequest(java.io.PrintWriter out,
java.util.Hashtable<java.lang.String,java.lang.String[]> params,
javax.servlet.http.HttpServletResponse response)
Sends all of the xml_documents information encoded in xml to a requestor the format is: all of the subelements of document info are #PCDATA |
protected static void |
handleGetDocumentRequest(java.io.PrintWriter out,
java.util.Hashtable<java.lang.String,java.lang.String[]> params,
javax.servlet.http.HttpServletResponse response)
Sends a document to a remote host |
protected static void |
handleGetLockRequest(java.io.PrintWriter out,
java.util.Hashtable<java.lang.String,java.lang.String[]> params,
javax.servlet.http.HttpServletResponse response)
Grants or denies a lock to a requesting host. |
protected static void |
handleGetTimeRequest(java.io.PrintWriter out,
java.util.Hashtable<java.lang.String,java.lang.String[]> params,
javax.servlet.http.HttpServletResponse response)
Sends the current system date to the remote server. |
protected static void |
handleServerControlRequest(java.io.PrintWriter out,
java.util.Hashtable<java.lang.String,java.lang.String[]> params,
javax.servlet.http.HttpServletResponse response)
This method can add, delete and list the servers currently included in xml_replication. |
protected static void |
handleUpdateRequest(java.io.PrintWriter out,
java.util.Hashtable<java.lang.String,java.lang.String[]> params,
javax.servlet.http.HttpServletResponse response)
Sends a list of all of the documents on this sever along with their revision numbers. |
boolean |
refreshable()
|
static boolean |
replToServer(java.lang.String server)
Returns true if the replicate field for server in xml_replication is 1. |
void |
run()
this method handles the timeout for a file lock. |
void |
runOnce()
|
protected void |
startReplication(java.util.Hashtable<java.lang.String,java.lang.String[]> params)
|
void |
stop()
|
void |
stopReplication()
|
static void |
updateUserOwner(DBConnection dbConn,
java.lang.String docid,
java.lang.String owner,
java.lang.String updater)
|
| Methods inherited from class edu.ucsb.nceas.metacat.shared.BaseService |
|---|
refresh |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final java.lang.String FORCEREPLICATEDELETE
public static final java.lang.String REPLICATIONUSER
public static final java.lang.String REPLICATION_LOG_FILE_NAME
public static java.lang.String METACAT_REPL_ERROR_MSG
| Method Detail |
|---|
public static ReplicationService getInstance()
throws ServiceException
ServiceExceptionpublic boolean refreshable()
refreshable in class BaseService
protected void doRefresh()
throws ServiceException
doRefresh in class BaseServiceServiceException
public void stop()
throws ServiceException
stop in class BaseServiceServiceException
public void stopReplication()
throws ServiceException
ServiceException
protected void startReplication(java.util.Hashtable<java.lang.String,java.lang.String[]> params)
throws ServiceException
ServiceException
public void runOnce()
throws ServiceException
ServiceException
protected static void handleServerControlRequest(java.io.PrintWriter out,
java.util.Hashtable<java.lang.String,java.lang.String[]> params,
javax.servlet.http.HttpServletResponse response)
protected static void handleForceReplicateRequest(java.io.PrintWriter out,
java.util.Hashtable<java.lang.String,java.lang.String[]> params,
javax.servlet.http.HttpServletResponse response,
javax.servlet.http.HttpServletRequest request)
protected static void handleForceReplicateDeleteRequest(java.io.PrintWriter out,
java.util.Hashtable<java.lang.String,java.lang.String[]> params,
javax.servlet.http.HttpServletResponse response,
javax.servlet.http.HttpServletRequest request)
protected static void handleForceReplicateDataFileRequest(java.util.Hashtable<java.lang.String,java.lang.String[]> params,
javax.servlet.http.HttpServletRequest request)
protected static void handleGetLockRequest(java.io.PrintWriter out,
java.util.Hashtable<java.lang.String,java.lang.String[]> params,
javax.servlet.http.HttpServletResponse response)
protected static void handleGetDocumentInfoRequest(java.io.PrintWriter out,
java.util.Hashtable<java.lang.String,java.lang.String[]> params,
javax.servlet.http.HttpServletResponse response)
protected static void handleGetDataFileRequest(java.io.OutputStream outPut,
java.util.Hashtable<java.lang.String,java.lang.String[]> params,
javax.servlet.http.HttpServletResponse response)
protected static void handleGetDocumentRequest(java.io.PrintWriter out,
java.util.Hashtable<java.lang.String,java.lang.String[]> params,
javax.servlet.http.HttpServletResponse response)
protected static void handleUpdateRequest(java.io.PrintWriter out,
java.util.Hashtable<java.lang.String,java.lang.String[]> params,
javax.servlet.http.HttpServletResponse response)
public static void updateUserOwner(DBConnection dbConn,
java.lang.String docid,
java.lang.String owner,
java.lang.String updater)
throws java.sql.SQLException
dbConn - connection for doing the updatedocid - the document id to updateowner - the user_ownerupdater - the user_updated
java.sql.SQLExceptionpublic static java.lang.String getCatalogXML()
protected static java.lang.String handleGetCatalogRequest(java.io.PrintWriter out,
java.util.Hashtable<java.lang.String,java.lang.String[]> params,
javax.servlet.http.HttpServletResponse response,
boolean printFlag)
protected static void handleGetTimeRequest(java.io.PrintWriter out,
java.util.Hashtable<java.lang.String,java.lang.String[]> params,
javax.servlet.http.HttpServletResponse response)
public void run()
public static java.lang.String getServerNameForServerCode(int serverCode)
serverCode - the serverid of the server
public static int getServerCodeForServerName(java.lang.String server)
throws ServiceException
server - the name of the server
ServiceExceptionpublic static java.util.Hashtable<java.lang.String,java.lang.String> getHomeServerInfoForDocId(java.lang.String docId)
conn - a connection to the database
public static int getHomeServerCodeForDocId(java.lang.String accNum)
throws ServiceException
accNum - , given accNum for a document
ServiceException
public static java.lang.String getURLContent(java.net.URL u)
throws java.io.IOException
u - the url to return the content from
java.io.IOExceptionpublic static boolean replToServer(java.lang.String server)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||