diff --git a/src/main/java/net/spy/memcached/v2/AbstractArcusResult.java b/src/main/java/net/spy/memcached/v2/AbstractArcusResult.java index b31ca05dc..c9c9365a2 100644 --- a/src/main/java/net/spy/memcached/v2/AbstractArcusResult.java +++ b/src/main/java/net/spy/memcached/v2/AbstractArcusResult.java @@ -1,3 +1,20 @@ +/* + * arcus-java-client : Arcus Java client + * Copyright 2010-2014 NAVER Corp. + * Copyright 2014-present JaM2in Co., Ltd. + * + * 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. + */ package net.spy.memcached.v2; import java.util.ArrayList; diff --git a/src/main/java/net/spy/memcached/v2/ArcusExecutors.java b/src/main/java/net/spy/memcached/v2/ArcusExecutors.java index fba3390ca..0232b4609 100644 --- a/src/main/java/net/spy/memcached/v2/ArcusExecutors.java +++ b/src/main/java/net/spy/memcached/v2/ArcusExecutors.java @@ -1,3 +1,20 @@ +/* + * arcus-java-client : Arcus Java client + * Copyright 2010-2014 NAVER Corp. + * Copyright 2014-present JaM2in Co., Ltd. + * + * 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. + */ package net.spy.memcached.v2; import java.util.concurrent.ExecutorService; diff --git a/src/main/java/net/spy/memcached/v2/ArcusFuture.java b/src/main/java/net/spy/memcached/v2/ArcusFuture.java index 887a81ca0..fa6a7c299 100644 --- a/src/main/java/net/spy/memcached/v2/ArcusFuture.java +++ b/src/main/java/net/spy/memcached/v2/ArcusFuture.java @@ -1,3 +1,20 @@ +/* + * arcus-java-client : Arcus Java client + * Copyright 2010-2014 NAVER Corp. + * Copyright 2014-present JaM2in Co., Ltd. + * + * 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. + */ package net.spy.memcached.v2; import java.util.concurrent.CompletionStage; diff --git a/src/main/java/net/spy/memcached/v2/ArcusFutureImpl.java b/src/main/java/net/spy/memcached/v2/ArcusFutureImpl.java index 0e6a37fa8..f018bed38 100644 --- a/src/main/java/net/spy/memcached/v2/ArcusFutureImpl.java +++ b/src/main/java/net/spy/memcached/v2/ArcusFutureImpl.java @@ -1,3 +1,20 @@ +/* + * arcus-java-client : Arcus Java client + * Copyright 2010-2014 NAVER Corp. + * Copyright 2014-present JaM2in Co., Ltd. + * + * 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. + */ package net.spy.memcached.v2; import java.util.ArrayList; diff --git a/src/main/java/net/spy/memcached/v2/ArcusMultiFuture.java b/src/main/java/net/spy/memcached/v2/ArcusMultiFuture.java index c3061f7ab..dea4af413 100644 --- a/src/main/java/net/spy/memcached/v2/ArcusMultiFuture.java +++ b/src/main/java/net/spy/memcached/v2/ArcusMultiFuture.java @@ -1,3 +1,20 @@ +/* + * arcus-java-client : Arcus Java client + * Copyright 2010-2014 NAVER Corp. + * Copyright 2014-present JaM2in Co., Ltd. + * + * 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. + */ package net.spy.memcached.v2; import java.util.ArrayList; diff --git a/src/main/java/net/spy/memcached/v2/ArcusResult.java b/src/main/java/net/spy/memcached/v2/ArcusResult.java index 3b0d2bbd7..3639503a0 100644 --- a/src/main/java/net/spy/memcached/v2/ArcusResult.java +++ b/src/main/java/net/spy/memcached/v2/ArcusResult.java @@ -1,3 +1,20 @@ +/* + * arcus-java-client : Arcus Java client + * Copyright 2010-2014 NAVER Corp. + * Copyright 2014-present JaM2in Co., Ltd. + * + * 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. + */ package net.spy.memcached.v2; import java.util.List; diff --git a/src/main/java/net/spy/memcached/v2/AsyncArcusCommands.java b/src/main/java/net/spy/memcached/v2/AsyncArcusCommands.java index c9403dfb9..d8b2d17cd 100644 --- a/src/main/java/net/spy/memcached/v2/AsyncArcusCommands.java +++ b/src/main/java/net/spy/memcached/v2/AsyncArcusCommands.java @@ -1,3 +1,20 @@ +/* + * arcus-java-client : Arcus Java client + * Copyright 2010-2014 NAVER Corp. + * Copyright 2014-present JaM2in Co., Ltd. + * + * 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. + */ package net.spy.memcached.v2; import java.util.ArrayList; @@ -22,7 +39,7 @@ import net.spy.memcached.ops.StoreType; import net.spy.memcached.transcoders.Transcoder; -public class AsyncArcusCommands { +public class AsyncArcusCommands implements AsyncArcusCommandsIF { private final Transcoder tc; private final Transcoder tcForCollection; diff --git a/src/main/java/net/spy/memcached/v2/AsyncArcusCommandsIF.java b/src/main/java/net/spy/memcached/v2/AsyncArcusCommandsIF.java new file mode 100644 index 000000000..085da0267 --- /dev/null +++ b/src/main/java/net/spy/memcached/v2/AsyncArcusCommandsIF.java @@ -0,0 +1,109 @@ +/* + * arcus-java-client : Arcus Java client + * Copyright 2010-2014 NAVER Corp. + * Copyright 2014-present JaM2in Co., Ltd. + * + * 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. + */ +package net.spy.memcached.v2; + +import java.util.List; +import java.util.Map; + +public interface AsyncArcusCommandsIF { + + /** + * Set a value for the given key. + * + * @param key the key + * @param exp expiration time in seconds + * @param value the value to store + * @return {@code Boolean.True} if stored, otherwise {@code Boolean.False} + */ + ArcusFuture set(String key, int exp, T value); + + /** + * Add a value for the given key if it does not exist. + * + * @param key the key + * @param exp expiration time in seconds + * @param value the value to store + * @return {@code Boolean.True} if stored, otherwise {@code Boolean.False} + */ + ArcusFuture add(String key, int exp, T value); + + /** + * Replace a value for the given key if it exists. + * + * @param key the key + * @param exp expiration time in seconds + * @param value the value to store + * @return {@code Boolean.True} if stored, otherwise {@code Boolean.False} + */ + ArcusFuture replace(String key, int exp, T value); + + /** + * Set values for multiple keys. + * + * @param keys list of keys to store + * @param exp expiration time in seconds + * @param value the value to store for all keys + * @return Map of key to Boolean result + */ + ArcusFuture> multiSet(List keys, int exp, T value); + + /** + * Add values for multiple keys if they do not exist. + * + * @param keys list of keys to store + * @param exp expiration time in seconds + * @param value the value to store for all keys + * @return Map of key to Boolean result + */ + ArcusFuture> multiAdd(List keys, int exp, T value); + + /** + * Replace values for multiple keys if they exist. + * + * @param keys list of keys to store + * @param exp expiration time in seconds + * @param value the value to store for all keys + * @return Map of key to Boolean result + */ + ArcusFuture> multiReplace(List keys, int exp, T value); + + /** + * Get a value for the given key. + * + * @param key the key + * @return the value, or {@code null} if not found + */ + ArcusFuture get(String key); + + /** + * Get values for multiple keys. + * + * @param keys list of keys to get + * @return Map of key to value + */ + ArcusFuture> multiGet(List keys); + + /** + * Flush all items from all servers. + * + * @param delay delay in seconds before flushing + * @return {@code Boolean.True} if flushed successfully, otherwise {@code Boolean.False} + */ + ArcusFuture flush(int delay); + +}