You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ignite.apache.org by ak...@apache.org on 2015/11/12 09:03:59 UTC
[04/28] ignite git commit: IGNITE-1845: Adopted new binary API in
.Net.
http://git-wip-us.apache.org/repos/asf/ignite/blob/894057e5/modules/platforms/dotnet/examples/Apache.Ignite.ExamplesDll/Portable/Employee.cs
----------------------------------------------------------------------
diff --git a/modules/platforms/dotnet/examples/Apache.Ignite.ExamplesDll/Portable/Employee.cs b/modules/platforms/dotnet/examples/Apache.Ignite.ExamplesDll/Portable/Employee.cs
deleted file mode 100644
index 7f4388d..0000000
--- a/modules/platforms/dotnet/examples/Apache.Ignite.ExamplesDll/Portable/Employee.cs
+++ /dev/null
@@ -1,93 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-using System;
-using System.Collections.Generic;
-using System.Linq;
-
-namespace Apache.Ignite.ExamplesDll.Portable
-{
- /// <summary>
- /// Employee.
- /// </summary>
- [Serializable]
- public class Employee
- {
- /// <summary>
- /// Constructor.
- /// </summary>
- /// <param name="name">Name.</param>
- /// <param name="salary">Salary.</param>
- /// <param name="address">Address.</param>
- /// <param name="departments">Departments.</param>
- public Employee(string name, long salary, Address address, ICollection<string> departments)
- {
- Name = name;
- Salary = salary;
- Address = address;
- Departments = departments;
- }
-
- /// <summary>
- /// Name.
- /// </summary>
- public string Name { get; set; }
-
- /// <summary>
- /// Salary.
- /// </summary>
- public long Salary { get; set; }
-
- /// <summary>
- /// Address.
- /// </summary>
- public Address Address { get; set; }
-
- /// <summary>
- /// Departments.
- /// </summary>
- public ICollection<string> Departments { get; set; }
-
- /// <summary>
- /// Returns a string that represents the current object.
- /// </summary>
- /// <returns>
- /// A string that represents the current object.
- /// </returns>
- override public string ToString()
- {
- return string.Format("{0} [name={1}, salary={2}, address={3}, departments={4}]", typeof(Employee).Name,
- Name, Salary, Address, CollectionToString(Departments));
- }
-
- /// <summary>
- /// Get string representation of collection.
- /// </summary>
- /// <returns></returns>
- private static string CollectionToString<T>(ICollection<T> col)
- {
- if (col == null)
- return "null";
-
- var elements = col.Any()
- ? col.Select(x => x.ToString()).Aggregate((x, y) => x + ", " + y)
- : string.Empty;
-
- return string.Format("[{0}]", elements);
- }
- }
-}
http://git-wip-us.apache.org/repos/asf/ignite/blob/894057e5/modules/platforms/dotnet/examples/Apache.Ignite.ExamplesDll/Portable/EmployeeKey.cs
----------------------------------------------------------------------
diff --git a/modules/platforms/dotnet/examples/Apache.Ignite.ExamplesDll/Portable/EmployeeKey.cs b/modules/platforms/dotnet/examples/Apache.Ignite.ExamplesDll/Portable/EmployeeKey.cs
deleted file mode 100644
index 2267154..0000000
--- a/modules/platforms/dotnet/examples/Apache.Ignite.ExamplesDll/Portable/EmployeeKey.cs
+++ /dev/null
@@ -1,86 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-using System;
-
-namespace Apache.Ignite.ExamplesDll.Portable
-{
- /// <summary>
- /// Employee key. Used in query example to co-locate employees with their organizations.
- /// </summary>
- [Serializable]
- public class EmployeeKey
- {
- /// <summary>
- /// Constructor.
- /// </summary>
- /// <param name="id">ID.</param>
- /// <param name="orgId">Organization ID.</param>
- public EmployeeKey(int id, int orgId)
- {
- Id = id;
- OrganizationId = orgId;
- }
-
- /// <summary>
- /// ID.
- /// </summary>
- public int Id { get; private set; }
-
- /// <summary>
- /// Organization ID.
- /// </summary>
- public int OrganizationId { get; private set; }
-
- /// <summary>
- /// Determines whether the specified <see cref="T:System.Object"/> is equal to the current <see cref="T:System.Object"/>.
- /// </summary>
- /// <returns>
- /// true if the specified <see cref="T:System.Object"/> is equal to the current <see cref="T:System.Object"/>; otherwise, false.
- /// </returns>
- /// <param name="obj">The object to compare with the current object. </param><filterpriority>2</filterpriority>
- public override bool Equals(object obj)
- {
- EmployeeKey other = obj as EmployeeKey;
-
- return other != null && Id == other.Id && OrganizationId == other.OrganizationId;
- }
-
- /// <summary>
- /// Serves as a hash function for a particular type.
- /// </summary>
- /// <returns>
- /// A hash code for the current <see cref="T:System.Object"/>.
- /// </returns>
- /// <filterpriority>2</filterpriority>
- public override int GetHashCode()
- {
- return 31 * Id + OrganizationId;
- }
-
- /// <summary>
- /// Returns a string that represents the current object.
- /// </summary>
- /// <returns>
- /// A string that represents the current object.
- /// </returns>
- public override string ToString()
- {
- return string.Format("{0} [id={1}, organizationId={2}]", typeof (EmployeeKey).Name, Id, OrganizationId);
- }
- }
-}
http://git-wip-us.apache.org/repos/asf/ignite/blob/894057e5/modules/platforms/dotnet/examples/Apache.Ignite.ExamplesDll/Portable/Organization.cs
----------------------------------------------------------------------
diff --git a/modules/platforms/dotnet/examples/Apache.Ignite.ExamplesDll/Portable/Organization.cs b/modules/platforms/dotnet/examples/Apache.Ignite.ExamplesDll/Portable/Organization.cs
deleted file mode 100644
index e23c3c1..0000000
--- a/modules/platforms/dotnet/examples/Apache.Ignite.ExamplesDll/Portable/Organization.cs
+++ /dev/null
@@ -1,84 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-using System;
-
-namespace Apache.Ignite.ExamplesDll.Portable
-{
- /// <summary>
- /// Organization.
- /// </summary>
- [Serializable]
- public class Organization
- {
- /// <summary>
- /// Default constructor.
- /// </summary>
- public Organization()
- {
- // No-op.
- }
-
- /// <summary>
- /// Constructor.
- /// </summary>
- /// <param name="name">Name.</param>
- /// <param name="address">Address.</param>
- /// <param name="type">Type.</param>
- /// <param name="lastUpdated">Last update time.</param>
- public Organization(string name, Address address, OrganizationType type, DateTime lastUpdated)
- {
- Name = name;
- Address = address;
- Type = type;
- LastUpdated = lastUpdated;
- }
-
- /// <summary>
- /// Name.
- /// </summary>
- public string Name { get; set; }
-
- /// <summary>
- /// Address.
- /// </summary>
- public Address Address { get; set; }
-
- /// <summary>
- /// Type.
- /// </summary>
- public OrganizationType Type { get; set; }
-
- /// <summary>
- /// Last update time.
- /// </summary>
- public DateTime LastUpdated { get; set; }
-
- /// <summary>
- /// Returns a string that represents the current object.
- /// </summary>
- /// <returns>
- /// A string that represents the current object.
- /// </returns>
- /// <filterpriority>2</filterpriority>
- public override string ToString()
- {
- return string.Format("{0} [name={1}, address={2}, type={3}, lastUpdated={4}]", typeof (Organization).Name,
- Name, Address, Type, LastUpdated);
- }
- }
-}
http://git-wip-us.apache.org/repos/asf/ignite/blob/894057e5/modules/platforms/dotnet/examples/Apache.Ignite.ExamplesDll/Portable/OrganizationType.cs
----------------------------------------------------------------------
diff --git a/modules/platforms/dotnet/examples/Apache.Ignite.ExamplesDll/Portable/OrganizationType.cs b/modules/platforms/dotnet/examples/Apache.Ignite.ExamplesDll/Portable/OrganizationType.cs
deleted file mode 100644
index 198edb1..0000000
--- a/modules/platforms/dotnet/examples/Apache.Ignite.ExamplesDll/Portable/OrganizationType.cs
+++ /dev/null
@@ -1,43 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-using System;
-
-namespace Apache.Ignite.ExamplesDll.Portable
-{
- /// <summary>
- /// Organization type.
- /// </summary>
- [Serializable]
- public enum OrganizationType
- {
- /// <summary>
- /// Non-profit organization.
- /// </summary>
- NonProfit,
-
- /// <summary>
- /// Private organization.
- /// </summary>
- Private,
-
- /// <summary>
- /// Government organization.
- /// </summary>
- Government
- }
-}
http://git-wip-us.apache.org/repos/asf/ignite/blob/894057e5/modules/platforms/dotnet/examples/Config/example-cache-query.xml
----------------------------------------------------------------------
diff --git a/modules/platforms/dotnet/examples/Config/example-cache-query.xml b/modules/platforms/dotnet/examples/Config/example-cache-query.xml
index c9ea7e1..7755645 100644
--- a/modules/platforms/dotnet/examples/Config/example-cache-query.xml
+++ b/modules/platforms/dotnet/examples/Config/example-cache-query.xml
@@ -29,8 +29,8 @@
<property name="platformConfiguration">
<bean class="org.apache.ignite.platform.dotnet.PlatformDotNetConfiguration">
- <property name="portableConfiguration">
- <bean class="org.apache.ignite.platform.dotnet.PlatformDotNetPortableConfiguration">
+ <property name="binaryConfiguration">
+ <bean class="org.apache.ignite.platform.dotnet.PlatformDotNetBinaryConfiguration">
<property name="types">
<list>
<value>Apache.Ignite.Examples.Dll.Portable.Account</value>
http://git-wip-us.apache.org/repos/asf/ignite/blob/894057e5/modules/platforms/dotnet/examples/Config/example-cache.xml
----------------------------------------------------------------------
diff --git a/modules/platforms/dotnet/examples/Config/example-cache.xml b/modules/platforms/dotnet/examples/Config/example-cache.xml
index e6b44d6..d31938a 100644
--- a/modules/platforms/dotnet/examples/Config/example-cache.xml
+++ b/modules/platforms/dotnet/examples/Config/example-cache.xml
@@ -28,8 +28,8 @@
<bean id="grid.cfg" class="org.apache.ignite.configuration.IgniteConfiguration">
<property name="platformConfiguration">
<bean class="org.apache.ignite.platform.dotnet.PlatformDotNetConfiguration">
- <property name="portableConfiguration">
- <bean class="org.apache.ignite.platform.dotnet.PlatformDotNetPortableConfiguration">
+ <property name="binaryConfiguration">
+ <bean class="org.apache.ignite.platform.dotnet.PlatformDotNetBinaryConfiguration">
<property name="types">
<list>
<value>Apache.Ignite.Examples.Dll.Portable.Account</value>