edu.cmu.sei.ams.cloudlet.Cloudlet Maven / Gradle / Ivy
/*
KVM-based Discoverable Cloudlet (KD-Cloudlet)
Copyright (c) 2015 Carnegie Mellon University.
All Rights Reserved.
THIS SOFTWARE IS PROVIDED "AS IS," WITH NO WARRANTIES WHATSOEVER. CARNEGIE MELLON UNIVERSITY EXPRESSLY DISCLAIMS TO THE FULLEST EXTENT PERMITTEDBY LAW ALL EXPRESS, IMPLIED, AND STATUTORY WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT OF PROPRIETARY RIGHTS.
Released under a modified BSD license, please see license.txt for full terms.
DM-0002138
KD-Cloudlet includes and/or makes use of the following Third-Party Software subject to their own licenses:
MiniMongo
Copyright (c) 2010-2014, Steve Lacy
All rights reserved. Released under BSD license.
https://github.com/MiniMongo/minimongo/blob/master/LICENSE
Bootstrap
Copyright (c) 2011-2015 Twitter, Inc.
Released under the MIT License
https://github.com/twbs/bootstrap/blob/master/LICENSE
jQuery JavaScript Library v1.11.0
http://jquery.com/
Includes Sizzle.js
http://sizzlejs.com/
Copyright 2005, 2014 jQuery Foundation, Inc. and other contributors
Released under the MIT license
http://jquery.org/license
*/
package edu.cmu.sei.ams.cloudlet;
import java.io.File;
import java.net.InetAddress;
import java.util.List;
import edu.cmu.sei.ams.cloudlet.impl.cmds.*;
/**
* User: jdroot
* Date: 3/19/14
* Time: 1:28 PM
*
* This interface is an immutable representation of an existing Cloudlet server
*/
public interface Cloudlet
{
/**
* Gets the name of this Cloudlet
* @return the name of this Cloudlet
*/
public String getName();
/**
* Gets the address of this Cloudlet
* @return address of this Cloudlet
*/
public InetAddress getAddress();
/**
* Gets the port this cloudlet is listening on
* @return port
*/
public int getPort();
/**
* True if encryption is enabled for the API, false if not.
* @return
*/
public boolean isEncryptionEnabled();
/**
* Gets a list of services available on this Cloudlet
* @return list of services
* @throws CloudletException can throw exceptions when server is unreachable or bad data is returned
*/
public List getServices() throws CloudletException;
/**
* Gets a list of services available on this Cloudlet
* @param useCache flag to specify if we should used our cached list
* @return list of services
* @throws CloudletException can throw exceptions when server is unreachable or bad data is returned
*/
public List getServices(boolean useCache) throws CloudletException;
/**
* Will locate a service based on the ID of the service
* @param id The service ID to look for
* @return The service object or null if it is not found
* @throws CloudletException
*/
public Service getServiceById(String id) throws CloudletException;
/**
* Starts a Service VM, or locates an existing one, for the given service.
* @param serviceId The service ID to start a VM for
* @return The service VM object
* @throws CloudletException
*/
ServiceVM startService(String serviceId, boolean join) throws CloudletException;
/**
* Stops a Service VM.
* @param serviceVMId the ID of the vm to stop.
* @return true if it was stopped
* @throws CloudletException
*/
boolean stopServiceVM(String serviceVMId) throws CloudletException;
/**
* Gets the current CPU and Memory state of the Cloudlet for evaluating Cloudlet selection
* @return
* @throws CloudletException can throw exceptions when the server is unreachable or bad data is returned
*/
public CloudletSystemInfo getSystemInfo() throws CloudletException;
/**
* Gets a list of pending messages available on the cloudlet.
* @return
* @throws CloudletException can throw exceptions when the server is unreachable or bad data is returned
*/
public List getMessages(String serviceId) throws CloudletException;
/**
* Gets a list of apps available for installation from this Cloudlet
* @return list of apps
* @throws CloudletException
*/
public List getApps() throws CloudletException;
/**
* Gets a list of apps available for installation from this Cloudlet
* @param useCache flag to specify if we should use the cached list
* @return list of apps
* @throws CloudletException
*/
public List getApps(boolean useCache) throws CloudletException;
/**
*
* @param filter Filters to apply to this request
* @return A list of apps matching the correct tags
* @throws CloudletException
*/
public List getApps(AppFilter filter) throws CloudletException;
/**
* Downloads the APK of an app.
* @param appId the id of the app to download
* @param outFile the file where the APK contents will be stored
* @return the md5 hash of the downloaded file
* @throws CloudletException
*/
public String getApp(String appId, File outFile) throws CloudletException;
}