-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixed #5. Finished datastore service.
- Loading branch information
1 parent
ccc5ebc
commit 601f56b
Showing
27 changed files
with
911 additions
and
35 deletions.
There are no files selected for viewing
20 changes: 20 additions & 0 deletions
20
src/GeoTools.GeoServer.Abstractions/Models/Catalog/ConnectionParameter.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
using System.Text.Json.Serialization; | ||
|
||
namespace GeoTools.GeoServer.Models.Catalog | ||
{ | ||
public class ConnectionParameter | ||
{ | ||
[JsonPropertyName("@key")] | ||
public string Key { get; } | ||
|
||
[JsonPropertyName("$")] | ||
public string Value { get; } | ||
|
||
[JsonConstructor] | ||
public ConnectionParameter(string key, string value) | ||
{ | ||
Key = key; | ||
Value = value; | ||
} | ||
} | ||
} |
17 changes: 17 additions & 0 deletions
17
src/GeoTools.GeoServer.Abstractions/Models/Catalog/ConnectionParameters.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
using System.Collections.Generic; | ||
using System.Text.Json.Serialization; | ||
|
||
namespace GeoTools.GeoServer.Models.Catalog | ||
{ | ||
public class ConnectionParameters | ||
{ | ||
[JsonPropertyName("entry")] | ||
public IList<ConnectionParameter> ConnectionParameterList { get; } | ||
|
||
[JsonConstructor] | ||
public ConnectionParameters(IList<ConnectionParameter> connectionParameters) | ||
{ | ||
ConnectionParameterList = connectionParameters; | ||
} | ||
} | ||
} |
2 changes: 1 addition & 1 deletion
2
src/GeoTools.GeoServer.Abstractions/Models/CatalogResponses/NamedLink.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
45 changes: 45 additions & 0 deletions
45
src/GeoTools.GeoServer.Abstractions/Models/Datastore/DataStoreInfo.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
using GeoTools.GeoServer.Models.Catalog; | ||
using System.Text.Json.Serialization; | ||
|
||
namespace GeoTools.GeoServer.Models.Datastore | ||
{ | ||
/// <summary> | ||
/// Datastore. | ||
/// </summary> | ||
public class DataStoreInfo | ||
{ | ||
/// <summary> | ||
/// Name of data store. | ||
/// </summary> | ||
[JsonPropertyName("name")] | ||
public string Name { get; } | ||
|
||
/// <summary> | ||
/// Description of data store. | ||
/// </summary> | ||
[JsonPropertyName("description")] | ||
public string Description { get; } | ||
|
||
/// <summary> | ||
/// Whether or not the data store is enabled. | ||
/// </summary> | ||
[JsonPropertyName("enabled")] | ||
public bool Enabled { get; } = true; | ||
|
||
[JsonPropertyName("connectionParameters")] | ||
public ConnectionParameters ConnectionParameters { get; } | ||
|
||
[JsonPropertyName("disableOnConnFailure")] | ||
public bool DisableOnConnFailure { get; } | ||
|
||
[JsonConstructor] | ||
public DataStoreInfo(string name, string description, bool enabled, ConnectionParameters connectionParameters, bool disableOnConnFailure) | ||
{ | ||
Name = name; | ||
Description = description; | ||
Enabled = enabled; | ||
ConnectionParameters = connectionParameters; | ||
DisableOnConnFailure = disableOnConnFailure; | ||
} | ||
} | ||
} |
59 changes: 59 additions & 0 deletions
59
src/GeoTools.GeoServer.Abstractions/Models/Datastore/DataStoreSummary.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
using GeoTools.GeoServer.Models.Catalog; | ||
using GeoTools.GeoServer.Models.CatalogResponses; | ||
using System; | ||
using System.Text.Json.Serialization; | ||
|
||
namespace GeoTools.GeoServer.Models.Datastore | ||
{ | ||
/// <summary> | ||
/// Datastore. | ||
/// </summary> | ||
public class DataStoreSummary | ||
{ | ||
/// <summary> | ||
/// Name of data store. | ||
/// </summary> | ||
[JsonPropertyName("name")] | ||
public string Name { get; } | ||
|
||
/// <summary> | ||
/// Description of data store. | ||
/// </summary> | ||
[JsonPropertyName("description")] | ||
public string Description { get; } | ||
|
||
/// <summary> | ||
/// Whether or not the data store is enabled. | ||
/// </summary> | ||
[JsonPropertyName("enabled")] | ||
public bool Enabled { get; } = true; | ||
|
||
[JsonPropertyName("connectionParameters")] | ||
public ConnectionParameters ConnectionParameters { get; } | ||
|
||
[JsonPropertyName("workspace")] | ||
public NamedLink Workspace { get; } | ||
|
||
[JsonPropertyName("_default")] | ||
public bool Default { get; } | ||
|
||
[JsonPropertyName("disableOnConnFailure")] | ||
public bool DisableOnConnFailure { get; } | ||
|
||
[JsonPropertyName("featureTypes")] | ||
public Uri FeatureTypes { get; } | ||
|
||
[JsonConstructor] | ||
public DataStoreSummary(string name, string description, bool enabled, ConnectionParameters connectionParameters, NamedLink workspace, bool @default, bool disableOnConnFailure, Uri featureTypes) | ||
{ | ||
Name = name; | ||
Description = description; | ||
Enabled = enabled; | ||
ConnectionParameters = connectionParameters; | ||
Workspace = workspace; | ||
Default = @default; | ||
DisableOnConnFailure = disableOnConnFailure; | ||
FeatureTypes = featureTypes; | ||
} | ||
} | ||
} |
23 changes: 23 additions & 0 deletions
23
...GeoTools.GeoServer.Abstractions/Models/Datastore/Sources/ShapefileConnectionParameters.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
using GeoTools.GeoServer.Models.Catalog; | ||
using System; | ||
using System.Collections.Generic; | ||
|
||
namespace GeoTools.GeoServer.Models.Datastore.Sources | ||
{ | ||
public class ShapefileConnectionParameters : ConnectionParameters | ||
{ | ||
public ShapefileConnectionParameters(Uri shapefilePath, Uri @namespace) : base(CreateConnectionParameters(shapefilePath, @namespace)) | ||
{ | ||
|
||
} | ||
|
||
private static IList<ConnectionParameter> CreateConnectionParameters(Uri shapefilePath, Uri @namespace) | ||
{ | ||
return new List<ConnectionParameter> | ||
{ | ||
new ConnectionParameter("namespace", @namespace.ToString()), | ||
new ConnectionParameter("url", shapefilePath.ToString()), | ||
}; | ||
} | ||
} | ||
} |
2 changes: 1 addition & 1 deletion
2
src/GeoTools.GeoServer.Abstractions/Models/Workspace/WorkspaceInfo.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
5 changes: 3 additions & 2 deletions
5
src/GeoTools.GeoServer.Abstractions/Models/Workspace/WorkspaceResponseWrapper.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.