Example #1
0
        public MessagingService()
        {
            Types.AddClientClassMapping("com.backendless.management.DeviceRegistrationDto", typeof(Messaging.DeviceRegistration));
            Types.AddClientClassMapping("com.backendless.services.messaging.MessageStatus", typeof(Messaging.MessageStatus));
            Types.AddClientClassMapping("com.backendless.services.messaging.PublishOptions", typeof(Messaging.PublishOptions));
            Types.AddClientClassMapping("com.backendless.services.messaging.DeliveryOptions", typeof(Messaging.DeliveryOptions));
            Types.AddClientClassMapping("com.backendless.services.messaging.PublishStatusEnum", typeof(Messaging.PublishStatusEnum));
            Types.AddClientClassMapping("com.backendless.services.messaging.Message", typeof(Messaging.Message));
            deviceId = Guid.NewGuid().ToString();

#if WINDOWS_PHONE8
            object deviceId;
            if (!Microsoft.Phone.Info.DeviceExtendedProperties.TryGetValue("DeviceUniqueId", out deviceId))
            {
                deviceId = HostInformation.PublisherHostId;

                if (deviceId == null)
                {
                    throw new BackendlessException(new BackendlessFault(ExceptionMessage.NO_DEVICEID_CAPABILITY));
                }
            }

            _deviceRegistrationDto = new DeviceRegistration
            {
                Os        = "WP",
                DeviceId  = BitConverter.ToString((byte[])deviceId).Replace("-", ""),
                OsVersion = System.Environment.OSVersion.Version.Major.ToString(CultureInfo.InvariantCulture)
            };
#elif UNITY
            _deviceRegistrationDto = new DeviceRegistration();
#endif
        }
Example #2
0
        static Backendless()
        {
            Types.AddAbstractTypeMapping(typeof(IList <>), typeof(List <>));
            Types.AddClientClassMapping("flex.messaging.messages.AcknowledgeMessage", typeof(AckMessage));
            Types.AddClientClassMapping("flex.messaging.messages.AsyncMessage", typeof(AsyncMessage));
            Types.AddClientClassMapping("flex.messaging.messages.RemotingMessage", typeof(ReqMessage));
            Types.AddClientClassMapping("flex.messaging.messages.CommandMessage", typeof(CommandMessage));
            Types.AddClientClassMapping("flex.messaging.messages.ErrorMessage", typeof(ErrMessage));
            Types.AddClientClassMapping("flex.messaging.io.ArrayCollection", typeof(ObjectProxy));
            Types.AddClientClassMapping("com.backendless.persistence.GeometryDTO", typeof(GeometryDTO));
            Types.AddClientClassMapping("com.backendless.persistence.Point", typeof(Point));
            Types.AddClientClassMapping("com.backendless.persistence.LineString", typeof(LineString));
            Types.AddClientClassMapping("com.backendless.persistence.Polygon", typeof(Polygon));
            Types.AddClientClassMapping("com.backendless.transaction.UnitOfWork", typeof(UnitOfWork));
            Types.AddClientClassMapping("com.backendless.transaction.Operation", typeof(Operation));
            Types.AddClientClassMapping("com.backendless.transaction.OperationCreate", typeof(OperationCreate));
            Types.AddClientClassMapping("com.backendless.transaction.OperationCreateBulk", typeof(OperationCreateBulk));
            Types.AddClientClassMapping("com.backendless.transaction.OperationDelete", typeof(OperationDelete));
            Types.AddClientClassMapping("com.backendless.transaction.OperationDeleteBulk", typeof(OperationDeleteBulk));
            Types.AddClientClassMapping("com.backendless.transaction.OperationUpdate", typeof(OperationUpdate));
            Types.AddClientClassMapping("com.backendless.transaction.OperationUpdateBulk", typeof(OperationUpdateBulk));
            Types.AddClientClassMapping("com.backendless.transaction.OperationFind", typeof(OperationFind));
            Types.AddClientClassMapping("com.backendless.transaction.OperationAddRelation", typeof(OperationAddRelation));
            Types.AddClientClassMapping("com.backendless.transaction.OperationSetRelation", typeof(OperationSetRelation));
            Types.AddClientClassMapping("com.backendless.transaction.OperationDeleteRelation", typeof(OperationDeleteRelation));

            ORBConfig.GetInstance()
            .getObjectFactories()
            .AddArgumentObjectFactory("Weborb.V3Types.BodyHolder", new BodyHolderFactory());
            Types.AddAbstractTypeMapping(typeof(IDictionary), typeof(Dictionary <object, object>));
        }
Example #3
0
        private UnitOfWorkResult Execute(AsyncCallback <UnitOfWorkResult> callback, bool isAsync)
        {
            if (unitOfWork.operations == null || unitOfWork.operations.Count == 0)
            {
                throw new ArgumentException(ExceptionMessage.LIST_OPERATIONS_NULL);
            }

            Object[] args = new Object[] { unitOfWork };

            foreach (KeyValuePair <String, Type> entry in clazzes)
            {
                Types.AddClientClassMapping(entry.Key, entry.Value);
            }

            if (isAsync)
            {
                Invoker.InvokeAsync <UnitOfWorkResult>(TRANSACTION_MANAGER_SERVER_ALIAS, "execute", args, false, callback);
            }
            else
            {
                return(Invoker.InvokeSync <UnitOfWorkResult>(TRANSACTION_MANAGER_SERVER_ALIAS, "execute", args, false));
            }

            return(null);
        }
Example #4
0
 public GeoService()
 {
     Types.AddClientClassMapping("com.backendless.geo.model.SearchMatchesResult", typeof(SearchMatchesResult));
     Types.AddClientClassMapping("com.backendless.geo.model.GeoPoint", typeof(GeoPoint));
     Types.AddClientClassMapping("com.backendless.geo.model.GeoCluster", typeof(GeoCluster));
     Types.AddClientClassMapping("com.backendless.geo.model.GeoCategory", typeof(GeoCategory));
     Types.AddClientClassMapping("com.backendless.geo.BackendlessGeoQuery", typeof(BackendlessGeoQuery));
     Types.AddClientClassMapping("com.backendless.geo.Units", typeof(Units));
 }
Example #5
0
 static Backendless()
 {
     Types.AddAbstractTypeMapping(typeof(IList <>), typeof(List <>));
     Types.AddClientClassMapping("flex.messaging.messages.AcknowledgeMessage", typeof(AckMessage));
     Types.AddClientClassMapping("flex.messaging.messages.AsyncMessage", typeof(AsyncMessage));
     Types.AddClientClassMapping("flex.messaging.messages.RemotingMessage", typeof(ReqMessage));
     Types.AddClientClassMapping("flex.messaging.messages.CommandMessage", typeof(CommandMessage));
     Types.AddClientClassMapping("flex.messaging.messages.ErrorMessage", typeof(ErrMessage));
     Types.AddClientClassMapping("flex.messaging.io.ArrayCollection", typeof(ObjectProxy));
     ORBConfig.GetInstance()
     .getObjectFactories()
     .AddArgumentObjectFactory("Weborb.V3Types.BodyHolder", new BodyHolderFactory());
     Types.AddAbstractTypeMapping(typeof(IDictionary), typeof(Dictionary <object, object>));
 }
Example #6
0
 static UserService()
 {
     Types.AddClientClassMapping("com.backendless.services.users.property.AbstractProperty", typeof(AbstractProperty));
     Types.AddClientClassMapping("com.backendless.services.users.property.UserProperty", typeof(UserProperty));
 }
Example #7
0
 public PersistenceService()
 {
     Types.AddClientClassMapping("com.backendless.services.persistence.BackendlessDataQuery", typeof(BackendlessDataQuery));
     Types.AddClientClassMapping("com.backendless.services.persistence.ObjectProperty", typeof(ObjectProperty));
     Types.AddClientClassMapping("com.backendless.services.persistence.QueryOptions", typeof(QueryOptions));
 }