http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/dff026be/modules/core/src/main/java/org/apache/ignite/internal/util/IgniteUtils.java ---------------------------------------------------------------------- diff --git a/modules/core/src/main/java/org/apache/ignite/internal/util/IgniteUtils.java b/modules/core/src/main/java/org/apache/ignite/internal/util/IgniteUtils.java index 171e0f1..7a68627 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/util/IgniteUtils.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/util/IgniteUtils.java @@ -40,7 +40,6 @@ import org.apache.ignite.internal.util.typedef.internal.*; import org.apache.ignite.internal.util.worker.*; import org.apache.ignite.lang.*; import org.apache.ignite.lifecycle.*; -import org.apache.ignite.portables.*; import org.apache.ignite.spi.*; import org.apache.ignite.spi.discovery.*; import org.apache.ignite.transactions.*; @@ -283,9 +282,6 @@ public abstract class IgniteUtils { public static final String MAC_INVALID_ARG_MSG = "On MAC OS you may have too many file descriptors open " + "(simple restart usually solves the issue)"; - /** Portable classes. */ - private static final Collection<Class<?>> PORTABLE_CLS = new HashSet<>(); - /** Ignite Logging Directory. */ public static final String IGNITE_LOG_DIR = System.getenv(IgniteSystemProperties.IGNITE_LOG_DIR); @@ -519,31 +515,6 @@ public abstract class IgniteUtils { } } - PORTABLE_CLS.add(Byte.class); - PORTABLE_CLS.add(Short.class); - PORTABLE_CLS.add(Integer.class); - PORTABLE_CLS.add(Long.class); - PORTABLE_CLS.add(Float.class); - PORTABLE_CLS.add(Double.class); - PORTABLE_CLS.add(Character.class); - PORTABLE_CLS.add(Boolean.class); - PORTABLE_CLS.add(String.class); - PORTABLE_CLS.add(UUID.class); - PORTABLE_CLS.add(Date.class); - PORTABLE_CLS.add(Timestamp.class); - PORTABLE_CLS.add(byte[].class); - PORTABLE_CLS.add(short[].class); - PORTABLE_CLS.add(int[].class); - PORTABLE_CLS.add(long[].class); - PORTABLE_CLS.add(float[].class); - PORTABLE_CLS.add(double[].class); - PORTABLE_CLS.add(char[].class); - PORTABLE_CLS.add(boolean[].class); - PORTABLE_CLS.add(String[].class); - PORTABLE_CLS.add(UUID[].class); - PORTABLE_CLS.add(Date[].class); - PORTABLE_CLS.add(Timestamp[].class); - exceptionConverters = Collections.unmodifiableMap(exceptionConverters()); } @@ -7215,19 +7186,6 @@ public abstract class IgniteUtils { } /** - * Gets portable enabled flag from the given node for the given cache name. - * - * @param n Node. - * @param cacheName Cache name. - * @return Portable enabled flag. - */ - @Nullable public static Boolean portableEnabled(ClusterNode n, @Nullable String cacheName) { - GridCacheAttributes attrs = cacheAttributes(n, cacheName); - - return attrs == null ? false : attrs.portableEnabled(); - } - - /** * Gets view on all cache names started on the node. * * @param n Node to get cache names for. @@ -8780,36 +8738,6 @@ public abstract class IgniteUtils { } /** - * Tells whether provided type is portable. - * - * @param cls Class to check. - * @return Whether type is portable. - */ - public static boolean isPortableType(Class<?> cls) { - assert cls != null; - - return PortableObject.class.isAssignableFrom(cls) || - PORTABLE_CLS.contains(cls) || - cls.isEnum() || - (cls.isArray() && cls.getComponentType().isEnum()); - } - /** - * Tells whether provided type is portable or a collection. - * - * @param cls Class to check. - * @return Whether type is portable or a collection. - */ - public static boolean isPortableOrCollectionType(Class<?> cls) { - assert cls != null; - - return isPortableType(cls) || - cls == Object[].class || - Collection.class.isAssignableFrom(cls) || - Map.class.isAssignableFrom(cls) || - Map.Entry.class.isAssignableFrom(cls); - } - - /** * @param arr Array. * @param off Offset. * @param uid UUID.
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/dff026be/modules/core/src/main/java/org/apache/ignite/internal/util/portable/PortableRawReaderEx.java ---------------------------------------------------------------------- diff --git a/modules/core/src/main/java/org/apache/ignite/internal/util/portable/PortableRawReaderEx.java b/modules/core/src/main/java/org/apache/ignite/internal/util/portable/PortableRawReaderEx.java deleted file mode 100644 index 1cb5749..0000000 --- a/modules/core/src/main/java/org/apache/ignite/internal/util/portable/PortableRawReaderEx.java +++ /dev/null @@ -1,32 +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. - */ - -package org.apache.ignite.internal.util.portable; - -import org.apache.ignite.portables.*; -import org.jetbrains.annotations.*; - -/** - * Extended reader interface. - */ -public interface PortableRawReaderEx extends PortableRawReader { - /** - * @return Object. - * @throws org.apache.ignite.portables.PortableException In case of error. - */ - @Nullable public Object readObjectDetached() throws PortableException; -} http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/dff026be/modules/core/src/main/java/org/apache/ignite/internal/util/portable/PortableRawWriterEx.java ---------------------------------------------------------------------- diff --git a/modules/core/src/main/java/org/apache/ignite/internal/util/portable/PortableRawWriterEx.java b/modules/core/src/main/java/org/apache/ignite/internal/util/portable/PortableRawWriterEx.java deleted file mode 100644 index df7c83c..0000000 --- a/modules/core/src/main/java/org/apache/ignite/internal/util/portable/PortableRawWriterEx.java +++ /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. - */ - -package org.apache.ignite.internal.util.portable; - -import org.apache.ignite.internal.processors.portable.*; -import org.apache.ignite.portables.*; -import org.jetbrains.annotations.*; - -/** - * Extended writer interface. - */ -public interface PortableRawWriterEx extends PortableRawWriter, AutoCloseable { - /** - * @param obj Object to write. - * @throws org.apache.ignite.portables.PortableException In case of error. - */ - public void writeObjectDetached(@Nullable Object obj) throws PortableException; - - /** - * @return Output stream. - */ - public GridPortableOutputStream out(); - - /** - * Cleans resources. - */ - @Override public void close(); -} http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/dff026be/modules/core/src/main/java/org/apache/ignite/internal/visor/portable/VisorPortableMetadata.java ---------------------------------------------------------------------- diff --git a/modules/core/src/main/java/org/apache/ignite/internal/visor/portable/VisorPortableMetadata.java b/modules/core/src/main/java/org/apache/ignite/internal/visor/portable/VisorPortableMetadata.java deleted file mode 100644 index 74a3997..0000000 --- a/modules/core/src/main/java/org/apache/ignite/internal/visor/portable/VisorPortableMetadata.java +++ /dev/null @@ -1,72 +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. - */ - -package org.apache.ignite.internal.visor.portable; - -import org.apache.ignite.internal.util.typedef.internal.*; - -import java.io.*; -import java.util.*; - -/** - * Portable object metadata to show in Visor. - */ -public class VisorPortableMetadata implements Serializable { - /** */ - private static final long serialVersionUID = 0L; - - /** Type name */ - private String typeName; - - /** Type Id */ - private Integer typeId; - - /** Filed list */ - private Collection<VisorPortableMetadataField> fields; - - /** Type name */ - public String typeName() { - return typeName; - } - - public void typeName(String typeName) { - this.typeName = typeName; - } - - /** Type Id */ - public Integer typeId() { - return typeId; - } - - public void typeId(Integer typeId) { - this.typeId = typeId; - } - - /** Fields list */ - public Collection<VisorPortableMetadataField> fields() { - return fields; - } - - public void fields(Collection<VisorPortableMetadataField> fields) { - this.fields = fields; - } - - /** {@inheritDoc} */ - @Override public String toString() { - return S.toString(VisorPortableMetadata.class, this); - } -} http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/dff026be/modules/core/src/main/java/org/apache/ignite/internal/visor/portable/VisorPortableMetadataCollectorTask.java ---------------------------------------------------------------------- diff --git a/modules/core/src/main/java/org/apache/ignite/internal/visor/portable/VisorPortableMetadataCollectorTask.java b/modules/core/src/main/java/org/apache/ignite/internal/visor/portable/VisorPortableMetadataCollectorTask.java deleted file mode 100644 index 8fc967a..0000000 --- a/modules/core/src/main/java/org/apache/ignite/internal/visor/portable/VisorPortableMetadataCollectorTask.java +++ /dev/null @@ -1,94 +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. - */ - -package org.apache.ignite.internal.visor.portable; - -import org.apache.ignite.*; -import org.apache.ignite.internal.processors.task.*; -import org.apache.ignite.internal.util.typedef.internal.*; -import org.apache.ignite.internal.visor.*; -import org.apache.ignite.lang.*; -import org.apache.ignite.portables.*; - -import java.util.*; - -/** - * Task that collects portables metadata. - */ -@GridInternal -public class VisorPortableMetadataCollectorTask extends VisorOneNodeTask<Long, IgniteBiTuple<Long, Collection<VisorPortableMetadata>>> { - /** */ - private static final long serialVersionUID = 0L; - - /** {@inheritDoc} */ - @Override protected VisorPortableCollectMetadataJob job(Long lastUpdate) { - return new VisorPortableCollectMetadataJob(lastUpdate, debug); - } - - /** Job that collect portables metadata on node. */ - private static class VisorPortableCollectMetadataJob extends VisorJob<Long, IgniteBiTuple<Long, Collection<VisorPortableMetadata>>> { - /** */ - private static final long serialVersionUID = 0L; - - /** - * Create job with given argument. - * - * @param lastUpdate Time data was collected last time. - * @param debug Debug flag. - */ - private VisorPortableCollectMetadataJob(Long lastUpdate, boolean debug) { - super(lastUpdate, debug); - } - - /** {@inheritDoc} */ - @Override protected IgniteBiTuple<Long, Collection<VisorPortableMetadata>> run(Long lastUpdate) { - final IgnitePortables p = g.portables(); - - final Collection<VisorPortableMetadata> data = new ArrayList<>(p.metadata().size()); - - for(PortableMetadata metadata: p.metadata()) { - final VisorPortableMetadata type = new VisorPortableMetadata(); - - type.typeName(metadata.typeName()); - - type.typeId(p.typeId(metadata.typeName())); - - final Collection<VisorPortableMetadataField> fields = new ArrayList<>(metadata.fields().size()); - - for (String fieldName: metadata.fields()) { - final VisorPortableMetadataField field = new VisorPortableMetadataField(); - - field.fieldName(fieldName); - field.fieldTypeName(metadata.fieldTypeName(fieldName)); - - fields.add(field); - } - - type.fields(fields); - - data.add(type); - } - - return new IgniteBiTuple<>(0L, data); - } - - /** {@inheritDoc} */ - @Override public String toString() { - return S.toString(VisorPortableCollectMetadataJob.class, this); - } - } -} http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/dff026be/modules/core/src/main/java/org/apache/ignite/internal/visor/portable/VisorPortableMetadataField.java ---------------------------------------------------------------------- diff --git a/modules/core/src/main/java/org/apache/ignite/internal/visor/portable/VisorPortableMetadataField.java b/modules/core/src/main/java/org/apache/ignite/internal/visor/portable/VisorPortableMetadataField.java deleted file mode 100644 index d5cbac4..0000000 --- a/modules/core/src/main/java/org/apache/ignite/internal/visor/portable/VisorPortableMetadataField.java +++ /dev/null @@ -1,71 +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. - */ - -package org.apache.ignite.internal.visor.portable; - -import org.apache.ignite.internal.util.typedef.internal.*; - -import java.io.*; - -/** - * Portable object metadata field information. - */ -public class VisorPortableMetadataField implements Serializable { - /** */ - private static final long serialVersionUID = 0L; - - /** Field name. */ - private String fieldName; - - /** Field type name. */ - private String fieldTypeName; - - /** Field id. */ - private Integer fieldId; - - /** Field name. */ - public String fieldName() { - return fieldName; - } - - public void fieldName(String fieldName) { - this.fieldName = fieldName; - } - - /** Field type name. */ - public String fieldTypeName() { - return fieldTypeName; - } - - public void fieldTypeName(String fieldTypeName) { - this.fieldTypeName = fieldTypeName; - } - - /** Field id. */ - public Integer fieldId() { - return fieldId; - } - - public void fieldId(Integer fieldId) { - this.fieldId = fieldId; - } - - /** {@inheritDoc} */ - @Override public String toString() { - return S.toString(VisorPortableMetadataField.class, this); - } -} http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/dff026be/modules/core/src/main/java/org/apache/ignite/plugin/PluginProvider.java ---------------------------------------------------------------------- diff --git a/modules/core/src/main/java/org/apache/ignite/plugin/PluginProvider.java b/modules/core/src/main/java/org/apache/ignite/plugin/PluginProvider.java index 9e5bb2c..7be8dcc 100644 --- a/modules/core/src/main/java/org/apache/ignite/plugin/PluginProvider.java +++ b/modules/core/src/main/java/org/apache/ignite/plugin/PluginProvider.java @@ -51,7 +51,7 @@ public interface PluginProvider<C extends PluginConfiguration> { * @param cls Ignite component class. * @return Ignite component or {@code null} if component is not supported. */ - @Nullable public <T> T createComponent(Class<T> cls); + @Nullable public <T> T createComponent(PluginContext ctx, Class<T> cls); /** * Register extensions. http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/dff026be/modules/core/src/main/java/org/apache/ignite/plugin/security/GridSecurityCredentials.java ---------------------------------------------------------------------- diff --git a/modules/core/src/main/java/org/apache/ignite/plugin/security/GridSecurityCredentials.java b/modules/core/src/main/java/org/apache/ignite/plugin/security/GridSecurityCredentials.java index 78f7abc..79dafd3 100644 --- a/modules/core/src/main/java/org/apache/ignite/plugin/security/GridSecurityCredentials.java +++ b/modules/core/src/main/java/org/apache/ignite/plugin/security/GridSecurityCredentials.java @@ -17,10 +17,10 @@ package org.apache.ignite.plugin.security; +import org.apache.ignite.configuration.IgniteConfiguration; import org.apache.ignite.internal.util.tostring.*; import org.apache.ignite.internal.util.typedef.*; import org.apache.ignite.internal.util.typedef.internal.*; -import org.apache.ignite.portables.*; import org.jetbrains.annotations.*; import java.io.*; @@ -31,7 +31,7 @@ import java.io.*; * client or node startup in configuration. * <p> * For grid node, security credentials provider is specified in - * {@link org.apache.ignite.configuration.IgniteConfiguration#setSecurityCredentialsProvider(GridSecurityCredentialsProvider)} + * {@link IgniteConfiguration#setSecurityCredentialsProvider(GridSecurityCredentialsProvider)} * configuration property. For Java clients, you can provide credentials in * {@code GridClientConfiguration.setSecurityCredentialsProvider(...)} method. * <p> @@ -45,7 +45,7 @@ import java.io.*; * specifying {@link #setUserObject(Object) userObject} as well, which can be used * to pass in any additional information required for authentication. */ -public class GridSecurityCredentials implements Externalizable, PortableMarshalAware { +public class GridSecurityCredentials implements Externalizable { /** */ private static final long serialVersionUID = -2655741071578326256L; @@ -184,20 +184,6 @@ public class GridSecurityCredentials implements Externalizable, PortableMarshalA } /** {@inheritDoc} */ - @Override public void writePortable(PortableWriter writer) throws PortableException { - writer.rawWriter().writeObject(login); - writer.rawWriter().writeObject(password); - writer.rawWriter().writeObject(userObj); - } - - /** {@inheritDoc} */ - @Override public void readPortable(PortableReader reader) throws PortableException { - login = reader.rawReader().readObject(); - password = reader.rawReader().readObject(); - userObj = reader.rawReader().readObject(); - } - - /** {@inheritDoc} */ @Override public String toString() { return S.toString(GridSecurityCredentials.class, this); } http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/dff026be/modules/core/src/main/java/org/apache/ignite/portables/PortableBuilder.java ---------------------------------------------------------------------- diff --git a/modules/core/src/main/java/org/apache/ignite/portables/PortableBuilder.java b/modules/core/src/main/java/org/apache/ignite/portables/PortableBuilder.java deleted file mode 100644 index 619081c..0000000 --- a/modules/core/src/main/java/org/apache/ignite/portables/PortableBuilder.java +++ /dev/null @@ -1,137 +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. - */ - -package org.apache.ignite.portables; - -import org.jetbrains.annotations.*; - -/** - * Portable object builder. Provides ability to build portable objects dynamically - * without having class definitions. - * <p> - * Here is an example of how a portable object can be built dynamically: - * <pre name=code class=java> - * GridPortableBuilder builder = Ignition.ignite().portables().builder("org.project.MyObject"); - * - * builder.setField("fieldA", "A"); - * builder.setField("fieldB", "B"); - * - * GridPortableObject portableObj = builder.build(); - * </pre> - * - * <p> - * Also builder can be initialized by existing portable object. This allows changing some fields without affecting - * other fields. - * <pre name=code class=java> - * GridPortableBuilder builder = Ignition.ignite().portables().builder(person); - * - * builder.setField("name", "John"); - * - * person = builder.build(); - * </pre> - * </p> - * - * If you need to modify nested portable object you can get builder for nested object using - * {@link #getField(String)}, changes made on nested builder will affect parent object, - * for example: - * - * <pre name=code class=java> - * GridPortableBuilder personBuilder = grid.portables().createBuilder(personPortableObj); - * GridPortableBuilder addressBuilder = personBuilder.setField("address"); - * - * addressBuilder.setField("city", "New York"); - * - * personPortableObj = personBuilder.build(); - * - * // Should be "New York". - * String city = personPortableObj.getField("address").getField("city"); - * </pre> - * - * @see org.apache.ignite.IgnitePortables#builder(int) - * @see org.apache.ignite.IgnitePortables#builder(String) - * @see org.apache.ignite.IgnitePortables#builder(PortableObject) - */ -public interface PortableBuilder { - /** - * Returns value assigned to the specified field. - * If the value is a portable object instance of {@code GridPortableBuilder} will be returned, - * which can be modified. - * <p> - * Collections and maps returned from this method are modifiable. - * - * @param name Field name. - * @return Filed value. - */ - public <T> T getField(String name); - - /** - * Sets field value. - * - * @param name Field name. - * @param val Field value (cannot be {@code null}). - * @see PortableObject#metaData() - */ - public PortableBuilder setField(String name, Object val); - - /** - * Sets field value with value type specification. - * <p> - * Field type is needed for proper metadata update. - * - * @param name Field name. - * @param val Field value. - * @param type Field type. - * @see PortableObject#metaData() - */ - public <T> PortableBuilder setField(String name, @Nullable T val, Class<? super T> type); - - /** - * Sets field value. - * <p> - * This method should be used if field is portable object. - * - * @param name Field name. - * @param builder Builder for object field. - */ - public PortableBuilder setField(String name, @Nullable PortableBuilder builder); - - /** - * Removes field from this builder. - * - * @param fieldName Field name. - * @return {@code this} instance for chaining. - */ - public PortableBuilder removeField(String fieldName); - - /** - * Sets hash code for resulting portable object returned by {@link #build()} method. - * <p> - * If not set {@code 0} is used. - * - * @param hashCode Hash code. - * @return {@code this} instance for chaining. - */ - public PortableBuilder hashCode(int hashCode); - - /** - * Builds portable object. - * - * @return Portable object. - * @throws PortableException In case of error. - */ - public PortableObject build() throws PortableException; -} http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/dff026be/modules/core/src/main/java/org/apache/ignite/portables/PortableConfiguration.java ---------------------------------------------------------------------- diff --git a/modules/core/src/main/java/org/apache/ignite/portables/PortableConfiguration.java b/modules/core/src/main/java/org/apache/ignite/portables/PortableConfiguration.java deleted file mode 100644 index 967f8cd..0000000 --- a/modules/core/src/main/java/org/apache/ignite/portables/PortableConfiguration.java +++ /dev/null @@ -1,189 +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. - */ - -package org.apache.ignite.portables; - -import org.apache.ignite.internal.util.typedef.internal.*; - -import java.sql.*; -import java.util.*; - -/** - * Defines configuration for Ignite portable functionality. All configuration - * properties defined here can be overridden on per-type level in - * {@link PortableTypeConfiguration}. Type configurations are provided via - * {@link #getTypeConfigurations()} method. - */ -public class PortableConfiguration { - /** Class names. */ - private Collection<String> clsNames; - - /** ID mapper. */ - private PortableIdMapper idMapper; - - /** Serializer. */ - private PortableSerializer serializer; - - /** Types. */ - private Collection<PortableTypeConfiguration> typeCfgs; - - /** Use timestamp flag. */ - private boolean useTs = true; - - /** Meta data enabled flag. */ - private boolean metaDataEnabled = true; - - /** Keep deserialized flag. */ - private boolean keepDeserialized = true; - - /** - * Gets class names. - * - * @return Class names. - */ - public Collection<String> getClassNames() { - return clsNames; - } - - /** - * Sets class names. - * - * @param clsNames Class names. - */ - public void setClassNames(Collection<String> clsNames) { - this.clsNames = clsNames; - } - - /** - * Gets ID mapper. - * - * @return ID mapper. - */ - public PortableIdMapper getIdMapper() { - return idMapper; - } - - /** - * Sets ID mapper. - * - * @param idMapper ID mapper. - */ - public void setIdMapper(PortableIdMapper idMapper) { - this.idMapper = idMapper; - } - - /** - * Gets serializer. - * - * @return Serializer. - */ - public PortableSerializer getSerializer() { - return serializer; - } - - /** - * Sets serializer. - * - * @param serializer Serializer. - */ - public void setSerializer(PortableSerializer serializer) { - this.serializer = serializer; - } - - /** - * Gets types configuration. - * - * @return Types configuration. - */ - public Collection<PortableTypeConfiguration> getTypeConfigurations() { - return typeCfgs; - } - - /** - * Sets type configurations. - * - * @param typeCfgs Type configurations. - */ - public void setTypeConfigurations(Collection<PortableTypeConfiguration> typeCfgs) { - this.typeCfgs = typeCfgs; - } - - /** - * If {@code true} then date values converted to {@link Timestamp} on deserialization. - * <p> - * Default value is {@code true}. - * - * @return Flag indicating whether date values converted to {@link Timestamp} during unmarshalling. - */ - public boolean isUseTimestamp() { - return useTs; - } - - /** - * @param useTs Flag indicating whether date values converted to {@link Timestamp} during unmarshalling. - */ - public void setUseTimestamp(boolean useTs) { - this.useTs = useTs; - } - - /** - * If {@code true}, meta data will be collected or all types. If you need to override this behaviour for - * some specific type, use {@link PortableTypeConfiguration#setMetaDataEnabled(Boolean)} method. - * <p> - * Default value if {@code true}. - * - * @return Whether meta data is collected. - */ - public boolean isMetaDataEnabled() { - return metaDataEnabled; - } - - /** - * @param metaDataEnabled Whether meta data is collected. - */ - public void setMetaDataEnabled(boolean metaDataEnabled) { - this.metaDataEnabled = metaDataEnabled; - } - - /** - * If {@code true}, {@link PortableObject} will cache deserialized instance after - * {@link PortableObject#deserialize()} is called. All consequent calls of this - * method on the same instance of {@link PortableObject} will return that cached - * value without actually deserializing portable object. If you need to override this - * behaviour for some specific type, use {@link PortableTypeConfiguration#setKeepDeserialized(Boolean)} - * method. - * <p> - * Default value if {@code true}. - * - * @return Whether deserialized value is kept. - */ - public boolean isKeepDeserialized() { - return keepDeserialized; - } - - /** - * @param keepDeserialized Whether deserialized value is kept. - */ - public void setKeepDeserialized(boolean keepDeserialized) { - this.keepDeserialized = keepDeserialized; - } - - /** {@inheritDoc} */ - @Override public String toString() { - return S.toString(PortableConfiguration.class, this); - } -} http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/dff026be/modules/core/src/main/java/org/apache/ignite/portables/PortableException.java ---------------------------------------------------------------------- diff --git a/modules/core/src/main/java/org/apache/ignite/portables/PortableException.java b/modules/core/src/main/java/org/apache/ignite/portables/PortableException.java deleted file mode 100644 index 63ac1e5..0000000 --- a/modules/core/src/main/java/org/apache/ignite/portables/PortableException.java +++ /dev/null @@ -1,57 +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. - */ - -package org.apache.ignite.portables; - -import org.apache.ignite.*; -import org.jetbrains.annotations.*; - -/** - * Exception indicating portable object serialization error. - */ -public class PortableException extends IgniteException { - /** */ - private static final long serialVersionUID = 0L; - - /** - * Creates portable exception with error message. - * - * @param msg Error message. - */ - public PortableException(String msg) { - super(msg); - } - - /** - * Creates portable exception with {@link Throwable} as a cause. - * - * @param cause Cause. - */ - public PortableException(Throwable cause) { - super(cause); - } - - /** - * Creates portable exception with error message and {@link Throwable} as a cause. - * - * @param msg Error message. - * @param cause Cause. - */ - public PortableException(String msg, @Nullable Throwable cause) { - super(msg, cause); - } -} http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/dff026be/modules/core/src/main/java/org/apache/ignite/portables/PortableIdMapper.java ---------------------------------------------------------------------- diff --git a/modules/core/src/main/java/org/apache/ignite/portables/PortableIdMapper.java b/modules/core/src/main/java/org/apache/ignite/portables/PortableIdMapper.java deleted file mode 100644 index f3316de..0000000 --- a/modules/core/src/main/java/org/apache/ignite/portables/PortableIdMapper.java +++ /dev/null @@ -1,55 +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. - */ - -package org.apache.ignite.portables; - -/** - * Type and field ID mapper for portable objects. Ignite never writes full - * strings for field or type names. Instead, for performance reasons, Ignite - * writes integer hash codes for type and field names. It has been tested that - * hash code conflicts for the type names or the field names - * within the same type are virtually non-existent and, to gain performance, it is safe - * to work with hash codes. For the cases when hash codes for different types or fields - * actually do collide {@code GridPortableIdMapper} allows to override the automatically - * generated hash code IDs for the type and field names. - * <p> - * Portable ID mapper can be configured for all portable objects via - * {@link PortableConfiguration#getIdMapper()} method, or for a specific - * portable type via {@link PortableTypeConfiguration#getIdMapper()} method. - */ -public interface PortableIdMapper { - /** - * Gets type ID for provided class name. - * <p> - * If {@code 0} is returned, hash code of class simple name will be used. - * - * @param clsName Class name. - * @return Type ID. - */ - public int typeId(String clsName); - - /** - * Gets ID for provided field. - * <p> - * If {@code 0} is returned, hash code of field name will be used. - * - * @param typeId Type ID. - * @param fieldName Field name. - * @return Field ID. - */ - public int fieldId(int typeId, String fieldName); -} http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/dff026be/modules/core/src/main/java/org/apache/ignite/portables/PortableInvalidClassException.java ---------------------------------------------------------------------- diff --git a/modules/core/src/main/java/org/apache/ignite/portables/PortableInvalidClassException.java b/modules/core/src/main/java/org/apache/ignite/portables/PortableInvalidClassException.java deleted file mode 100644 index 01500ec..0000000 --- a/modules/core/src/main/java/org/apache/ignite/portables/PortableInvalidClassException.java +++ /dev/null @@ -1,58 +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. - */ - -package org.apache.ignite.portables; - -import org.jetbrains.annotations.*; - -/** - * Exception indicating that class needed for deserialization of portable object does not exist. - * <p> - * Thrown from {@link PortableObject#deserialize()} method. - */ -public class PortableInvalidClassException extends PortableException { - /** */ - private static final long serialVersionUID = 0L; - - /** - * Creates invalid class exception with error message. - * - * @param msg Error message. - */ - public PortableInvalidClassException(String msg) { - super(msg); - } - - /** - * Creates invalid class exception with {@link Throwable} as a cause. - * - * @param cause Cause. - */ - public PortableInvalidClassException(Throwable cause) { - super(cause); - } - - /** - * Creates invalid class exception with error message and {@link Throwable} as a cause. - * - * @param msg Error message. - * @param cause Cause. - */ - public PortableInvalidClassException(String msg, @Nullable Throwable cause) { - super(msg, cause); - } -} http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/dff026be/modules/core/src/main/java/org/apache/ignite/portables/PortableMarshalAware.java ---------------------------------------------------------------------- diff --git a/modules/core/src/main/java/org/apache/ignite/portables/PortableMarshalAware.java b/modules/core/src/main/java/org/apache/ignite/portables/PortableMarshalAware.java deleted file mode 100644 index b2813a5..0000000 --- a/modules/core/src/main/java/org/apache/ignite/portables/PortableMarshalAware.java +++ /dev/null @@ -1,48 +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. - */ - -package org.apache.ignite.portables; - -/** - * Interface that allows to implement custom serialization - * logic for portable objects. Portable objects are not required - * to implement this interface, in which case Ignite will automatically - * serialize portable objects using reflection. - * <p> - * This interface, in a way, is analogous to {@link java.io.Externalizable} - * interface, which allows users to override default serialization logic, - * usually for performance reasons. The only difference here is that portable - * serialization is already very fast and implementing custom serialization - * logic for portables does not provide significant performance gains. - */ -public interface PortableMarshalAware { - /** - * Writes fields to provided writer. - * - * @param writer Portable object writer. - * @throws PortableException In case of error. - */ - public void writePortable(PortableWriter writer) throws PortableException; - - /** - * Reads fields from provided reader. - * - * @param reader Portable object reader. - * @throws PortableException In case of error. - */ - public void readPortable(PortableReader reader) throws PortableException; -} http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/dff026be/modules/core/src/main/java/org/apache/ignite/portables/PortableMetadata.java ---------------------------------------------------------------------- diff --git a/modules/core/src/main/java/org/apache/ignite/portables/PortableMetadata.java b/modules/core/src/main/java/org/apache/ignite/portables/PortableMetadata.java deleted file mode 100644 index 25daf94..0000000 --- a/modules/core/src/main/java/org/apache/ignite/portables/PortableMetadata.java +++ /dev/null @@ -1,61 +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. - */ - -package org.apache.ignite.portables; - -import org.jetbrains.annotations.*; - -import java.util.*; - -/** - * Portable type meta data. Metadata for portable types can be accessed from any of the - * {@link org.apache.ignite.IgnitePortables#metadata(String) GridPortables.metadata(...)} methods. - * Having metadata also allows for proper formatting of {@code GridPortableObject.toString()} method, - * even when portable objects are kept in binary format only, which may be necessary for audit reasons. - */ -public interface PortableMetadata { - /** - * Gets portable type name. - * - * @return Portable type name. - */ - public String typeName(); - - /** - * Gets collection of all field names for this portable type. - * - * @return Collection of all field names for this portable type. - */ - public Collection<String> fields(); - - /** - * Gets name of the field type for a given field. - * - * @param fieldName Field name. - * @return Field type name. - */ - @Nullable public String fieldTypeName(String fieldName); - - /** - * Portable objects can optionally specify custom key-affinity mapping in the - * configuration. This method returns the name of the field which should be - * used for the key-affinity mapping. - * - * @return Affinity key field name. - */ - @Nullable public String affinityKeyFieldName(); -} http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/dff026be/modules/core/src/main/java/org/apache/ignite/portables/PortableObject.java ---------------------------------------------------------------------- diff --git a/modules/core/src/main/java/org/apache/ignite/portables/PortableObject.java b/modules/core/src/main/java/org/apache/ignite/portables/PortableObject.java deleted file mode 100644 index 40deabf..0000000 --- a/modules/core/src/main/java/org/apache/ignite/portables/PortableObject.java +++ /dev/null @@ -1,160 +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. - */ - -package org.apache.ignite.portables; - -import org.jetbrains.annotations.*; - -import java.io.*; -import java.util.*; - -/** - * Wrapper for portable object in portable binary format. Once an object is defined as portable, - * Ignite will always store it in memory in the portable (i.e. binary) format. - * User can choose to work either with the portable format or with the deserialized form - * (assuming that class definitions are present in the classpath). - * <p> - * <b>NOTE:</b> user does not need to (and should not) implement this interface directly. - * <p> - * To work with the portable format directly, user should create a cache projection - * over {@code GridPortableObject} class and then retrieve individual fields as needed: - * <pre name=code class=java> - * CacheProjection<GridPortableObject.class, GridPortableObject.class> prj = - * cache.projection(GridPortableObject.class, GridPortableObject.class); - * - * // Convert instance of MyKey to portable format. - * // We could also use GridPortableBuilder to create - * // the key in portable format directly. - * GridPortableObject key = grid.portables().toPortable(new MyKey()); - * - * GridPortableObject val = prj.get(key); - * - * String field = val.field("myFieldName"); - * </pre> - * Alternatively, we could also choose a hybrid approach, where, for example, - * the keys are concrete deserialized objects and the values are returned in portable - * format, like so: - * <pre name=code class=java> - * CacheProjection<MyKey.class, GridPortableObject.class> prj = - * cache.projection(MyKey.class, GridPortableObject.class); - * - * GridPortableObject val = prj.get(new MyKey()); - * - * String field = val.field("myFieldName"); - * </pre> - * We could also have the values as concrete deserialized objects and the keys in portable format, - * but such use case is a lot less common because cache keys are usually a lot smaller than values, and - * it may be very cheap to deserialize the keys, but not the values. - * <p> - * And finally, if we have class definitions in the classpath, we may choose to work with deserialized - * typed objects at all times. In this case we do incur the deserialization cost, however, - * Ignite will only deserialize on the first access and will cache the deserialized object, - * so it does not have to be deserialized again: - * <pre name=code class=java> - * CacheProjection<MyKey.class, MyValue.class> prj = - * cache.projection(MyKey.class, MyValue.class); - * - * MyValue val = prj.get(new MyKey()); - * - * // Normal java getter. - * String fieldVal = val.getMyFieldName(); - * </pre> - * <h1 class="header">Working With Maps and Collections</h1> - * All maps and collections in the portable objects are serialized automatically. When working - * with different platforms, e.g. C++ or .NET, Ignite will automatically pick the most - * adequate collection or map in either language. For example, {@link ArrayList} in Java will become - * {@code List} in C#, {@link LinkedList} in Java is {@link LinkedList} in C#, {@link HashMap} - * in Java is {@code Dictionary} in C#, and {@link TreeMap} in Java becomes {@code SortedDictionary} - * in C#, etc. - * <h1 class="header">Dynamic Structure Changes</h1> - * Since objects are always cached in the portable binary format, server does not need to - * be aware of the class definitions. Moreover, if class definitions are not present or not - * used on the server, then clients can continuously change the structure of the portable - * objects without having to restart the cluster. For example, if one client stores a - * certain class with fields A and B, and another client stores the same class with - * fields B and C, then the server-side portable object will have the fields A, B, and C. - * As the structure of a portable object changes, the new fields become available for SQL queries - * automatically. - * <h1 class="header">Building Portable Objects</h1> - * Ignite comes with {@link PortableBuilder} which allows to build portable objects dynamically: - * <pre name=code class=java> - * GridPortableBuilder builder = Ignition.ignite().portables().builder("org.project.MyObject"); - * - * builder.setField("fieldA", "A"); - * builder.setField("fieldB", "B"); - * - * GridPortableObject portableObj = builder.build(); - * </pre> - * For the cases when class definition is present - * in the class path, it is also possible to populate a standard POJO and then - * convert it to portable format, like so: - * <pre name=code class=java> - * MyObject obj = new MyObject(); - * - * obj.setFieldA("A"); - * obj.setFieldB(123); - * - * GridPortableObject portableObj = Ignition.ignite().portables().toPortable(obj); - * </pre> - * <h1 class="header">Portable Metadata</h1> - * Even though Ignite portable protocol only works with hash codes for type and field names - * to achieve better performance, Ignite provides metadata for all portable types which - * can be queried ar runtime via any of the {@link org.apache.ignite.IgnitePortables#metadata(Class) GridPortables.metadata(...)} - * methods. Having metadata also allows for proper formatting of {@code GridPortableObject.toString()} method, - * even when portable objects are kept in binary format only, which may be necessary for audit reasons. - */ -public interface PortableObject extends Serializable, Cloneable { - /** - * Gets portable object type ID. - * - * @return Type ID. - */ - public int typeId(); - - /** - * Gets meta data for this portable object. - * - * @return Meta data. - * @throws PortableException In case of error. - */ - @Nullable public PortableMetadata metaData() throws PortableException; - - /** - * Gets field value. - * - * @param fieldName Field name. - * @return Field value. - * @throws PortableException In case of any other error. - */ - @Nullable public <F> F field(String fieldName) throws PortableException; - - /** - * Gets fully deserialized instance of portable object. - * - * @return Fully deserialized instance of portable object. - * @throws PortableInvalidClassException If class doesn't exist. - * @throws PortableException In case of any other error. - */ - @Nullable public <T> T deserialize() throws PortableException; - - /** - * Copies this portable object. - * - * @return Copy of this portable object. - */ - public PortableObject clone() throws CloneNotSupportedException; -} http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/dff026be/modules/core/src/main/java/org/apache/ignite/portables/PortableRawReader.java ---------------------------------------------------------------------- diff --git a/modules/core/src/main/java/org/apache/ignite/portables/PortableRawReader.java b/modules/core/src/main/java/org/apache/ignite/portables/PortableRawReader.java deleted file mode 100644 index 5801aa8..0000000 --- a/modules/core/src/main/java/org/apache/ignite/portables/PortableRawReader.java +++ /dev/null @@ -1,235 +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. - */ - -package org.apache.ignite.portables; - -import org.jetbrains.annotations.*; - -import java.math.*; -import java.sql.*; -import java.util.*; -import java.util.Date; - -/** - * Raw reader for portable objects. Raw reader does not use field name hash codes, therefore, - * making the format even more compact. However, if the raw reader is used, - * dynamic structure changes to the portable objects are not supported. - */ -public interface PortableRawReader { - /** - * @return Byte value. - * @throws PortableException In case of error. - */ - public byte readByte() throws PortableException; - - /** - * @return Short value. - * @throws PortableException In case of error. - */ - public short readShort() throws PortableException; - - /** - * @return Integer value. - * @throws PortableException In case of error. - */ - public int readInt() throws PortableException; - - /** - * @return Long value. - * @throws PortableException In case of error. - */ - public long readLong() throws PortableException; - - /** - * @return Float value. - * @throws PortableException In case of error. - */ - public float readFloat() throws PortableException; - - /** - * @return Double value. - * @throws PortableException In case of error. - */ - public double readDouble() throws PortableException; - - /** - * @return Char value. - * @throws PortableException In case of error. - */ - public char readChar() throws PortableException; - - /** - * @return Boolean value. - * @throws PortableException In case of error. - */ - public boolean readBoolean() throws PortableException; - - /** - * @return Decimal value. - * @throws PortableException In case of error. - */ - @Nullable public BigDecimal readDecimal() throws PortableException; - - /** - * @return String value. - * @throws PortableException In case of error. - */ - @Nullable public String readString() throws PortableException; - - /** - * @return UUID. - * @throws PortableException In case of error. - */ - @Nullable public UUID readUuid() throws PortableException; - - /** - * @return Date. - * @throws PortableException In case of error. - */ - @Nullable public Date readDate() throws PortableException; - - /** - * @return Timestamp. - * @throws PortableException In case of error. - */ - @Nullable public Timestamp readTimestamp() throws PortableException; - - /** - * @return Object. - * @throws PortableException In case of error. - */ - @Nullable public <T> T readObject() throws PortableException; - - /** - * @return Byte array. - * @throws PortableException In case of error. - */ - @Nullable public byte[] readByteArray() throws PortableException; - - /** - * @return Short array. - * @throws PortableException In case of error. - */ - @Nullable public short[] readShortArray() throws PortableException; - - /** - * @return Integer array. - * @throws PortableException In case of error. - */ - @Nullable public int[] readIntArray() throws PortableException; - - /** - * @return Long array. - * @throws PortableException In case of error. - */ - @Nullable public long[] readLongArray() throws PortableException; - - /** - * @return Float array. - * @throws PortableException In case of error. - */ - @Nullable public float[] readFloatArray() throws PortableException; - - /** - * @return Byte array. - * @throws PortableException In case of error. - */ - @Nullable public double[] readDoubleArray() throws PortableException; - - /** - * @return Char array. - * @throws PortableException In case of error. - */ - @Nullable public char[] readCharArray() throws PortableException; - - /** - * @return Boolean array. - * @throws PortableException In case of error. - */ - @Nullable public boolean[] readBooleanArray() throws PortableException; - - /** - * @return Decimal array. - * @throws PortableException In case of error. - */ - @Nullable public BigDecimal[] readDecimalArray() throws PortableException; - - /** - * @return String array. - * @throws PortableException In case of error. - */ - @Nullable public String[] readStringArray() throws PortableException; - - /** - * @return UUID array. - * @throws PortableException In case of error. - */ - @Nullable public UUID[] readUuidArray() throws PortableException; - - /** - * @return Date array. - * @throws PortableException In case of error. - */ - @Nullable public Date[] readDateArray() throws PortableException; - - /** - * @return Object array. - * @throws PortableException In case of error. - */ - @Nullable public Object[] readObjectArray() throws PortableException; - - /** - * @return Collection. - * @throws PortableException In case of error. - */ - @Nullable public <T> Collection<T> readCollection() throws PortableException; - - /** - * @param colCls Collection class. - * @return Collection. - * @throws PortableException In case of error. - */ - @Nullable public <T> Collection<T> readCollection(Class<? extends Collection<T>> colCls) - throws PortableException; - - /** - * @return Map. - * @throws PortableException In case of error. - */ - @Nullable public <K, V> Map<K, V> readMap() throws PortableException; - - /** - * @param mapCls Map class. - * @return Map. - * @throws PortableException In case of error. - */ - @Nullable public <K, V> Map<K, V> readMap(Class<? extends Map<K, V>> mapCls) throws PortableException; - - /** - * @param enumCls Enum class. - * @return Value. - * @throws PortableException In case of error. - */ - @Nullable public <T extends Enum<?>> T readEnum(Class<T> enumCls) throws PortableException; - - /** - * @param enumCls Enum class. - * @return Value. - * @throws PortableException In case of error. - */ - @Nullable public <T extends Enum<?>> T[] readEnumArray(Class<T> enumCls) throws PortableException; -} http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/dff026be/modules/core/src/main/java/org/apache/ignite/portables/PortableRawWriter.java ---------------------------------------------------------------------- diff --git a/modules/core/src/main/java/org/apache/ignite/portables/PortableRawWriter.java b/modules/core/src/main/java/org/apache/ignite/portables/PortableRawWriter.java deleted file mode 100644 index b8bd487..0000000 --- a/modules/core/src/main/java/org/apache/ignite/portables/PortableRawWriter.java +++ /dev/null @@ -1,218 +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. - */ - -package org.apache.ignite.portables; - -import org.jetbrains.annotations.*; - -import java.math.*; -import java.sql.*; -import java.util.*; -import java.util.Date; - -/** - * Raw writer for portable object. Raw writer does not write field name hash codes, therefore, - * making the format even more compact. However, if the raw writer is used, - * dynamic structure changes to the portable objects are not supported. - */ -public interface PortableRawWriter { - /** - * @param val Value to write. - * @throws PortableException In case of error. - */ - public void writeByte(byte val) throws PortableException; - - /** - * @param val Value to write. - * @throws PortableException In case of error. - */ - public void writeShort(short val) throws PortableException; - - /** - * @param val Value to write. - * @throws PortableException In case of error. - */ - public void writeInt(int val) throws PortableException; - - /** - * @param val Value to write. - * @throws PortableException In case of error. - */ - public void writeLong(long val) throws PortableException; - - /** - * @param val Value to write. - * @throws PortableException In case of error. - */ - public void writeFloat(float val) throws PortableException; - - /** - * @param val Value to write. - * @throws PortableException In case of error. - */ - public void writeDouble(double val) throws PortableException; - - /** - * @param val Value to write. - * @throws PortableException In case of error. - */ - public void writeChar(char val) throws PortableException; - - /** - * @param val Value to write. - * @throws PortableException In case of error. - */ - public void writeBoolean(boolean val) throws PortableException; - - /** - * @param val Value to write. - * @throws PortableException In case of error. - */ - public void writeDecimal(@Nullable BigDecimal val) throws PortableException; - - /** - * @param val Value to write. - * @throws PortableException In case of error. - */ - public void writeString(@Nullable String val) throws PortableException; - - /** - * @param val UUID to write. - * @throws PortableException In case of error. - */ - public void writeUuid(@Nullable UUID val) throws PortableException; - - /** - * @param val Date to write. - * @throws PortableException In case of error. - */ - public void writeDate(@Nullable Date val) throws PortableException; - - /** - * @param val Timestamp to write. - * @throws PortableException In case of error. - */ - public void writeTimestamp(@Nullable Timestamp val) throws PortableException; - - /** - * @param obj Value to write. - * @throws PortableException In case of error. - */ - public void writeObject(@Nullable Object obj) throws PortableException; - - /** - * @param val Value to write. - * @throws PortableException In case of error. - */ - public void writeByteArray(@Nullable byte[] val) throws PortableException; - - /** - * @param val Value to write. - * @throws PortableException In case of error. - */ - public void writeShortArray(@Nullable short[] val) throws PortableException; - - /** - * @param val Value to write. - * @throws PortableException In case of error. - */ - public void writeIntArray(@Nullable int[] val) throws PortableException; - - /** - * @param val Value to write. - * @throws PortableException In case of error. - */ - public void writeLongArray(@Nullable long[] val) throws PortableException; - - /** - * @param val Value to write. - * @throws PortableException In case of error. - */ - public void writeFloatArray(@Nullable float[] val) throws PortableException; - - /** - * @param val Value to write. - * @throws PortableException In case of error. - */ - public void writeDoubleArray(@Nullable double[] val) throws PortableException; - - /** - * @param val Value to write. - * @throws PortableException In case of error. - */ - public void writeCharArray(@Nullable char[] val) throws PortableException; - - /** - * @param val Value to write. - * @throws PortableException In case of error. - */ - public void writeBooleanArray(@Nullable boolean[] val) throws PortableException; - - /** - * @param val Value to write. - * @throws PortableException In case of error. - */ - public void writeDecimalArray(@Nullable BigDecimal[] val) throws PortableException; - - /** - * @param val Value to write. - * @throws PortableException In case of error. - */ - public void writeStringArray(@Nullable String[] val) throws PortableException; - - /** - * @param val Value to write. - * @throws PortableException In case of error. - */ - public void writeUuidArray(@Nullable UUID[] val) throws PortableException; - - /** - * @param val Value to write. - * @throws PortableException In case of error. - */ - public void writeDateArray(@Nullable Date[] val) throws PortableException; - - /** - * @param val Value to write. - * @throws PortableException In case of error. - */ - public void writeObjectArray(@Nullable Object[] val) throws PortableException; - - /** - * @param col Collection to write. - * @throws PortableException In case of error. - */ - public <T> void writeCollection(@Nullable Collection<T> col) throws PortableException; - - /** - * @param map Map to write. - * @throws PortableException In case of error. - */ - public <K, V> void writeMap(@Nullable Map<K, V> map) throws PortableException; - - /** - * @param val Value to write. - * @throws PortableException In case of error. - */ - public <T extends Enum<?>> void writeEnum(T val) throws PortableException; - - /** - * @param val Value to write. - * @throws PortableException In case of error. - */ - public <T extends Enum<?>> void writeEnumArray(T[] val) throws PortableException; -} http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/dff026be/modules/core/src/main/java/org/apache/ignite/portables/PortableReader.java ---------------------------------------------------------------------- diff --git a/modules/core/src/main/java/org/apache/ignite/portables/PortableReader.java b/modules/core/src/main/java/org/apache/ignite/portables/PortableReader.java deleted file mode 100644 index 8059389..0000000 --- a/modules/core/src/main/java/org/apache/ignite/portables/PortableReader.java +++ /dev/null @@ -1,286 +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. - */ - -package org.apache.ignite.portables; - -import org.jetbrains.annotations.*; - -import java.math.*; -import java.sql.*; -import java.util.*; -import java.util.Date; - -/** - * Reader for portable objects used in {@link PortableMarshalAware} implementations. - * Useful for the cases when user wants a fine-grained control over serialization. - * <p> - * Note that Ignite never writes full strings for field or type names. Instead, - * for performance reasons, Ignite writes integer hash codes for type and field names. - * It has been tested that hash code conflicts for the type names or the field names - * within the same type are virtually non-existent and, to gain performance, it is safe - * to work with hash codes. For the cases when hash codes for different types or fields - * actually do collide, Ignite provides {@link PortableIdMapper} which - * allows to override the automatically generated hash code IDs for the type and field names. - */ -public interface PortableReader { - /** - * @param fieldName Field name. - * @return Byte value. - * @throws PortableException In case of error. - */ - public byte readByte(String fieldName) throws PortableException; - - /** - * @param fieldName Field name. - * @return Short value. - * @throws PortableException In case of error. - */ - public short readShort(String fieldName) throws PortableException; - - /** - * @param fieldName Field name. - * @return Integer value. - * @throws PortableException In case of error. - */ - public int readInt(String fieldName) throws PortableException; - - /** - * @param fieldName Field name. - * @return Long value. - * @throws PortableException In case of error. - */ - public long readLong(String fieldName) throws PortableException; - - /** - * @param fieldName Field name. - * @throws PortableException In case of error. - * @return Float value. - */ - public float readFloat(String fieldName) throws PortableException; - - /** - * @param fieldName Field name. - * @return Double value. - * @throws PortableException In case of error. - */ - public double readDouble(String fieldName) throws PortableException; - - /** - * @param fieldName Field name. - * @return Char value. - * @throws PortableException In case of error. - */ - public char readChar(String fieldName) throws PortableException; - - /** - * @param fieldName Field name. - * @return Boolean value. - * @throws PortableException In case of error. - */ - public boolean readBoolean(String fieldName) throws PortableException; - - /** - * @param fieldName Field name. - * @return Decimal value. - * @throws PortableException In case of error. - */ - @Nullable public BigDecimal readDecimal(String fieldName) throws PortableException; - - /** - * @param fieldName Field name. - * @return String value. - * @throws PortableException In case of error. - */ - @Nullable public String readString(String fieldName) throws PortableException; - - /** - * @param fieldName Field name. - * @return UUID. - * @throws PortableException In case of error. - */ - @Nullable public UUID readUuid(String fieldName) throws PortableException; - - /** - * @param fieldName Field name. - * @return Date. - * @throws PortableException In case of error. - */ - @Nullable public Date readDate(String fieldName) throws PortableException; - - /** - * @param fieldName Field name. - * @return Timestamp. - * @throws PortableException In case of error. - */ - @Nullable public Timestamp readTimestamp(String fieldName) throws PortableException; - - /** - * @param fieldName Field name. - * @return Object. - * @throws PortableException In case of error. - */ - @Nullable public <T> T readObject(String fieldName) throws PortableException; - - /** - * @param fieldName Field name. - * @return Byte array. - * @throws PortableException In case of error. - */ - @Nullable public byte[] readByteArray(String fieldName) throws PortableException; - - /** - * @param fieldName Field name. - * @return Short array. - * @throws PortableException In case of error. - */ - @Nullable public short[] readShortArray(String fieldName) throws PortableException; - - /** - * @param fieldName Field name. - * @return Integer array. - * @throws PortableException In case of error. - */ - @Nullable public int[] readIntArray(String fieldName) throws PortableException; - - /** - * @param fieldName Field name. - * @return Long array. - * @throws PortableException In case of error. - */ - @Nullable public long[] readLongArray(String fieldName) throws PortableException; - - /** - * @param fieldName Field name. - * @return Float array. - * @throws PortableException In case of error. - */ - @Nullable public float[] readFloatArray(String fieldName) throws PortableException; - - /** - * @param fieldName Field name. - * @return Byte array. - * @throws PortableException In case of error. - */ - @Nullable public double[] readDoubleArray(String fieldName) throws PortableException; - - /** - * @param fieldName Field name. - * @return Char array. - * @throws PortableException In case of error. - */ - @Nullable public char[] readCharArray(String fieldName) throws PortableException; - - /** - * @param fieldName Field name. - * @return Boolean array. - * @throws PortableException In case of error. - */ - @Nullable public boolean[] readBooleanArray(String fieldName) throws PortableException; - - /** - * @param fieldName Field name. - * @return Decimal array. - * @throws PortableException In case of error. - */ - @Nullable public BigDecimal[] readDecimalArray(String fieldName) throws PortableException; - - /** - * @param fieldName Field name. - * @return String array. - * @throws PortableException In case of error. - */ - @Nullable public String[] readStringArray(String fieldName) throws PortableException; - - /** - * @param fieldName Field name. - * @return UUID array. - * @throws PortableException In case of error. - */ - @Nullable public UUID[] readUuidArray(String fieldName) throws PortableException; - - /** - * @param fieldName Field name. - * @return Date array. - * @throws PortableException In case of error. - */ - @Nullable public Date[] readDateArray(String fieldName) throws PortableException; - - /** - * @param fieldName Field name. - * @return Object array. - * @throws PortableException In case of error. - */ - @Nullable public Object[] readObjectArray(String fieldName) throws PortableException; - - /** - * @param fieldName Field name. - * @return Collection. - * @throws PortableException In case of error. - */ - @Nullable public <T> Collection<T> readCollection(String fieldName) throws PortableException; - - /** - * @param fieldName Field name. - * @param colCls Collection class. - * @return Collection. - * @throws PortableException In case of error. - */ - @Nullable public <T> Collection<T> readCollection(String fieldName, Class<? extends Collection<T>> colCls) - throws PortableException; - - /** - * @param fieldName Field name. - * @return Map. - * @throws PortableException In case of error. - */ - @Nullable public <K, V> Map<K, V> readMap(String fieldName) throws PortableException; - - /** - * @param fieldName Field name. - * @param mapCls Map class. - * @return Map. - * @throws PortableException In case of error. - */ - @Nullable public <K, V> Map<K, V> readMap(String fieldName, Class<? extends Map<K, V>> mapCls) - throws PortableException; - - /** - * @param fieldName Field name. - * @param enumCls Enum class. - * @return Value. - * @throws PortableException In case of error. - */ - @Nullable public <T extends Enum<?>> T readEnum(String fieldName, Class<T> enumCls) throws PortableException; - - /** - * @param fieldName Field name. - * @param enumCls Enum class. - * @return Value. - * @throws PortableException In case of error. - */ - @Nullable public <T extends Enum<?>> T[] readEnumArray(String fieldName, Class<T> enumCls) - throws PortableException; - - /** - * Gets raw reader. Raw reader does not use field name hash codes, therefore, - * making the format even more compact. However, if the raw reader is used, - * dynamic structure changes to the portable objects are not supported. - * - * @return Raw reader. - */ - public PortableRawReader rawReader(); -} http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/dff026be/modules/core/src/main/java/org/apache/ignite/portables/PortableSerializer.java ---------------------------------------------------------------------- diff --git a/modules/core/src/main/java/org/apache/ignite/portables/PortableSerializer.java b/modules/core/src/main/java/org/apache/ignite/portables/PortableSerializer.java deleted file mode 100644 index 6b343a0..0000000 --- a/modules/core/src/main/java/org/apache/ignite/portables/PortableSerializer.java +++ /dev/null @@ -1,47 +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. - */ - -package org.apache.ignite.portables; - -/** - * Interface that allows to implement custom serialization logic for portable objects. - * Can be used instead of {@link PortableMarshalAware} in case if the class - * cannot be changed directly. - * <p> - * Portable serializer can be configured for all portable objects via - * {@link PortableConfiguration#getSerializer()} method, or for a specific - * portable type via {@link PortableTypeConfiguration#getSerializer()} method. - */ -public interface PortableSerializer { - /** - * Writes fields to provided writer. - * - * @param obj Empty object. - * @param writer Portable object writer. - * @throws PortableException In case of error. - */ - public void writePortable(Object obj, PortableWriter writer) throws PortableException; - - /** - * Reads fields from provided reader. - * - * @param obj Empty object - * @param reader Portable object reader. - * @throws PortableException In case of error. - */ - public void readPortable(Object obj, PortableReader reader) throws PortableException; -} http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/dff026be/modules/core/src/main/java/org/apache/ignite/portables/PortableTypeConfiguration.java ---------------------------------------------------------------------- diff --git a/modules/core/src/main/java/org/apache/ignite/portables/PortableTypeConfiguration.java b/modules/core/src/main/java/org/apache/ignite/portables/PortableTypeConfiguration.java deleted file mode 100644 index 1af4097..0000000 --- a/modules/core/src/main/java/org/apache/ignite/portables/PortableTypeConfiguration.java +++ /dev/null @@ -1,195 +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. - */ - -package org.apache.ignite.portables; - -import org.apache.ignite.internal.util.typedef.internal.*; - -import java.sql.*; - -/** - * Defines configuration properties for a specific portable type. Providing per-type - * configuration is optional, as it is generally enough to provide global - * portable configuration in {@link PortableConfiguration} instance. However, - * this class allows you to change configuration properties for a specific - * portable type without affecting configuration for other portable types. - * <p> - * Per-type portable configuration can be specified in - * {@link PortableConfiguration#getTypeConfigurations()} method. - */ -public class PortableTypeConfiguration { - /** Class name. */ - private String clsName; - - /** ID mapper. */ - private PortableIdMapper idMapper; - - /** Serializer. */ - private PortableSerializer serializer; - - /** Use timestamp flag. */ - private Boolean useTs; - - /** Meta data enabled flag. */ - private Boolean metaDataEnabled; - - /** Keep deserialized flag. */ - private Boolean keepDeserialized; - - /** Affinity key field name. */ - private String affKeyFieldName; - - /** - */ - public PortableTypeConfiguration() { - // No-op. - } - - /** - * @param clsName Class name. - */ - public PortableTypeConfiguration(String clsName) { - this.clsName = clsName; - } - - /** - * Gets type name. - * - * @return Type name. - */ - public String getClassName() { - return clsName; - } - - /** - * Sets type name. - * - * @param clsName Type name. - */ - public void setClassName(String clsName) { - this.clsName = clsName; - } - - /** - * Gets ID mapper. - * - * @return ID mapper. - */ - public PortableIdMapper getIdMapper() { - return idMapper; - } - - /** - * Sets ID mapper. - * - * @param idMapper ID mapper. - */ - public void setIdMapper(PortableIdMapper idMapper) { - this.idMapper = idMapper; - } - - /** - * Gets serializer. - * - * @return Serializer. - */ - public PortableSerializer getSerializer() { - return serializer; - } - - /** - * Sets serializer. - * - * @param serializer Serializer. - */ - public void setSerializer(PortableSerializer serializer) { - this.serializer = serializer; - } - - /** - * If {@code true} then date values converted to {@link Timestamp} during unmarshalling. - * - * @return Flag indicating whether date values converted to {@link Timestamp} during unmarshalling. - */ - public Boolean isUseTimestamp() { - return useTs; - } - - /** - * @param useTs Flag indicating whether date values converted to {@link Timestamp} during unmarshalling. - */ - public void setUseTimestamp(Boolean useTs) { - this.useTs = useTs; - } - - /** - * Defines whether meta data is collected for this type. If provided, this value will override - * {@link PortableConfiguration#isMetaDataEnabled()} property. - * - * @return Whether meta data is collected. - */ - public Boolean isMetaDataEnabled() { - return metaDataEnabled; - } - - /** - * @param metaDataEnabled Whether meta data is collected. - */ - public void setMetaDataEnabled(Boolean metaDataEnabled) { - this.metaDataEnabled = metaDataEnabled; - } - - /** - * Defines whether {@link PortableObject} should cache deserialized instance. If provided, - * this value will override {@link PortableConfiguration#isKeepDeserialized()} property. - * - * @return Whether deserialized value is kept. - */ - public Boolean isKeepDeserialized() { - return keepDeserialized; - } - - /** - * @param keepDeserialized Whether deserialized value is kept. - */ - public void setKeepDeserialized(Boolean keepDeserialized) { - this.keepDeserialized = keepDeserialized; - } - - /** - * Gets affinity key field name. - * - * @return Affinity key field name. - */ - public String getAffinityKeyFieldName() { - return affKeyFieldName; - } - - /** - * Sets affinity key field name. - * - * @param affKeyFieldName Affinity key field name. - */ - public void setAffinityKeyFieldName(String affKeyFieldName) { - this.affKeyFieldName = affKeyFieldName; - } - - /** {@inheritDoc} */ - @Override public String toString() { - return S.toString(PortableTypeConfiguration.class, this, super.toString()); - } -}