All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.sitewhere.grpc.client.device.DeviceManagementCacheProviders Maven / Gradle / Ivy

There is a newer version: 3.0.13
Show newest version
/*
 * Copyright (c) SiteWhere, LLC. All rights reserved. http://www.sitewhere.com
 *
 * The software in this package is published under the terms of the CPAL v1.0
 * license, a copy of which has been included with this distribution in the
 * LICENSE.txt file.
 */
package com.sitewhere.grpc.client.device;

import java.util.UUID;

import com.sitewhere.microservice.cache.RedissonCacheProvider;
import com.sitewhere.spi.area.IArea;
import com.sitewhere.spi.device.IDevice;
import com.sitewhere.spi.device.IDeviceAssignment;
import com.sitewhere.spi.device.IDeviceType;
import com.sitewhere.spi.microservice.IMicroservice;
import com.sitewhere.spi.microservice.cache.ICacheConfiguration;

/**
 * Cache providers for device management entities.
 */
public class DeviceManagementCacheProviders {

    public static final String AREA_BY_TOKEN = "area_by_token";
    public static final String AREA_BY_ID = "area_by_id";
    public static final String DEVICE_BY_TOKEN = "device_by_token";
    public static final String DEVICE_BY_ID = "device_by_id";
    public static final String DEVICE_ASSIGNMENT_BY_TOKEN = "device_assignment_by_token";
    public static final String DEVICE_ASSIGNMENT_BY_ID = "device_assignment_by_id";
    public static final String DEVICE_TYPE_BY_TOKEN = "device_type_by_token";
    public static final String DEVICE_TYPE_BY_ID = "device_type_by_id";

    /**
     * Cache for areas.
     */
    public static class AreaByTokenCache extends RedissonCacheProvider {

	public AreaByTokenCache(IMicroservice microservice, ICacheConfiguration configuration) {
	    super(microservice, AREA_BY_TOKEN, String.class, IArea.class, configuration);
	}
    }

    /**
     * Cache for areas by id.
     */
    public static class AreaByIdCache extends RedissonCacheProvider {

	public AreaByIdCache(IMicroservice microservice, ICacheConfiguration configuration) {
	    super(microservice, AREA_BY_ID, UUID.class, IArea.class, configuration);
	}
    }

    /**
     * Cache for device types.
     */
    public static class DeviceTypeByTokenCache extends RedissonCacheProvider {

	public DeviceTypeByTokenCache(IMicroservice microservice, ICacheConfiguration configuration) {
	    super(microservice, DEVICE_TYPE_BY_TOKEN, String.class, IDeviceType.class, configuration);
	}
    }

    /**
     * Cache for device types by id.
     */
    public static class DeviceTypeByIdCache extends RedissonCacheProvider {

	public DeviceTypeByIdCache(IMicroservice microservice, ICacheConfiguration configuration) {
	    super(microservice, DEVICE_TYPE_BY_ID, UUID.class, IDeviceType.class, configuration);
	}
    }

    /**
     * Cache for devices by token.
     */
    public static class DeviceByTokenCache extends RedissonCacheProvider {

	public DeviceByTokenCache(IMicroservice microservice, ICacheConfiguration configuration) {
	    super(microservice, DEVICE_BY_TOKEN, String.class, IDevice.class, configuration);
	}
    }

    /**
     * Cache for devices by id.
     */
    public static class DeviceByIdCache extends RedissonCacheProvider {

	public DeviceByIdCache(IMicroservice microservice, ICacheConfiguration configuration) {
	    super(microservice, DEVICE_BY_ID, UUID.class, IDevice.class, configuration);
	}
    }

    /**
     * Cache for device assignments by token.
     */
    public static class DeviceAssignmentByTokenCache extends RedissonCacheProvider {

	public DeviceAssignmentByTokenCache(IMicroservice microservice, ICacheConfiguration configuration) {
	    super(microservice, DEVICE_ASSIGNMENT_BY_TOKEN, String.class, IDeviceAssignment.class, configuration);
	}
    }

    /**
     * Cache for device assignments by id.
     */
    public static class DeviceAssignmentByIdCache extends RedissonCacheProvider {

	public DeviceAssignmentByIdCache(IMicroservice microservice, ICacheConfiguration configuration) {
	    super(microservice, DEVICE_ASSIGNMENT_BY_ID, UUID.class, IDeviceAssignment.class, configuration);
	}
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy