1 /* 2 * Licensed to the Apache Software Foundation (ASF) under one 3 * or more contributor license agreements. See the NOTICE file 4 * distributed with this work for additional information 5 * regarding copyright ownership. The ASF licenses this file 6 * to you under the Apache License, Version 2.0 (the 7 * "License"); you may not use this file except in compliance 8 * with the License. You may obtain a copy of the License at 9 * 10 * http://www.apache.org/licenses/LICENSE-2.0 11 * 12 * Unless required by applicable law or agreed to in writing, 13 * software distributed under the License is distributed on an 14 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 * KIND, either express or implied. See the License for the 16 * specific language governing permissions and limitations 17 * under the License. 18 * 19 */ 20 package org.apache.directory.server.core.api.changelog; 21 22 23 /** 24 * A ChangeLogStore which allows tagging for tracking server state snapshots. 25 * At most one tag per revision can be created. There is no point to creating 26 * more than one tag on a revision in our case for snapshotting server state. 27 * 28 * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a> 29 */ 30 public interface TaggableChangeLogStore extends ChangeLogStore 31 { 32 /** 33 * Creates a tag for a snapshot of the server in a specific state at a revision. 34 * 35 * @param revision the revision to tag the snapshot 36 * @return the Tag associated with the revision 37 */ 38 Tag tag( long revision ); 39 40 41 /** 42 * Creates a snapshot of the server at the current revision. 43 * 44 * @return the revision at which the tag is created 45 */ 46 Tag tag(); 47 48 49 /** 50 * Creates a snapshot of the server at the current revision with a description 51 * of the snapshot tag. 52 * 53 * @param description a description of the state associate with the tag 54 * @return the revision at which the tag is created 55 */ 56 Tag tag( String description ); 57 58 59 /** 60 * Gets the latest tag if one was at all taken. 61 * 62 * @return the last tag to have been created (youngest), or null if no 63 * tags have been created 64 */ 65 Tag getLatest(); 66 67 68 /** 69 * Removes a Tag created for a given revision. 70 * 71 * @param revision the revision number that was tagged 72 * @return the removed tag, null if there is no Tag present with the given revision 73 */ 74 Tag removeTag( long revision ); 75 76 77 /** 78 * Creates a tag with the given description for a snapshot of the server 79 * in a specific state at a revision. 80 * 81 * @param revision the revision number that was tagged 82 * @param descrition a description of the state associate with the tag 83 * @return the Tag associated with the revision 84 */ 85 Tag tag( long revision, String descrition ); 86 }