PageRenderTime 363ms CodeModel.GetById 100ms app.highlight 3ms RepoModel.GetById 88ms app.codeStats 0ms

/src/main/java/com/google/ie/business/service/ShardedCounterService.java

http://thoughtsite.googlecode.com/
Java | 85 lines | 11 code | 13 blank | 61 comment | 0 complexity | c9fe975ba76fa77198b02a9cd67b0242 MD5 | raw file
 1/* Copyright 2010 Google Inc.
 2 * 
 3 * Licensed under the Apache License, Version 2.0 (the "License");
 4 * you may not use this file except in compliance with the License.
 5 * You may obtain a copy of the License at
 6 * 
 7 *      http://www.apache.org/licenses/LICENSE-2.0
 8 * 
 9 * Unless required by applicable law or agreed to in writing, software
10 * distributed under the License is distributed on an "AS IS" BASIS.
11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 * See the License for the specific language governing permissions and
13 * limitations under the License
14 */
15
16package com.google.ie.business.service;
17
18import com.google.ie.business.domain.ShardedCounter;
19
20/**
21 * A Service specification for the {@link ShardedCounter} entity.
22 * 
23 * @author gmaurya
24 * 
25 */
26public interface ShardedCounterService {
27    /**
28     * This method get the merged shardedcounter for a specific parentKey;
29     * 
30     * @param parentKey key of the object for which merging of shareded counter
31     *        is being done.
32     * @return ShardedCounter Aggregate sharded counter.
33     */
34    public ShardedCounter getMergedShardedCounter(String parentKey);
35
36    /**
37     * Get total point for a specific parent key.
38     * 
39     * @param parentKey String
40     * @return long
41     */
42    public long getTotalPoint(String parentKey);
43
44    /**
45     * Increment negative points for a specific parent key.
46     * 
47     * @param parentKey Key of object
48     */
49
50    public void incrementNegativePoints(String parentKey);
51
52    /**
53     * increment positive points for a specific parent key.
54     * 
55     * @param parentKey Key of object
56     */
57    public void incrementPositivePoints(String parentKey);
58
59    /**
60     * Retrieves negative points for a specific parent key.
61     * 
62     * @param parentKey Key of object.
63     * @return total negative points.
64     */
65    public int getNegativePoint(String parentKey);
66
67    /**
68     * Get positive points for a specific parent key.
69     * 
70     * @param parentKey Key of object.
71     * @return total positive points.
72     */
73    public int getPositivePoint(String parentKey);
74
75    /**
76     * update Total Points for a specific key.
77     * 
78     * @param parentKey Key of object.
79     * @param points
80     */
81
82    public void updateTotalPoints(String parentKey, long points);
83
84}
85