6.3.1.7.15. NGWVectorLayer

public class NGWVectorLayer extends VectorLayer implements INGWLayer

6.3.1.7.15.1. Fields

6.3.1.7.15.1.1. DIRECTION_BOTH

protected static final int DIRECTION_BOTH

6.3.1.7.15.1.2. DIRECTION_FROM

protected static final int DIRECTION_FROM

6.3.1.7.15.1.3. DIRECTION_TO

protected static final int DIRECTION_TO

6.3.1.7.15.1.4. JSON_ACCOUNT_KEY

protected static final String JSON_ACCOUNT_KEY

6.3.1.7.15.1.5. JSON_NGWLAYER_TYPE_KEY

protected static final String JSON_NGWLAYER_TYPE_KEY

6.3.1.7.15.1.6. JSON_NGW_VERSION_MAJOR_KEY

protected static final String JSON_NGW_VERSION_MAJOR_KEY

6.3.1.7.15.1.7. JSON_NGW_VERSION_MINOR_KEY

protected static final String JSON_NGW_VERSION_MINOR_KEY

6.3.1.7.15.1.8. JSON_SERVERWHERE_KEY

protected static final String JSON_SERVERWHERE_KEY

6.3.1.7.15.1.9. JSON_SYNC_DIRECTION_KEY

protected static final String JSON_SYNC_DIRECTION_KEY

6.3.1.7.15.1.10. JSON_SYNC_TYPE_KEY

protected static final String JSON_SYNC_TYPE_KEY

6.3.1.7.15.1.11. JSON_TRACKED_KEY

protected static final String JSON_TRACKED_KEY

6.3.1.7.15.1.12. TYPE_CHANGES_ATTACH

protected static final int TYPE_CHANGES_ATTACH

6.3.1.7.15.1.13. TYPE_CHANGES_ATTACH_ID

protected static final int TYPE_CHANGES_ATTACH_ID

6.3.1.7.15.1.14. TYPE_CHANGES_FEATURE

protected static final int TYPE_CHANGES_FEATURE

6.3.1.7.15.1.15. TYPE_CHANGES_TABLE

protected static final int TYPE_CHANGES_TABLE

6.3.1.7.15.1.16. mAccountName

protected String mAccountName

6.3.1.7.15.1.17. mCRS

protected int mCRS

6.3.1.7.15.1.18. mIsAddedToUriMatcher

protected static boolean mIsAddedToUriMatcher

6.3.1.7.15.1.19. mNGWLayerType

protected int mNGWLayerType

6.3.1.7.15.1.20. mNet

protected NetworkUtil mNet

6.3.1.7.15.1.21. mNgwVersionMajor

protected int mNgwVersionMajor

6.3.1.7.15.1.22. mNgwVersionMinor

protected int mNgwVersionMinor

6.3.1.7.15.1.23. mRemoteId

protected long mRemoteId

6.3.1.7.15.1.24. mServerWhere

protected String mServerWhere

6.3.1.7.15.1.25. mSyncDirection

protected int mSyncDirection

6.3.1.7.15.1.26. mSyncType

protected int mSyncType

6.3.1.7.15.1.27. mTracked

protected boolean mTracked

6.3.1.7.15.2. Constructors

6.3.1.7.15.2.1. NGWVectorLayer

public NGWVectorLayer(Context context, File path)

6.3.1.7.15.3. Methods

6.3.1.7.15.3.1. addChange

public void addChange(long featureId, int operation)

6.3.1.7.15.3.2. addChange

public void addChange(long featureId, long attachId, int attachOperation)

6.3.1.7.15.3.3. addFeatureOnServer

protected boolean addFeatureOnServer(long featureId, SyncResult syncResult)

6.3.1.7.15.3.4. addFeatureOnServer

protected HttpResponse addFeatureOnServer(String payload)

6.3.1.7.15.3.5. applySync

protected synchronized void applySync(int syncType)

6.3.1.7.15.3.6. changeAttachOnServer

protected HttpResponse changeAttachOnServer(long featureId, long attachId, String putData)

6.3.1.7.15.3.7. changeFeatureId

protected void changeFeatureId(long oldFeatureId, long newFeatureId)

6.3.1.7.15.3.8. changeFeatureOnServer

protected boolean changeFeatureOnServer(long featureId, SyncResult syncResult)

6.3.1.7.15.3.9. changeFeatureOnServer

protected HttpResponse changeFeatureOnServer(long featureId, String payload)

6.3.1.7.15.3.10. checkGeometryType

protected boolean checkGeometryType(Feature feature)

6.3.1.7.15.3.11. compareFeature

protected void compareFeature(Cursor cursor, String authority, Feature remoteFeature, String changeTableName)

6.3.1.7.15.3.12. create

public void create(int geometryType, List<Field> fields)

6.3.1.7.15.3.13. createFromNGW

public void createFromNGW(IProgressor progressor)

download and create new NGW layer from GeoJSON data

6.3.1.7.15.3.14. createNewFeature

protected void createNewFeature(Feature remoteFeature, String authority)

6.3.1.7.15.3.15. cursorToJson

protected String cursorToJson(Cursor cursor)

6.3.1.7.15.3.16. delete

public boolean delete()

6.3.1.7.15.3.17. deleteAllTempAttachesFlags

public int deleteAllTempAttachesFlags()

6.3.1.7.15.3.18. deleteAllTempFeaturesFlags

public int deleteAllTempFeaturesFlags()

6.3.1.7.15.3.19. deleteAttachOnServer

protected HttpResponse deleteAttachOnServer(long featureId, long attachId)

6.3.1.7.15.3.20. deleteFeatureOnServer

protected boolean deleteFeatureOnServer(long featureId, SyncResult syncResult)

6.3.1.7.15.3.21. deleteFeatureOnServer

protected HttpResponse deleteFeatureOnServer(long featureId)

6.3.1.7.15.3.22. deleteFeatures

protected void deleteFeatures(List<Long> deleteItems)

6.3.1.7.15.3.23. deleteInternal

protected int deleteInternal(Uri uri, int uriType, String selection, String[] selectionArgs)

6.3.1.7.15.3.24. fromJSON

public void fromJSON(JSONObject jsonObject)

6.3.1.7.15.3.25. getAccountName

public String getAccountName()

6.3.1.7.15.3.26. getChangeTableName

public String getChangeTableName()

6.3.1.7.15.3.27. getChangesFromServer

public boolean getChangesFromServer(String authority, SyncResult syncResult)

6.3.1.7.15.3.28. getFeatures

protected HashMap<Integer, List<Feature>> getFeatures(SyncResult syncResult, boolean tracked)

6.3.1.7.15.3.29. getFeaturesUrl

protected String getFeaturesUrl(AccountUtil.AccountData accountData)

6.3.1.7.15.3.30. getHttpConnection

protected HttpURLConnection getHttpConnection(AccountUtil.AccountData accountData)

6.3.1.7.15.3.31. getRemoteId

public long getRemoteId()

6.3.1.7.15.3.32. getRemoteUrl

public String getRemoteUrl()

6.3.1.7.15.3.33. getRequiredCls

protected String getRequiredCls()

6.3.1.7.15.3.34. getResourceMetaUrl

protected String getResourceMetaUrl(AccountUtil.AccountData accountData)

6.3.1.7.15.3.35. getServerWhere

public String getServerWhere()

6.3.1.7.15.3.36. getSyncDirection

public int getSyncDirection()

6.3.1.7.15.3.37. getSyncType

public int getSyncType()

get synchronization type

Returns:the synchronization type - the OR of this values: SYNC_NONE - no synchronization SYNC_DATA - synchronize only data SYNC_ATTACH - synchronize only attachments SYNC_ALL - synchronize everything

6.3.1.7.15.3.38. hasAttachChanges

protected boolean hasAttachChanges(long featureId, long attachId)

6.3.1.7.15.3.39. hasAttachNotSyncFlag

public boolean hasAttachNotSyncFlag(long featureId, long attachId)

6.3.1.7.15.3.40. hasAttachTempFlag

public boolean hasAttachTempFlag(long featureId, long attachId)

6.3.1.7.15.3.41. hasFeatureChanges

protected boolean hasFeatureChanges(long featureId)

6.3.1.7.15.3.42. hasFeatureNotSyncFlag

public boolean hasFeatureNotSyncFlag(long featureId)

6.3.1.7.15.3.43. hasFeatureTempFlag

public boolean hasFeatureTempFlag(long featureId)

6.3.1.7.15.3.44. haveFeaturesNotSyncFlag

protected boolean haveFeaturesNotSyncFlag()

6.3.1.7.15.3.45. insertInternal

protected long insertInternal(ContentValues contentValues)

6.3.1.7.15.3.46. isChanges

public boolean isChanges()

6.3.1.7.15.3.47. isRemoteReadOnly

public boolean isRemoteReadOnly()

Indicate if layer can send changes to remote server

Returns:true if layer can send changes to remote server or false

6.3.1.7.15.3.48. isSyncable

public boolean isSyncable()

Indicate if layer can sync data with remote server

Returns:true if layer can sync or false

6.3.1.7.15.3.49. log

protected void log(SyncResult syncResult, String code)

6.3.1.7.15.3.50. log

protected void log(Exception e, String tag)

6.3.1.7.15.3.51. proceedAddedFeatures

protected void proceedAddedFeatures(List<Feature> added, String authority, String changeTableName)

6.3.1.7.15.3.52. proceedAttach

protected boolean proceedAttach(JSONObject result, SyncResult syncResult)

6.3.1.7.15.3.53. proceedChangedFeatures

protected void proceedChangedFeatures(List<Feature> changed, String authority, String changeTableName)

6.3.1.7.15.3.54. proceedDeletedFeatures

protected void proceedDeletedFeatures(List<Feature> deleted, String changeTableName)

6.3.1.7.15.3.55. queryFirstTempAttachFlags

public Cursor queryFirstTempAttachFlags()

6.3.1.7.15.3.56. queryFirstTempFeatureFlags

public Cursor queryFirstTempFeatureFlags()

6.3.1.7.15.3.57. queryInternal

protected Cursor queryInternal(Uri uri, int uriType, String[] projection, String selection, String[] selectionArgs, String sortOrder, String limit)

6.3.1.7.15.3.58. readFeatures

protected void readFeatures(JsonReader reader, List<Feature> features)

6.3.1.7.15.3.59. sendAttachOnServer

protected boolean sendAttachOnServer(long featureId, long attachId, SyncResult syncResult)

6.3.1.7.15.3.60. sendAttachOnServer

protected HttpResponse sendAttachOnServer(long featureId, AttachItem attach)

6.3.1.7.15.3.61. sendFeatureAttachOnServer

protected HttpResponse sendFeatureAttachOnServer(JSONObject result, long featureId, AttachItem attach)

6.3.1.7.15.3.62. sendLocalChanges

public boolean sendLocalChanges(SyncResult syncResult)

6.3.1.7.15.3.63. setAccountCacheData

public void setAccountCacheData()

6.3.1.7.15.3.64. setAccountName

public void setAccountName(String accountName)

6.3.1.7.15.3.65. setAttachNotSyncFlag

public long setAttachNotSyncFlag(long featureId, long attachId, boolean flag)

6.3.1.7.15.3.66. setAttachTempFlag

public long setAttachTempFlag(long featureId, long attachId, boolean flag)

6.3.1.7.15.3.67. setFeatureNotSyncFlag

public long setFeatureNotSyncFlag(long featureId, boolean flag)

6.3.1.7.15.3.68. setFeatureTempFlag

public long setFeatureTempFlag(long featureId, boolean flag)

6.3.1.7.15.3.69. setRemoteId

public void setRemoteId(long remoteId)

6.3.1.7.15.3.70. setServerWhere

public void setServerWhere(String serverWhere)

6.3.1.7.15.3.71. setSyncDirection

public void setSyncDirection(int direction)

6.3.1.7.15.3.72. setSyncType

public void setSyncType(int syncType)

6.3.1.7.15.3.73. sync

public void sync(String authority, Pair<Integer, Integer> ver, SyncResult syncResult)

Synchronize changes with NGW. Should be run from non UI thread.

Parameters:
  • authority
    • a content resolver authority (i.e. com.nextgis.mobile.provider)
  • syncResult
    • report some errors via this parameter

6.3.1.7.15.3.74. toJSON

public JSONObject toJSON()