Android Open Source - android-rackspacecloud Image






From Project

Back to project page android-rackspacecloud.

License

The source code is released under:

MIT License

If you think the Android project android-rackspacecloud listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.

Java Source Code

/**
 * //from   w w w.j  a  v a2  s .  co m
 */
package com.rackspace.cloud.servers.api.client;

import java.util.TreeMap;

import com.rackspacecloud.android.R;

/**
 * @author Mike Mayo - mike.mayo@rackspace.com - twitter.com/greenisus
 *
 */
public class Image extends Entity implements Comparable<Image>{

  private static final long serialVersionUID = -9020224299062520935L;
  private static TreeMap<String, Image> images;
  private String status;
  private String updated;
  
  public int iconResourceId() {
    int iconResourceId = R.drawable.cloudservers_icon; // default if unknown
    
    if ("2".equals(getId())) {
      iconResourceId = R.drawable.centos_icon;
    } else if ("3".equals(getId())) {
      iconResourceId = R.drawable.gentoo_icon;
    } else if ("4".equals(getId())) {
      iconResourceId = R.drawable.debian_icon;
    } else if ("5".equals(getId())) {
      iconResourceId = R.drawable.fedora_icon;
    } else if ("7".equals(getId())) {
      iconResourceId = R.drawable.centos_icon;
    } else if ("8".equals(getId())) {
      iconResourceId = R.drawable.ubuntu_icon;
    } else if ("9".equals(getId())) {
      iconResourceId = R.drawable.arch_icon;
    } else if ("10".equals(getId())) {
      iconResourceId = R.drawable.ubuntu_icon;
    } else if ("11".equals(getId())) {
      iconResourceId = R.drawable.ubuntu_icon;
    } else if ("12".equals(getId())) {
      iconResourceId = R.drawable.redhat_icon;
    } else if ("13".equals(getId())) {
      iconResourceId = R.drawable.fedora_icon;
    } else if ("4056".equals(getId())) {
      iconResourceId = R.drawable.fedora_icon;
    } else if ("14362".equals(getId())) {
      iconResourceId = R.drawable.ubuntu_icon;
    } else if ("23".equals(getId())) {
      iconResourceId = R.drawable.windows_icon;
    } else if ("24".equals(getId())) {
      iconResourceId = R.drawable.windows_icon;
    } else if ("28".equals(getId())) {
      iconResourceId = R.drawable.windows_icon;
    } else if ("29".equals(getId())) {
      iconResourceId = R.drawable.windows_icon;
    } else if ("31".equals(getId())) {
      iconResourceId = R.drawable.windows_icon;
    } else if ("14".equals(getId())) {
      iconResourceId = R.drawable.redhat_icon;
    } else if ("17".equals(getId())) {
      iconResourceId = R.drawable.fedora_icon;
    } else if ("19".equals(getId())) {
      iconResourceId = R.drawable.gentoo_icon;
    } else if ("187811".equals(getId())) {
      iconResourceId = R.drawable.centos_icon;
    } else if ("49".equals(getId())) {
      iconResourceId = R.drawable.ubuntu_icon;
    } else if ("51".equals(getId())) {
      iconResourceId = R.drawable.centos_icon;
    } else if ("53".equals(getId())) {
      iconResourceId = R.drawable.fedora_icon;
    } else if ("55".equals(getId())) {
      iconResourceId = R.drawable.arch_icon;
    } else if ("56".equals(getId())) {
      iconResourceId = R.drawable.windows_icon;
    } else if ("57".equals(getId())) {
      iconResourceId = R.drawable.windows_icon;
    } else if ("58".equals(getId())) {
      iconResourceId = R.drawable.windows_icon;
    } else if ("62".equals(getId())) {
      iconResourceId = R.drawable.redhat_icon;
    } else if ("69".equals(getId())) {
      iconResourceId = R.drawable.ubuntu_icon;
    } else if ("71".equals(getId())) {
      iconResourceId = R.drawable.fedora_icon;
    }
    return iconResourceId;
  }
  
  public int logoResourceId() {
    int logoResourceId = R.drawable.cloudservers_large; // default if unknown
    
    if ("2".equals(getId())) {
      logoResourceId = R.drawable.centos_large;
    } else if ("3".equals(getId())) {
      logoResourceId = R.drawable.gentoo_large;
    } else if ("4".equals(getId())) {
      logoResourceId = R.drawable.debian_large;
    } else if ("5".equals(getId())) {
      logoResourceId = R.drawable.fedora_large;
    } else if ("7".equals(getId())) {
      logoResourceId = R.drawable.centos_large;
    } else if ("8".equals(getId())) {
      logoResourceId = R.drawable.ubuntu_large;
    } else if ("9".equals(getId())) {
      logoResourceId = R.drawable.arch_large;
    } else if ("10".equals(getId())) {
      logoResourceId = R.drawable.ubuntu_large;
    } else if ("11".equals(getId())) {
      logoResourceId = R.drawable.ubuntu_large;
    } else if ("12".equals(getId())) {
      logoResourceId = R.drawable.redhat_large;
    } else if ("13".equals(getId())) {
      logoResourceId = R.drawable.fedora_large;
    } else if ("4056".equals(getId())) {
      logoResourceId = R.drawable.fedora_large;
    } else if ("14362".equals(getId())) {
      logoResourceId = R.drawable.ubuntu_large;
    } else if ("23".equals(getId())) {
      logoResourceId = R.drawable.windows_large;
    } else if ("24".equals(getId())) {
      logoResourceId = R.drawable.windows_large;
    } else if ("28".equals(getId())) {
      logoResourceId = R.drawable.windows_large;
    } else if ("29".equals(getId())) {
      logoResourceId = R.drawable.windows_large;
    } else if ("31".equals(getId())) {
      logoResourceId = R.drawable.windows_large;
    } else if ("14".equals(getId())) {
      logoResourceId = R.drawable.redhat_large;
    } else if ("17".equals(getId())) {
      logoResourceId = R.drawable.fedora_large;
    } else if ("19".equals(getId())) {
      logoResourceId = R.drawable.gentoo_large;
    } else if ("187811".equals(getId())) {
      logoResourceId = R.drawable.centos_large;
    } else if ("49".equals(getId())) {
      logoResourceId = R.drawable.ubuntu_large;
    } else if ("51".equals(getId())) {
      logoResourceId = R.drawable.centos_large;
    } else if ("53".equals(getId())) {
      logoResourceId = R.drawable.fedora_large;
    } else if ("55".equals(getId())) {
      logoResourceId = R.drawable.arch_large;
    } else if ("56".equals(getId())) {
      logoResourceId = R.drawable.windows_large;
    } else if ("57".equals(getId())) {
      logoResourceId = R.drawable.windows_large;
    } else if ("58".equals(getId())) {
      logoResourceId = R.drawable.windows_large;
    } else if ("62".equals(getId())) {
      logoResourceId = R.drawable.redhat_large;
    } else if ("69".equals(getId())) {
      logoResourceId = R.drawable.ubuntu_large;
    } else if ("71".equals(getId())) {
      logoResourceId = R.drawable.fedora_large;
    }
    
    return logoResourceId;
  }
  
  /**
   * @return the status
   */
  public String getStatus() {
    return status;
  }
  /**
   * @param status the status to set
   */
  public void setStatus(String status) {
    this.status = status;
  }
  /**
   * @return the updated
   */
  public String getUpdated() {
    return updated;
  }
  /**
   * @param updated the updated to set
   */
  public void setUpdated(String updated) {
    this.updated = updated;
  }

  /**
   * @return the images
   */
  public static TreeMap<String, Image> getImages() {
    return images;
  }

  /**
   * @param images the images to set
   */
  public static void setImages(TreeMap<String, Image> images) {
    Image.images = images;
  }

  @Override
  public int compareTo(Image b) {
    return this.getName().compareTo(b.getName());
  }
  
  
}




Java Source Code List

com.rackspace.cloud.files.api.client.ContainerManager.java
com.rackspace.cloud.files.api.client.ContainerObjectManager.java
com.rackspace.cloud.files.api.client.ContainerObjects.java
com.rackspace.cloud.files.api.client.Container.java
com.rackspace.cloud.files.api.client.CustomHttpClient.java
com.rackspace.cloud.files.api.client.parsers.ContainerObjectXMLparser.java
com.rackspace.cloud.files.api.client.parsers.ContainerXMLParser.java
com.rackspace.cloud.servers.api.client.Account.java
com.rackspace.cloud.servers.api.client.Backup.java
com.rackspace.cloud.servers.api.client.CloudServersException.java
com.rackspace.cloud.servers.api.client.EntityManager.java
com.rackspace.cloud.servers.api.client.Entity.java
com.rackspace.cloud.servers.api.client.FlavorManager.java
com.rackspace.cloud.servers.api.client.Flavor.java
com.rackspace.cloud.servers.api.client.ImageManager.java
com.rackspace.cloud.servers.api.client.Image.java
com.rackspace.cloud.servers.api.client.ServerManager.java
com.rackspace.cloud.servers.api.client.Server.java
com.rackspace.cloud.servers.api.client.http.Authentication.java
com.rackspace.cloud.servers.api.client.http.HttpBundle.java
com.rackspace.cloud.servers.api.client.parsers.CloudServersFaultXMLParser.java
com.rackspace.cloud.servers.api.client.parsers.FlavorsXMLParser.java
com.rackspace.cloud.servers.api.client.parsers.ImagesXMLParser.java
com.rackspace.cloud.servers.api.client.parsers.ServersXMLParser.java
com.rackspacecloud.android.AddAccountActivity.java
com.rackspacecloud.android.AddContainerActivity.java
com.rackspacecloud.android.AddFileActivity.java
com.rackspacecloud.android.AddServerActivity.java
com.rackspacecloud.android.AndroidCloudApplication.java
com.rackspacecloud.android.BackupServerActivity.java
com.rackspacecloud.android.Config.java
com.rackspacecloud.android.ConfirmResizeActivity.java
com.rackspacecloud.android.ContactActivity.java
com.rackspacecloud.android.ContainerObjectDetails.java
com.rackspacecloud.android.ContainerObjectsActivity.java
com.rackspacecloud.android.CreatePasswordActivity.java
com.rackspacecloud.android.EnableCDNActivity.java
com.rackspacecloud.android.ErrorDetailsActivity.java
com.rackspacecloud.android.GaActivity.java
com.rackspacecloud.android.GaListActivity.java
com.rackspacecloud.android.ListAccountsActivity.java
com.rackspacecloud.android.ListContainerActivity.java
com.rackspacecloud.android.ListServersActivity.java
com.rackspacecloud.android.PasswordManager.java
com.rackspacecloud.android.PasswordServerActivity.java
com.rackspacecloud.android.PingServerActivity.java
com.rackspacecloud.android.Preferences.java
com.rackspacecloud.android.ServerErrorActivity.java
com.rackspacecloud.android.TabViewActivity.java
com.rackspacecloud.android.ViewServerActivity.java
net.elasticgrid.rackspace.cloudservers.Addresses.java
net.elasticgrid.rackspace.cloudservers.BackupSchedule.java
net.elasticgrid.rackspace.cloudservers.CloudServersException.java
net.elasticgrid.rackspace.cloudservers.CloudServers.java
net.elasticgrid.rackspace.cloudservers.File.java
net.elasticgrid.rackspace.cloudservers.Flavor.java
net.elasticgrid.rackspace.cloudservers.HTTPVerb.java
net.elasticgrid.rackspace.cloudservers.Image.java
net.elasticgrid.rackspace.cloudservers.Limits.java
net.elasticgrid.rackspace.cloudservers.Personality.java
net.elasticgrid.rackspace.cloudservers.RebootType.java
net.elasticgrid.rackspace.cloudservers.Server.java
net.elasticgrid.rackspace.cloudservers.SharedIPGroup.java
net.elasticgrid.rackspace.cloudservers.XMLCloudServers.java
net.elasticgrid.rackspace.cloudservers.package-info.java
net.elasticgrid.rackspace.common.RackspaceConnection.java
net.elasticgrid.rackspace.common.RackspaceException.java
net.elasticgrid.rackspace.common.package-info.java
org.jclouds.date.joda.JodaDateService.java
org.jclouds.date.joda.config.JodaDateServiceModule.java
org.jclouds.encryption.bouncycastle.BouncyCastleEncryptionService.java
org.jclouds.encryption.bouncycastle.config.BouncyCastleEncryptionServiceModule.java
org.jclouds.enterprise.config.EnterpriseConfigurationModule.java
org.jclouds.gae.GaeHttpCommandExecutorService.java
org.jclouds.gae.config.GoogleAppEngineConfigurationModule.java
org.jclouds.http.apachehc.ApacheHCHttpCommandExecutorService.java
org.jclouds.http.apachehc.ApacheHCUtils.java
org.jclouds.http.apachehc.config.ApacheHCHttpCommandExecutorServiceModule.java
org.jclouds.http.httpnio.config.NioTransformingHttpCommandExecutorServiceModule.java
org.jclouds.http.httpnio.pool.NioHttpCommandConnectionHandle.java
org.jclouds.http.httpnio.pool.NioHttpCommandConnectionPool.java
org.jclouds.http.httpnio.pool.NioHttpCommandExecutionHandler.java
org.jclouds.http.httpnio.pool.NioTransformingHttpCommandExecutorService.java
org.jclouds.http.httpnio.util.NioHttpUtils.java
org.jclouds.http.pool.ConnectionPoolTransformingHttpCommandExecutorService.java
org.jclouds.http.pool.HttpCommandConnectionHandle.java
org.jclouds.http.pool.HttpCommandConnectionPool.java
org.jclouds.http.pool.config.ConnectionPoolCommandExecutorServiceModule.java
org.jclouds.logging.log4j.Log4JLogger.java
org.jclouds.logging.log4j.config.Log4JLoggingModule.java
org.jclouds.ssh.jsch.JschSshClient.java
org.jclouds.ssh.jsch.config.JschSshClientModule.java