Move classes to their pertinent packages, too much clutter under
com.rcarrillocruz.android.openstackdroid
This commit is contained in:
parent
a052ab848c
commit
10f3c5885b
|
@ -41,7 +41,8 @@
|
||||||
<service android:name="com.rcarrillocruz.android.openstackdroid.CloudControllerService" />
|
<service android:name="com.rcarrillocruz.android.openstackdroid.CloudControllerService" />
|
||||||
|
|
||||||
<provider
|
<provider
|
||||||
android:name="com.rcarrillocruz.android.openstackdroid.ConnectionProfileContentProvider"
|
android:name="com.rcarrillocruz.android.openstackdroid.db.connectionprofile.ConnectionProfileContentProvider"
|
||||||
|
android:exported="false"
|
||||||
android:authorities="com.rcarrillocruz.android.openstackdroid" >
|
android:authorities="com.rcarrillocruz.android.openstackdroid" >
|
||||||
</provider>
|
</provider>
|
||||||
</application>
|
</application>
|
||||||
|
|
|
@ -105,7 +105,6 @@ public class CloudBrowserActivity extends Activity implements TabListener {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean onOptionsItemSelected(MenuItem item) {
|
public boolean onOptionsItemSelected(MenuItem item) {
|
||||||
switch(item.getItemId()) {
|
switch(item.getItemId()) {
|
||||||
case android.R.id.home:
|
case android.R.id.home:
|
||||||
|
@ -125,15 +124,11 @@ public class CloudBrowserActivity extends Activity implements TabListener {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onTabReselected(Tab tab, FragmentTransaction ft) {
|
public void onTabReselected(Tab tab, FragmentTransaction ft) {
|
||||||
// TODO Auto-generated method stub
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onTabSelected(Tab tab, FragmentTransaction ft) {
|
public void onTabSelected(Tab tab, FragmentTransaction ft) {
|
||||||
// TODO Auto-generated method stub
|
|
||||||
Class<?> tabClass = null;
|
Class<?> tabClass = null;
|
||||||
|
|
||||||
switch(tab.getPosition()) {
|
switch(tab.getPosition()) {
|
||||||
|
@ -239,9 +234,7 @@ public class CloudBrowserActivity extends Activity implements TabListener {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onTabUnselected(Tab tab, FragmentTransaction ft) {
|
public void onTabUnselected(Tab tab, FragmentTransaction ft) {
|
||||||
// TODO Auto-generated method stub
|
|
||||||
if (mListFragmentAttached != null)
|
if (mListFragmentAttached != null)
|
||||||
ft.detach(mListFragmentAttached);
|
ft.detach(mListFragmentAttached);
|
||||||
}
|
}
|
||||||
|
|
|
@ -17,9 +17,8 @@ public abstract class CloudBrowserListFragment extends ListFragment implements R
|
||||||
mReceiver.setReceiver(this);
|
mReceiver.setReceiver(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onReceiveResult(int resultCode, Bundle resultData) {
|
public void onReceiveResult(int resultCode, Bundle resultData) {
|
||||||
// TODO Auto-generated method stub
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getEndpoint() {
|
public String getEndpoint() {
|
||||||
|
|
|
@ -9,7 +9,6 @@ public class CloudControllerResultReceiver extends ResultReceiver {
|
||||||
|
|
||||||
public CloudControllerResultReceiver(Handler handler) {
|
public CloudControllerResultReceiver(Handler handler) {
|
||||||
super(handler);
|
super(handler);
|
||||||
// TODO Auto-generated constructor stub
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public interface Receiver {
|
public interface Receiver {
|
||||||
|
@ -20,7 +19,6 @@ public class CloudControllerResultReceiver extends ResultReceiver {
|
||||||
mReceiver = receiver;
|
mReceiver = receiver;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
protected void onReceiveResult(int resultCode, Bundle resultData) {
|
protected void onReceiveResult(int resultCode, Bundle resultData) {
|
||||||
|
|
||||||
if (mReceiver != null) {
|
if (mReceiver != null) {
|
||||||
|
|
|
@ -1,29 +1,15 @@
|
||||||
package com.rcarrillocruz.android.openstackdroid;
|
package com.rcarrillocruz.android.openstackdroid;
|
||||||
|
|
||||||
import java.io.BufferedReader;
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.io.InputStreamReader;
|
|
||||||
import java.io.UnsupportedEncodingException;
|
|
||||||
import java.net.URI;
|
|
||||||
import java.net.URISyntaxException;
|
|
||||||
import java.util.ArrayList;
|
|
||||||
import java.util.List;
|
|
||||||
import java.util.Map;
|
|
||||||
|
|
||||||
import org.apache.http.HttpResponse;
|
import org.apache.http.HttpResponse;
|
||||||
import org.apache.http.ParseException;
|
import org.apache.http.ParseException;
|
||||||
import org.apache.http.client.ClientProtocolException;
|
import org.apache.http.client.ClientProtocolException;
|
||||||
import org.apache.http.client.HttpClient;
|
import org.apache.http.client.HttpClient;
|
||||||
import org.apache.http.client.methods.HttpGet;
|
|
||||||
import org.apache.http.client.methods.HttpPost;
|
|
||||||
import org.apache.http.client.methods.HttpRequestBase;
|
import org.apache.http.client.methods.HttpRequestBase;
|
||||||
import org.apache.http.entity.StringEntity;
|
|
||||||
import org.apache.http.impl.client.DefaultHttpClient;
|
import org.apache.http.impl.client.DefaultHttpClient;
|
||||||
import org.apache.http.message.BasicNameValuePair;
|
|
||||||
import org.apache.http.util.EntityUtils;
|
import org.apache.http.util.EntityUtils;
|
||||||
|
|
||||||
import com.rcarrillocruz.android.openstackdroid.operations.ApiOperation;
|
|
||||||
|
|
||||||
import android.app.IntentService;
|
import android.app.IntentService;
|
||||||
import android.content.Intent;
|
import android.content.Intent;
|
||||||
import android.net.Uri;
|
import android.net.Uri;
|
||||||
|
@ -32,6 +18,8 @@ import android.os.ResultReceiver;
|
||||||
import android.util.Log;
|
import android.util.Log;
|
||||||
import android.widget.Toast;
|
import android.widget.Toast;
|
||||||
|
|
||||||
|
import com.rcarrillocruz.android.openstackdroid.operations.ApiOperation;
|
||||||
|
|
||||||
public class CloudControllerService extends IntentService {
|
public class CloudControllerService extends IntentService {
|
||||||
public static final String TAG = CloudControllerResultReceiver.class.getName();
|
public static final String TAG = CloudControllerResultReceiver.class.getName();
|
||||||
public static final String GET_TOKEN_OPERATION = "com.rcarrillocruz.android.openstackdroid.operations.identity.GetTokenOperation";
|
public static final String GET_TOKEN_OPERATION = "com.rcarrillocruz.android.openstackdroid.operations.identity.GetTokenOperation";
|
||||||
|
@ -51,12 +39,9 @@ public class CloudControllerService extends IntentService {
|
||||||
|
|
||||||
public CloudControllerService() {
|
public CloudControllerService() {
|
||||||
super("CloudControllerService");
|
super("CloudControllerService");
|
||||||
// TODO Auto-generated constructor stub
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
protected void onHandleIntent(Intent intent) {
|
protected void onHandleIntent(Intent intent) {
|
||||||
// TODO Auto-generated method stub
|
|
||||||
Uri data = intent.getData();
|
Uri data = intent.getData();
|
||||||
Bundle extras = intent.getExtras();
|
Bundle extras = intent.getExtras();
|
||||||
|
|
||||||
|
@ -77,45 +62,42 @@ public class CloudControllerService extends IntentService {
|
||||||
}
|
}
|
||||||
|
|
||||||
private ApiOperation getOperationInstance(String operation) {
|
private ApiOperation getOperationInstance(String operation) {
|
||||||
// TODO Auto-generated method stub
|
|
||||||
ApiOperation apiOperation = null;
|
ApiOperation apiOperation = null;
|
||||||
|
|
||||||
try {
|
try {
|
||||||
apiOperation = (ApiOperation) Class.forName(operation).newInstance();
|
apiOperation = (ApiOperation) Class.forName(operation).newInstance();
|
||||||
} catch (InstantiationException e) {
|
} catch (InstantiationException e) {
|
||||||
// TODO Auto-generated catch block
|
Log.e(TAG,Log.getStackTraceString(e));
|
||||||
e.printStackTrace();
|
Toast.makeText(getApplicationContext(), "Instantiation exception, check the Android log!", Toast.LENGTH_LONG).show();
|
||||||
} catch (IllegalAccessException e) {
|
} catch (IllegalAccessException e) {
|
||||||
// TODO Auto-generated catch block
|
Log.e(TAG,Log.getStackTraceString(e));
|
||||||
e.printStackTrace();
|
Toast.makeText(getApplicationContext(), "Illegal access exception, check the Android log!", Toast.LENGTH_LONG).show();
|
||||||
} catch (ClassNotFoundException e) {
|
} catch (ClassNotFoundException e) {
|
||||||
// TODO Auto-generated catch block
|
Log.e(TAG,Log.getStackTraceString(e));
|
||||||
e.printStackTrace();
|
Toast.makeText(getApplicationContext(), "Class not found exception, check the Android log!", Toast.LENGTH_LONG).show();
|
||||||
}
|
}
|
||||||
|
|
||||||
return apiOperation;
|
return apiOperation;
|
||||||
}
|
}
|
||||||
|
|
||||||
private HttpResponse executeOperation(HttpRequestBase request) {
|
private HttpResponse executeOperation(HttpRequestBase request) {
|
||||||
// TODO Auto-generated method stub
|
|
||||||
HttpResponse response = null;
|
HttpResponse response = null;
|
||||||
HttpClient client = new DefaultHttpClient();
|
HttpClient client = new DefaultHttpClient();
|
||||||
|
|
||||||
try {
|
try {
|
||||||
response = client.execute(request);
|
response = client.execute(request);
|
||||||
} catch (ClientProtocolException e) {
|
} catch (ClientProtocolException e) {
|
||||||
// TODO Auto-generated catch block
|
Log.e(TAG,Log.getStackTraceString(e));
|
||||||
e.printStackTrace();
|
Toast.makeText(getApplicationContext(), "Client protocol exception, check the Android log!", Toast.LENGTH_LONG).show();
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
// TODO Auto-generated catch block
|
Log.e(TAG,Log.getStackTraceString(e));
|
||||||
e.printStackTrace();
|
Toast.makeText(getApplicationContext(), "Input/output exception, check the Android log!", Toast.LENGTH_LONG).show();
|
||||||
}
|
}
|
||||||
return response;
|
return response;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void returnResultstoReceiver(String operation, HttpResponse response,
|
private void returnResultstoReceiver(String operation, HttpResponse response,
|
||||||
ResultReceiver receiver) {
|
ResultReceiver receiver) {
|
||||||
// TODO Auto-generated method stub
|
|
||||||
Bundle results = new Bundle();
|
Bundle results = new Bundle();
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
@ -128,11 +110,11 @@ public class CloudControllerService extends IntentService {
|
||||||
receiver.send(504, results);
|
receiver.send(504, results);
|
||||||
}
|
}
|
||||||
} catch (ParseException e) {
|
} catch (ParseException e) {
|
||||||
// TODO Auto-generated catch block
|
Log.e(TAG,Log.getStackTraceString(e));
|
||||||
e.printStackTrace();
|
Toast.makeText(getApplicationContext(), "Parsing exception, check the Android log!", Toast.LENGTH_LONG).show();
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
// TODO Auto-generated catch block
|
Log.e(TAG,Log.getStackTraceString(e));
|
||||||
e.printStackTrace();
|
Toast.makeText(getApplicationContext(), "Input/output exception, check the Android log!", Toast.LENGTH_LONG).show();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,5 +1,12 @@
|
||||||
package com.rcarrillocruz.android.openstackdroid;
|
package com.rcarrillocruz.android.openstackdroid;
|
||||||
|
|
||||||
|
import com.rcarrillocruz.android.openstackdroid.R;
|
||||||
|
import com.rcarrillocruz.android.openstackdroid.R.id;
|
||||||
|
import com.rcarrillocruz.android.openstackdroid.R.layout;
|
||||||
|
import com.rcarrillocruz.android.openstackdroid.R.menu;
|
||||||
|
import com.rcarrillocruz.android.openstackdroid.db.connectionprofile.ConnectionProfileContentProvider;
|
||||||
|
import com.rcarrillocruz.android.openstackdroid.db.connectionprofile.ConnectionProfileTable;
|
||||||
|
|
||||||
import android.app.Activity;
|
import android.app.Activity;
|
||||||
import android.content.ContentValues;
|
import android.content.ContentValues;
|
||||||
import android.database.Cursor;
|
import android.database.Cursor;
|
||||||
|
@ -18,9 +25,7 @@ public class ConnectionProfileActivity extends Activity {
|
||||||
private EditText mPassword;
|
private EditText mPassword;
|
||||||
private EditText mTenantId;
|
private EditText mTenantId;
|
||||||
|
|
||||||
@Override
|
|
||||||
protected void onCreate(Bundle savedInstanceState) {
|
protected void onCreate(Bundle savedInstanceState) {
|
||||||
// TODO Auto-generated method stub
|
|
||||||
super.onCreate(savedInstanceState);
|
super.onCreate(savedInstanceState);
|
||||||
setContentView(R.layout.connection_profile_activity);
|
setContentView(R.layout.connection_profile_activity);
|
||||||
|
|
||||||
|
@ -56,7 +61,6 @@ public class ConnectionProfileActivity extends Activity {
|
||||||
}
|
}
|
||||||
|
|
||||||
private void saveConnectionProfile() {
|
private void saveConnectionProfile() {
|
||||||
// TODO Auto-generated method stub
|
|
||||||
String profileName = (String) mProfileName.getText().toString();
|
String profileName = (String) mProfileName.getText().toString();
|
||||||
String endpoint = mEndpoint.getText().toString();
|
String endpoint = mEndpoint.getText().toString();
|
||||||
String username = mUsername.getText().toString();
|
String username = mUsername.getText().toString();
|
||||||
|
@ -80,7 +84,6 @@ public class ConnectionProfileActivity extends Activity {
|
||||||
}
|
}
|
||||||
|
|
||||||
private void populateForm(Uri uri) {
|
private void populateForm(Uri uri) {
|
||||||
// TODO Auto-generated method stub
|
|
||||||
String[] projection = {ConnectionProfileTable.COLUMN_PROFILE_NAME, ConnectionProfileTable.COLUMN_ENDPOINT,
|
String[] projection = {ConnectionProfileTable.COLUMN_PROFILE_NAME, ConnectionProfileTable.COLUMN_ENDPOINT,
|
||||||
ConnectionProfileTable.COLUMN_USERNAME, ConnectionProfileTable.COLUMN_PASSWORD,
|
ConnectionProfileTable.COLUMN_USERNAME, ConnectionProfileTable.COLUMN_PASSWORD,
|
||||||
ConnectionProfileTable.COLUMN_TENANT_ID};
|
ConnectionProfileTable.COLUMN_TENANT_ID};
|
||||||
|
|
|
@ -16,7 +16,6 @@ public class FlavorDetailsFragment extends Fragment {
|
||||||
private TextView tv;
|
private TextView tv;
|
||||||
|
|
||||||
public static FlavorDetailsFragment newInstance(int position) {
|
public static FlavorDetailsFragment newInstance(int position) {
|
||||||
// TODO Auto-generated method stub
|
|
||||||
FlavorDetailsFragment f = new FlavorDetailsFragment();
|
FlavorDetailsFragment f = new FlavorDetailsFragment();
|
||||||
|
|
||||||
Bundle args = new Bundle();
|
Bundle args = new Bundle();
|
||||||
|
@ -27,7 +26,6 @@ public class FlavorDetailsFragment extends Fragment {
|
||||||
}
|
}
|
||||||
|
|
||||||
public int getShownIndex() {
|
public int getShownIndex() {
|
||||||
// TODO Auto-generated method stub
|
|
||||||
return getArguments().getInt("position", 0);
|
return getArguments().getInt("position", 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -20,10 +20,8 @@ public class FlavorListFragment extends CloudBrowserListFragment {
|
||||||
List<FlavorModel> flavors;
|
List<FlavorModel> flavors;
|
||||||
private ArrayAdapter<FlavorModel> adapter;
|
private ArrayAdapter<FlavorModel> adapter;
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onActivityCreated(Bundle savedInstanceState) {
|
public void onActivityCreated(Bundle savedInstanceState) {
|
||||||
// TODO Auto-generated method stub
|
super.onActivityCreated(savedInstanceState);
|
||||||
super.onActivityCreated(savedInstanceState);
|
|
||||||
endpoint = ((OpenstackdroidApplication) (getActivity().getApplication())).getComputeEndpoint();
|
endpoint = ((OpenstackdroidApplication) (getActivity().getApplication())).getComputeEndpoint();
|
||||||
flavors = ((CloudBrowserActivity) getActivity()).getFlavors();
|
flavors = ((CloudBrowserActivity) getActivity()).getFlavors();
|
||||||
|
|
||||||
|
@ -44,18 +42,14 @@ public class FlavorListFragment extends CloudBrowserListFragment {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
public void onListItemClick(ListView l, View v, int position, long id) {
|
||||||
public void onListItemClick(ListView l, View v, int position, long id) {
|
mCurCheckPosition = position;
|
||||||
// TODO Auto-generated method stub
|
|
||||||
mCurCheckPosition = position;
|
|
||||||
getListView().setItemChecked(position, true);
|
getListView().setItemChecked(position, true);
|
||||||
|
|
||||||
showDetails(position);
|
showDetails(position);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
protected void showDetails(int position) {
|
protected void showDetails(int position) {
|
||||||
// TODO Auto-generated method stub
|
|
||||||
FlavorDetailsFragment fdf = (FlavorDetailsFragment) ((CloudBrowserActivity) getActivity()).getmFlavorDetailsFragment();
|
FlavorDetailsFragment fdf = (FlavorDetailsFragment) ((CloudBrowserActivity) getActivity()).getmFlavorDetailsFragment();
|
||||||
|
|
||||||
if (fdf == null || fdf.getShownIndex() != position)
|
if (fdf == null || fdf.getShownIndex() != position)
|
||||||
|
@ -68,9 +62,7 @@ public class FlavorListFragment extends CloudBrowserListFragment {
|
||||||
((CloudBrowserActivity) getActivity()).showDetailsLayout();
|
((CloudBrowserActivity) getActivity()).showDetailsLayout();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onReceiveResult(int resultCode, Bundle resultData) {
|
public void onReceiveResult(int resultCode, Bundle resultData) {
|
||||||
// TODO Auto-generated method stub
|
|
||||||
if (resultCode == 200) {
|
if (resultCode == 200) {
|
||||||
String operation = resultData.getString(CloudControllerService.OPERATION);
|
String operation = resultData.getString(CloudControllerService.OPERATION);
|
||||||
|
|
||||||
|
@ -84,7 +76,6 @@ public class FlavorListFragment extends CloudBrowserListFragment {
|
||||||
}
|
}
|
||||||
|
|
||||||
private void populateItems(GetFlavorsResponse gfr) {
|
private void populateItems(GetFlavorsResponse gfr) {
|
||||||
// TODO Auto-generated method stub
|
|
||||||
flavors.clear();
|
flavors.clear();
|
||||||
Iterator<FlavorDetailsObject> it = gfr.getFlavors().iterator();
|
Iterator<FlavorDetailsObject> it = gfr.getFlavors().iterator();
|
||||||
FlavorDetailsObject item = null;
|
FlavorDetailsObject item = null;
|
||||||
|
|
|
@ -16,7 +16,6 @@ public class ImageDetailsFragment extends Fragment {
|
||||||
private TextView tv;
|
private TextView tv;
|
||||||
|
|
||||||
public static ImageDetailsFragment newInstance(int position) {
|
public static ImageDetailsFragment newInstance(int position) {
|
||||||
// TODO Auto-generated method stub
|
|
||||||
ImageDetailsFragment f = new ImageDetailsFragment();
|
ImageDetailsFragment f = new ImageDetailsFragment();
|
||||||
|
|
||||||
Bundle args = new Bundle();
|
Bundle args = new Bundle();
|
||||||
|
@ -27,7 +26,6 @@ public class ImageDetailsFragment extends Fragment {
|
||||||
}
|
}
|
||||||
|
|
||||||
public int getShownIndex() {
|
public int getShownIndex() {
|
||||||
// TODO Auto-generated method stub
|
|
||||||
return getArguments().getInt("position", 0);
|
return getArguments().getInt("position", 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -4,17 +4,14 @@ import java.util.Iterator;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import android.app.FragmentTransaction;
|
import android.app.FragmentTransaction;
|
||||||
import android.app.ListFragment;
|
|
||||||
import android.content.Intent;
|
import android.content.Intent;
|
||||||
import android.net.Uri;
|
import android.net.Uri;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
import android.os.Handler;
|
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
import android.widget.ArrayAdapter;
|
import android.widget.ArrayAdapter;
|
||||||
import android.widget.ListView;
|
import android.widget.ListView;
|
||||||
|
|
||||||
import com.google.gson.Gson;
|
import com.google.gson.Gson;
|
||||||
import com.rcarrillocruz.android.openstackdroid.CloudControllerResultReceiver.Receiver;
|
|
||||||
import com.rcarrillocruz.android.openstackdroid.json.image.GetImagesResponse;
|
import com.rcarrillocruz.android.openstackdroid.json.image.GetImagesResponse;
|
||||||
import com.rcarrillocruz.android.openstackdroid.json.image.ImageDetailsObject;
|
import com.rcarrillocruz.android.openstackdroid.json.image.ImageDetailsObject;
|
||||||
import com.rcarrillocruz.android.openstackdroid.model.ImageModel;
|
import com.rcarrillocruz.android.openstackdroid.model.ImageModel;
|
||||||
|
@ -23,10 +20,8 @@ public class ImageListFragment extends CloudBrowserListFragment {
|
||||||
List<ImageModel> images;
|
List<ImageModel> images;
|
||||||
private ArrayAdapter<ImageModel> adapter;
|
private ArrayAdapter<ImageModel> adapter;
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onActivityCreated(Bundle savedInstanceState) {
|
public void onActivityCreated(Bundle savedInstanceState) {
|
||||||
// TODO Auto-generated method stub
|
super.onActivityCreated(savedInstanceState);
|
||||||
super.onActivityCreated(savedInstanceState);
|
|
||||||
endpoint = ((OpenstackdroidApplication) (getActivity().getApplication())).getImageEndpoint();
|
endpoint = ((OpenstackdroidApplication) (getActivity().getApplication())).getImageEndpoint();
|
||||||
images = ((CloudBrowserActivity) getActivity()).getImages();
|
images = ((CloudBrowserActivity) getActivity()).getImages();
|
||||||
|
|
||||||
|
@ -47,17 +42,14 @@ public class ImageListFragment extends CloudBrowserListFragment {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
public void onListItemClick(ListView l, View v, int position, long id) {
|
||||||
public void onListItemClick(ListView l, View v, int position, long id) {
|
mCurCheckPosition = position;
|
||||||
// TODO Auto-generated method stub
|
|
||||||
mCurCheckPosition = position;
|
|
||||||
getListView().setItemChecked(position, true);
|
getListView().setItemChecked(position, true);
|
||||||
|
|
||||||
showDetails(position);
|
showDetails(position);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void showDetails(int position) {
|
protected void showDetails(int position) {
|
||||||
// TODO Auto-generated method stub
|
|
||||||
ImageDetailsFragment idf = (ImageDetailsFragment) ((CloudBrowserActivity) getActivity()).getmImageDetailsFragment();
|
ImageDetailsFragment idf = (ImageDetailsFragment) ((CloudBrowserActivity) getActivity()).getmImageDetailsFragment();
|
||||||
|
|
||||||
if (idf == null || idf.getShownIndex() != position)
|
if (idf == null || idf.getShownIndex() != position)
|
||||||
|
@ -70,9 +62,7 @@ public class ImageListFragment extends CloudBrowserListFragment {
|
||||||
((CloudBrowserActivity) getActivity()).showDetailsLayout();
|
((CloudBrowserActivity) getActivity()).showDetailsLayout();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onReceiveResult(int resultCode, Bundle resultData) {
|
public void onReceiveResult(int resultCode, Bundle resultData) {
|
||||||
// TODO Auto-generated method stub
|
|
||||||
if (resultCode == 200) {
|
if (resultCode == 200) {
|
||||||
String operation = resultData.getString(CloudControllerService.OPERATION);
|
String operation = resultData.getString(CloudControllerService.OPERATION);
|
||||||
|
|
||||||
|
@ -86,7 +76,6 @@ public class ImageListFragment extends CloudBrowserListFragment {
|
||||||
}
|
}
|
||||||
|
|
||||||
private void populateItems(GetImagesResponse gir) {
|
private void populateItems(GetImagesResponse gir) {
|
||||||
// TODO Auto-generated method stub
|
|
||||||
images.clear();
|
images.clear();
|
||||||
Iterator<ImageDetailsObject> it = gir.getImages().iterator();
|
Iterator<ImageDetailsObject> it = gir.getImages().iterator();
|
||||||
ImageDetailsObject item = null;
|
ImageDetailsObject item = null;
|
||||||
|
|
|
@ -5,7 +5,6 @@ import java.util.List;
|
||||||
|
|
||||||
import android.net.Uri;
|
import android.net.Uri;
|
||||||
import android.os.Handler;
|
import android.os.Handler;
|
||||||
import android.os.Parcelable;
|
|
||||||
import android.app.ListActivity;
|
import android.app.ListActivity;
|
||||||
import android.app.ProgressDialog;
|
import android.app.ProgressDialog;
|
||||||
import android.content.ContentValues;
|
import android.content.ContentValues;
|
||||||
|
@ -27,6 +26,8 @@ import android.app.LoaderManager;
|
||||||
import android.content.CursorLoader;
|
import android.content.CursorLoader;
|
||||||
import com.google.gson.Gson;
|
import com.google.gson.Gson;
|
||||||
import com.rcarrillocruz.android.openstackdroid.CloudControllerResultReceiver.Receiver;
|
import com.rcarrillocruz.android.openstackdroid.CloudControllerResultReceiver.Receiver;
|
||||||
|
import com.rcarrillocruz.android.openstackdroid.db.connectionprofile.ConnectionProfileContentProvider;
|
||||||
|
import com.rcarrillocruz.android.openstackdroid.db.connectionprofile.ConnectionProfileTable;
|
||||||
import com.rcarrillocruz.android.openstackdroid.json.identity.EndpointObject;
|
import com.rcarrillocruz.android.openstackdroid.json.identity.EndpointObject;
|
||||||
import com.rcarrillocruz.android.openstackdroid.json.identity.GetTokenResponse;
|
import com.rcarrillocruz.android.openstackdroid.json.identity.GetTokenResponse;
|
||||||
import com.rcarrillocruz.android.openstackdroid.json.identity.RoleObject;
|
import com.rcarrillocruz.android.openstackdroid.json.identity.RoleObject;
|
||||||
|
@ -43,7 +44,6 @@ public class LoginActivity extends ListActivity implements Receiver, LoaderManag
|
||||||
private long selectedItemId = -1;
|
private long selectedItemId = -1;
|
||||||
private ProgressDialog progressDialog;
|
private ProgressDialog progressDialog;
|
||||||
|
|
||||||
@Override
|
|
||||||
protected void onCreate(Bundle savedInstanceState) {
|
protected void onCreate(Bundle savedInstanceState) {
|
||||||
super.onCreate(savedInstanceState);
|
super.onCreate(savedInstanceState);
|
||||||
|
|
||||||
|
@ -52,7 +52,6 @@ public class LoginActivity extends ListActivity implements Receiver, LoaderManag
|
||||||
|
|
||||||
lv.setOnItemLongClickListener(new OnItemLongClickListener() {
|
lv.setOnItemLongClickListener(new OnItemLongClickListener() {
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean onItemLongClick(AdapterView<?> parent, View view, int position, long id) {
|
public boolean onItemLongClick(AdapterView<?> parent, View view, int position, long id) {
|
||||||
|
|
||||||
if (mActionMode != null) {
|
if (mActionMode != null) {
|
||||||
|
@ -110,7 +109,6 @@ public class LoginActivity extends ListActivity implements Receiver, LoaderManag
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean onCreateOptionsMenu(Menu menu) {
|
public boolean onCreateOptionsMenu(Menu menu) {
|
||||||
getMenuInflater().inflate(R.menu.login_menu, menu);
|
getMenuInflater().inflate(R.menu.login_menu, menu);
|
||||||
return true;
|
return true;
|
||||||
|
@ -153,8 +151,6 @@ public class LoginActivity extends ListActivity implements Receiver, LoaderManag
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean onOptionsItemSelected(MenuItem item) {
|
public boolean onOptionsItemSelected(MenuItem item) {
|
||||||
switch(item.getItemId()) {
|
switch(item.getItemId()) {
|
||||||
case R.id.add_profile:
|
case R.id.add_profile:
|
||||||
|
@ -203,7 +199,6 @@ public class LoginActivity extends ListActivity implements Receiver, LoaderManag
|
||||||
}
|
}
|
||||||
|
|
||||||
private EndpointObject getEndpointByType(List<ServiceCatalogObject> sc, String type) {
|
private EndpointObject getEndpointByType(List<ServiceCatalogObject> sc, String type) {
|
||||||
// TODO Auto-generated method stub
|
|
||||||
EndpointObject eo = null;
|
EndpointObject eo = null;
|
||||||
boolean found = false;
|
boolean found = false;
|
||||||
ServiceCatalogObject item = null;
|
ServiceCatalogObject item = null;
|
||||||
|
@ -278,20 +273,17 @@ public class LoginActivity extends ListActivity implements Receiver, LoaderManag
|
||||||
|
|
||||||
setListAdapter(adapter);
|
setListAdapter(adapter);
|
||||||
}
|
}
|
||||||
@Override
|
|
||||||
public Loader<Cursor> onCreateLoader(int id, Bundle args) {
|
public Loader<Cursor> onCreateLoader(int id, Bundle args) {
|
||||||
// TODO Auto-generated method stub
|
|
||||||
String[] projection = { ConnectionProfileTable.COLUMN_ID, ConnectionProfileTable.COLUMN_PROFILE_NAME };
|
String[] projection = { ConnectionProfileTable.COLUMN_ID, ConnectionProfileTable.COLUMN_PROFILE_NAME };
|
||||||
CursorLoader cursorLoader = new CursorLoader(this, ConnectionProfileContentProvider.CONTENT_URI, projection, null, null, null);
|
CursorLoader cursorLoader = new CursorLoader(this, ConnectionProfileContentProvider.CONTENT_URI, projection, null, null, null);
|
||||||
return cursorLoader;
|
return cursorLoader;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onLoadFinished(Loader<Cursor> loader, Cursor data) {
|
public void onLoadFinished(Loader<Cursor> loader, Cursor data) {
|
||||||
adapter.swapCursor(data);
|
adapter.swapCursor(data);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onLoaderReset(Loader<Cursor> loader) {
|
public void onLoaderReset(Loader<Cursor> loader) {
|
||||||
adapter.swapCursor(null);
|
adapter.swapCursor(null);
|
||||||
}
|
}
|
||||||
|
|
|
@ -12,61 +12,73 @@ public class OpenstackdroidApplication extends Application {
|
||||||
private String identityAdminEndpoint;
|
private String identityAdminEndpoint;
|
||||||
private String imageEndpoint;
|
private String imageEndpoint;
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onCreate() {
|
public void onCreate() {
|
||||||
// TODO Auto-generated method stub
|
|
||||||
super.onCreate();
|
super.onCreate();
|
||||||
}
|
}
|
||||||
@Override
|
|
||||||
public void onTerminate() {
|
public void onTerminate() {
|
||||||
// TODO Auto-generated method stub
|
|
||||||
super.onTerminate();
|
super.onTerminate();
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getToken() {
|
public String getToken() {
|
||||||
return token;
|
return token;
|
||||||
}
|
}
|
||||||
public void setToken(String token) {
|
public void setToken(String token) {
|
||||||
this.token = token;
|
this.token = token;
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getTenantId() {
|
public String getTenantId() {
|
||||||
return tenantId;
|
return tenantId;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setTenantId(String tenantId) {
|
public void setTenantId(String tenantId) {
|
||||||
this.tenantId = tenantId;
|
this.tenantId = tenantId;
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean isAdminUser() {
|
public boolean isAdminUser() {
|
||||||
return isAdminUser;
|
return isAdminUser;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setAdminUser(boolean isAdminUser) {
|
public void setAdminUser(boolean isAdminUser) {
|
||||||
this.isAdminUser = isAdminUser;
|
this.isAdminUser = isAdminUser;
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getComputeEndpoint() {
|
public String getComputeEndpoint() {
|
||||||
return computeEndpoint;
|
return computeEndpoint;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setComputeEndpoint(String computeEndpoint) {
|
public void setComputeEndpoint(String computeEndpoint) {
|
||||||
this.computeEndpoint = computeEndpoint;
|
this.computeEndpoint = computeEndpoint;
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getVolumeEndpoint() {
|
public String getVolumeEndpoint() {
|
||||||
return volumeEndpoint;
|
return volumeEndpoint;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setVolumeEndpoint(String volumeEndpoint) {
|
public void setVolumeEndpoint(String volumeEndpoint) {
|
||||||
this.volumeEndpoint = volumeEndpoint;
|
this.volumeEndpoint = volumeEndpoint;
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getIdentityEndpoint() {
|
public String getIdentityEndpoint() {
|
||||||
return identityEndpoint;
|
return identityEndpoint;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setIdentityEndpoint(String identityEndpoint) {
|
public void setIdentityEndpoint(String identityEndpoint) {
|
||||||
this.identityEndpoint = identityEndpoint;
|
this.identityEndpoint = identityEndpoint;
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getIdentityAdminEndpoint() {
|
public String getIdentityAdminEndpoint() {
|
||||||
return identityAdminEndpoint;
|
return identityAdminEndpoint;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setIdentityAdminEndpoint(String identityAdminEndpoint) {
|
public void setIdentityAdminEndpoint(String identityAdminEndpoint) {
|
||||||
this.identityAdminEndpoint = identityAdminEndpoint;
|
this.identityAdminEndpoint = identityAdminEndpoint;
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getImageEndpoint() {
|
public String getImageEndpoint() {
|
||||||
return imageEndpoint;
|
return imageEndpoint;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setImageEndpoint(String imageEndpoint) {
|
public void setImageEndpoint(String imageEndpoint) {
|
||||||
this.imageEndpoint = imageEndpoint;
|
this.imageEndpoint = imageEndpoint;
|
||||||
}
|
}
|
||||||
|
|
|
@ -19,7 +19,6 @@ public class ServerDetailsFragment extends Fragment {
|
||||||
private TextView tv;
|
private TextView tv;
|
||||||
|
|
||||||
public static ServerDetailsFragment newInstance(int position) {
|
public static ServerDetailsFragment newInstance(int position) {
|
||||||
// TODO Auto-generated method stub
|
|
||||||
ServerDetailsFragment f = new ServerDetailsFragment();
|
ServerDetailsFragment f = new ServerDetailsFragment();
|
||||||
|
|
||||||
Bundle args = new Bundle();
|
Bundle args = new Bundle();
|
||||||
|
@ -30,11 +29,9 @@ public class ServerDetailsFragment extends Fragment {
|
||||||
}
|
}
|
||||||
|
|
||||||
public int getShownIndex() {
|
public int getShownIndex() {
|
||||||
// TODO Auto-generated method stub
|
|
||||||
return getArguments().getInt("position", 0);
|
return getArguments().getInt("position", 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
|
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
|
||||||
|
|
||||||
scroller = new ScrollView(getActivity());
|
scroller = new ScrollView(getActivity());
|
||||||
|
|
|
@ -4,31 +4,26 @@ import java.util.ArrayList;
|
||||||
import java.util.Iterator;
|
import java.util.Iterator;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
|
import android.app.FragmentTransaction;
|
||||||
|
import android.content.Intent;
|
||||||
|
import android.net.Uri;
|
||||||
|
import android.os.Bundle;
|
||||||
|
import android.view.View;
|
||||||
|
import android.widget.ArrayAdapter;
|
||||||
|
import android.widget.ListView;
|
||||||
|
|
||||||
import com.google.gson.Gson;
|
import com.google.gson.Gson;
|
||||||
import com.rcarrillocruz.android.openstackdroid.CloudControllerResultReceiver.Receiver;
|
|
||||||
import com.rcarrillocruz.android.openstackdroid.json.compute.GetServersResponse;
|
import com.rcarrillocruz.android.openstackdroid.json.compute.GetServersResponse;
|
||||||
import com.rcarrillocruz.android.openstackdroid.json.compute.IPAddressObject;
|
import com.rcarrillocruz.android.openstackdroid.json.compute.IPAddressObject;
|
||||||
import com.rcarrillocruz.android.openstackdroid.json.compute.ServerDetailsObject;
|
import com.rcarrillocruz.android.openstackdroid.json.compute.ServerDetailsObject;
|
||||||
import com.rcarrillocruz.android.openstackdroid.model.IPAddressModel;
|
import com.rcarrillocruz.android.openstackdroid.model.IPAddressModel;
|
||||||
import com.rcarrillocruz.android.openstackdroid.model.ServerModel;
|
import com.rcarrillocruz.android.openstackdroid.model.ServerModel;
|
||||||
|
|
||||||
import android.app.FragmentTransaction;
|
|
||||||
import android.app.ListFragment;
|
|
||||||
import android.content.Intent;
|
|
||||||
import android.net.Uri;
|
|
||||||
import android.os.Bundle;
|
|
||||||
import android.os.Handler;
|
|
||||||
import android.view.View;
|
|
||||||
import android.widget.ArrayAdapter;
|
|
||||||
import android.widget.ListView;
|
|
||||||
|
|
||||||
public class ServerListFragment extends CloudBrowserListFragment {
|
public class ServerListFragment extends CloudBrowserListFragment {
|
||||||
List<ServerModel> servers;
|
List<ServerModel> servers;
|
||||||
private ArrayAdapter<ServerModel> adapter;
|
private ArrayAdapter<ServerModel> adapter;
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onActivityCreated(Bundle savedInstanceState) {
|
public void onActivityCreated(Bundle savedInstanceState) {
|
||||||
// TODO Auto-generated method stub
|
|
||||||
super.onActivityCreated(savedInstanceState);
|
super.onActivityCreated(savedInstanceState);
|
||||||
servers = ((CloudBrowserActivity) getActivity()).getServers();
|
servers = ((CloudBrowserActivity) getActivity()).getServers();
|
||||||
endpoint = ((OpenstackdroidApplication) (getActivity().getApplication())).getComputeEndpoint();
|
endpoint = ((OpenstackdroidApplication) (getActivity().getApplication())).getComputeEndpoint();
|
||||||
|
@ -50,9 +45,7 @@ public class ServerListFragment extends CloudBrowserListFragment {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onListItemClick(ListView l, View v, int position, long id) {
|
public void onListItemClick(ListView l, View v, int position, long id) {
|
||||||
// TODO Auto-generated method stub
|
|
||||||
mCurCheckPosition = position;
|
mCurCheckPosition = position;
|
||||||
getListView().setItemChecked(position, true);
|
getListView().setItemChecked(position, true);
|
||||||
|
|
||||||
|
@ -60,7 +53,6 @@ public class ServerListFragment extends CloudBrowserListFragment {
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void showDetails(int position) {
|
protected void showDetails(int position) {
|
||||||
// TODO Auto-generated method stub
|
|
||||||
ServerDetailsFragment sdf = (ServerDetailsFragment) ((CloudBrowserActivity) getActivity()).getmServerDetailsFragment();
|
ServerDetailsFragment sdf = (ServerDetailsFragment) ((CloudBrowserActivity) getActivity()).getmServerDetailsFragment();
|
||||||
|
|
||||||
if (sdf == null || sdf.getShownIndex() != position)
|
if (sdf == null || sdf.getShownIndex() != position)
|
||||||
|
@ -73,9 +65,7 @@ public class ServerListFragment extends CloudBrowserListFragment {
|
||||||
((CloudBrowserActivity) getActivity()).showDetailsLayout();
|
((CloudBrowserActivity) getActivity()).showDetailsLayout();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onReceiveResult(int resultCode, Bundle resultData) {
|
public void onReceiveResult(int resultCode, Bundle resultData) {
|
||||||
// TODO Auto-generated method stub
|
|
||||||
if (resultCode == 200) {
|
if (resultCode == 200) {
|
||||||
String operation = resultData.getString(CloudControllerService.OPERATION);
|
String operation = resultData.getString(CloudControllerService.OPERATION);
|
||||||
|
|
||||||
|
@ -89,7 +79,6 @@ public class ServerListFragment extends CloudBrowserListFragment {
|
||||||
}
|
}
|
||||||
|
|
||||||
private void populateItems(GetServersResponse gsr) {
|
private void populateItems(GetServersResponse gsr) {
|
||||||
// TODO Auto-generated method stub
|
|
||||||
servers.clear();
|
servers.clear();
|
||||||
Iterator<ServerDetailsObject> it = gsr.getServers().iterator();
|
Iterator<ServerDetailsObject> it = gsr.getServers().iterator();
|
||||||
ServerDetailsObject item = null;
|
ServerDetailsObject item = null;
|
||||||
|
|
|
@ -16,7 +16,6 @@ public class TenantDetailsFragment extends Fragment {
|
||||||
private TextView tv;
|
private TextView tv;
|
||||||
|
|
||||||
public static TenantDetailsFragment newInstance(int position) {
|
public static TenantDetailsFragment newInstance(int position) {
|
||||||
// TODO Auto-generated method stub
|
|
||||||
TenantDetailsFragment f = new TenantDetailsFragment();
|
TenantDetailsFragment f = new TenantDetailsFragment();
|
||||||
|
|
||||||
Bundle args = new Bundle();
|
Bundle args = new Bundle();
|
||||||
|
@ -27,11 +26,9 @@ public class TenantDetailsFragment extends Fragment {
|
||||||
}
|
}
|
||||||
|
|
||||||
public int getShownIndex() {
|
public int getShownIndex() {
|
||||||
// TODO Auto-generated method stub
|
|
||||||
return getArguments().getInt("position", 0);
|
return getArguments().getInt("position", 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
|
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
|
||||||
scroller = new ScrollView(getActivity());
|
scroller = new ScrollView(getActivity());
|
||||||
tv = new TextView(getActivity());
|
tv = new TextView(getActivity());
|
||||||
|
|
|
@ -22,7 +22,6 @@ public class TenantListFragment extends CloudBrowserListFragment {
|
||||||
private ArrayAdapter<TenantModel> adapter;
|
private ArrayAdapter<TenantModel> adapter;
|
||||||
|
|
||||||
public void onActivityCreated(Bundle savedInstanceState) {
|
public void onActivityCreated(Bundle savedInstanceState) {
|
||||||
// TODO Auto-generated method stub
|
|
||||||
super.onActivityCreated(savedInstanceState);
|
super.onActivityCreated(savedInstanceState);
|
||||||
tenants = ((CloudBrowserActivity) getActivity()).getTenants();
|
tenants = ((CloudBrowserActivity) getActivity()).getTenants();
|
||||||
endpoint = ((OpenstackdroidApplication) (getActivity().getApplication())).getIdentityAdminEndpoint();
|
endpoint = ((OpenstackdroidApplication) (getActivity().getApplication())).getIdentityAdminEndpoint();
|
||||||
|
@ -44,9 +43,7 @@ public class TenantListFragment extends CloudBrowserListFragment {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onListItemClick(ListView l, View v, int position, long id) {
|
public void onListItemClick(ListView l, View v, int position, long id) {
|
||||||
// TODO Auto-generated method stub
|
|
||||||
mCurCheckPosition = position;
|
mCurCheckPosition = position;
|
||||||
getListView().setItemChecked(position, true);
|
getListView().setItemChecked(position, true);
|
||||||
|
|
||||||
|
@ -54,7 +51,6 @@ public class TenantListFragment extends CloudBrowserListFragment {
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void showDetails(int position) {
|
protected void showDetails(int position) {
|
||||||
// TODO Auto-generated method stub
|
|
||||||
TenantDetailsFragment tdf = (TenantDetailsFragment) ((CloudBrowserActivity) getActivity()).getmTenantDetailsFragment();
|
TenantDetailsFragment tdf = (TenantDetailsFragment) ((CloudBrowserActivity) getActivity()).getmTenantDetailsFragment();
|
||||||
|
|
||||||
if (tdf == null || tdf.getShownIndex() != position)
|
if (tdf == null || tdf.getShownIndex() != position)
|
||||||
|
@ -67,9 +63,7 @@ public class TenantListFragment extends CloudBrowserListFragment {
|
||||||
((CloudBrowserActivity) getActivity()).showDetailsLayout();
|
((CloudBrowserActivity) getActivity()).showDetailsLayout();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onReceiveResult(int resultCode, Bundle resultData) {
|
public void onReceiveResult(int resultCode, Bundle resultData) {
|
||||||
// TODO Auto-generated method stub
|
|
||||||
if (resultCode == 200) {
|
if (resultCode == 200) {
|
||||||
String operation = resultData.getString(CloudControllerService.OPERATION);
|
String operation = resultData.getString(CloudControllerService.OPERATION);
|
||||||
|
|
||||||
|
@ -83,7 +77,6 @@ public class TenantListFragment extends CloudBrowserListFragment {
|
||||||
}
|
}
|
||||||
|
|
||||||
private void populateItems(GetTenantsResponse gtr) {
|
private void populateItems(GetTenantsResponse gtr) {
|
||||||
// TODO Auto-generated method stub
|
|
||||||
tenants.clear();
|
tenants.clear();
|
||||||
Iterator<TenantDetailsObject> it = gtr.getTenants().iterator();
|
Iterator<TenantDetailsObject> it = gtr.getTenants().iterator();
|
||||||
TenantDetailsObject item = null;
|
TenantDetailsObject item = null;
|
||||||
|
|
|
@ -16,7 +16,6 @@ public class UserDetailsFragment extends Fragment {
|
||||||
private TextView tv;
|
private TextView tv;
|
||||||
|
|
||||||
public static UserDetailsFragment newInstance(int position) {
|
public static UserDetailsFragment newInstance(int position) {
|
||||||
// TODO Auto-generated method stub
|
|
||||||
UserDetailsFragment f = new UserDetailsFragment();
|
UserDetailsFragment f = new UserDetailsFragment();
|
||||||
|
|
||||||
Bundle args = new Bundle();
|
Bundle args = new Bundle();
|
||||||
|
@ -27,11 +26,9 @@ public class UserDetailsFragment extends Fragment {
|
||||||
}
|
}
|
||||||
|
|
||||||
public int getShownIndex() {
|
public int getShownIndex() {
|
||||||
// TODO Auto-generated method stub
|
|
||||||
return getArguments().getInt("position", 0);
|
return getArguments().getInt("position", 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
|
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
|
||||||
scroller = new ScrollView(getActivity());
|
scroller = new ScrollView(getActivity());
|
||||||
tv = new TextView(getActivity());
|
tv = new TextView(getActivity());
|
||||||
|
|
|
@ -22,7 +22,6 @@ public class UserListFragment extends CloudBrowserListFragment {
|
||||||
private ArrayAdapter<UserModel> adapter;
|
private ArrayAdapter<UserModel> adapter;
|
||||||
|
|
||||||
public void onActivityCreated(Bundle savedInstanceState) {
|
public void onActivityCreated(Bundle savedInstanceState) {
|
||||||
// TODO Auto-generated method stub
|
|
||||||
super.onActivityCreated(savedInstanceState);
|
super.onActivityCreated(savedInstanceState);
|
||||||
users = ((CloudBrowserActivity) getActivity()).getUsers();
|
users = ((CloudBrowserActivity) getActivity()).getUsers();
|
||||||
endpoint = ((OpenstackdroidApplication) (getActivity().getApplication())).getIdentityAdminEndpoint();
|
endpoint = ((OpenstackdroidApplication) (getActivity().getApplication())).getIdentityAdminEndpoint();
|
||||||
|
@ -44,9 +43,7 @@ public class UserListFragment extends CloudBrowserListFragment {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onListItemClick(ListView l, View v, int position, long id) {
|
public void onListItemClick(ListView l, View v, int position, long id) {
|
||||||
// TODO Auto-generated method stub
|
|
||||||
mCurCheckPosition = position;
|
mCurCheckPosition = position;
|
||||||
getListView().setItemChecked(position, true);
|
getListView().setItemChecked(position, true);
|
||||||
|
|
||||||
|
@ -54,7 +51,6 @@ public class UserListFragment extends CloudBrowserListFragment {
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void showDetails(int position) {
|
protected void showDetails(int position) {
|
||||||
// TODO Auto-generated method stub
|
|
||||||
UserDetailsFragment udf = (UserDetailsFragment) ((CloudBrowserActivity) getActivity()).getmUserDetailsFragment();
|
UserDetailsFragment udf = (UserDetailsFragment) ((CloudBrowserActivity) getActivity()).getmUserDetailsFragment();
|
||||||
|
|
||||||
if (udf == null || udf.getShownIndex() != position)
|
if (udf == null || udf.getShownIndex() != position)
|
||||||
|
@ -67,9 +63,7 @@ public class UserListFragment extends CloudBrowserListFragment {
|
||||||
((CloudBrowserActivity) getActivity()).showDetailsLayout();
|
((CloudBrowserActivity) getActivity()).showDetailsLayout();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onReceiveResult(int resultCode, Bundle resultData) {
|
public void onReceiveResult(int resultCode, Bundle resultData) {
|
||||||
// TODO Auto-generated method stub
|
|
||||||
if (resultCode == 200) {
|
if (resultCode == 200) {
|
||||||
String operation = resultData.getString(CloudControllerService.OPERATION);
|
String operation = resultData.getString(CloudControllerService.OPERATION);
|
||||||
|
|
||||||
|
@ -83,7 +77,6 @@ public class UserListFragment extends CloudBrowserListFragment {
|
||||||
}
|
}
|
||||||
|
|
||||||
private void populateItems(GetUsersResponse gur) {
|
private void populateItems(GetUsersResponse gur) {
|
||||||
// TODO Auto-generated method stub
|
|
||||||
users.clear();
|
users.clear();
|
||||||
Iterator<UserDetailsObject> it = gur.getUsers().iterator();
|
Iterator<UserDetailsObject> it = gur.getUsers().iterator();
|
||||||
UserDetailsObject item = null;
|
UserDetailsObject item = null;
|
||||||
|
|
|
@ -16,7 +16,6 @@ public class VolumeDetailsFragment extends Fragment {
|
||||||
private TextView tv;
|
private TextView tv;
|
||||||
|
|
||||||
public static VolumeDetailsFragment newInstance(int position) {
|
public static VolumeDetailsFragment newInstance(int position) {
|
||||||
// TODO Auto-generated method stub
|
|
||||||
VolumeDetailsFragment f = new VolumeDetailsFragment();
|
VolumeDetailsFragment f = new VolumeDetailsFragment();
|
||||||
|
|
||||||
Bundle args = new Bundle();
|
Bundle args = new Bundle();
|
||||||
|
@ -27,11 +26,9 @@ public class VolumeDetailsFragment extends Fragment {
|
||||||
}
|
}
|
||||||
|
|
||||||
public int getShownIndex() {
|
public int getShownIndex() {
|
||||||
// TODO Auto-generated method stub
|
|
||||||
return getArguments().getInt("position", 0);
|
return getArguments().getInt("position", 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
|
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
|
||||||
scroller = new ScrollView(getActivity());
|
scroller = new ScrollView(getActivity());
|
||||||
tv = new TextView(getActivity());
|
tv = new TextView(getActivity());
|
||||||
|
|
|
@ -1,34 +1,26 @@
|
||||||
package com.rcarrillocruz.android.openstackdroid;
|
package com.rcarrillocruz.android.openstackdroid;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
|
||||||
import java.util.Iterator;
|
import java.util.Iterator;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
|
import android.app.FragmentTransaction;
|
||||||
|
import android.content.Intent;
|
||||||
|
import android.net.Uri;
|
||||||
|
import android.os.Bundle;
|
||||||
|
import android.view.View;
|
||||||
|
import android.widget.ArrayAdapter;
|
||||||
|
import android.widget.ListView;
|
||||||
|
|
||||||
import com.google.gson.Gson;
|
import com.google.gson.Gson;
|
||||||
import com.rcarrillocruz.android.openstackdroid.json.volume.GetVolumesResponse;
|
import com.rcarrillocruz.android.openstackdroid.json.volume.GetVolumesResponse;
|
||||||
import com.rcarrillocruz.android.openstackdroid.json.volume.VolumeDetailsObject;
|
import com.rcarrillocruz.android.openstackdroid.json.volume.VolumeDetailsObject;
|
||||||
import com.rcarrillocruz.android.openstackdroid.model.VolumeModel;
|
import com.rcarrillocruz.android.openstackdroid.model.VolumeModel;
|
||||||
|
|
||||||
import android.app.FragmentTransaction;
|
|
||||||
import android.app.ListFragment;
|
|
||||||
import android.content.Intent;
|
|
||||||
import android.net.Uri;
|
|
||||||
import android.os.Bundle;
|
|
||||||
import android.view.LayoutInflater;
|
|
||||||
import android.view.View;
|
|
||||||
import android.view.ViewGroup;
|
|
||||||
import android.widget.ArrayAdapter;
|
|
||||||
import android.widget.FrameLayout;
|
|
||||||
import android.widget.LinearLayout;
|
|
||||||
import android.widget.ListView;
|
|
||||||
import android.widget.LinearLayout.LayoutParams;
|
|
||||||
|
|
||||||
public class VolumeListFragment extends CloudBrowserListFragment {
|
public class VolumeListFragment extends CloudBrowserListFragment {
|
||||||
List<VolumeModel> volumes;
|
List<VolumeModel> volumes;
|
||||||
private ArrayAdapter<VolumeModel> adapter;
|
private ArrayAdapter<VolumeModel> adapter;
|
||||||
|
|
||||||
public void onActivityCreated(Bundle savedInstanceState) {
|
public void onActivityCreated(Bundle savedInstanceState) {
|
||||||
// TODO Auto-generated method stub
|
|
||||||
super.onActivityCreated(savedInstanceState);
|
super.onActivityCreated(savedInstanceState);
|
||||||
volumes = ((CloudBrowserActivity) getActivity()).getVolumes();
|
volumes = ((CloudBrowserActivity) getActivity()).getVolumes();
|
||||||
endpoint = ((OpenstackdroidApplication) (getActivity().getApplication())).getVolumeEndpoint();
|
endpoint = ((OpenstackdroidApplication) (getActivity().getApplication())).getVolumeEndpoint();
|
||||||
|
@ -50,9 +42,7 @@ public class VolumeListFragment extends CloudBrowserListFragment {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onListItemClick(ListView l, View v, int position, long id) {
|
public void onListItemClick(ListView l, View v, int position, long id) {
|
||||||
// TODO Auto-generated method stub
|
|
||||||
mCurCheckPosition = position;
|
mCurCheckPosition = position;
|
||||||
getListView().setItemChecked(position, true);
|
getListView().setItemChecked(position, true);
|
||||||
|
|
||||||
|
@ -60,7 +50,6 @@ public class VolumeListFragment extends CloudBrowserListFragment {
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void showDetails(int position) {
|
protected void showDetails(int position) {
|
||||||
// TODO Auto-generated method stub
|
|
||||||
VolumeDetailsFragment sdf = (VolumeDetailsFragment) ((CloudBrowserActivity) getActivity()).getmVolumeDetailsFragment();
|
VolumeDetailsFragment sdf = (VolumeDetailsFragment) ((CloudBrowserActivity) getActivity()).getmVolumeDetailsFragment();
|
||||||
|
|
||||||
if (sdf == null || sdf.getShownIndex() != position)
|
if (sdf == null || sdf.getShownIndex() != position)
|
||||||
|
@ -73,9 +62,7 @@ public class VolumeListFragment extends CloudBrowserListFragment {
|
||||||
((CloudBrowserActivity) getActivity()).showDetailsLayout();
|
((CloudBrowserActivity) getActivity()).showDetailsLayout();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onReceiveResult(int resultCode, Bundle resultData) {
|
public void onReceiveResult(int resultCode, Bundle resultData) {
|
||||||
// TODO Auto-generated method stub
|
|
||||||
if (resultCode == 200) {
|
if (resultCode == 200) {
|
||||||
String operation = resultData.getString(CloudControllerService.OPERATION);
|
String operation = resultData.getString(CloudControllerService.OPERATION);
|
||||||
|
|
||||||
|
@ -89,7 +76,6 @@ public class VolumeListFragment extends CloudBrowserListFragment {
|
||||||
}
|
}
|
||||||
|
|
||||||
private void populateItems(GetVolumesResponse gsr) {
|
private void populateItems(GetVolumesResponse gsr) {
|
||||||
// TODO Auto-generated method stub
|
|
||||||
volumes.clear();
|
volumes.clear();
|
||||||
Iterator<VolumeDetailsObject> it = gsr.getVolumes().iterator();
|
Iterator<VolumeDetailsObject> it = gsr.getVolumes().iterator();
|
||||||
VolumeDetailsObject item = null;
|
VolumeDetailsObject item = null;
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
package com.rcarrillocruz.android.openstackdroid;
|
package com.rcarrillocruz.android.openstackdroid.db.connectionprofile;
|
||||||
|
|
||||||
public class ConnectionProfile {
|
public class ConnectionProfile {
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
package com.rcarrillocruz.android.openstackdroid;
|
package com.rcarrillocruz.android.openstackdroid.db.connectionprofile;
|
||||||
|
|
||||||
import android.content.ContentProvider;
|
import android.content.ContentProvider;
|
||||||
import android.content.ContentResolver;
|
import android.content.ContentResolver;
|
||||||
|
@ -28,9 +28,7 @@ public class ConnectionProfileContentProvider extends ContentProvider {
|
||||||
sURIMatcher.addURI(AUTHORITY, BASE_PATH + "/#", CONNECTION_PROFILE_ID);
|
sURIMatcher.addURI(AUTHORITY, BASE_PATH + "/#", CONNECTION_PROFILE_ID);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public int delete(Uri uri, String selection, String[] selectionArgs) {
|
public int delete(Uri uri, String selection, String[] selectionArgs) {
|
||||||
// TODO Auto-generated method stub
|
|
||||||
int uriType = sURIMatcher.match(uri);
|
int uriType = sURIMatcher.match(uri);
|
||||||
SQLiteDatabase sqlDB = database.getWritableDatabase();
|
SQLiteDatabase sqlDB = database.getWritableDatabase();
|
||||||
int rowsDeleted = 0;
|
int rowsDeleted = 0;
|
||||||
|
@ -59,15 +57,11 @@ public class ConnectionProfileContentProvider extends ContentProvider {
|
||||||
return rowsDeleted;
|
return rowsDeleted;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public String getType(Uri uri) {
|
public String getType(Uri uri) {
|
||||||
// TODO Auto-generated method stub
|
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public Uri insert(Uri uri, ContentValues values) {
|
public Uri insert(Uri uri, ContentValues values) {
|
||||||
// TODO Auto-generated method stub
|
|
||||||
int uriType = sURIMatcher.match(uri);
|
int uriType = sURIMatcher.match(uri);
|
||||||
SQLiteDatabase sqlDB = database.getWritableDatabase();
|
SQLiteDatabase sqlDB = database.getWritableDatabase();
|
||||||
long id = 0;
|
long id = 0;
|
||||||
|
@ -85,16 +79,12 @@ public class ConnectionProfileContentProvider extends ContentProvider {
|
||||||
return Uri.parse(BASE_PATH + "/" + id);
|
return Uri.parse(BASE_PATH + "/" + id);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean onCreate() {
|
public boolean onCreate() {
|
||||||
// TODO Auto-generated method stub
|
|
||||||
database = new ConnectionProfileDatabaseHelper(getContext());
|
database = new ConnectionProfileDatabaseHelper(getContext());
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public Cursor query(Uri uri, String[] projection, String selection, String[] selectionArgs, String sortOrder) {
|
public Cursor query(Uri uri, String[] projection, String selection, String[] selectionArgs, String sortOrder) {
|
||||||
// TODO Auto-generated method stub
|
|
||||||
SQLiteQueryBuilder queryBuilder = new SQLiteQueryBuilder();
|
SQLiteQueryBuilder queryBuilder = new SQLiteQueryBuilder();
|
||||||
queryBuilder.setTables(ConnectionProfileTable.TABLE_CONNECTION_PROFILE);
|
queryBuilder.setTables(ConnectionProfileTable.TABLE_CONNECTION_PROFILE);
|
||||||
int uriType = sURIMatcher.match(uri);
|
int uriType = sURIMatcher.match(uri);
|
||||||
|
@ -116,9 +106,7 @@ public class ConnectionProfileContentProvider extends ContentProvider {
|
||||||
return cursor;
|
return cursor;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public int update(Uri uri, ContentValues values, String selection, String[] selectionArgs) {
|
public int update(Uri uri, ContentValues values, String selection, String[] selectionArgs) {
|
||||||
// TODO Auto-generated method stub
|
|
||||||
int uriType = sURIMatcher.match(uri);
|
int uriType = sURIMatcher.match(uri);
|
||||||
SQLiteDatabase sqlDB = database.getWritableDatabase();
|
SQLiteDatabase sqlDB = database.getWritableDatabase();
|
||||||
int rowsUpdated = 0;
|
int rowsUpdated = 0;
|
||||||
|
|
|
@ -1,7 +1,6 @@
|
||||||
package com.rcarrillocruz.android.openstackdroid;
|
package com.rcarrillocruz.android.openstackdroid.db.connectionprofile;
|
||||||
|
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
import android.database.DatabaseErrorHandler;
|
|
||||||
import android.database.sqlite.SQLiteDatabase;
|
import android.database.sqlite.SQLiteDatabase;
|
||||||
import android.database.sqlite.SQLiteDatabase.CursorFactory;
|
import android.database.sqlite.SQLiteDatabase.CursorFactory;
|
||||||
import android.database.sqlite.SQLiteOpenHelper;
|
import android.database.sqlite.SQLiteOpenHelper;
|
||||||
|
@ -18,18 +17,13 @@ public class ConnectionProfileDatabaseHelper extends SQLiteOpenHelper {
|
||||||
public ConnectionProfileDatabaseHelper(Context context, String name,
|
public ConnectionProfileDatabaseHelper(Context context, String name,
|
||||||
CursorFactory factory, int version) {
|
CursorFactory factory, int version) {
|
||||||
super(context, name, factory, version);
|
super(context, name, factory, version);
|
||||||
// TODO Auto-generated constructor stub
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onCreate(SQLiteDatabase database) {
|
public void onCreate(SQLiteDatabase database) {
|
||||||
// TODO Auto-generated method stub
|
|
||||||
ConnectionProfileTable.onCreate(database);
|
ConnectionProfileTable.onCreate(database);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onUpgrade(SQLiteDatabase database, int oldVersion, int newVersion) {
|
public void onUpgrade(SQLiteDatabase database, int oldVersion, int newVersion) {
|
||||||
// TODO Auto-generated method stub
|
|
||||||
ConnectionProfileTable.onUpgrade(database, oldVersion, newVersion);
|
ConnectionProfileTable.onUpgrade(database, oldVersion, newVersion);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
package com.rcarrillocruz.android.openstackdroid;
|
package com.rcarrillocruz.android.openstackdroid.db.connectionprofile;
|
||||||
|
|
||||||
import android.database.sqlite.SQLiteDatabase;
|
import android.database.sqlite.SQLiteDatabase;
|
||||||
|
|
||||||
|
|
|
@ -22,7 +22,6 @@ public class FlavorDetailsObject {
|
||||||
|
|
||||||
public FlavorDetailsObject() {
|
public FlavorDetailsObject() {
|
||||||
super();
|
super();
|
||||||
// TODO Auto-generated constructor stub
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getId() {
|
public String getId() {
|
||||||
|
|
|
@ -6,7 +6,6 @@ public class FlavorLinkObject {
|
||||||
|
|
||||||
public FlavorLinkObject() {
|
public FlavorLinkObject() {
|
||||||
super();
|
super();
|
||||||
// TODO Auto-generated constructor stub
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getHref() {
|
public String getHref() {
|
||||||
|
|
|
@ -8,7 +8,6 @@ public class FlavorObject {
|
||||||
|
|
||||||
public FlavorObject() {
|
public FlavorObject() {
|
||||||
super();
|
super();
|
||||||
// TODO Auto-generated constructor stub
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getId() {
|
public String getId() {
|
||||||
|
|
|
@ -7,7 +7,6 @@ public class GetFlavorsResponse {
|
||||||
|
|
||||||
public GetFlavorsResponse() {
|
public GetFlavorsResponse() {
|
||||||
super();
|
super();
|
||||||
// TODO Auto-generated constructor stub
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public List<FlavorDetailsObject> getFlavors() {
|
public List<FlavorDetailsObject> getFlavors() {
|
||||||
|
|
|
@ -7,7 +7,6 @@ public class GetServersResponse {
|
||||||
|
|
||||||
public GetServersResponse() {
|
public GetServersResponse() {
|
||||||
super();
|
super();
|
||||||
// TODO Auto-generated constructor stub
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public List<ServerDetailsObject> getServers() {
|
public List<ServerDetailsObject> getServers() {
|
||||||
|
|
|
@ -6,7 +6,6 @@ public class IPAddressObject {
|
||||||
|
|
||||||
public IPAddressObject() {
|
public IPAddressObject() {
|
||||||
super();
|
super();
|
||||||
// TODO Auto-generated constructor stub
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getAddr() {
|
public String getAddr() {
|
||||||
|
|
|
@ -13,7 +13,6 @@ public class IPAddressesObject {
|
||||||
|
|
||||||
public IPAddressesObject() {
|
public IPAddressesObject() {
|
||||||
super();
|
super();
|
||||||
// TODO Auto-generated constructor stub
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public List<IPAddressObject> getPrivateAddresses() {
|
public List<IPAddressObject> getPrivateAddresses() {
|
||||||
|
|
|
@ -6,7 +6,6 @@ public class ImageLinkObject {
|
||||||
|
|
||||||
public ImageLinkObject() {
|
public ImageLinkObject() {
|
||||||
super();
|
super();
|
||||||
// TODO Auto-generated constructor stub
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getHref() {
|
public String getHref() {
|
||||||
|
|
|
@ -8,7 +8,6 @@ public class ImageObject {
|
||||||
|
|
||||||
public ImageObject() {
|
public ImageObject() {
|
||||||
super();
|
super();
|
||||||
// TODO Auto-generated constructor stub
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getId() {
|
public String getId() {
|
||||||
|
|
|
@ -6,7 +6,6 @@ public class LinkObject {
|
||||||
|
|
||||||
public LinkObject() {
|
public LinkObject() {
|
||||||
super();
|
super();
|
||||||
// TODO Auto-generated constructor stub
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getHref() {
|
public String getHref() {
|
||||||
|
|
|
@ -13,7 +13,6 @@ public class ServerDetailsObject {
|
||||||
|
|
||||||
public ServerDetailsObject() {
|
public ServerDetailsObject() {
|
||||||
super();
|
super();
|
||||||
// TODO Auto-generated constructor stub
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getId() {
|
public String getId() {
|
||||||
|
|
|
@ -6,7 +6,6 @@ public class ServerLinkObject {
|
||||||
|
|
||||||
public ServerLinkObject() {
|
public ServerLinkObject() {
|
||||||
super();
|
super();
|
||||||
// TODO Auto-generated constructor stub
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getHref() {
|
public String getHref() {
|
||||||
|
|
|
@ -10,7 +10,6 @@ public class AccessObject {
|
||||||
|
|
||||||
public AccessObject() {
|
public AccessObject() {
|
||||||
super();
|
super();
|
||||||
// TODO Auto-generated constructor stub
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public TokenObject getToken() {
|
public TokenObject getToken() {
|
||||||
|
|
|
@ -9,7 +9,6 @@ public class EndpointObject {
|
||||||
|
|
||||||
|
|
||||||
public EndpointObject() {
|
public EndpointObject() {
|
||||||
// TODO Auto-generated constructor stub
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getAdminURL() {
|
public String getAdminURL() {
|
||||||
|
|
|
@ -7,7 +7,6 @@ public class GetTenantsResponse {
|
||||||
|
|
||||||
public GetTenantsResponse() {
|
public GetTenantsResponse() {
|
||||||
super();
|
super();
|
||||||
// TODO Auto-generated constructor stub
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public List<TenantDetailsObject> getTenants() {
|
public List<TenantDetailsObject> getTenants() {
|
||||||
|
|
|
@ -6,7 +6,6 @@ public class GetTokenRequest {
|
||||||
|
|
||||||
public GetTokenRequest() {
|
public GetTokenRequest() {
|
||||||
super();
|
super();
|
||||||
// TODO Auto-generated constructor stub
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public GetTokenRequest(AuthObject auth) {
|
public GetTokenRequest(AuthObject auth) {
|
||||||
|
|
|
@ -5,7 +5,6 @@ public class GetTokenResponse {
|
||||||
|
|
||||||
public GetTokenResponse() {
|
public GetTokenResponse() {
|
||||||
super();
|
super();
|
||||||
// TODO Auto-generated constructor stub
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public AccessObject getAccess() {
|
public AccessObject getAccess() {
|
||||||
|
|
|
@ -15,6 +15,5 @@ public class GetUsersResponse {
|
||||||
|
|
||||||
public GetUsersResponse() {
|
public GetUsersResponse() {
|
||||||
super();
|
super();
|
||||||
// TODO Auto-generated constructor stub
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -7,7 +7,6 @@ public class MetadataObject {
|
||||||
private List<String> roles;
|
private List<String> roles;
|
||||||
|
|
||||||
public MetadataObject() {
|
public MetadataObject() {
|
||||||
// TODO Auto-generated constructor stub
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public int getIs_admin() {
|
public int getIs_admin() {
|
||||||
|
|
|
@ -4,7 +4,6 @@ public class RoleObject {
|
||||||
private String name;
|
private String name;
|
||||||
|
|
||||||
public RoleObject() {
|
public RoleObject() {
|
||||||
// TODO Auto-generated constructor stub
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getName() {
|
public String getName() {
|
||||||
|
|
|
@ -10,7 +10,6 @@ public class ServiceCatalogObject {
|
||||||
|
|
||||||
public ServiceCatalogObject() {
|
public ServiceCatalogObject() {
|
||||||
super();
|
super();
|
||||||
// TODO Auto-generated constructor stub
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public List<EndpointObject> getEndpoints() {
|
public List<EndpointObject> getEndpoints() {
|
||||||
|
|
|
@ -7,7 +7,6 @@ public class TenantObject {
|
||||||
private String description;
|
private String description;
|
||||||
|
|
||||||
public TenantObject() {
|
public TenantObject() {
|
||||||
// TODO Auto-generated constructor stub
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getId() {
|
public String getId() {
|
||||||
|
|
|
@ -8,7 +8,6 @@ public class TokenObject {
|
||||||
|
|
||||||
public TokenObject() {
|
public TokenObject() {
|
||||||
super();
|
super();
|
||||||
// TODO Auto-generated constructor stub
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getId() {
|
public String getId() {
|
||||||
|
|
|
@ -9,7 +9,6 @@ public class UserDetailsObject {
|
||||||
|
|
||||||
public UserDetailsObject() {
|
public UserDetailsObject() {
|
||||||
super();
|
super();
|
||||||
// TODO Auto-generated constructor stub
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getId() {
|
public String getId() {
|
||||||
|
|
|
@ -11,7 +11,6 @@ public class UserObject {
|
||||||
|
|
||||||
public UserObject() {
|
public UserObject() {
|
||||||
super();
|
super();
|
||||||
// TODO Auto-generated constructor stub
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getId() {
|
public String getId() {
|
||||||
|
|
|
@ -7,7 +7,6 @@ public class GetImagesResponse {
|
||||||
|
|
||||||
public GetImagesResponse() {
|
public GetImagesResponse() {
|
||||||
super();
|
super();
|
||||||
// TODO Auto-generated constructor stub
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public List<ImageDetailsObject> getImages() {
|
public List<ImageDetailsObject> getImages() {
|
||||||
|
|
|
@ -14,7 +14,6 @@ public class ImageDetailsObject {
|
||||||
|
|
||||||
public ImageDetailsObject() {
|
public ImageDetailsObject() {
|
||||||
super();
|
super();
|
||||||
// TODO Auto-generated constructor stub
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getChecksum() {
|
public String getChecksum() {
|
||||||
|
|
|
@ -7,7 +7,6 @@ public class GetVolumesResponse {
|
||||||
|
|
||||||
public GetVolumesResponse() {
|
public GetVolumesResponse() {
|
||||||
super();
|
super();
|
||||||
// TODO Auto-generated constructor stub
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public List<VolumeDetailsObject> getVolumes() {
|
public List<VolumeDetailsObject> getVolumes() {
|
||||||
|
|
|
@ -6,7 +6,6 @@ public class IPAddressModel {
|
||||||
|
|
||||||
public IPAddressModel() {
|
public IPAddressModel() {
|
||||||
super();
|
super();
|
||||||
// TODO Auto-generated constructor stub
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public IPAddressModel(String addr, int version) {
|
public IPAddressModel(String addr, int version) {
|
||||||
|
|
|
@ -14,7 +14,6 @@ public class ImageModel {
|
||||||
|
|
||||||
public ImageModel() {
|
public ImageModel() {
|
||||||
super();
|
super();
|
||||||
// TODO Auto-generated constructor stub
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public ImageModel(String id, String name, String status, String visibility,
|
public ImageModel(String id, String name, String status, String visibility,
|
||||||
|
|
|
@ -15,11 +15,9 @@ public class ServerModel {
|
||||||
|
|
||||||
public ServerModel() {
|
public ServerModel() {
|
||||||
super();
|
super();
|
||||||
// TODO Auto-generated constructor stub
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public ServerModel(String id, String name) {
|
public ServerModel(String id, String name) {
|
||||||
// TODO Auto-generated constructor stub
|
|
||||||
super();
|
super();
|
||||||
this.id = id;
|
this.id = id;
|
||||||
this.name = name;
|
this.name = name;
|
||||||
|
@ -119,7 +117,6 @@ public class ServerModel {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean equals(Object o) {
|
public boolean equals(Object o) {
|
||||||
// TODO Auto-generated method stub
|
|
||||||
return (this.getId().equals(((ServerModel)o).getId()));
|
return (this.getId().equals(((ServerModel)o).getId()));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -11,7 +11,6 @@ public class VolumeModel {
|
||||||
|
|
||||||
public VolumeModel() {
|
public VolumeModel() {
|
||||||
super();
|
super();
|
||||||
// TODO Auto-generated constructor stub
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public VolumeModel(String id, String name, String description,
|
public VolumeModel(String id, String name, String description,
|
||||||
|
|
|
@ -15,10 +15,8 @@ public class GetFlavorsOperation implements ApiOperation {
|
||||||
super();
|
super();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public HttpRequestBase invoke(Uri endpoint, String token, String tenantId,
|
public HttpRequestBase invoke(Uri endpoint, String token, String tenantId,
|
||||||
Bundle params) {
|
Bundle params) {
|
||||||
// TODO Auto-generated method stub
|
|
||||||
HttpGet httpGet = new HttpGet(endpoint.toString() + urlTail);
|
HttpGet httpGet = new HttpGet(endpoint.toString() + urlTail);
|
||||||
httpGet.setHeader("X-Auth-Token", token);
|
httpGet.setHeader("X-Auth-Token", token);
|
||||||
|
|
||||||
|
|
|
@ -15,10 +15,8 @@ public class GetServersOperation implements ApiOperation {
|
||||||
super();
|
super();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public HttpRequestBase invoke(Uri endpoint, String token, String tenantId,
|
public HttpRequestBase invoke(Uri endpoint, String token, String tenantId,
|
||||||
Bundle params) {
|
Bundle params) {
|
||||||
// TODO Auto-generated method stub
|
|
||||||
HttpGet httpGet = new HttpGet(endpoint.toString()+urlTail);
|
HttpGet httpGet = new HttpGet(endpoint.toString()+urlTail);
|
||||||
httpGet.setHeader("X-Auth-Token", token);
|
httpGet.setHeader("X-Auth-Token", token);
|
||||||
|
|
||||||
|
|
|
@ -16,10 +16,8 @@ public class GetTenantsOperation implements ApiOperation {
|
||||||
super();
|
super();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public HttpRequestBase invoke(Uri endpoint, String token, String tenantId,
|
public HttpRequestBase invoke(Uri endpoint, String token, String tenantId,
|
||||||
Bundle params) {
|
Bundle params) {
|
||||||
// TODO Auto-generated method stub
|
|
||||||
HttpGet httpGet = new HttpGet(endpoint.toString()+urlTail);
|
HttpGet httpGet = new HttpGet(endpoint.toString()+urlTail);
|
||||||
httpGet.setHeader("X-Auth-Token", token);
|
httpGet.setHeader("X-Auth-Token", token);
|
||||||
|
|
||||||
|
|
|
@ -8,6 +8,7 @@ import org.apache.http.entity.StringEntity;
|
||||||
|
|
||||||
import android.net.Uri;
|
import android.net.Uri;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
|
import android.util.Log;
|
||||||
|
|
||||||
import com.google.gson.Gson;
|
import com.google.gson.Gson;
|
||||||
import com.rcarrillocruz.android.openstackdroid.json.identity.AuthObject;
|
import com.rcarrillocruz.android.openstackdroid.json.identity.AuthObject;
|
||||||
|
@ -18,16 +19,15 @@ import com.rcarrillocruz.android.openstackdroid.operations.ApiOperation;
|
||||||
public class GetTokenOperation implements ApiOperation {
|
public class GetTokenOperation implements ApiOperation {
|
||||||
private Gson gson;
|
private Gson gson;
|
||||||
private static final String urlTail = "/v2.0/tokens";
|
private static final String urlTail = "/v2.0/tokens";
|
||||||
|
private static final String TAG = "com.rcarrillocruz.android.openstackdroid.operations.identity.GetTokenOperation";
|
||||||
|
|
||||||
public GetTokenOperation() {
|
public GetTokenOperation() {
|
||||||
super();
|
super();
|
||||||
gson = new Gson();
|
gson = new Gson();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public HttpRequestBase invoke(Uri endpoint, String token, String tenantId,
|
public HttpRequestBase invoke(Uri endpoint, String token, String tenantId,
|
||||||
Bundle params) {
|
Bundle params) {
|
||||||
// TODO Auto-generated method stub
|
|
||||||
HttpPost httpPost = new HttpPost(endpoint.toString()+urlTail);
|
HttpPost httpPost = new HttpPost(endpoint.toString()+urlTail);
|
||||||
httpPost.setHeader("Content-type", "application/json");
|
httpPost.setHeader("Content-type", "application/json");
|
||||||
|
|
||||||
|
@ -40,8 +40,7 @@ public class GetTokenOperation implements ApiOperation {
|
||||||
try {
|
try {
|
||||||
se = new StringEntity(gson.toJson(request));
|
se = new StringEntity(gson.toJson(request));
|
||||||
} catch (UnsupportedEncodingException e) {
|
} catch (UnsupportedEncodingException e) {
|
||||||
// TODO Auto-generated catch block
|
Log.e(TAG,Log.getStackTraceString(e));
|
||||||
e.printStackTrace();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
httpPost.setEntity(se);
|
httpPost.setEntity(se);
|
||||||
|
|
|
@ -15,10 +15,8 @@ public class GetUsersOperation implements ApiOperation {
|
||||||
super();
|
super();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public HttpRequestBase invoke(Uri endpoint, String token, String tenantId,
|
public HttpRequestBase invoke(Uri endpoint, String token, String tenantId,
|
||||||
Bundle params) {
|
Bundle params) {
|
||||||
// TODO Auto-generated method stub
|
|
||||||
HttpGet httpGet = new HttpGet(endpoint.toString()+urlTail);
|
HttpGet httpGet = new HttpGet(endpoint.toString()+urlTail);
|
||||||
httpGet.setHeader("X-Auth-Token", token);
|
httpGet.setHeader("X-Auth-Token", token);
|
||||||
|
|
||||||
|
|
|
@ -10,10 +10,8 @@ import android.os.Bundle;
|
||||||
|
|
||||||
public class GetImagesOperation implements ApiOperation {
|
public class GetImagesOperation implements ApiOperation {
|
||||||
private static final String urlTail = "/v2/images";
|
private static final String urlTail = "/v2/images";
|
||||||
@Override
|
|
||||||
public HttpRequestBase invoke(Uri endpoint, String token, String tenantId,
|
public HttpRequestBase invoke(Uri endpoint, String token, String tenantId,
|
||||||
Bundle params) {
|
Bundle params) {
|
||||||
// TODO Auto-generated method stub
|
|
||||||
HttpGet httpGet = new HttpGet(endpoint.toString()+urlTail);
|
HttpGet httpGet = new HttpGet(endpoint.toString()+urlTail);
|
||||||
httpGet.setHeader("X-Auth-Token", token);
|
httpGet.setHeader("X-Auth-Token", token);
|
||||||
|
|
||||||
|
|
|
@ -16,10 +16,8 @@ public class GetVolumesOperation implements ApiOperation {
|
||||||
super();
|
super();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public HttpRequestBase invoke(Uri endpoint, String token, String tenantId,
|
public HttpRequestBase invoke(Uri endpoint, String token, String tenantId,
|
||||||
Bundle params) {
|
Bundle params) {
|
||||||
// TODO Auto-generated method stub
|
|
||||||
HttpGet httpGet = new HttpGet(endpoint.toString()+urlTail);
|
HttpGet httpGet = new HttpGet(endpoint.toString()+urlTail);
|
||||||
httpGet.setHeader("X-Auth-Token", token);
|
httpGet.setHeader("X-Auth-Token", token);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue