-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[#26] Start
ISVNManager
implementation
* reuse `CallWatch` and others
- Loading branch information
1 parent
62f4e6c
commit 3afc8cf
Showing
8 changed files
with
302 additions
and
14 deletions.
There are no files selected for viewing
55 changes: 55 additions & 0 deletions
55
...ector.svnkit1_10/src/ru/arsysop/svn/connector/internal/adapt/jhlsv/NodeActionAdapter.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
/* | ||
* Copyright (c) 2023, 2024 ArSysOp | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
* | ||
* SPDX-License-Identifier: Apache-2.0 | ||
* | ||
* Contributors: | ||
* ArSysOp - initial API and implementation | ||
*/ | ||
|
||
package ru.arsysop.svn.connector.internal.adapt.jhlsv; | ||
|
||
import java.util.HashMap; | ||
import java.util.Map; | ||
|
||
import org.apache.subversion.javahl.ReposNotifyInformation; | ||
import org.eclipse.team.svn.core.connector.SVNRepositoryNotification; | ||
import org.eclipse.team.svn.core.connector.SVNRepositoryNotification.NodeAction; | ||
|
||
import ru.arsysop.svn.connector.internal.adapt.SvnTypeMap; | ||
|
||
public final class NodeActionAdapter | ||
extends SvnTypeMap<ReposNotifyInformation.NodeAction, SVNRepositoryNotification.NodeAction> { | ||
|
||
public NodeActionAdapter(ReposNotifyInformation.NodeAction source) { | ||
super(source); | ||
} | ||
|
||
@Override | ||
protected Map<ReposNotifyInformation.NodeAction, SVNRepositoryNotification.NodeAction> fill() { | ||
Map<ReposNotifyInformation.NodeAction, SVNRepositoryNotification.NodeAction> map = new HashMap<>(); | ||
map.put(ReposNotifyInformation.NodeAction.change, SVNRepositoryNotification.NodeAction.CHANGE); | ||
map.put(ReposNotifyInformation.NodeAction.add, SVNRepositoryNotification.NodeAction.ADD); | ||
map.put(ReposNotifyInformation.NodeAction.deleted, SVNRepositoryNotification.NodeAction.DELETE); | ||
map.put(ReposNotifyInformation.NodeAction.replace, SVNRepositoryNotification.NodeAction.REPLACE); | ||
return map; | ||
} | ||
|
||
@Override | ||
protected SVNRepositoryNotification.NodeAction defaults() { | ||
return NodeAction.UNKNOWN; | ||
} | ||
|
||
} |
69 changes: 69 additions & 0 deletions
69
...rc/ru/arsysop/svn/connector/internal/adapt/jhlsv/ReposNotifyInformationActionAdapter.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
/* | ||
* Copyright (c) 2023, 2024 ArSysOp | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
* | ||
* SPDX-License-Identifier: Apache-2.0 | ||
* | ||
* Contributors: | ||
* ArSysOp - initial API and implementation | ||
*/ | ||
|
||
package ru.arsysop.svn.connector.internal.adapt.jhlsv; | ||
|
||
import java.util.LinkedHashMap; | ||
import java.util.Map; | ||
|
||
import org.apache.subversion.javahl.ReposNotifyInformation; | ||
import org.apache.subversion.javahl.ReposNotifyInformation.Action; | ||
import org.eclipse.team.svn.core.connector.SVNRepositoryNotification; | ||
|
||
import ru.arsysop.svn.connector.internal.adapt.SvnTypeMap; | ||
|
||
final class ReposNotifyInformationActionAdapter | ||
extends SvnTypeMap<ReposNotifyInformation.Action, SVNRepositoryNotification.Action> { | ||
|
||
ReposNotifyInformationActionAdapter(ReposNotifyInformation.Action source) { | ||
super(source); | ||
} | ||
|
||
@Override | ||
protected Map<ReposNotifyInformation.Action, SVNRepositoryNotification.Action> fill() { | ||
Map<Action, SVNRepositoryNotification.Action> map = new LinkedHashMap<>(); | ||
map.put(Action.warning, SVNRepositoryNotification.Action.WARNING); | ||
map.put(Action.dump_rev_end, SVNRepositoryNotification.Action.DUMP_REV_END); | ||
map.put(Action.verify_rev_end, SVNRepositoryNotification.Action.VERIFY_REV_END); | ||
map.put(Action.pack_shard_start, SVNRepositoryNotification.Action.PACK_SHARD_START); | ||
map.put(Action.pack_shard_end, SVNRepositoryNotification.Action.PACK_SHARD_END); | ||
map.put(Action.pack_shard_start_revprop, SVNRepositoryNotification.Action.PACK_SHARD_START_REVPROP); | ||
map.put(Action.pack_shard_end_revprop, SVNRepositoryNotification.Action.PACK_SHARD_END_REVPROP); | ||
map.put(Action.load_txn_start, SVNRepositoryNotification.Action.LOAD_TXN_START); | ||
map.put(Action.load_txn_committed, SVNRepositoryNotification.Action.LOAD_TXN_COMMITTED); | ||
map.put(Action.load_node_start, SVNRepositoryNotification.Action.LOAD_NODE_START); | ||
map.put(Action.load_node_done, SVNRepositoryNotification.Action.LOAD_NODE_END); | ||
map.put(Action.load_copied_node, SVNRepositoryNotification.Action.LOAD_COPIED_NODE); | ||
map.put(Action.load_normalized_mergeinfo, SVNRepositoryNotification.Action.LOAD_NORMALIZED_MERGEINFO); | ||
map.put(Action.mutex_acquired, SVNRepositoryNotification.Action.MUTEX_ACQUIRED); | ||
map.put(Action.recover_start, SVNRepositoryNotification.Action.RECOVER_START); | ||
map.put(Action.upgrade_start, SVNRepositoryNotification.Action.UPGRADE_START); | ||
map.put(Action.load_skipped_rev, SVNRepositoryNotification.Action.LOAD_SKIPPED_REV); | ||
map.put(Action.verify_rev_structure, SVNRepositoryNotification.Action.VERIFY_REV_STRUCTURE); | ||
return map; | ||
} | ||
|
||
@Override | ||
protected SVNRepositoryNotification.Action defaults() { | ||
return SVNRepositoryNotification.Action.UNKNOWN; | ||
} | ||
|
||
} |
48 changes: 48 additions & 0 deletions
48
...1_10/src/ru/arsysop/svn/connector/internal/adapt/jhlsv/ReposNotifyInformationAdapter.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
/* | ||
* Copyright (c) 2023, 2024 ArSysOp | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
* | ||
* SPDX-License-Identifier: Apache-2.0 | ||
* | ||
* Contributors: | ||
* ArSysOp - initial API and implementation | ||
*/ | ||
|
||
package ru.arsysop.svn.connector.internal.adapt.jhlsv; | ||
|
||
import org.apache.subversion.javahl.ReposNotifyInformation; | ||
import org.eclipse.team.svn.core.connector.SVNRepositoryNotification; | ||
|
||
import ru.arsysop.svn.connector.internal.adapt.SvnTypeConstructor; | ||
|
||
public final class ReposNotifyInformationAdapter | ||
extends SvnTypeConstructor<ReposNotifyInformation, SVNRepositoryNotification> { | ||
|
||
public ReposNotifyInformationAdapter(ReposNotifyInformation source) { | ||
super(source); | ||
} | ||
|
||
@Override | ||
public SVNRepositoryNotification adapt() { | ||
return new SVNRepositoryNotification(// | ||
source.getPath(), // | ||
new NodeActionAdapter(source.getNodeAction()).adapt(), | ||
new ReposNotifyInformationActionAdapter(source.getAction()).adapt(), // | ||
source.getRevision(), source.getWarning(), // | ||
source.getShard(), // | ||
source.getNewRevision(), // | ||
source.getOldRevision()); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
47 changes: 47 additions & 0 deletions
47
...vnkit1_10/src/ru/arsysop/svn/connector/internal/adapt/svjhl/AdaptReposNotifyCallback.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
/* | ||
* Copyright (c) 2023, 2024 ArSysOp | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
* | ||
* SPDX-License-Identifier: Apache-2.0 | ||
* | ||
* Contributors: | ||
* ArSysOp - initial API and implementation | ||
*/ | ||
|
||
package ru.arsysop.svn.connector.internal.adapt.svjhl; | ||
|
||
import java.util.Objects; | ||
|
||
import org.apache.subversion.javahl.ReposNotifyInformation; | ||
import org.eclipse.team.svn.core.connector.ISVNRepositoryNotificationCallback; | ||
|
||
import ru.arsysop.svn.connector.internal.adapt.jhlsv.ReposNotifyInformationAdapter; | ||
|
||
public final class AdaptReposNotifyCallback implements org.apache.subversion.javahl.callback.ReposNotifyCallback { | ||
|
||
private final ISVNRepositoryNotificationCallback callback; | ||
|
||
public AdaptReposNotifyCallback(ISVNRepositoryNotificationCallback notify) { | ||
callback = Objects.requireNonNull(notify); | ||
} | ||
|
||
public ISVNRepositoryNotificationCallback callback() { | ||
return callback; | ||
} | ||
|
||
@Override | ||
public void onNotify(ReposNotifyInformation info) { | ||
callback.notify(new ReposNotifyInformationAdapter(info).adapt()); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.