01: /*
02: * Copyright Aduna (http://www.aduna-software.com/) (c) 1997-2007.
03: *
04: * Licensed under the Aduna BSD-style license.
05: */
06: package org.openrdf.http.protocol.transaction.operations;
07:
08: import org.openrdf.model.Resource;
09: import org.openrdf.model.URI;
10: import org.openrdf.model.Value;
11: import org.openrdf.repository.RepositoryConnection;
12: import org.openrdf.repository.RepositoryException;
13:
14: /**
15: * Operation to remove statements matching specific pattern of subject,
16: * predicate and object.
17: *
18: * @author Arjohn Kampman
19: */
20: public class RemoveStatementsOperation extends StatementOperation {
21:
22: /**
23: * Creates a RemoveStatementsOperation.
24: */
25: public RemoveStatementsOperation(Resource subj, URI pred,
26: Value obj, Resource... contexts) {
27: super (contexts);
28:
29: setSubject(subj);
30: setPredicate(pred);
31: setObject(obj);
32: }
33:
34: public void execute(RepositoryConnection con)
35: throws RepositoryException {
36: con.remove(getSubject(), getPredicate(), getObject(),
37: getContexts());
38: }
39:
40: @Override
41: public boolean equals(Object other) {
42: if (other instanceof RemoveStatementsOperation) {
43: return super .equals(other);
44: }
45:
46: return false;
47: }
48: }
|