當前位置: 首頁>>代碼示例>>Java>>正文


Java IMap.delete方法代碼示例

本文整理匯總了Java中com.hazelcast.core.IMap.delete方法的典型用法代碼示例。如果您正苦於以下問題:Java IMap.delete方法的具體用法?Java IMap.delete怎麽用?Java IMap.delete使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在com.hazelcast.core.IMap的用法示例。


在下文中一共展示了IMap.delete方法的10個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: testClientCache

import com.hazelcast.core.IMap; //導入方法依賴的package包/類
@SuppressWarnings("unchecked")
@Test
public void testClientCache() {
    CacheStartupHookProvider start = new CacheStartupHookProvider();
    start.onStartup();

    final IMap<String, Client> clients = CacheStartupHookProvider.hz.getMap("clients");

    Client client = clients.get("f7d42348-c647-4efb-a52d-4c5787421e72");
    System.out.println("client = " + client);

    client.setClientType(Client.ClientTypeEnum.fromValue("trusted"));

    clients.put("f7d42348-c647-4efb-a52d-4c5787421e72", client);
    System.out.println("clients size = " + clients.size());

    clients.delete("f7d42348-c647-4efb-a52d-4c5787421e72");
    System.out.println("clients size = " + clients.size());

    CacheShutdownHookProvider shutdown = new CacheShutdownHookProvider();
    shutdown.onShutdown();

}
 
開發者ID:networknt,項目名稱:light-oauth2,代碼行數:24,代碼來源:CacheStartupHookProviderTest.java

示例2: handleRequest

import com.hazelcast.core.IMap; //導入方法依賴的package包/類
@Override
public void handleRequest(HttpServerExchange exchange) throws Exception {
    String refreshToken = exchange.getQueryParameters().get("refreshToken").getFirst();
    if(logger.isDebugEnabled()) logger.debug("refreshToken = " + refreshToken);
    IMap<String, RefreshToken> tokens = CacheStartupHookProvider.hz.getMap("tokens");
    if(tokens.get(refreshToken) == null) {
        Status status = new Status(REFRESH_TOKEN_NOT_FOUND, refreshToken);
        exchange.setStatusCode(status.getStatusCode());
        exchange.getResponseSender().send(status.toString());
    } else {
        tokens.delete(refreshToken);
    }
}
 
開發者ID:networknt,項目名稱:light-oauth2,代碼行數:14,代碼來源:Oauth2RefreshTokenRefreshTokenDeleteHandler.java

示例3: handleRequest

import com.hazelcast.core.IMap; //導入方法依賴的package包/類
@Override
public void handleRequest(HttpServerExchange exchange) throws Exception {
    String userId = exchange.getQueryParameters().get("userId").getFirst();
    IMap<String, User> users = CacheStartupHookProvider.hz.getMap("users");
    if(users.get(userId) == null) {
        Status status = new Status(USER_NOT_FOUND, userId);
        exchange.setStatusCode(status.getStatusCode());
        exchange.getResponseSender().send(status.toString());
    } else {
        users.delete(userId);
    }
}
 
開發者ID:networknt,項目名稱:light-oauth2,代碼行數:13,代碼來源:Oauth2UserUserIdDeleteHandler.java

示例4: handleRequest

import com.hazelcast.core.IMap; //導入方法依賴的package包/類
@Override
public void handleRequest(HttpServerExchange exchange) throws Exception {
    String serviceId = exchange.getQueryParameters().get("serviceId").getFirst();
    IMap<String, Service> services = CacheStartupHookProvider.hz.getMap("services");
    if(services.get(serviceId) == null) {
        Status status = new Status(SERVICE_NOT_FOUND, serviceId);
        exchange.setStatusCode(status.getStatusCode());
        exchange.getResponseSender().send(status.toString());
    } else {
        services.delete(serviceId);
    }
}
 
開發者ID:networknt,項目名稱:light-oauth2,代碼行數:13,代碼來源:Oauth2ServiceServiceIdDeleteHandler.java

示例5: handleRequest

import com.hazelcast.core.IMap; //導入方法依賴的package包/類
@Override
public void handleRequest(HttpServerExchange exchange) throws Exception {
    String clientId = exchange.getQueryParameters().get("clientId").getFirst();

    IMap<String, Client> clients = CacheStartupHookProvider.hz.getMap("clients");
    if(clients.get(clientId) == null) {
        Status status = new Status(CLIENT_NOT_FOUND, clientId);
        exchange.setStatusCode(status.getStatusCode());
        exchange.getResponseSender().send(status.toString());
    } else {
        clients.delete(clientId);
    }
}
 
開發者ID:networknt,項目名稱:light-oauth2,代碼行數:14,代碼來源:Oauth2ClientClientIdDeleteHandler.java

示例6: handle

import com.hazelcast.core.IMap; //導入方法依賴的package包/類
@Override
public void handle(InventoryItemDeactivated event) {
    IMap<String, InventoryItemListItem> inventoryItems = getInventoryItemsMap();

    String id = event.id.toString();
    inventoryItems.delete(id);
}
 
開發者ID:vgoldin,項目名稱:cqrs-eventsourcing-kafka,代碼行數:8,代碼來源:InventoryItemDeactivatedHandler.java

示例7: testServiceCache

import com.hazelcast.core.IMap; //導入方法依賴的package包/類
@SuppressWarnings("unchecked")
@Test
public void testServiceCache() {
    CacheStartupHookProvider start = new CacheStartupHookProvider();
    start.onStartup();

    final IMap<String, Service> services = CacheStartupHookProvider.hz.getMap("services");

    Service service = services.get("AACT0001");
    System.out.println("service = " + service);

    service.setServiceType(Service.ServiceTypeEnum.fromValue("api"));

    services.replace("AACT0001", service);

    System.out.println("services size = " + services.size());

    services.delete("AACT0001");

    System.out.println("services size = " + services.size());

    CacheShutdownHookProvider shutdown = new CacheShutdownHookProvider();
    shutdown.onShutdown();

}
 
開發者ID:networknt,項目名稱:light-oauth2,代碼行數:26,代碼來源:CacheStartupHookProviderTest.java

示例8: testCodeCache

import com.hazelcast.core.IMap; //導入方法依賴的package包/類
@Test
public void testCodeCache() {
    CacheStartupHookProvider start = new CacheStartupHookProvider();
    start.onStartup();

    final IMap<String, Object> codes = CacheStartupHookProvider.hz.getMap("codes");
    Map<String, String> codeMap = new HashMap<>();
    codeMap.put("userId", "admin");
    codeMap.put("redirectUri", "https://localhost:8080/authorization");

    codes.put("code1", codeMap);

    System.out.println("codes size = " + codes.size());

    codes.delete("code1");

    System.out.println("codes size = " + codes.size());

    CacheShutdownHookProvider shutdown = new CacheShutdownHookProvider();
    shutdown.onShutdown();

}
 
開發者ID:networknt,項目名稱:light-oauth2,代碼行數:23,代碼來源:CacheStartupHookProviderTest.java

示例9: testRefreshTokenCache

import com.hazelcast.core.IMap; //導入方法依賴的package包/類
@Test
public void testRefreshTokenCache() {
    CacheStartupHookProvider start = new CacheStartupHookProvider();
    start.onStartup();

    final IMap<String, Object> tokens = CacheStartupHookProvider.hz.getMap("tokens");
    Map<String, String> tokenMap = new HashMap<>();
    tokenMap.put("userId", "admin");
    tokenMap.put("redirectUri", "https://localhost:8080/authorization");

    tokens.put("token1", tokenMap);

    System.out.println("tokens size = " + tokens.size());

    tokens.delete("token1");

    System.out.println("tokens size = " + tokens.size());

    CacheShutdownHookProvider shutdown = new CacheShutdownHookProvider();
    shutdown.onShutdown();

}
 
開發者ID:networknt,項目名稱:light-oauth2,代碼行數:23,代碼來源:CacheStartupHookProviderTest.java

示例10: testUserCache

import com.hazelcast.core.IMap; //導入方法依賴的package包/類
@SuppressWarnings("unchecked")
@Test
public void testUserCache() {
    CacheStartupHookProvider start = new CacheStartupHookProvider();
    start.onStartup();

    final IMap<String, User> users = CacheStartupHookProvider.hz.getMap("users");

    User user = (User)users.get("admin");
    System.out.println("user = " + user);

    user.setUserType(User.UserTypeEnum.fromValue("customer"));

    users.put("admin", user);

    System.out.println("users size = " + users.size());

    // query email as it is indexed.
    String email = "adm%";
    Predicate predicate = new SqlPredicate(String.format("email like %s", email));
    Set<User> uSet = (Set<User>) users.values(predicate);

    System.out.println("uSet = " + uSet);

    users.delete("admin");

    System.out.println("users size = " + users.size());

    CacheShutdownHookProvider shutdown = new CacheShutdownHookProvider();
    shutdown.onShutdown();

}
 
開發者ID:networknt,項目名稱:light-oauth2,代碼行數:33,代碼來源:CacheStartupHookProviderTest.java


注:本文中的com.hazelcast.core.IMap.delete方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。