{"id":3038,"date":"2013-09-30T17:51:43","date_gmt":"2013-09-30T22:51:43","guid":{"rendered":"http:\/\/appcrawler.com\/wordpress\/?p=3038"},"modified":"2013-09-30T17:51:43","modified_gmt":"2013-09-30T22:51:43","slug":"dump-atg-publishing-cluster-state","status":"publish","type":"post","link":"http:\/\/appcrawler.com\/wordpress\/2013\/09\/30\/dump-atg-publishing-cluster-state\/","title":{"rendered":"Dump ATG publishing cluster state"},"content":{"rendered":"<p>The ATG publishing infrastructure maintains a cluster state file on each target. This is used to sync up with the Business Control Center (&#8220;BCC&#8221;) content, and ensure they match. When troubleshooting, it can be helpful to print the contents of the cluster state file. What is below will do that. It also prints all methods, so you can add what you also need. It may be useful to simply execute each getter and print its return value(s).<\/p>\n<pre lang=\"java\">import java.io.*;\r\nimport java.lang.reflect.*;\r\n\r\npublic class clusterDump {\r\n\r\n  public static void main(String[] args) {\r\n    FileInputStream fIn=null;\r\n    ObjectInputStream oIn=null;\r\n\r\n    try{\r\n      fIn= new FileInputStream(args[0]);\r\n      oIn = new ObjectInputStream(fIn);\r\n\r\n      atg.deployment.common.ClusterStatus cluster = (atg.deployment.common.ClusterStatus) oIn.readObject();\r\n      Class c = cluster.getClass();\r\n      Method m[] = c.getDeclaredMethods();\r\n      for (int i = 0; i < m.length; i++) {\r\n        System.out.println(m[i]);\r\n      }\r\n      System.out.println(\"Cluster ID = \" + cluster.getClusterID());\r\n      System.out.println(\"Deployed snapshot = \" + cluster.getDeployedSnapshot());\r\n      String[] depProject = cluster.getDeploymentProjectIDs();\r\n      for (int j = 0; j < depProject.length; j++) {\r\n        System.out.println(\"Deployed project \" + depProject[j]);\r\n      }\r\n    }\r\n    catch(Exception e){\r\n      e.printStackTrace();\r\n    }\r\n  }\r\n}<\/pre>\n<p>Set the CLASSPATH to the following, changing the locations to where your EAR is located.<\/p>\n<pre lang=\"text\">export CLASSPATH=.:\/opt\/jboss\/kits\/current\/atglib\/_PublishingAgent.base_slib_sclasses.jar:\/opt\/jboss\/kits\/current\/atglib\/_DAS_slib_sclasses.jar<\/pre>\n<p>The output of a run looks like the following...<\/p>\n<pre lang=\"text\">-bash-4.1$ java clusterDump \/opt\/atg\/ATG-Data\/servers\/p_ecm_01\/PublishingAgent\/data\/cluster-stat-Express-PROD-CMH\r\nprotected java.lang.Object atg.deployment.common.ClusterStatus.clone() throws java.lang.CloneNotSupportedException\r\nvoid atg.deployment.common.ClusterStatus.write()\r\nvoid atg.deployment.common.ClusterStatus.delete()\r\nstatic java.util.Map atg.deployment.common.ClusterStatus.read(atg.deployment.common.event.DeploymentEventSender,java.io.File,atg.nucleus.logging.ApplicationLogging)\r\npublic java.lang.String atg.deployment.common.ClusterStatus.getClusterID()\r\npublic java.lang.String atg.deployment.common.ClusterStatus.getDeployedSnapshot()\r\npublic java.lang.String[] atg.deployment.common.ClusterStatus.getDeploymentProjectIDs()\r\npublic void atg.deployment.common.ClusterStatus.setClusterID(java.lang.String)\r\npublic void atg.deployment.common.ClusterStatus.setDeploymentToSnapshot(java.lang.String)\r\npublic java.lang.String atg.deployment.common.ClusterStatus.getDeploymentToSnapshot()\r\npublic void atg.deployment.common.ClusterStatus.setDeploymentFromSnapshot(java.lang.String)\r\npublic java.lang.String atg.deployment.common.ClusterStatus.getDeploymentFromSnapshot()\r\npublic void atg.deployment.common.ClusterStatus.setDeploymentProjectIDs(java.lang.String[])\r\npublic void atg.deployment.common.ClusterStatus.setPrerequisiteDeploymentProjectIDs(java.lang.String[])\r\npublic java.lang.String[] atg.deployment.common.ClusterStatus.getPrerequisiteDeploymentProjectIDs()\r\npublic void atg.deployment.common.ClusterStatus.setDeployedSnapshot(java.lang.String)\r\npublic void atg.deployment.common.ClusterStatus.setDeployedSnapshotTimestamp(long)\r\npublic long atg.deployment.common.ClusterStatus.getDeployedSnapshotTimestamp()\r\npublic void atg.deployment.common.ClusterStatus.setAssetDestinations(java.util.Set)\r\npublic java.util.Set atg.deployment.common.ClusterStatus.getAssetDestinations()\r\npublic void atg.deployment.common.ClusterStatus.setClusterState(int)\r\npublic int atg.deployment.common.ClusterStatus.getClusterState()\r\npublic java.lang.String atg.deployment.common.ClusterStatus.getClusterStateString()\r\npublic static java.lang.String atg.deployment.common.ClusterStatus.clusterStateToString(int)\r\natg.deployment.common.ClusterStatus atg.deployment.common.ClusterStatus.getSafeCopy()\r\nvoid atg.deployment.common.ClusterStatus.deploymentReset()\r\nCluster ID = PROD-XYZ\r\nDeployed snapshot = 52808\r\nDeployed project prj590041<\/pre>\n<p>You can do the same thing for the dep-stat file, using what is below.<\/p>\n<pre lang=\"java\">\r\nimport java.io.*;\r\nimport java.lang.reflect.*;\r\n\r\npublic class depStatDump {\r\n\r\n  public static void main(String[] args) {\r\n    FileInputStream fIn=null;\r\n    ObjectInputStream oIn=null;\r\n\r\n    try{\r\n      fIn= new FileInputStream(args[0]);\r\n      oIn = new ObjectInputStream(fIn);\r\n\r\n      atg.deployment.common.Status cluster = (atg.deployment.common.Status) oIn.readObject();\r\n\/*\r\n      Class c = cluster.getClass();\r\n      Method m[] = c.getDeclaredMethods();\r\n      for (int i = 0; i < m.length; i++) {\r\n        System.out.println(m[i]);\r\n      }\r\n*\/\r\n      System.out.println(\"Deployed Snapshot = \" + cluster.getDeployedSnapshot());\r\n      System.out.println(\"Deployed snapshot time = \" + new java.util.Date(cluster.getDeployedSnapshotTimestamp()));\r\n      String[] depProject = cluster.getDeploymentProjectIDs();\r\n      for (int j = 0; j < depProject.length; j++) {\r\n        System.out.println(\"Deployed project \" + depProject[j]);\r\n      }\r\n    }\r\n    catch(Exception e){\r\n      e.printStackTrace();\r\n    }\r\n  }\r\n}\r\n<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>The ATG publishing infrastructure maintains a cluster state file on each target. This is used to sync up with the Business Control Center (&#8220;BCC&#8221;) content, and ensure they match. When troubleshooting, it can be helpful to print the contents of&hellip;<\/p>\n<p class=\"more-link-p\"><a class=\"more-link\" href=\"http:\/\/appcrawler.com\/wordpress\/2013\/09\/30\/dump-atg-publishing-cluster-state\/\">Read more &rarr;<\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_mi_skip_tracking":false,"footnotes":""},"categories":[37,38,24,25],"tags":[],"_links":{"self":[{"href":"http:\/\/appcrawler.com\/wordpress\/wp-json\/wp\/v2\/posts\/3038"}],"collection":[{"href":"http:\/\/appcrawler.com\/wordpress\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/appcrawler.com\/wordpress\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/appcrawler.com\/wordpress\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"http:\/\/appcrawler.com\/wordpress\/wp-json\/wp\/v2\/comments?post=3038"}],"version-history":[{"count":20,"href":"http:\/\/appcrawler.com\/wordpress\/wp-json\/wp\/v2\/posts\/3038\/revisions"}],"predecessor-version":[{"id":3488,"href":"http:\/\/appcrawler.com\/wordpress\/wp-json\/wp\/v2\/posts\/3038\/revisions\/3488"}],"wp:attachment":[{"href":"http:\/\/appcrawler.com\/wordpress\/wp-json\/wp\/v2\/media?parent=3038"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/appcrawler.com\/wordpress\/wp-json\/wp\/v2\/categories?post=3038"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/appcrawler.com\/wordpress\/wp-json\/wp\/v2\/tags?post=3038"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}