KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > objectweb > cjdbc > controller > virtualdatabase > protocol > UnlogRequest


1 /**
2  * C-JDBC: Clustered JDBC.
3  * Copyright (C) 2005 Emic Networks.
4  * Contact: c-jdbc@objectweb.org
5  *
6  * This library is free software; you can redistribute it and/or modify it
7  * under the terms of the GNU Lesser General Public License as published by the
8  * Free Software Foundation; either version 2.1 of the License, or any later
9  * version.
10  *
11  * This library is distributed in the hope that it will be useful, but WITHOUT
12  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13  * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License
14  * for more details.
15  *
16  * You should have received a copy of the GNU Lesser General Public License
17  * along with this library; if not, write to the Free Software Foundation,
18  * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
19  *
20  * Initial developer(s): Emmanuel Cecchet.
21  * Contributor(s): ______________________.
22  */

23
24 package org.objectweb.cjdbc.controller.virtualdatabase.protocol;
25
26 import java.sql.SQLException JavaDoc;
27
28 import org.objectweb.cjdbc.common.sql.AbstractRequest;
29 import org.objectweb.cjdbc.common.sql.AbstractWriteRequest;
30 import org.objectweb.cjdbc.controller.requestmanager.distributed.DistributedRequestManager;
31
32 /**
33  * This class defines an UnlogRequest command that is sent when a query has
34  * failed on all controllers and it is necessary for controllers without backend
35  * to remove this query from their recovery log since they systematically log
36  * write queries.
37  *
38  * @author <a HREF="mailto:emmanuel.cecchet@emicnetworks.com">Emmanuel Cecchet
39  * </a>
40  * @version 1.0
41  */

42 public class UnlogRequest extends DistributedRequest
43 {
44   private static final long serialVersionUID = 6056579752275966631L;
45
46   private long id;
47
48   /**
49    * Creates a new <code>UnlogRequest</code> object
50    *
51    * @param request the request that failed on all controllers
52    * @param recoveryLogId request identifier in the recovery log on controller
53    * where the request should be unlogged
54    */

55   public UnlogRequest(AbstractRequest request, long recoveryLogId)
56   {
57     super(request);
58     this.id = recoveryLogId;
59   }
60
61   /**
62    * @see org.objectweb.cjdbc.controller.virtualdatabase.protocol.DistributedRequest#scheduleRequest(org.objectweb.cjdbc.controller.requestmanager.distributed.DistributedRequestManager)
63    */

64   public final void scheduleRequest(DistributedRequestManager drm)
65       throws SQLException JavaDoc
66   {
67   }
68
69   /**
70    * @see org.objectweb.cjdbc.controller.virtualdatabase.protocol.DistributedRequest#executeScheduledRequest(org.objectweb.cjdbc.controller.requestmanager.distributed.DistributedRequestManager)
71    */

72   public final Object JavaDoc executeScheduledRequest(DistributedRequestManager drm)
73       throws SQLException JavaDoc
74   {
75     drm.removeFailedRequestFromRecoveryLog((AbstractWriteRequest) request, id);
76     return null;
77   }
78
79 }
Popular Tags