Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
  /*
   * 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.device;
  
 import java.util.List;
 
 
Allows classes to inject themselves as a facade around an existing device management implementation. By default all methods just pass calls to the underlying delegate.

Author(s):
Derek
 
 public class DeviceManagementDecorator implements IDeviceManagement {

Delegate instance
 
 
 		this. = delegate;
 	}
 
 	/*
 	 * (non-Javadoc)
 	 * 
 	 * @see com.sitewhere.spi.server.lifecycle.ILifecycleComponent#getComponentId()
 	 */
 	public String getComponentId() {
 	}
 
 	/*
 	 * (non-Javadoc)
 	 * 
 	 * @see com.sitewhere.spi.server.lifecycle.ILifecycleComponent#getComponentType()
	 */
	}
	/*
	 * (non-Javadoc)
	 * 
	 * @see com.sitewhere.server.lifecycle.LifecycleComponent#lifecycleStart()
	 */
	public void lifecycleStart() {
	}
	/*
	 * (non-Javadoc)
	 * 
	 * @see com.sitewhere.spi.server.lifecycle.ILifecycleComponent#start()
	 */
	public void start() throws SiteWhereException {
	}
	/*
	 * (non-Javadoc)
	 * 
	 * @see com.sitewhere.spi.server.lifecycle.ILifecycleComponent#lifecyclePause()
	 */
	public void lifecyclePause() {
	}
	/*
	 * (non-Javadoc)
	 * 
	 * @see com.sitewhere.spi.server.lifecycle.ILifecycleComponent#canPause()
	 */
	public boolean canPause() throws SiteWhereException {
		return .canPause();
	}
	/*
	 * (non-Javadoc)
	 * 
	 * @see com.sitewhere.spi.server.lifecycle.ILifecycleComponent#pause()
	 */
	public void pause() throws SiteWhereException {
	}
	/*
	 * (non-Javadoc)
	 * 
	 * @see com.sitewhere.spi.server.lifecycle.ILifecycleComponent#getLogger()
	 */
	public Logger getLogger() {
	}
	/*
	 * (non-Javadoc)
	 * 
	 * @see com.sitewhere.server.lifecycle.LifecycleComponent#lifecycleStop()
	 */
	public void lifecycleStop() {
	}
	/*
	 * (non-Javadoc)
	 * 
	 * @see com.sitewhere.spi.server.lifecycle.ILifecycleComponent#getComponentName()
	 */
	}
	/*
	 * (non-Javadoc)
	 * 
	 * @see com.sitewhere.spi.server.lifecycle.ILifecycleComponent#getLifecycleStatus()
	 */
	}
	/*
	 * (non-Javadoc)
	 * 
	 * @see com.sitewhere.spi.server.lifecycle.ILifecycleComponent#getLifecycleError()
	 */
	}
	/*
	 * (non-Javadoc)
	 * 
	 * @see
	 * com.sitewhere.spi.server.lifecycle.ILifecycleComponent#getLifecycleComponents()
	 */
	}
	/*
	 * (non-Javadoc)
	 * 
	 * @see com.sitewhere.spi.server.lifecycle.ILifecycleComponent#stop()
	 */
	public void stop() throws SiteWhereException {
	}
	/*
	 * (non-Javadoc)
	 * 
	 * @see
	 * com.sitewhere.spi.server.lifecycle.ILifecycleComponent#findComponentsOfType(com
	 * .sitewhere.spi.server.lifecycle.LifecycleComponentType)
	 */
	}
	/*
	 * (non-Javadoc)
	 * 
	 * @see com.sitewhere.spi.server.lifecycle.ILifecycleComponent#logState()
	 */
	public void logState() {
	}
	}
	}
		return .updateDeviceSpecification(tokenrequest);
	}
			ISearchCriteria criteriathrows SiteWhereException {
		return .listDeviceSpecifications(includeDeletedcriteria);
	}
	public IDeviceSpecification deleteDeviceSpecification(String tokenboolean force)
		return .deleteDeviceSpecification(tokenforce);
	}
		return .createDeviceCommand(specrequest);
	}
	}
		return .updateDeviceCommand(tokenrequest);
	}
	public List<IDeviceCommandlistDeviceCommands(String tokenboolean includeDeleted)
		return .listDeviceCommands(tokenincludeDeleted);
	}
	public IDeviceCommand deleteDeviceCommand(String tokenboolean forcethrows SiteWhereException {
		return .deleteDeviceCommand(tokenforce);
	}
		return .createDevice(device);
	}
	public IDevice getDeviceByHardwareId(String hardwareIdthrows SiteWhereException {
		return .getDeviceByHardwareId(hardwareId);
	}
	public IDevice updateDevice(String hardwareIdIDeviceCreateRequest requestthrows SiteWhereException {
		return .updateDevice(hardwareIdrequest);
	}
	}
	public ISearchResults<IDevicelistDevices(boolean includeDeletedIDeviceSearchCriteria criteria)
		return .listDevices(includeDeletedcriteria);
	}
		return .createDeviceElementMapping(hardwareIdmapping);
	}
	public IDevice deleteDeviceElementMapping(String hardwareIdString paththrows SiteWhereException {
		return .deleteDeviceElementMapping(hardwareIdpath);
	}
	public IDevice deleteDevice(String hardwareIdboolean forcethrows SiteWhereException {
		return .deleteDevice(hardwareIdforce);
	}
	}
	}
	public IDeviceAssignment deleteDeviceAssignment(String tokenboolean forcethrows SiteWhereException {
		return .deleteDeviceAssignment(tokenforce);
	}
		return .getDeviceForAssignment(assignment);
	}
		return .getSiteForAssignment(assignment);
	}
		return .updateDeviceAssignmentMetadata(tokenmetadata);
	}
		return .updateDeviceAssignmentStatus(tokenstatus);
	}
		return .updateDeviceAssignmentState(tokenstate);
	}
		return .addDeviceEventBatch(assignmentTokenbatch);
	}
	}
			ISearchCriteria criteriathrows SiteWhereException {
		return .getDeviceAssignmentHistory(hardwareIdcriteria);
	}
			ISearchCriteria criteriathrows SiteWhereException {
		return .getDeviceAssignmentsForSite(siteTokencriteria);
	}
	}
		return .listDeviceEvents(assignmentTokencriteria);
	}
		return .addDeviceMeasurements(assignmentTokenmeasurements);
	}
		return .listDeviceMeasurements(assignmentTokencriteria);
	}
		return .listDeviceMeasurementsForSite(siteTokencriteria);
	}
		return .addDeviceLocation(assignmentTokenrequest);
	}
		return .listDeviceLocations(assignmentTokencriteria);
	}
		return .listDeviceLocationsForSite(siteTokencriteria);
	}
		return .listDeviceLocations(assignmentTokenscriteria);
	}
	public IDeviceAlert addDeviceAlert(String assignmentTokenIDeviceAlertCreateRequest request)
		return .addDeviceAlert(assignmentTokenrequest);
	}
		return .listDeviceAlerts(assignmentTokencriteria);
	}
		return .listDeviceAlertsForSite(siteTokencriteria);
	}
		return .createDeviceStream(assignmentTokenrequest);
	}
	public IDeviceStream getDeviceStream(String assignmentTokenString streamIdthrows SiteWhereException {
		return .getDeviceStream(assignmentTokenstreamId);
	}
		return .listDeviceStreams(assignmentTokencriteria);
	}
	public IDeviceStreamData addDeviceStreamData(String assignmentToken,
		return .addDeviceStreamData(assignmentTokenrequest);
	}
	public IDeviceStreamData getDeviceStreamData(String assignmentTokenString streamIdlong sequenceNumber)
		return .getDeviceStreamData(assignmentTokenstreamIdsequenceNumber);
	}
	public ISearchResults<IDeviceStreamDatalistDeviceStreamData(String assignmentTokenString streamId,
		return .listDeviceStreamData(assignmentTokenstreamIdcriteria);
	}
		return .addDeviceCommandInvocation(assignmentTokencommandrequest);
	}
		return .listDeviceCommandInvocations(assignmentTokencriteria);
	}
		return .listDeviceCommandInvocationsForSite(siteTokencriteria);
	}
	}
		return .addDeviceCommandResponse(assignmentTokenrequest);
	}
		return .listDeviceCommandResponses(assignmentTokencriteria);
	}
		return .listDeviceCommandResponsesForSite(siteTokencriteria);
	}
		return .addDeviceStateChange(assignmentTokenrequest);
	}
		return .listDeviceStateChanges(assignmentTokencriteria);
	}
		return .listDeviceStateChangesForSite(siteTokencriteria);
	}
		return .createSite(request);
	}
	public ISite deleteSite(String siteTokenboolean forcethrows SiteWhereException {
		return .deleteSite(siteTokenforce);
	}
	public ISite updateSite(String siteTokenISiteCreateRequest requestthrows SiteWhereException {
		return .updateSite(siteTokenrequest);
	}
	public ISite getSiteByToken(String tokenthrows SiteWhereException {
		return .getSiteByToken(token);
	}
		return .listSites(criteria);
	}
	public IZone createZone(ISite siteIZoneCreateRequest requestthrows SiteWhereException {
		return .createZone(siterequest);
	}
	public IZone updateZone(String tokenIZoneCreateRequest requestthrows SiteWhereException {
		return .updateZone(tokenrequest);
	}
	public IZone getZone(String zoneTokenthrows SiteWhereException {
		return .getZone(zoneToken);
	}
	public ISearchResults<IZonelistZones(String siteTokenISearchCriteria criteria)
		return .listZones(siteTokencriteria);
	}
	public IZone deleteZone(String zoneTokenboolean forcethrows SiteWhereException {
		return .deleteZone(zoneTokenforce);
	}
		return .createDeviceGroup(request);
	}
		return .updateDeviceGroup(tokenrequest);
	}
		return .getDeviceGroup(token);
	}
	public ISearchResults<IDeviceGrouplistDeviceGroups(boolean includeDeletedISearchCriteria criteria)
		return .listDeviceGroups(includeDeletedcriteria);
	}
	public ISearchResults<IDeviceGrouplistDeviceGroupsWithRole(String roleboolean includeDeleted,
			ISearchCriteria criteriathrows SiteWhereException {
		return .listDeviceGroupsWithRole(roleincludeDeletedcriteria);
	}
		return .addDeviceGroupElements(groupTokenelements);
	}
		return .removeDeviceGroupElements(groupTokenelements);
	}
			ISearchCriteria criteriathrows SiteWhereException {
		return .listDeviceGroupElements(groupTokencriteria);
	}
	public IDeviceGroup deleteDeviceGroup(String tokenboolean forcethrows SiteWhereException {
		return .deleteDeviceGroup(tokenforce);
	}
	}
		return .updateBatchOperation(tokenrequest);
	}
	}
	public ISearchResults<IBatchOperationlistBatchOperations(boolean includeDeleted,
			ISearchCriteria criteriathrows SiteWhereException {
		return .listBatchOperations(includeDeletedcriteria);
	}
	public IBatchOperation deleteBatchOperation(String tokenboolean forcethrows SiteWhereException {
		return .deleteBatchOperation(tokenforce);
	}
		return .listBatchElements(batchTokencriteria);
	}
	public IBatchElement updateBatchElement(String operationTokenlong index,
		return .updateBatchElement(operationTokenindexrequest);
	}
	}
		return ;
	}
	public void setDelegate(IDeviceManagement delegate) {
		this. = delegate;
	}
New to GrepCode? Check out our FAQ X