3
* ====================================================================
4
* Licensed to the Apache Software Foundation (ASF) under one
5
* or more contributor license agreements. See the NOTICE file
6
* distributed with this work for additional information
7
* regarding copyright ownership. The ASF licenses this file
8
* to you under the Apache License, Version 2.0 (the
9
* "License"); you may not use this file except in compliance
10
* with the License. You may obtain a copy of the License at
12
* http://www.apache.org/licenses/LICENSE-2.0
14
* Unless required by applicable law or agreed to in writing,
15
* software distributed under the License is distributed on an
16
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
17
* KIND, either express or implied. See the License for the
18
* specific language governing permissions and limitations
20
* ====================================================================
23
* @file CommitEditor.h
24
* @brief Interface of the class CommitEditor
27
#ifndef JAVAHL_COMMIT_EDITOR_H
28
#define JAVAHL_COMMIT_EDITOR_H
37
#include "CommitCallback.h"
39
#include "jniwrapper/jni_globalref.hpp"
43
// Forward-declare the currently private EV2 editor struct.
47
* This class wraps an EV2 commit editor.
49
class CommitEditor : public SVNBase
52
static CommitEditor* getCppObject(jobject jthis);
53
static jlong createInstance(jobject jsession,
55
jobject jcommit_callback,
59
jobject jget_props_cb,
60
jobject jget_kind_cb);
61
virtual ~CommitEditor();
63
virtual void dispose(jobject jthis);
65
void addDirectory(jstring jrelpath,
66
jobject jchildren, jobject jproperties,
67
jlong jreplaces_revision);
68
void addFile(jstring jrelpath,
69
jobject jchecksum, jobject jcontents,
71
jlong jreplaces_revision);
72
void addSymlink(jstring jrelpath,
73
jstring jtarget, jobject jproperties,
74
jlong jreplaces_revision);
75
void addAbsent(jstring jrelpath,
76
jobject jkind, jlong jreplaces_revision);
77
void alterDirectory(jstring jrelpath, jlong jrevision,
78
jobject jchildren, jobject jproperties);
79
void alterFile(jstring jrelpath, jlong jrevision,
80
jobject jchecksum, jobject jcontents,
82
void alterSymlink(jstring jrelpath, jlong jrevision,
83
jstring jtarget, jobject jproperties);
84
void remove(jstring jrelpath, jlong jrevision);
85
void copy(jstring jsrc_relpath, jlong jsrc_revision,
86
jstring jdst_relpath, jlong jreplaces_revision);
87
void move(jstring jsrc_relpath, jlong jsrc_revision,
88
jstring jdst_relpath, jlong jreplaces_revision);
93
CommitEditor(RemoteSession* session,
94
jobject jrevprops, jobject jcommit_callback,
95
jobject jlock_tokens, jboolean jkeep_locks,
96
jobject jget_base_cb, jobject jget_props_cb,
97
jobject jget_kind_cb);
99
// This is our private callbacks for the commit editor.
100
static svn_error_t* provide_base_cb(svn_stream_t **contents,
101
svn_revnum_t *revision,
103
const char *repos_relpath,
104
apr_pool_t *result_pool,
105
apr_pool_t *scratch_pool);
106
static svn_error_t* provide_props_cb(apr_hash_t **props,
107
svn_revnum_t *revision,
109
const char *repos_relpath,
110
apr_pool_t *result_pool,
111
apr_pool_t *scratch_pool);
112
static svn_error_t* get_copysrc_kind_cb(svn_node_kind_t* kind, void* baton,
113
const char* repos_relpath,
114
svn_revnum_t src_revision,
115
apr_pool_t *scratch_pool);
118
PersistentCommitCallback m_callback;
119
RemoteSession* m_session;
120
svn_editor_t* m_editor;
122
Java::GlobalObject m_get_base_cb;
123
Java::GlobalObject m_get_props_cb;
124
Java::GlobalObject m_get_kind_cb;
126
// Temporary, while EV2 shims are in place
127
svn_ra_session_t* m_callback_session;
128
const char* m_callback_session_url;
129
const char* m_callback_session_uuid;
132
#endif // JAVAHL_COMMIT_EDITOR_H