Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,9 @@
*/
package com.microsoft.azure.management.resources.fluentcore.arm.collection.implementation;

import com.microsoft.azure.Page;
import com.microsoft.azure.PagedList;
import com.microsoft.azure.management.resources.fluentcore.utils.PagedListConverter;
import com.microsoft.azure.management.resources.implementation.PageImpl;
import com.microsoft.azure.management.resources.fluentcore.utils.Utils;

import java.util.List;

Expand Down Expand Up @@ -42,16 +41,8 @@ protected PagedList<T> wrapList(PagedList<InnerT> pagedList) {
}

protected PagedList<T> wrapList(List<InnerT> list) {
PageImpl<InnerT> page = new PageImpl<>();
page.setItems(list);
page.setNextPageLink(null);
PagedList<InnerT> pagedList = new PagedList<InnerT>(page) {
@Override
public Page<InnerT> nextPage(String nextPageLink) {
return null;
}
};

return converter.convert(pagedList);
return converter.convert(Utils.convertToPagedList(list));
}


}
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,12 @@

package com.microsoft.azure.management.resources.fluentcore.utils;

import com.microsoft.azure.Page;
import com.microsoft.azure.PagedList;
import com.microsoft.azure.management.resources.implementation.PageImpl;

import java.util.List;

/**
* Defines a few utilities.
*/
Expand Down Expand Up @@ -40,6 +46,23 @@ public static String createOdataFilterForTags(String tagName, String tagValue) {
}
}

/**
* Converts the List to PagedList.
* @param list list to be converted in to paged list
* @param <InnerT> the wrapper inner type
* @return the Paged list for the inner type.
*/
public static <InnerT> PagedList<InnerT> convertToPagedList(List<InnerT> list) {
PageImpl<InnerT> page = new PageImpl<>();
page.setItems(list);
page.setNextPageLink(null);
return new PagedList<InnerT>(page) {
@Override
public Page<InnerT> nextPage(String nextPageLink) {
return null;
}
};
}
private Utils() {
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
/**
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for
* license information.
*/

package com.microsoft.azure.management.sql;

import com.microsoft.azure.management.apigeneration.Fluent;
import com.microsoft.azure.management.resources.fluentcore.model.Wrapper;
import com.microsoft.azure.management.sql.implementation.DatabaseMetricInner;
import org.joda.time.DateTime;


/**
* An immutable client-side representation of an Azure SQL DatabaseMetric.
*/
@Fluent
public interface DatabaseMetric extends
Wrapper<DatabaseMetricInner> {

/**
* @return the name of the resource
*/
String resourceName();

/**
* @return the metric display name
*/
String displayName();

/**
* @return the current value of the metric
*/
double currentValue();

/**
* @return the current limit of the metric
*/
double limit();

/**
* @return the units of the metric
*/
String unit();

/**
* @return the next reset time for the metric (ISO8601 format)
*/
DateTime nextResetTime();
}

Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
/**
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for
* license information.
*/

package com.microsoft.azure.management.sql;

import com.microsoft.azure.management.apigeneration.Fluent;
import com.microsoft.azure.management.resources.fluentcore.arm.models.HasId;
import com.microsoft.azure.management.resources.fluentcore.arm.models.HasName;
import com.microsoft.azure.management.resources.fluentcore.arm.models.HasResourceGroup;
import com.microsoft.azure.management.resources.fluentcore.model.Refreshable;
import com.microsoft.azure.management.resources.fluentcore.model.Wrapper;
import com.microsoft.azure.management.sql.implementation.ReplicationLinkInner;
import org.joda.time.DateTime;


/**
* An immutable client-side representation of an Azure SQL Replication link.
*/
@Fluent
public interface ReplicationLink extends
Refreshable<ReplicationLink>,
Wrapper<ReplicationLinkInner>,
HasResourceGroup,
HasName,
HasId {

/**
* @return name of the SQL Server to which this replication belongs
*/
String sqlServerName();

/**
* @return name of the SQL Database to which this replication belongs
*/
String databaseName();

/**
* @return the name of the Azure SQL Server hosting the partner Azure SQL Database.
*/
String partnerServer();

/**
* @return the name of the partner Azure SQL Database
*/
String partnerDatabase();

/**
* @return the Azure Region of the partner Azure SQL Database
*/
String partnerLocation();

/**
* @return the role of the SQL Database in the replication link
*/
ReplicationRole role();

/**
* @return the role of the partner SQL Database in the replication link
*/
ReplicationRole partnerRole();

/**
* @return start time for the replication link (ISO8601 format)
*/
DateTime startTime();

/**
* @return the percentage of the seeding completed for the replication link
*/
int percentComplete();

/**
* @return the replication state for the replication link
*/
ReplicationState replicationState();

}

Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
/**
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for
* license information.
*/

package com.microsoft.azure.management.sql;

import com.microsoft.azure.management.apigeneration.Fluent;
import com.microsoft.azure.management.resources.fluentcore.arm.models.HasId;
import com.microsoft.azure.management.resources.fluentcore.arm.models.HasName;
import com.microsoft.azure.management.resources.fluentcore.arm.models.HasResourceGroup;
import com.microsoft.azure.management.resources.fluentcore.model.Wrapper;
import com.microsoft.azure.management.sql.implementation.RestorePointInner;
import org.joda.time.DateTime;


/**
* An immutable client-side representation of an Azure SQL database's Restore Point.
*/
@Fluent
public interface RestorePoint extends
Wrapper<RestorePointInner>,
HasResourceGroup,
HasName,
HasId {
/**
* @return name of the SQL Server to which this replication belongs
*/
String sqlServerName();

/**
* @return name of the SQL Database to which this replication belongs
*/
String databaseName();

/**
* @return the restore point type of the Azure SQL Database restore point.
*/
RestorePointTypes restorePointType();

/**
* @return restore point creation time (ISO8601 format). Populated when
* restorePointType = CONTINUOUS. Null otherwise.
*/
DateTime restorePointCreationDate();

/**
* @return earliest restore time (ISO8601 format). Populated when restorePointType
* = DISCRETE. Null otherwise.
*/
DateTime earliestRestoreDate();
}

Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
/**
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for
* license information.
*/

package com.microsoft.azure.management.sql;

import com.microsoft.azure.management.apigeneration.Fluent;
import com.microsoft.azure.management.resources.fluentcore.model.Wrapper;
import com.microsoft.azure.management.sql.implementation.ServerMetricInner;
import org.joda.time.DateTime;


/**
* An immutable client-side representation of an Azure SQL ServerMetric.
*/
@Fluent
public interface ServerMetric extends
Wrapper<ServerMetricInner> {

/**
* @return the name of the resource
*/
String resourceName();

/**
* @return the metric display name
*/
String displayName();

/**
* @return the current value of the metric
*/
double currentValue();

/**
* @return the current limit of the metric
*/
double limit();

/**
* @return the units of the metric
*/
String unit();

/**
* @return the next reset time for the metric (ISO8601 format)
*/
DateTime nextResetTime();
}

Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
/**
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for
* license information.
*/

package com.microsoft.azure.management.sql;

import com.microsoft.azure.management.apigeneration.Fluent;
import com.microsoft.azure.management.resources.fluentcore.model.Wrapper;
import com.microsoft.azure.management.sql.implementation.ServerUpgradeGetResultInner;
import org.joda.time.DateTime;


/**
* An immutable client-side representation of an Azure SQL upgrade result.
*/
@Fluent
public interface ServerUpgradeResult extends
Wrapper<ServerUpgradeGetResultInner> {
/**
* @return the status of the Azure SQL Server Upgrade
*/
String status();

/**
* @return the schedule time of the Azure SQL Server Upgrade (ISO8601 format).
*/
DateTime scheduleUpgradeAfterTime();
}

Loading